app.js 4.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197126198126199126200126201126202126203126204126205126206126207126208126209126210126211126212126213126214126215126216126217126218126219126220126221126222126223126224126225126226126227126228126229126230126231126232126233126234126235126236126237126238126239126240126241126242126243126244126245126246126247126248126249126250126251126252126253126254126255126256126257126258126259126260126261126262126263126264126265126266126267126268126269126270126271126272126273126274126275126276126277126278126279126280126281126282126283126284126285126286126287126288126289126290126291126292126293126294126295126296126297126298126299126300126301126302126303126304126305126306126307126308126309126310126311126312126313126314126315126316126317126318126319126320126321126322126323126324126325126326126327126328126329126330126331126332126333126334126335126336126337126338126339126340126341126342126343126344126345126346126347126348126349126350126351126352126353126354126355126356126357126358126359126360126361126362126363126364126365126366126367126368126369126370126371126372126373126374126375126376126377126378126379126380126381126382126383126384126385126386126387126388126389126390126391126392126393126394126395126396126397126398126399126400126401126402126403126404126405126406126407126408126409126410126411126412126413126414126415126416126417126418126419126420126421126422126423126424126425126426126427126428126429126430126431126432126433126434126435126436126437126438126439126440126441126442126443126444126445126446126447126448126449126450126451126452126453126454126455126456126457126458126459126460126461126462126463126464126465126466126467126468126469126470126471126472126473126474126475126476126477126478126479126480126481126482126483126484126485126486126487126488126489126490126491126492126493126494126495126496126497126498126499126500126501126502126503126504126505126506126507126508126509126510126511126512126513126514126515126516126517126518126519126520126521126522126523126524126525126526126527126528126529126530126531126532126533126534126535126536126537126538126539126540126541126542126543126544126545126546126547126548126549126550126551126552126553126554126555126556126557126558126559126560126561126562126563126564126565126566126567126568126569126570126571126572126573126574126575126576126577126578126579126580126581126582126583126584126585126586126587126588126589126590126591126592126593126594126595126596126597126598126599126600126601126602126603126604126605126606126607126608126609126610126611126612126613126614126615126616126617126618126619126620126621126622126623126624126625126626126627126628126629126630126631126632126633126634126635126636126637126638126639126640126641126642126643126644126645126646126647126648126649126650126651126652126653126654126655126656126657126658126659126660126661126662126663126664126665126666126667126668126669126670126671126672126673126674126675126676126677126678126679126680126681126682126683126684126685126686126687126688126689126690126691126692126693126694126695126696126697126698126699126700126701126702126703126704126705126706126707126708126709126710126711126712126713126714126715126716126717126718126719126720126721126722126723126724126725126726126727126728126729126730126731126732126733126734126735126736126737126738126739126740126741126742126743126744126745126746126747126748126749126750126751126752126753126754126755126756126757126758126759126760126761126762126763126764126765126766126767126768126769126770126771126772126773126774126775126776126777126778126779126780126781126782126783126784126785126786126787126788126789126790126791126792126793126794126795126796126797126798126799126800126801126802126803126804126805126806126807126808126809126810126811126812126813126814126815126816126817126818126819126820126821126822126823126824126825126826126827126828126829126830126831126832126833126834126835126836126837126838126839126840126841126842126843126844126845126846126847126848126849126850126851126852126853126854126855126856126857126858126859126860126861126862126863126864126865126866126867126868126869126870126871126872126873126874126875126876126877126878126879126880126881126882126883126884126885126886126887126888126889126890126891126892126893126894126895126896126897126898126899126900126901126902126903126904126905126906126907126908126909126910126911126912126913126914126915126916126917126918126919126920126921126922126923126924126925126926126927126928126929126930126931126932126933126934126935126936126937126938126939126940126941126942126943126944126945126946126947126948126949126950126951126952126953126954126955126956126957126958126959126960126961126962126963126964126965126966126967126968126969126970126971126972126973126974126975126976126977126978126979126980126981126982126983126984126985126986126987126988126989126990126991126992126993126994126995126996126997126998126999127000127001127002127003127004127005127006127007127008127009127010127011127012127013127014127015127016127017127018127019127020127021127022127023127024127025127026127027127028127029127030127031127032127033127034127035127036127037127038127039127040127041127042127043127044127045127046127047127048127049127050127051127052127053127054127055127056127057127058127059127060127061127062127063127064127065127066127067127068127069127070127071127072127073127074127075127076127077127078127079127080127081127082127083127084127085127086127087127088127089127090127091127092127093127094127095127096127097127098127099127100127101127102127103127104127105127106127107127108127109127110127111127112127113127114127115127116127117127118127119127120127121127122127123127124127125127126127127127128127129127130127131127132127133127134127135127136127137127138127139127140127141127142127143127144127145127146127147127148127149127150127151127152127153127154127155127156127157127158127159127160127161127162127163127164127165127166127167127168127169127170127171127172127173127174127175127176127177127178127179127180127181127182127183127184127185127186127187127188127189127190127191127192127193127194127195127196127197127198127199127200127201127202127203127204127205127206127207127208127209127210127211127212127213127214127215127216127217127218127219127220127221127222127223127224127225127226127227127228127229127230127231127232127233127234127235127236127237127238127239127240127241127242127243127244127245127246127247127248127249127250127251127252127253127254127255127256127257127258127259127260127261127262127263127264127265127266127267127268127269127270127271127272127273127274127275127276127277127278127279127280127281127282127283127284127285127286127287127288127289127290127291127292127293127294127295127296127297127298127299127300127301127302127303127304127305127306127307127308127309127310127311127312127313127314127315127316127317127318127319127320127321127322127323127324127325127326127327127328127329127330127331127332127333127334127335127336127337127338127339127340127341127342127343127344127345127346127347127348127349127350127351127352127353127354127355127356127357127358127359127360127361127362127363127364127365127366127367127368127369127370127371127372127373127374127375127376127377127378127379127380127381127382127383127384127385127386127387127388127389127390127391127392127393127394127395127396127397127398127399127400127401127402127403127404127405127406127407127408127409127410127411127412127413127414127415127416127417127418127419127420127421127422127423127424127425127426127427127428127429127430127431127432127433127434127435127436127437127438127439127440127441127442127443127444127445127446127447127448127449127450127451127452127453127454127455127456127457127458127459127460127461127462127463127464127465127466127467127468127469127470127471127472127473127474127475127476127477127478127479127480127481127482127483127484127485127486127487127488127489127490127491127492127493127494127495127496127497127498127499127500127501127502127503127504127505127506127507127508127509127510127511127512127513127514127515127516127517127518127519127520127521127522127523127524127525127526127527127528127529127530127531127532127533127534127535127536127537127538127539127540127541127542127543127544127545127546127547127548127549127550127551127552127553127554127555127556127557127558127559127560127561127562127563127564127565127566127567127568127569127570127571127572127573127574127575127576127577127578127579127580127581127582127583127584127585127586127587127588127589127590127591127592127593127594127595127596127597127598127599127600127601127602127603127604127605127606127607127608127609127610127611127612127613127614127615127616127617127618127619127620127621127622127623127624127625127626127627127628127629127630127631127632127633127634127635127636127637127638127639127640127641127642127643127644127645127646127647127648127649127650127651127652127653127654127655127656127657127658127659127660127661127662127663127664127665127666127667127668127669127670127671127672127673127674127675127676127677127678127679127680127681127682127683127684127685127686127687127688127689127690127691127692127693127694127695127696127697127698127699127700127701127702127703127704127705127706127707127708127709127710127711127712127713127714127715127716127717127718127719127720127721127722127723127724127725127726127727127728127729127730127731127732127733127734127735127736127737127738127739127740127741127742127743127744127745127746127747127748127749127750127751127752127753127754127755127756127757127758127759127760127761127762127763127764127765127766127767127768127769127770127771127772127773127774127775127776127777127778127779127780127781127782127783127784127785127786127787127788127789127790127791127792127793127794127795127796127797127798127799127800127801127802127803127804127805127806127807127808127809127810127811127812127813127814127815127816127817127818127819127820127821127822127823127824127825127826127827127828127829127830127831127832127833127834127835127836127837127838127839127840127841127842127843127844127845127846127847127848127849127850127851127852127853127854127855127856127857127858127859127860127861127862127863127864127865127866127867127868127869127870127871127872127873127874127875127876127877127878127879127880127881127882127883127884127885127886127887127888127889127890127891127892127893127894127895127896127897127898127899127900127901127902127903127904127905127906127907127908127909127910127911127912127913127914127915127916127917127918127919127920127921127922127923127924127925127926127927127928127929127930127931127932127933127934127935127936127937127938127939127940127941127942127943127944127945127946127947127948127949127950127951127952127953127954127955127956127957127958127959127960127961127962127963127964127965127966127967127968127969127970127971127972127973127974127975127976127977127978127979127980127981127982127983127984127985127986127987127988127989127990127991127992127993127994127995127996127997127998127999128000128001128002128003128004128005128006128007128008128009128010128011128012128013128014128015128016128017128018128019128020128021128022128023128024128025128026128027128028128029128030128031128032128033128034128035128036128037128038128039128040128041128042128043128044128045128046128047128048128049128050128051128052128053128054128055128056128057128058128059128060128061128062128063128064128065128066128067128068128069128070128071128072128073128074128075128076128077128078128079128080128081128082128083128084128085128086128087128088128089128090128091128092128093128094128095128096128097128098128099128100128101128102128103128104128105128106128107128108128109128110128111128112128113128114128115128116128117128118128119128120128121128122128123128124128125128126128127128128128129128130128131128132128133128134128135128136128137128138128139128140128141128142128143128144128145128146128147128148128149128150128151128152128153128154128155128156128157128158128159128160128161128162128163128164128165128166128167128168128169128170128171128172128173128174128175128176128177128178128179128180128181128182128183128184128185128186128187128188128189128190128191128192128193128194128195128196128197128198128199128200128201128202128203128204128205128206128207128208128209128210128211128212128213128214128215128216128217128218128219128220128221128222128223128224128225128226128227128228128229128230128231128232128233128234128235128236128237128238128239128240128241128242128243128244128245128246128247128248128249128250128251128252128253128254128255128256128257128258128259128260128261128262128263128264128265128266128267128268128269128270128271128272128273128274128275128276128277128278128279128280128281128282128283128284128285128286128287128288128289128290128291128292128293128294128295128296128297128298128299128300128301128302128303128304128305128306128307128308128309128310128311128312128313128314128315128316128317128318128319128320128321128322128323128324128325128326128327128328128329128330128331128332128333128334128335128336128337128338128339128340128341128342128343128344128345128346128347128348128349128350128351128352128353128354128355128356128357128358128359128360128361128362128363128364128365128366128367128368128369128370128371128372128373128374128375128376128377128378128379128380128381128382128383128384128385128386128387128388128389128390128391128392128393128394128395128396128397128398128399128400128401128402128403128404128405128406128407128408128409128410128411128412128413128414128415128416128417128418128419128420128421128422128423128424128425128426128427128428128429128430128431128432128433128434128435128436128437128438128439128440128441128442128443128444128445128446128447128448128449128450128451128452128453128454128455128456128457128458128459128460128461128462128463128464128465128466128467128468128469128470128471128472128473128474128475128476128477128478128479128480128481128482128483128484128485128486128487128488128489128490128491128492128493128494128495128496128497128498128499128500128501128502128503128504128505128506128507128508128509128510128511128512128513128514128515128516128517128518128519128520128521128522128523128524128525128526128527128528128529128530128531128532128533128534128535128536128537128538128539128540128541128542128543128544128545128546128547128548128549128550128551128552128553128554128555128556128557128558128559128560128561128562128563128564128565128566128567128568128569128570128571128572128573128574128575128576128577128578128579128580128581128582128583128584128585128586128587128588128589128590128591128592128593128594128595128596128597128598128599128600128601128602128603128604128605128606128607128608128609128610128611128612128613128614128615128616128617128618128619128620128621128622128623128624128625128626128627128628128629128630128631128632128633128634128635128636128637128638128639128640128641128642128643128644128645128646128647128648128649128650128651128652128653128654128655128656128657128658128659128660128661128662128663128664128665128666128667128668128669128670128671128672128673128674128675128676128677128678128679128680128681128682128683128684128685128686128687128688128689128690128691128692128693128694128695128696128697128698128699128700128701128702128703128704128705128706128707128708128709128710128711128712128713128714128715128716128717128718128719128720128721128722128723128724128725128726128727128728128729128730128731128732128733128734128735128736128737128738128739128740128741128742128743128744128745128746128747128748128749128750128751128752128753128754128755128756128757128758128759128760128761128762128763128764128765128766128767128768128769128770128771128772128773128774128775128776128777128778128779128780128781128782128783128784128785128786128787128788128789128790128791128792128793128794128795128796128797128798128799128800128801128802128803128804128805128806128807128808128809128810128811128812128813128814128815128816128817128818128819128820128821128822128823128824128825128826128827128828128829128830128831128832128833128834128835128836128837128838128839128840128841128842128843128844128845128846128847128848128849128850128851128852128853128854128855128856128857128858128859128860128861128862128863128864128865128866128867128868128869128870128871128872128873128874128875128876128877128878128879128880128881128882128883128884128885128886128887128888128889128890128891128892128893128894128895128896128897128898128899128900128901128902128903128904128905128906128907128908128909128910128911128912128913128914128915128916128917128918128919128920128921128922128923128924128925128926128927128928128929128930128931128932128933128934128935128936128937128938128939128940128941128942128943128944128945128946128947128948128949128950128951128952128953128954128955128956128957128958128959128960128961128962128963128964128965128966128967128968128969128970128971128972128973128974128975128976128977128978128979128980128981128982128983128984128985128986128987128988128989128990128991128992128993128994128995128996128997128998128999129000129001129002129003129004129005129006129007129008129009129010129011129012129013129014129015129016129017129018129019129020129021129022129023129024129025129026129027129028129029129030129031129032129033129034129035129036129037129038129039129040129041129042129043129044129045129046129047129048129049129050129051129052129053129054129055129056129057129058129059129060129061129062129063129064129065129066129067129068129069129070129071129072129073129074129075129076129077129078129079129080129081129082129083129084129085129086129087129088129089129090129091129092129093129094129095129096129097129098129099129100129101129102129103129104129105129106129107129108129109129110129111129112129113129114129115129116129117129118129119129120129121129122129123129124129125129126129127129128129129129130129131129132129133129134129135129136129137129138129139129140129141129142129143129144129145129146129147129148129149129150129151129152129153129154129155129156129157129158129159129160129161129162129163129164129165129166129167129168129169129170129171129172129173129174129175129176129177129178129179129180129181129182129183129184129185129186129187129188129189129190129191129192129193129194129195129196129197129198129199129200129201129202129203129204129205129206129207129208129209129210129211129212129213129214129215129216129217129218129219129220129221129222129223129224129225129226129227129228129229129230129231129232129233129234129235129236129237129238129239129240129241129242129243129244129245129246129247129248129249129250129251129252129253129254129255129256129257129258129259129260129261129262129263129264129265129266129267129268129269129270129271129272129273129274129275129276129277129278129279129280129281129282129283129284129285129286129287129288129289129290129291129292129293129294129295129296129297129298129299129300129301129302129303129304129305129306129307129308129309129310129311129312129313129314129315129316129317129318129319129320129321129322129323129324129325129326129327129328129329129330129331129332129333129334129335129336129337129338129339129340129341129342129343129344129345129346129347129348129349129350129351129352129353129354129355129356129357129358129359129360129361129362129363129364129365129366129367129368129369129370129371129372129373129374129375129376129377129378129379129380129381129382129383129384129385129386129387129388129389129390129391129392129393129394129395129396129397129398129399129400129401129402129403129404129405129406129407129408129409129410129411129412129413129414129415129416129417129418129419129420129421129422129423129424129425129426129427129428129429129430129431129432129433129434129435129436129437129438129439129440129441129442129443129444129445129446129447129448129449129450129451129452129453129454129455129456129457129458129459129460129461129462129463129464129465129466129467129468129469129470129471129472129473129474129475129476129477129478129479129480129481129482129483129484129485129486129487129488129489129490129491129492129493129494129495129496129497129498129499129500129501129502129503129504129505129506129507129508129509129510129511129512129513129514129515129516129517129518129519129520129521129522129523129524129525129526129527129528129529129530129531129532129533129534129535129536129537129538129539129540129541129542129543129544129545129546129547129548129549129550129551129552129553129554129555129556129557129558129559129560129561129562129563129564129565129566129567129568129569129570129571129572129573129574129575129576129577129578129579129580129581129582129583129584129585129586129587129588129589129590129591129592129593129594129595129596129597129598129599129600129601129602129603129604129605129606129607129608129609129610129611129612129613129614129615129616129617129618129619129620129621129622129623129624129625129626129627129628129629129630129631129632129633129634129635129636129637129638129639129640129641129642129643129644129645129646129647129648129649129650129651129652129653129654129655129656129657129658129659129660129661129662129663129664129665129666129667129668129669129670129671129672129673129674129675129676129677129678129679129680129681129682129683129684129685129686129687129688129689129690129691129692129693129694129695129696129697129698129699129700129701129702129703129704129705129706129707129708129709129710129711129712129713129714129715129716129717129718129719129720129721129722129723129724129725129726129727129728129729129730129731129732129733129734129735129736129737129738129739129740129741129742129743129744129745129746129747129748129749129750129751129752129753129754129755129756129757129758129759129760129761129762129763129764129765129766129767129768129769129770129771129772129773129774129775129776129777129778129779129780129781129782129783129784129785129786129787129788129789129790129791129792129793129794129795129796129797129798129799129800129801129802129803129804129805129806129807129808129809129810129811129812129813129814129815129816129817129818129819129820129821129822129823129824129825129826129827129828129829129830129831129832129833129834129835129836129837129838129839129840129841129842129843129844129845129846129847129848129849129850129851129852129853129854129855129856129857129858129859129860129861129862129863129864129865129866129867129868129869129870129871129872129873129874129875129876129877129878129879129880129881129882129883129884129885129886129887129888129889129890129891129892129893129894129895129896129897129898129899129900129901129902129903129904129905129906129907129908129909129910129911129912129913129914129915129916129917129918129919129920129921129922129923129924129925129926129927129928129929129930129931129932129933129934129935129936129937129938129939129940129941129942129943129944129945129946129947129948129949129950129951129952129953129954129955129956129957129958129959129960129961129962129963129964129965129966129967129968129969129970129971129972129973129974129975129976129977129978129979129980129981129982129983129984129985129986129987129988129989129990129991129992129993129994129995129996129997129998129999130000130001130002130003130004130005130006130007130008130009130010130011130012130013130014130015130016130017130018130019130020130021130022130023130024130025130026130027130028130029130030130031130032130033130034130035130036130037130038130039130040130041130042130043130044130045130046130047130048130049130050130051130052130053130054130055130056130057130058130059130060130061130062130063130064130065130066130067130068130069130070130071130072130073130074130075130076130077130078130079130080130081130082130083130084130085130086130087130088130089130090130091130092130093130094130095130096130097130098130099130100130101130102130103130104130105130106130107130108130109130110130111130112130113130114130115130116130117130118130119130120130121130122130123130124130125130126130127130128130129130130130131130132130133130134130135130136130137130138130139130140130141130142130143130144130145130146130147130148130149130150130151130152130153130154130155130156130157130158130159130160130161130162130163130164130165130166130167130168130169130170130171130172130173130174130175130176130177130178130179130180130181130182130183130184130185130186130187130188130189130190130191130192130193130194130195130196130197130198130199130200130201130202130203130204130205130206130207130208130209130210130211130212130213130214130215130216130217130218130219130220130221130222130223130224130225130226130227130228130229130230130231130232130233130234130235130236130237130238130239130240130241130242130243130244130245130246130247130248130249130250130251130252130253130254130255130256130257130258130259130260130261130262130263130264130265130266130267130268130269130270130271130272130273130274130275130276130277130278130279130280130281130282130283130284130285130286130287130288130289130290130291130292130293130294130295130296130297130298130299130300130301130302130303130304130305130306130307130308130309130310130311130312130313130314130315130316130317130318130319130320130321130322130323130324130325130326130327130328130329130330130331130332130333130334130335130336130337130338130339130340130341130342130343130344130345130346130347130348130349130350130351130352130353130354130355130356130357130358130359130360130361130362130363130364130365130366130367130368130369130370130371130372130373130374130375130376130377130378130379130380130381130382130383130384130385130386130387130388130389130390130391130392130393130394130395130396130397130398130399130400130401130402130403130404130405130406130407130408130409130410130411130412130413130414130415130416130417130418130419130420130421130422130423130424130425130426130427130428130429130430130431130432130433130434130435130436130437130438130439130440130441130442130443130444130445130446130447130448130449130450130451130452130453130454130455130456130457130458130459130460130461130462130463130464130465130466130467130468130469130470130471130472130473130474130475130476130477130478130479130480130481130482130483130484130485130486130487130488130489130490130491130492130493130494130495130496130497130498130499130500130501130502130503130504130505130506130507130508130509130510130511130512130513130514130515130516130517130518130519130520130521130522130523130524130525130526130527130528130529130530130531130532130533130534130535130536130537130538130539130540130541130542130543130544130545130546130547130548130549130550130551130552130553130554130555130556130557130558130559130560130561130562130563130564130565130566130567130568130569130570130571130572130573130574130575130576130577130578130579130580130581130582130583130584130585130586130587130588130589130590130591130592130593130594130595130596130597130598130599130600130601130602130603130604130605130606130607130608130609130610130611130612130613130614130615130616130617130618130619130620130621130622130623130624130625130626130627130628130629130630130631130632130633130634130635130636130637130638130639130640130641130642130643130644130645130646130647130648130649130650130651130652130653130654130655130656130657130658130659130660130661130662130663130664130665130666130667130668130669130670130671130672130673130674130675130676130677130678130679130680130681130682130683130684130685130686130687130688130689130690130691130692130693130694130695130696130697130698130699130700130701130702130703130704130705130706130707130708130709130710130711130712130713130714130715130716130717130718130719130720130721130722130723130724130725130726130727130728130729130730130731130732130733130734130735130736130737130738130739130740130741130742130743130744130745130746130747130748130749130750130751130752130753130754130755130756130757130758130759130760130761130762130763130764130765130766130767130768130769130770130771130772130773130774130775130776130777130778130779130780130781130782130783130784130785130786130787130788130789130790130791130792130793130794130795130796130797130798130799130800130801130802130803130804130805130806130807130808130809130810130811130812130813130814130815130816130817130818130819130820130821130822130823130824130825130826130827130828130829130830130831130832130833130834130835130836130837130838130839130840130841130842130843130844130845130846130847130848130849130850130851130852130853130854130855130856130857130858130859130860130861130862130863130864130865130866130867130868130869130870130871130872130873130874130875130876130877130878130879130880130881130882130883130884130885130886130887130888130889130890130891130892130893130894130895130896130897130898130899130900130901130902130903130904130905130906130907130908130909130910130911130912130913130914130915130916130917130918130919130920130921130922130923130924130925130926130927130928130929130930130931130932130933130934130935130936130937130938130939130940130941130942130943130944130945130946130947130948130949130950130951130952130953130954130955130956130957130958130959130960130961130962130963130964130965130966130967130968130969130970130971130972130973130974130975130976130977130978130979130980130981130982130983130984130985130986130987130988130989130990130991130992130993130994130995130996130997130998130999131000131001131002131003131004131005131006131007131008131009131010131011131012131013131014131015131016131017131018131019131020131021131022131023131024131025131026131027131028131029131030131031131032131033131034131035131036131037131038131039131040131041131042131043131044131045131046131047131048131049131050131051131052131053131054131055131056131057131058131059131060131061131062131063131064131065131066131067131068131069131070131071131072131073131074131075131076131077131078131079131080131081131082131083131084131085131086131087131088131089131090131091131092131093131094131095131096131097131098131099131100131101131102131103131104131105131106131107131108131109131110131111131112131113131114131115131116131117131118131119131120131121131122131123131124131125131126131127131128131129131130131131131132131133131134131135131136131137131138131139131140131141131142131143131144131145131146131147131148131149131150131151131152131153131154131155131156131157131158131159131160131161131162131163131164131165131166131167131168131169131170131171131172131173131174131175131176131177131178131179131180131181131182131183131184131185131186131187131188131189131190131191131192131193131194131195131196131197131198131199131200131201131202131203131204131205131206131207131208131209131210131211131212131213131214131215131216131217131218131219131220131221131222131223131224131225131226131227131228131229131230131231131232131233131234131235131236131237131238131239131240131241131242131243131244131245131246131247131248131249131250131251131252131253131254131255131256131257131258131259131260131261131262131263131264131265131266131267131268131269131270131271131272131273131274131275131276131277131278131279131280131281131282131283131284131285131286131287131288131289131290131291131292131293131294131295131296131297131298131299131300131301131302131303131304131305131306131307131308131309131310131311131312131313131314131315131316131317131318131319131320131321131322131323131324131325131326131327131328131329131330131331131332131333131334131335131336131337131338131339131340131341131342131343131344131345131346131347131348131349131350131351131352131353131354131355131356131357131358131359131360131361131362131363131364131365131366131367131368131369131370131371131372131373131374131375131376131377131378131379131380131381131382131383131384131385131386131387131388131389131390131391131392131393131394131395131396131397131398131399131400131401131402131403131404131405131406131407131408131409131410131411131412131413131414131415131416131417131418131419131420131421131422131423131424131425131426131427131428131429131430131431131432131433131434131435131436131437131438131439131440131441131442131443131444131445131446131447131448131449131450131451131452131453131454131455131456131457131458131459131460131461131462131463131464131465131466131467131468131469131470131471131472131473131474131475131476131477131478131479131480131481131482131483131484131485131486131487131488131489131490131491131492131493131494131495131496131497131498131499131500131501131502131503131504131505131506131507131508131509131510131511131512131513131514131515131516131517131518131519131520131521131522131523131524131525131526131527131528131529131530131531131532131533131534131535131536131537131538131539131540131541131542131543131544131545131546131547131548131549131550131551131552131553131554131555131556131557131558131559131560131561131562131563131564131565131566131567131568131569131570131571131572131573131574131575131576131577131578131579131580131581131582131583131584131585131586131587131588131589131590131591131592131593131594131595131596131597131598131599131600131601131602131603131604131605131606131607131608131609131610131611131612131613131614131615131616131617131618131619131620131621131622131623131624131625131626131627131628131629131630131631131632131633131634131635131636131637131638131639131640131641131642131643131644131645131646131647131648131649131650131651131652131653131654131655131656131657131658131659131660131661131662131663131664131665131666131667131668131669131670131671131672131673131674131675131676131677131678131679131680131681131682131683131684131685131686131687131688131689131690131691131692131693131694131695131696131697131698131699131700131701131702131703131704131705131706131707131708131709131710131711131712131713131714131715131716131717131718131719131720131721131722131723131724131725131726131727131728131729131730131731131732131733131734131735131736131737131738131739131740131741131742131743131744131745131746131747131748131749131750131751131752131753131754131755131756131757131758131759131760131761131762131763131764131765131766131767131768131769131770131771131772131773131774131775131776131777131778131779131780131781131782131783131784131785131786131787131788131789131790131791131792131793131794131795131796131797131798131799131800131801131802131803131804131805131806131807131808131809131810131811131812131813131814131815131816131817131818131819131820131821131822131823131824131825131826131827131828131829131830131831131832131833131834131835131836131837131838131839131840131841131842131843131844131845131846131847131848131849131850131851131852131853131854131855131856131857131858131859131860131861131862131863131864131865131866131867131868131869131870131871131872131873131874131875131876131877131878131879131880131881131882131883131884131885131886131887131888131889131890131891131892131893131894131895131896131897131898131899131900131901131902131903131904131905131906131907131908131909131910131911131912131913131914131915131916131917131918131919131920131921131922131923131924131925131926131927131928131929131930131931131932131933131934131935131936131937131938131939131940131941131942131943131944131945131946131947131948131949131950131951131952131953131954131955131956131957131958131959131960131961131962131963131964131965131966131967131968131969131970131971131972131973131974131975131976131977131978131979131980131981131982131983131984131985131986131987131988131989131990131991131992131993131994131995131996131997131998131999132000132001132002132003132004132005132006132007132008132009132010132011132012132013132014132015132016132017132018132019132020132021132022132023132024132025132026132027132028132029132030132031132032132033132034132035132036132037132038132039132040132041132042132043132044132045132046132047132048132049132050132051132052132053132054132055132056132057132058132059132060132061132062132063132064132065132066132067132068132069132070132071132072132073132074132075132076132077132078132079132080132081132082132083132084132085132086132087132088132089132090132091132092132093132094132095132096132097132098132099132100132101132102132103132104132105132106132107132108132109132110132111132112132113132114132115132116132117132118132119132120132121132122132123132124132125132126132127132128132129132130132131132132132133132134132135132136132137132138132139132140132141132142132143132144132145132146132147132148132149132150132151132152132153132154132155132156132157132158132159132160132161132162132163132164132165132166132167132168132169132170132171132172132173132174132175132176132177132178132179132180132181132182132183132184132185132186132187132188132189132190132191132192132193132194132195132196132197132198132199132200132201132202132203132204132205132206132207132208132209132210132211132212132213132214132215132216132217132218132219132220132221132222132223132224132225132226132227132228132229132230132231132232132233132234132235132236132237132238132239132240132241132242132243132244132245132246132247132248132249132250132251132252132253132254132255132256132257132258132259132260132261132262132263132264132265132266132267132268132269132270132271132272132273132274132275132276132277132278132279132280132281132282132283132284132285132286132287132288132289132290132291132292132293132294132295132296132297132298132299132300132301132302132303132304132305132306132307132308132309132310132311132312132313132314132315132316132317132318132319132320132321132322132323132324132325132326132327132328132329132330132331132332132333132334132335132336132337132338132339132340132341132342132343132344132345132346132347132348132349132350132351132352132353132354132355132356132357132358132359132360132361132362132363132364132365132366132367132368132369132370132371132372132373132374132375132376132377132378132379132380132381132382132383132384132385132386132387132388132389132390132391132392132393132394132395132396132397132398132399132400132401132402132403132404132405132406132407132408132409132410132411132412132413132414132415132416132417132418132419132420132421132422132423132424132425132426132427132428132429132430132431132432132433132434132435132436132437132438132439132440132441132442132443132444132445132446132447132448132449132450132451132452132453132454132455132456132457132458132459132460132461132462132463132464132465132466132467132468132469132470132471132472132473132474132475132476132477132478132479132480132481132482132483132484132485132486132487132488132489132490132491132492132493132494132495132496132497132498132499132500132501132502132503132504132505132506132507132508132509132510132511132512132513132514132515132516132517132518132519132520132521132522132523132524132525132526132527132528132529132530132531132532132533132534132535132536132537132538132539132540132541132542132543132544132545132546132547132548132549132550132551132552132553132554132555132556132557132558132559132560132561132562132563132564132565132566132567132568132569132570132571132572132573132574132575132576132577132578132579132580132581132582132583132584132585132586132587132588132589132590132591132592132593132594132595132596132597132598132599132600132601132602132603132604132605132606132607132608132609132610132611132612132613132614132615132616132617132618132619132620132621132622132623132624132625132626132627132628132629132630132631132632132633132634132635132636132637132638132639132640132641132642132643132644132645132646132647132648132649132650132651132652132653132654132655132656132657132658132659132660132661132662132663132664132665132666132667132668132669132670132671132672132673132674132675132676132677132678132679132680132681132682132683132684132685132686132687132688132689132690132691132692132693132694132695132696132697132698132699132700132701132702132703132704132705132706132707132708132709132710132711132712132713132714132715132716132717132718132719132720132721132722132723132724132725132726132727132728132729132730132731132732132733132734132735132736132737132738132739132740132741132742132743132744132745132746132747132748132749132750132751132752132753132754132755132756132757132758132759132760132761132762132763132764132765132766132767132768132769132770132771132772132773132774132775132776132777132778132779132780132781132782132783132784132785132786132787132788132789132790132791132792132793132794132795132796132797132798132799132800132801132802132803132804132805132806132807132808132809132810132811132812132813132814132815132816132817132818132819132820132821132822132823132824132825132826132827132828132829132830132831132832132833132834132835132836132837132838132839132840132841132842132843132844132845132846132847132848132849132850132851132852132853132854132855132856132857132858132859132860132861132862132863132864132865132866132867132868132869132870132871132872132873132874132875132876132877132878132879132880132881132882132883132884132885132886132887132888132889132890132891132892132893132894132895132896132897132898132899132900132901132902132903132904132905132906132907132908132909132910132911132912132913132914132915132916132917132918132919132920132921132922132923132924132925132926132927132928132929132930132931132932132933132934132935132936132937132938132939132940132941132942132943132944132945132946132947132948132949132950132951132952132953132954132955132956132957132958132959132960132961132962132963132964132965132966132967132968132969132970132971132972132973132974132975132976132977132978132979132980132981132982132983132984132985132986132987132988132989132990132991132992132993132994132995132996132997132998132999133000133001133002133003133004133005133006133007133008133009133010133011133012133013133014133015133016133017133018133019133020133021133022133023133024133025133026133027133028133029133030133031133032133033133034133035133036133037133038133039133040133041133042133043133044133045133046133047133048133049133050133051133052133053133054133055133056133057133058133059133060133061133062133063133064133065133066133067133068133069133070133071133072133073133074133075133076133077133078133079133080133081133082133083133084133085133086133087133088133089133090133091133092133093133094133095133096133097133098133099133100133101133102133103133104133105133106133107133108133109133110133111133112133113133114133115133116133117133118133119133120133121133122133123133124133125133126133127133128133129133130133131133132133133133134133135133136133137133138133139133140133141133142133143133144133145133146133147133148133149133150133151133152133153133154133155133156133157133158133159133160133161133162133163133164133165133166133167133168133169133170133171133172133173133174133175133176133177133178133179133180133181133182133183133184133185133186133187133188133189133190133191133192133193133194133195133196133197133198133199133200133201133202133203133204133205133206133207133208133209133210133211133212133213133214133215133216133217133218133219133220133221133222133223133224133225133226133227133228133229133230133231133232133233133234133235133236133237133238133239133240133241133242133243133244133245133246133247133248133249133250133251133252133253133254133255133256133257133258133259133260133261133262133263133264133265133266133267133268133269133270133271133272133273133274133275133276133277133278133279133280133281133282133283133284133285133286133287133288133289133290133291133292133293133294133295133296133297133298133299133300133301133302133303133304133305133306133307133308133309133310133311133312133313133314133315133316133317133318133319133320133321133322133323133324133325133326133327133328133329133330133331133332133333133334133335133336133337133338133339133340133341133342133343133344133345133346133347133348133349133350133351133352133353133354133355133356133357133358133359133360133361133362133363133364133365133366133367133368133369133370133371133372133373133374133375133376133377133378133379133380133381133382133383133384133385133386133387133388133389133390133391133392133393133394133395133396133397133398133399133400133401133402133403133404133405133406133407133408133409133410133411133412133413133414133415133416133417133418133419133420133421133422133423133424133425133426133427133428133429133430133431133432133433133434133435133436133437133438133439133440133441133442133443133444133445133446133447133448133449133450133451133452133453133454133455133456133457133458133459133460133461133462133463133464133465133466133467133468133469133470133471133472133473133474133475133476133477133478133479133480133481133482133483133484133485133486133487133488133489133490133491133492133493133494133495133496133497133498133499133500133501133502133503133504133505133506133507133508133509133510133511133512133513133514133515133516133517133518133519133520133521133522133523133524133525133526133527133528133529133530133531133532133533133534133535133536133537133538133539133540133541133542133543133544133545133546133547133548133549133550133551133552133553133554133555133556133557133558133559133560133561133562133563133564133565133566133567133568133569133570133571133572133573133574133575133576133577133578133579133580133581133582133583133584133585133586133587133588133589133590133591133592133593133594133595133596133597133598133599133600133601133602133603133604133605133606133607133608133609133610133611133612133613133614133615133616133617133618133619133620133621133622133623133624133625133626133627133628133629133630133631133632133633133634133635133636133637133638133639133640133641133642133643133644133645133646133647133648133649133650133651133652133653133654133655133656133657133658133659133660133661133662133663133664133665133666133667133668133669133670133671133672133673133674133675133676133677133678133679133680133681133682133683133684133685133686133687133688133689133690133691133692133693133694133695133696133697133698133699133700133701133702133703133704133705133706133707133708133709133710133711133712133713133714133715133716133717133718133719133720133721133722133723133724133725133726133727133728133729133730133731133732133733133734133735133736133737133738133739133740133741133742133743133744133745133746133747133748133749133750133751133752133753133754133755133756133757133758133759133760133761133762133763133764133765133766133767133768133769133770133771133772133773133774133775133776133777133778133779133780133781133782133783133784133785133786133787133788133789133790133791133792133793133794133795133796133797133798133799133800133801133802133803133804133805133806133807133808133809133810133811133812133813133814133815133816133817133818133819133820133821133822133823133824133825133826133827133828133829133830133831133832133833133834133835133836133837133838133839133840133841133842133843133844133845133846133847133848133849133850133851133852133853133854133855133856133857133858133859133860133861133862133863133864133865133866133867133868133869133870133871133872133873133874133875133876133877133878133879133880133881133882133883133884133885133886133887133888133889133890133891133892133893133894133895133896133897133898133899133900133901133902133903133904133905133906133907133908133909133910133911133912133913133914133915133916133917133918133919133920133921133922133923133924133925133926133927133928133929133930133931133932133933133934133935133936133937133938133939133940133941133942133943133944133945133946133947133948133949133950133951133952133953133954133955133956133957133958133959133960133961133962133963133964133965133966133967133968133969133970133971133972133973133974133975133976133977133978133979133980133981133982133983133984133985133986133987133988133989133990133991133992133993133994133995133996133997133998133999134000134001134002134003134004134005134006134007134008134009134010134011134012134013134014134015134016134017134018134019134020134021134022134023134024134025134026134027134028134029134030134031134032134033134034134035134036134037134038134039134040134041134042134043134044134045134046134047134048134049134050134051134052134053134054134055134056134057134058134059134060134061134062134063134064134065134066134067134068134069134070134071134072134073134074134075134076134077134078134079134080134081134082134083134084134085134086134087134088134089134090134091134092134093134094134095134096134097134098134099134100134101134102134103134104134105134106134107134108134109134110134111134112134113134114134115134116134117134118134119134120134121134122134123134124134125134126134127134128134129134130134131134132134133134134134135134136134137134138134139134140134141134142134143134144134145134146134147134148134149134150134151134152134153134154134155134156134157134158134159134160134161134162134163134164134165134166134167134168134169134170134171134172134173134174134175134176134177134178134179134180134181134182134183134184134185134186134187134188134189134190134191134192134193134194134195134196134197134198134199134200134201134202134203134204134205134206134207134208134209134210134211134212134213134214134215134216134217134218134219134220134221134222134223134224134225134226134227134228134229134230134231134232134233134234134235134236134237134238134239134240134241134242134243134244134245134246134247134248134249134250134251134252134253134254134255134256134257134258134259134260134261134262134263134264134265134266134267134268134269134270134271134272134273134274134275134276134277134278134279134280134281134282134283134284134285134286134287134288134289134290134291134292134293134294134295134296134297134298134299134300134301134302134303134304134305134306134307134308134309134310134311134312134313134314134315134316134317134318134319134320134321134322134323134324134325134326134327134328134329134330134331134332134333134334134335134336134337134338134339134340134341134342134343134344134345134346134347134348134349134350134351134352134353134354134355134356134357134358134359134360134361134362134363134364134365134366134367134368134369134370134371134372134373134374134375134376134377134378134379134380134381134382134383134384134385134386134387134388134389134390134391134392134393134394134395134396134397134398134399134400134401134402134403134404134405134406134407134408134409134410134411134412134413134414134415134416134417134418134419134420134421134422134423134424134425134426134427134428134429134430134431134432134433134434134435134436134437134438134439134440134441134442134443134444134445134446134447134448134449134450134451134452134453134454134455134456134457134458134459134460134461134462134463134464134465134466134467134468134469134470134471134472134473134474134475134476134477134478134479134480134481134482134483134484134485134486134487134488134489134490134491134492134493134494134495134496134497134498134499134500134501134502134503134504134505134506134507134508134509134510134511134512134513134514134515134516134517134518134519134520134521134522134523134524134525134526134527134528134529134530134531134532134533134534134535134536134537134538134539134540134541134542134543134544134545134546134547134548134549134550134551134552134553134554134555134556134557134558134559134560134561134562134563134564134565134566134567134568134569134570134571134572134573134574134575134576134577134578134579134580134581134582134583134584134585134586134587134588134589134590134591134592134593134594134595134596134597134598134599134600134601134602134603134604134605134606134607134608134609134610134611134612134613134614134615134616134617134618134619134620134621134622134623134624134625134626134627134628134629134630134631134632134633134634134635134636134637134638134639134640134641134642134643134644134645134646134647134648134649134650134651134652134653134654134655134656134657134658134659134660134661134662134663134664134665134666134667134668134669134670134671134672134673134674134675134676134677134678134679134680134681134682134683134684134685134686134687134688134689134690134691134692134693134694134695134696134697134698134699134700134701134702134703134704134705134706134707134708134709134710134711134712134713134714134715134716134717134718134719134720134721134722134723134724134725134726134727134728134729134730134731134732134733134734134735134736134737134738134739134740134741134742134743134744134745134746134747134748134749134750134751134752134753134754134755134756134757134758134759134760134761134762134763134764134765134766134767134768134769134770134771134772134773134774134775134776134777134778134779134780134781134782134783134784134785134786134787134788134789134790134791134792134793134794134795134796134797134798134799134800134801134802134803134804134805134806134807134808134809134810134811134812134813134814134815134816134817134818134819134820134821134822134823134824134825134826134827134828134829134830134831134832134833134834134835134836134837134838134839134840134841134842134843134844134845134846134847134848134849134850134851134852134853134854134855134856134857134858134859134860134861134862134863134864134865134866134867134868134869134870134871134872134873134874134875134876134877134878134879134880134881134882134883134884134885134886134887134888134889134890134891134892134893134894134895134896134897134898134899134900134901134902134903134904134905134906134907134908134909134910134911134912134913134914134915134916134917134918134919134920134921134922134923134924134925134926134927134928134929134930134931134932134933134934134935134936134937134938134939134940134941134942134943134944134945134946134947134948134949134950134951134952134953134954134955134956134957134958134959134960134961134962134963134964134965134966134967134968134969134970134971134972134973134974134975134976134977134978134979134980134981134982134983134984134985134986134987134988134989134990134991134992134993134994134995134996134997134998134999135000135001135002135003135004135005135006135007135008135009135010135011135012135013135014135015135016135017135018135019135020135021135022135023135024135025135026135027135028135029135030135031135032135033135034135035135036135037135038135039135040135041135042135043135044135045135046135047135048135049135050135051135052135053135054135055135056135057135058135059135060135061135062135063135064135065135066135067135068135069135070135071135072135073135074135075135076135077135078135079135080135081135082135083135084135085135086135087135088135089135090135091135092135093135094135095135096135097135098135099135100135101135102135103135104135105135106135107135108135109135110135111135112135113135114135115135116135117135118135119135120135121135122135123135124135125135126135127135128135129135130135131135132135133135134135135135136135137135138135139135140135141135142135143135144135145135146135147135148135149135150135151135152135153135154135155135156135157135158135159135160135161135162135163135164135165135166135167135168135169135170135171135172135173135174135175135176135177135178135179135180135181135182135183135184135185135186135187135188135189135190135191135192135193135194135195135196135197135198135199135200135201135202135203135204135205135206135207135208135209135210135211135212135213135214135215135216135217135218135219135220135221135222135223135224135225135226135227135228135229135230135231135232135233135234135235135236135237135238135239135240135241135242135243135244135245135246135247135248135249135250135251135252135253135254135255135256135257135258135259135260135261135262135263135264135265135266135267135268135269135270135271135272135273135274135275135276135277135278135279135280135281135282135283135284135285135286135287135288135289135290135291135292135293135294135295135296135297135298135299135300135301135302135303135304135305135306135307135308135309135310135311135312135313135314135315135316135317135318135319135320135321135322135323135324135325135326135327135328135329135330135331135332135333135334135335135336135337135338135339135340135341135342135343135344135345135346135347135348135349135350135351135352135353135354135355135356135357135358135359135360135361135362135363135364135365135366135367135368135369135370135371135372135373135374135375135376135377135378135379135380135381135382135383135384135385135386135387135388135389135390135391135392135393135394135395135396135397135398135399135400135401135402135403135404135405135406135407135408135409135410135411135412135413135414135415135416135417135418135419135420135421135422135423135424135425135426135427135428135429135430135431135432135433135434135435135436135437135438135439135440135441135442135443135444135445135446135447135448135449135450135451135452135453135454135455135456135457135458135459135460135461135462135463135464135465135466135467135468135469135470135471135472135473135474135475135476135477135478135479135480135481135482135483135484135485135486135487135488135489135490135491135492135493135494135495135496135497135498135499135500135501135502135503135504135505135506135507135508135509135510135511135512135513135514135515135516135517135518135519135520135521135522135523135524135525135526135527135528135529135530135531135532135533135534135535135536135537135538135539135540135541135542135543135544135545135546135547135548135549135550135551135552135553135554135555135556135557135558135559135560135561135562135563135564135565135566135567135568135569135570135571135572135573135574135575135576135577135578135579135580135581135582135583135584135585135586135587135588135589135590135591135592135593135594135595135596135597135598135599135600135601135602135603135604135605135606135607135608135609135610135611135612135613135614135615135616135617135618135619135620135621135622135623135624135625135626135627135628135629135630135631135632135633135634135635135636135637135638135639135640135641135642135643135644135645135646135647135648135649135650135651135652135653135654135655135656135657135658135659135660135661135662135663135664135665135666135667135668135669135670135671135672135673135674135675135676135677135678135679135680135681135682135683135684135685135686135687135688135689135690135691135692135693135694135695135696135697135698135699135700135701135702135703135704135705135706135707135708135709135710135711135712135713135714135715135716135717135718135719135720135721135722135723135724135725135726135727135728135729135730135731135732135733135734135735135736135737135738135739135740135741135742135743135744135745135746135747135748135749135750135751135752135753135754135755135756135757135758135759135760135761135762135763135764135765135766135767135768135769135770135771135772135773135774135775135776135777135778135779135780135781135782135783135784135785135786135787135788135789135790135791135792135793135794135795135796135797135798135799135800135801135802135803135804135805135806135807135808135809135810135811135812135813135814135815135816135817135818135819135820135821135822135823135824135825135826135827135828135829135830135831135832135833135834135835135836135837135838135839135840135841135842135843135844135845135846135847135848135849135850135851135852135853135854135855135856135857135858135859135860135861135862135863135864135865135866135867135868135869135870135871135872135873135874135875135876135877135878135879135880135881135882135883135884135885135886135887135888135889135890135891135892135893135894135895135896135897135898135899135900135901135902135903135904135905135906135907135908135909135910135911135912135913135914135915135916135917135918135919135920135921135922135923135924135925135926135927135928135929135930135931135932135933135934135935135936135937135938135939135940135941135942135943135944135945135946135947135948135949135950135951135952135953135954135955135956135957135958135959135960135961135962135963135964135965135966135967135968135969135970135971135972135973135974135975135976135977135978135979135980135981135982135983135984135985135986135987135988135989135990135991135992135993135994135995135996135997135998135999136000136001136002136003136004136005136006136007136008136009136010136011136012136013136014136015136016136017136018136019136020136021136022136023136024136025136026136027136028136029136030136031136032136033136034136035136036136037136038136039136040136041136042136043136044136045136046136047136048136049136050136051136052136053136054136055136056136057136058136059136060136061136062136063136064136065136066136067136068136069136070136071136072136073136074136075136076136077136078136079136080136081136082136083136084136085136086136087136088136089136090136091136092136093136094136095136096136097136098136099136100136101136102136103136104136105136106136107136108136109136110136111136112136113136114136115136116136117136118136119136120136121136122136123136124136125136126136127136128136129136130136131136132136133136134136135136136136137136138136139136140136141136142136143136144136145136146136147136148136149136150136151136152136153136154136155136156136157136158136159136160136161136162136163136164136165136166136167136168136169136170136171136172136173136174136175136176136177136178136179136180136181136182136183136184136185136186136187136188136189136190136191136192136193136194136195136196136197136198136199136200136201136202136203136204136205136206136207136208136209136210136211136212136213136214136215136216136217136218136219136220136221136222136223136224136225136226136227136228136229136230136231136232136233136234136235136236136237136238136239136240136241136242136243136244136245136246136247136248136249136250136251136252136253136254136255136256136257136258136259136260136261136262136263136264136265136266136267136268136269136270136271136272136273136274136275136276136277136278136279136280136281136282136283136284136285136286136287136288136289136290136291136292136293136294136295136296136297136298136299136300136301136302136303136304136305136306136307136308136309136310136311136312136313136314136315136316136317136318136319136320136321136322136323136324136325136326136327136328136329136330136331136332136333136334136335136336136337136338136339136340136341136342136343136344136345136346136347136348136349136350136351136352136353136354136355136356136357136358136359136360136361136362136363136364136365136366136367136368136369136370136371136372136373136374136375136376136377136378136379136380136381136382136383136384136385136386136387136388136389136390136391136392136393136394136395136396136397136398136399136400136401136402136403136404136405136406136407136408136409136410136411136412136413136414136415136416136417136418136419136420136421136422136423136424136425136426136427136428136429136430136431136432136433136434136435136436136437136438136439136440136441136442136443136444136445136446136447136448136449136450136451136452136453136454136455136456136457136458136459136460136461136462136463136464136465136466136467136468136469136470136471136472136473136474136475136476136477136478136479136480136481136482136483136484136485136486136487136488136489136490136491136492136493136494136495136496136497136498136499136500136501136502136503136504136505136506136507136508136509136510136511136512136513136514136515136516136517136518136519136520136521136522136523136524136525136526136527136528136529136530136531136532136533136534136535136536136537136538136539136540136541136542136543136544136545136546136547136548136549136550136551136552136553136554136555136556136557136558136559136560136561136562136563136564136565136566136567136568136569136570136571136572136573136574136575136576136577136578136579136580136581136582136583136584136585136586136587136588136589136590136591136592136593136594136595136596136597136598136599136600136601136602136603136604136605136606136607136608136609136610136611136612136613136614136615136616136617136618136619136620136621136622136623136624136625136626136627136628136629136630136631136632136633136634136635136636136637136638136639136640136641136642136643136644136645136646136647136648136649136650136651136652136653136654136655136656136657136658136659136660136661136662136663136664136665136666136667136668136669136670136671136672136673136674136675136676136677136678136679136680136681136682136683136684136685136686136687136688136689136690136691136692136693136694136695136696136697136698136699136700136701136702136703136704136705136706136707136708136709136710136711136712136713136714136715136716136717136718136719136720136721136722136723136724136725136726136727136728136729136730136731136732136733136734136735136736136737136738136739136740136741136742136743136744136745136746136747136748136749136750136751136752136753136754136755136756136757136758136759136760136761136762136763136764136765136766136767136768136769136770136771136772136773136774136775136776136777136778136779136780136781136782136783136784136785136786136787136788136789136790136791136792136793136794136795136796136797136798136799136800136801136802136803136804136805136806136807136808136809136810136811136812136813136814136815136816136817136818136819136820136821136822136823136824136825136826136827136828136829136830136831136832136833136834136835136836136837136838136839136840136841136842136843136844136845136846136847136848136849136850136851136852136853136854136855136856136857136858136859136860136861136862136863136864136865136866136867136868136869136870136871136872136873136874136875136876136877136878136879136880136881136882136883136884136885136886136887136888136889136890136891136892136893136894136895136896136897136898136899136900136901136902136903136904136905136906136907136908136909136910136911136912136913136914136915136916136917136918136919136920136921136922136923136924136925136926136927136928136929136930136931136932136933136934136935136936136937136938136939136940136941136942136943136944136945136946136947136948136949136950136951136952136953136954136955136956136957136958136959136960136961136962136963136964136965136966136967136968136969136970136971136972136973136974136975136976136977136978136979136980136981136982136983136984136985136986136987136988136989136990136991136992136993136994136995136996136997136998136999137000137001137002137003137004137005137006137007137008137009137010137011137012137013137014137015137016137017137018137019137020137021137022137023137024137025137026137027137028137029137030137031137032137033137034137035137036137037137038137039137040137041137042137043137044137045137046137047137048137049137050137051137052137053137054137055137056137057137058137059137060137061137062137063137064137065137066137067137068137069137070137071137072137073137074137075137076137077137078137079137080137081137082137083137084137085137086137087137088137089137090137091137092137093137094137095137096137097137098137099137100137101137102137103137104137105137106137107137108137109137110137111137112137113137114137115137116137117137118137119137120137121137122137123137124137125137126137127137128137129137130137131137132137133137134137135137136137137137138137139137140137141137142137143137144137145137146137147137148137149137150137151137152137153137154137155137156137157137158137159137160137161137162137163137164137165137166137167137168137169137170137171137172137173137174137175137176137177137178137179137180137181137182137183137184137185137186137187137188137189137190137191137192137193137194137195137196137197137198137199137200137201137202137203137204137205137206137207137208137209137210137211137212137213137214137215137216137217137218137219137220137221137222137223137224137225137226137227137228137229137230137231137232137233137234137235137236137237137238137239137240137241137242137243137244137245137246137247137248137249137250137251137252137253137254137255137256137257137258137259137260137261137262137263137264137265137266137267137268137269137270137271137272137273137274137275137276137277137278137279137280137281137282137283137284137285137286137287137288137289137290137291137292137293137294137295137296137297137298137299137300137301137302137303137304137305137306137307137308137309137310137311137312137313137314137315137316137317137318137319137320137321137322137323137324137325137326137327137328137329137330137331137332137333137334137335137336137337137338137339137340137341137342137343137344137345137346137347137348137349137350137351137352137353137354137355137356137357137358137359137360137361137362137363137364137365137366137367137368137369137370137371137372137373137374137375137376137377137378137379137380137381137382137383137384137385137386137387137388137389137390137391137392137393137394137395137396137397137398137399137400137401137402137403137404137405137406137407137408137409137410137411137412137413137414137415137416137417137418137419137420137421137422137423137424137425137426137427137428137429137430137431137432137433137434137435137436137437137438137439137440137441137442137443137444137445137446137447137448137449137450137451137452137453137454137455137456137457137458137459137460137461137462137463137464137465137466137467137468137469137470137471137472137473137474137475137476137477137478137479137480137481137482137483137484137485137486137487137488137489137490137491137492137493137494137495137496137497137498137499137500137501137502137503137504137505137506137507137508137509137510137511137512137513137514137515137516137517137518137519137520137521137522137523137524137525137526137527137528137529137530137531137532137533137534137535137536137537137538137539137540137541137542137543137544137545137546137547137548137549137550137551137552137553137554137555137556137557137558137559137560137561137562137563137564137565137566137567137568137569137570137571137572137573137574137575137576137577137578137579137580137581137582137583137584137585137586137587137588137589137590137591137592137593137594137595137596137597137598137599137600137601137602137603137604137605137606137607137608137609137610137611137612137613137614137615137616137617137618137619137620137621137622137623137624137625137626137627137628137629137630137631137632137633137634137635137636137637137638137639137640137641137642137643137644137645137646137647137648137649137650137651137652137653137654137655137656137657137658137659137660137661137662137663137664137665137666137667137668137669137670137671137672137673137674137675137676137677137678137679137680137681137682137683137684137685137686137687137688137689137690137691137692137693137694137695137696137697137698137699137700137701137702137703137704137705137706137707137708137709137710137711137712137713137714137715137716137717137718137719137720137721137722137723137724137725137726137727137728137729137730137731137732137733137734137735137736137737137738137739137740137741137742137743137744137745137746137747137748137749137750137751137752137753137754137755137756137757137758137759137760137761137762137763137764137765137766137767137768137769137770137771137772137773137774137775137776137777137778137779137780137781137782137783137784137785137786137787137788137789137790137791137792137793137794137795137796137797137798137799137800137801137802137803137804137805137806137807137808137809137810137811137812137813137814137815137816137817137818137819137820137821137822137823137824137825137826137827137828137829137830137831137832137833137834137835137836137837137838137839137840137841137842137843137844137845137846137847137848137849137850137851137852137853137854137855137856137857137858137859137860137861137862137863137864137865137866137867137868137869137870137871137872137873137874137875137876137877137878137879137880137881137882137883137884137885137886137887137888137889137890137891137892137893137894137895137896137897137898137899137900137901137902137903137904137905137906137907137908137909137910137911137912137913137914137915137916137917137918137919137920137921137922137923137924137925137926137927137928137929137930137931137932137933137934137935137936137937137938137939137940137941137942137943137944137945137946137947137948137949137950137951137952137953137954137955137956137957137958137959137960137961137962137963137964137965137966137967137968137969137970137971137972137973137974137975137976137977137978137979137980137981137982137983137984137985137986137987137988137989137990137991137992137993137994137995137996137997137998137999138000138001138002138003138004138005138006138007138008138009138010138011138012138013138014138015138016138017138018138019138020138021138022138023138024138025138026138027138028138029138030138031138032138033138034138035138036138037138038138039138040138041138042138043138044138045138046138047138048138049138050138051138052138053138054138055138056138057138058138059138060138061138062138063138064138065138066138067138068138069138070138071138072138073138074138075138076138077138078138079138080138081138082138083138084138085138086138087138088138089138090138091138092138093138094138095138096138097138098138099138100138101138102138103138104138105138106138107138108138109138110138111138112138113138114138115138116138117138118138119138120138121138122138123138124138125138126138127138128138129138130138131138132138133138134138135138136138137138138138139138140138141138142138143138144138145138146138147138148138149138150138151138152138153138154138155138156138157138158138159138160138161138162138163138164138165138166138167138168138169138170138171138172138173138174138175138176138177138178138179138180138181138182138183138184138185138186138187138188138189138190138191138192138193138194138195138196138197138198138199138200138201138202138203138204138205138206138207138208138209138210138211138212138213138214138215138216138217138218138219138220138221138222138223138224138225138226138227138228138229138230138231138232138233138234138235138236138237138238138239138240138241138242138243138244138245138246138247138248138249138250138251138252138253138254138255138256138257138258138259138260138261138262138263138264138265138266138267138268138269138270138271138272138273138274138275138276138277138278138279138280138281138282138283138284138285138286138287138288138289138290138291138292138293138294138295138296138297138298138299138300138301138302138303138304138305138306138307138308138309138310138311138312138313138314138315138316138317138318138319138320138321138322138323138324138325138326138327138328138329138330138331138332138333138334138335138336138337138338138339138340138341138342138343138344138345138346138347138348138349138350138351138352138353138354138355138356138357138358138359138360138361138362138363138364138365138366138367138368138369138370138371138372138373138374138375138376138377138378138379138380138381138382138383138384138385138386138387138388138389138390138391138392138393138394138395138396138397138398138399138400138401138402138403138404138405138406138407138408138409138410138411138412138413138414138415138416138417138418138419138420138421138422138423138424138425138426138427138428138429138430138431138432138433138434138435138436138437138438138439138440138441138442138443138444138445138446138447138448138449138450138451138452138453138454138455138456138457138458138459138460138461138462138463138464138465138466138467138468138469138470138471138472138473138474138475138476138477138478138479138480138481138482138483138484138485138486138487138488138489138490138491138492138493138494138495138496138497138498138499138500138501138502138503138504138505138506138507138508138509138510138511138512138513138514138515138516138517138518138519138520138521138522138523138524138525138526138527138528138529138530138531138532138533138534138535138536138537138538138539138540138541138542138543138544138545138546138547138548138549138550138551138552138553138554138555138556138557138558138559138560138561138562138563138564138565138566138567138568138569138570138571138572138573138574138575138576138577138578138579138580138581138582138583138584138585138586138587138588138589138590138591138592138593138594138595138596138597138598138599138600138601138602138603138604138605138606138607138608138609138610138611138612138613138614138615138616138617138618138619138620138621138622138623138624138625138626138627138628138629138630138631138632138633138634138635138636138637138638138639138640138641138642138643138644138645138646138647138648138649138650138651138652138653138654138655138656138657138658138659138660138661138662138663138664138665138666138667138668138669138670138671138672138673138674138675138676138677138678138679138680138681138682138683138684138685138686138687138688138689138690138691138692138693138694138695138696138697138698138699138700138701138702138703138704138705138706138707138708138709138710138711138712138713138714138715138716138717138718138719138720138721138722138723138724138725138726138727138728138729138730138731138732138733138734138735138736138737138738138739138740138741138742138743138744138745138746138747138748138749138750138751138752138753138754138755138756138757138758138759138760138761138762138763138764138765138766138767138768138769138770138771138772138773138774138775138776138777138778138779138780138781138782138783138784138785138786138787138788138789138790138791138792138793138794138795138796138797138798138799138800138801138802138803138804138805138806138807138808138809138810138811138812138813138814138815138816138817138818138819138820138821138822138823138824138825138826138827138828138829138830138831138832138833138834138835138836138837138838138839138840138841138842138843138844138845138846138847138848138849138850138851138852138853138854138855138856138857138858138859138860138861138862138863138864138865138866138867138868138869138870138871138872138873138874138875138876138877138878138879138880138881138882138883138884138885138886138887138888138889138890138891138892138893138894138895138896138897138898138899138900138901138902138903138904138905138906138907138908138909138910138911138912138913138914138915138916138917138918138919138920138921138922138923138924138925138926138927138928138929138930138931138932138933138934138935138936138937138938138939138940138941138942138943138944138945138946138947138948138949138950138951138952138953138954138955138956138957138958138959138960138961138962138963138964138965138966138967138968138969138970138971138972138973138974138975138976138977138978138979138980138981138982138983138984138985138986138987138988138989138990138991138992138993138994138995138996138997138998138999139000139001139002139003139004139005139006139007139008139009139010139011139012139013139014139015139016139017139018139019139020139021139022139023139024139025139026139027139028139029139030139031139032139033139034139035139036139037139038139039139040139041139042139043139044139045139046139047139048139049139050139051139052139053139054139055139056139057139058139059139060139061139062139063139064139065139066139067139068139069139070139071139072139073139074139075139076139077139078139079139080139081139082139083139084139085139086139087139088139089139090139091139092139093139094139095139096139097139098139099139100139101139102139103139104139105139106139107139108139109139110139111139112139113139114139115139116139117139118139119139120139121139122139123139124139125139126139127139128139129139130139131139132139133139134139135139136139137139138139139139140139141139142139143139144139145139146139147139148139149139150139151139152139153139154139155139156139157139158139159139160139161139162139163139164139165139166139167139168139169139170139171139172139173139174139175139176139177139178139179139180139181139182139183139184139185139186139187139188139189139190139191139192139193139194139195139196139197139198139199139200139201139202139203139204139205139206139207139208139209139210139211139212139213139214139215139216139217139218139219139220139221139222139223139224139225139226139227139228139229139230139231139232139233139234139235139236139237139238139239139240139241139242139243139244139245139246139247139248139249139250139251139252139253139254139255139256139257139258139259139260139261139262139263139264139265139266139267139268139269139270139271139272139273139274139275139276139277139278139279139280139281139282139283139284139285139286139287139288139289139290139291139292139293139294139295139296139297139298139299139300139301139302139303139304139305139306139307139308139309139310139311139312139313139314139315139316139317139318139319139320139321139322139323139324139325139326139327139328139329139330139331139332139333139334139335139336139337139338139339139340139341139342139343139344139345139346139347139348139349139350139351139352139353139354139355139356139357139358139359139360139361139362139363139364139365139366139367139368139369139370139371139372139373139374139375139376139377139378139379139380139381139382139383139384139385139386139387139388139389139390139391139392139393139394139395139396139397139398139399139400139401139402139403139404139405139406139407139408139409139410139411139412139413139414139415139416139417139418139419139420139421139422139423139424139425139426139427139428139429139430139431139432139433139434139435139436139437139438139439139440139441139442139443139444139445139446139447139448139449139450139451139452139453139454139455139456139457139458139459139460139461139462139463139464139465139466139467139468139469139470139471139472139473139474139475139476139477139478139479139480139481139482139483139484139485139486139487139488139489139490139491139492139493139494139495139496139497139498139499139500139501139502139503139504139505139506139507139508139509139510139511139512139513139514139515139516139517139518139519139520139521139522139523139524139525139526139527139528139529139530139531139532139533139534139535139536139537139538139539139540139541139542139543139544139545139546139547139548139549139550139551139552139553139554139555139556139557139558139559139560139561139562139563139564139565139566139567139568139569139570139571139572139573139574139575139576139577139578139579139580139581139582139583139584139585139586139587139588139589139590139591139592139593139594139595139596139597139598139599139600139601139602139603139604139605139606139607139608139609139610139611139612139613139614139615139616139617139618139619139620139621139622139623139624139625139626139627139628139629139630139631139632139633139634139635139636139637139638139639139640139641139642139643139644139645139646139647139648139649139650139651139652139653139654139655139656139657139658139659139660139661139662139663139664139665139666139667139668139669139670139671139672139673139674139675139676139677139678139679139680139681139682139683139684139685139686139687139688139689139690139691139692139693139694139695139696139697139698139699139700139701139702139703139704139705139706139707139708139709139710139711139712139713139714139715139716139717139718139719139720139721139722139723139724139725139726139727139728139729139730139731139732139733139734139735139736139737139738139739139740139741139742139743139744139745139746139747139748139749139750139751139752139753139754139755139756139757139758139759139760139761139762139763139764139765139766139767139768139769139770139771139772139773139774139775139776139777139778139779139780139781139782139783139784139785139786139787139788139789139790139791139792139793139794139795139796139797139798139799139800139801139802139803139804139805139806139807139808139809139810139811139812139813139814139815139816139817139818139819139820139821139822139823139824139825139826139827139828139829139830139831139832139833139834139835139836139837139838139839139840139841139842139843139844139845139846139847139848139849139850139851139852139853139854139855139856139857139858139859139860139861139862139863139864139865139866139867139868139869139870139871139872139873139874139875139876139877139878139879139880139881139882139883139884139885139886139887139888139889139890139891139892139893139894139895139896139897139898139899139900139901139902139903139904139905139906139907139908139909139910139911139912139913139914139915139916139917139918139919139920139921139922139923139924139925139926139927139928139929139930139931139932139933139934139935139936139937139938139939139940139941139942139943139944139945139946139947139948139949139950139951139952139953139954139955139956139957139958139959139960139961139962139963139964139965139966139967139968139969139970139971139972139973139974139975139976139977139978139979139980139981139982139983139984139985139986139987139988139989139990139991139992139993139994139995139996139997139998139999140000140001140002140003140004140005140006140007140008140009140010140011140012140013140014140015140016140017140018140019140020140021140022140023140024140025140026140027140028140029140030140031140032140033140034140035140036140037140038140039140040140041140042140043140044140045140046140047140048140049140050140051140052140053140054140055140056140057140058140059140060140061140062140063140064140065140066140067140068140069140070140071140072140073140074140075140076140077140078140079140080140081140082140083140084140085140086140087140088140089140090140091140092140093140094140095140096140097140098140099140100140101140102140103140104140105140106140107140108140109140110140111140112140113140114140115140116140117140118140119140120140121140122140123140124140125140126140127140128140129140130140131140132140133140134140135140136140137140138140139140140140141140142140143140144140145140146140147140148140149140150140151140152140153140154140155140156140157140158140159140160140161140162140163140164140165140166140167140168140169140170140171140172140173140174140175140176140177140178140179140180140181140182140183140184140185140186140187140188140189140190140191140192140193140194140195140196140197140198140199140200140201140202140203140204140205140206140207140208140209140210140211140212140213140214140215140216140217140218140219140220140221140222140223140224140225140226140227140228140229140230140231140232140233140234140235140236140237140238140239140240140241140242140243140244140245140246140247140248140249140250140251140252140253140254140255140256140257140258140259140260140261140262140263140264140265140266140267140268140269140270140271140272140273140274140275140276140277140278140279140280140281140282140283140284140285140286140287140288140289140290140291140292140293140294140295140296140297140298140299140300140301140302140303140304140305140306140307140308140309140310140311140312140313140314140315140316140317140318140319140320140321140322140323140324140325140326140327140328140329140330140331140332140333140334140335140336140337140338140339140340140341140342140343140344140345140346140347140348140349140350140351140352140353140354140355140356140357140358140359140360140361140362140363140364140365140366140367140368140369140370140371140372140373140374140375140376140377140378140379140380140381140382140383140384140385140386140387140388140389140390140391140392140393140394140395140396140397140398140399140400140401140402140403140404140405140406140407140408140409140410140411140412140413140414140415140416140417140418140419140420140421140422140423140424140425140426140427140428140429140430140431140432140433140434140435140436140437140438140439140440140441140442140443140444140445140446140447140448140449140450140451140452140453140454140455140456140457140458140459140460140461140462140463140464140465140466140467140468140469140470140471140472140473140474140475140476140477140478140479140480140481140482140483140484140485140486140487140488140489140490140491140492140493140494140495140496140497140498140499140500140501140502140503140504140505140506140507140508140509140510140511140512140513140514140515140516140517140518140519140520140521140522140523140524140525140526140527140528140529140530140531140532140533140534140535140536140537140538140539140540140541140542140543140544140545140546140547140548140549140550140551140552140553140554140555140556140557140558140559140560140561140562140563140564140565140566140567140568140569140570140571140572140573140574140575140576140577140578140579140580140581140582140583140584140585140586140587140588140589140590140591140592140593140594140595140596140597140598140599140600140601140602140603140604140605140606140607140608140609140610140611140612140613140614140615140616140617140618140619140620140621140622140623140624140625140626140627140628140629140630140631140632140633140634140635140636140637140638140639140640140641140642140643140644140645140646140647140648140649140650140651140652140653140654140655140656140657140658140659140660140661140662140663140664140665140666140667140668140669140670140671140672140673140674140675140676140677140678140679140680140681140682140683140684140685140686140687140688140689140690140691140692140693140694140695140696140697140698140699140700140701140702140703140704140705140706140707140708140709140710140711140712140713140714140715140716140717140718140719140720140721140722140723140724140725140726140727140728140729140730140731140732140733140734140735140736140737140738140739140740140741140742140743140744140745140746140747140748140749140750140751140752140753140754140755140756140757140758140759140760140761140762140763140764140765140766140767140768140769140770140771140772140773140774140775140776140777140778140779140780140781140782140783140784140785140786140787140788140789140790140791140792140793140794140795140796140797140798140799140800140801140802140803140804140805140806140807140808140809140810140811140812140813140814140815140816140817140818140819140820140821140822140823140824140825140826140827140828140829140830140831140832140833140834140835140836140837140838140839140840140841140842140843140844140845140846140847140848140849140850140851140852140853140854140855140856140857140858140859140860140861140862140863140864140865140866140867140868140869140870140871140872140873140874140875140876140877140878140879140880140881140882140883140884140885140886140887140888140889140890140891140892140893140894140895140896140897140898140899140900140901140902140903140904140905140906140907140908140909140910140911140912140913140914140915140916140917140918140919140920140921140922140923140924140925140926140927140928140929140930140931140932140933140934140935140936140937140938140939140940140941140942140943140944140945140946140947140948140949140950140951140952140953140954140955140956140957140958140959140960140961140962140963140964140965140966140967140968140969140970140971140972140973140974140975140976140977140978140979140980140981140982140983140984140985140986140987140988140989140990140991140992140993140994140995140996140997140998140999141000141001141002141003141004141005141006141007141008141009141010141011141012141013141014141015141016141017141018141019141020141021141022141023141024141025141026141027141028141029141030141031141032141033141034141035141036141037141038141039141040141041141042141043141044141045141046141047141048141049141050141051141052141053141054141055141056141057141058141059141060141061141062141063141064141065141066141067141068141069141070141071141072141073141074141075141076141077141078141079141080141081141082141083141084141085141086141087141088141089141090141091141092141093141094141095141096141097141098141099141100141101141102141103141104141105141106141107141108141109141110141111141112141113141114141115141116141117141118141119141120141121141122141123141124141125141126141127141128141129141130141131141132141133141134141135141136141137141138141139141140141141141142141143141144141145141146141147141148141149141150141151141152141153141154141155141156141157141158141159141160141161141162141163141164141165141166141167141168141169141170141171141172141173141174141175141176141177141178141179141180141181141182141183141184141185141186141187141188141189141190141191141192141193141194141195141196141197141198141199141200141201141202141203141204141205141206141207141208141209141210141211141212141213141214141215141216141217141218141219141220141221141222141223141224141225141226141227141228141229141230141231141232141233141234141235141236141237141238141239141240141241141242141243141244141245141246141247141248141249141250141251141252141253141254141255141256141257141258141259141260141261141262141263141264141265141266141267141268141269141270141271141272141273141274141275141276141277141278141279141280141281141282141283141284141285141286141287141288141289141290141291141292141293141294141295141296141297141298141299141300141301141302141303141304141305141306141307141308141309141310141311141312141313141314141315141316141317141318141319141320141321141322141323141324141325141326141327141328141329141330141331141332141333141334141335141336141337141338141339141340141341141342141343141344141345141346141347141348141349141350141351141352141353141354141355141356141357141358141359141360141361141362141363141364141365141366141367141368141369141370141371141372141373141374141375141376141377141378141379141380141381141382141383141384141385141386141387141388141389141390141391141392141393141394141395141396141397141398141399141400141401141402141403141404141405141406141407141408141409141410141411141412141413141414141415141416141417141418141419141420141421141422141423141424141425141426141427141428141429141430141431141432141433141434141435141436141437141438141439141440141441141442141443141444141445141446141447141448141449141450141451141452141453141454141455141456141457141458141459141460141461141462141463141464141465141466141467141468141469141470141471141472141473141474141475141476141477141478141479141480141481141482141483141484141485141486141487141488141489141490141491141492141493141494141495141496141497141498141499141500141501141502141503141504141505141506141507141508141509141510141511141512141513141514141515141516141517141518141519141520141521141522141523141524141525141526141527141528141529141530141531141532141533141534141535141536141537141538141539141540141541141542141543141544141545141546141547141548141549141550141551141552141553141554141555141556141557141558141559141560141561141562141563141564141565141566141567141568141569141570141571141572141573141574141575141576141577141578141579141580141581141582141583141584141585141586141587141588141589141590141591141592141593141594141595141596141597141598141599141600141601141602141603141604141605141606141607141608141609141610141611141612141613141614141615141616141617141618141619141620141621141622141623141624141625141626141627141628141629141630141631141632141633141634141635141636141637141638141639141640141641141642141643141644141645141646141647141648141649141650141651141652141653141654141655141656141657141658141659141660141661141662141663141664141665141666141667141668141669141670141671141672141673141674141675141676141677141678141679141680141681141682141683141684141685141686141687141688141689141690141691141692141693141694141695141696141697141698141699141700141701141702141703141704141705141706141707141708141709141710141711141712141713141714141715141716141717141718141719141720141721141722141723141724141725141726141727141728141729141730141731141732141733141734141735141736141737141738141739141740141741141742141743141744141745141746141747141748141749141750141751141752141753141754141755141756141757141758141759141760141761141762141763141764141765141766141767141768141769141770141771141772141773141774141775141776141777141778141779141780141781141782141783141784141785141786141787141788141789141790141791141792141793141794141795141796141797141798141799141800141801141802141803141804141805141806141807141808141809141810141811141812141813141814141815141816141817141818141819141820141821141822141823141824141825141826141827141828141829141830141831141832141833141834141835141836141837141838141839141840141841141842141843141844141845141846141847141848141849141850141851141852141853141854141855141856141857141858141859141860141861141862141863141864141865141866141867141868141869141870141871141872141873141874141875141876141877141878141879141880141881141882141883141884141885141886141887141888141889141890141891141892141893141894141895141896141897141898141899141900141901141902141903141904141905141906141907141908141909141910141911141912141913141914141915141916141917141918141919141920141921141922141923141924141925141926141927141928141929141930141931141932141933141934141935141936141937141938141939141940141941141942141943141944141945141946141947141948141949141950141951141952141953141954141955141956141957141958141959141960141961141962141963141964141965141966141967141968141969141970141971141972141973141974141975141976141977141978141979141980141981141982141983141984141985141986141987141988141989141990141991141992141993141994141995141996141997141998141999142000142001142002142003142004142005142006142007142008142009142010142011142012142013142014142015142016142017142018142019142020142021142022142023142024142025142026142027142028142029142030142031142032142033142034142035142036142037142038142039142040142041142042142043142044142045142046142047142048142049142050142051142052142053142054142055142056142057142058142059142060142061142062142063142064142065142066142067142068142069142070142071142072142073142074142075142076142077142078142079142080142081142082142083142084142085142086142087142088142089142090142091142092142093142094142095142096142097142098142099142100142101142102142103142104142105142106142107142108142109142110142111142112142113142114142115142116142117142118142119142120142121142122142123142124142125142126142127142128142129142130142131142132142133142134142135142136142137142138142139142140142141142142142143142144142145142146142147142148142149142150142151142152142153142154142155142156142157142158142159142160142161142162142163142164142165142166142167142168142169142170142171142172142173142174142175142176142177142178142179142180142181142182142183142184142185142186142187142188142189142190142191142192142193142194142195142196142197142198142199142200142201142202142203142204142205142206142207142208142209142210142211142212142213142214142215142216142217142218142219142220142221142222142223142224142225142226142227142228142229142230142231142232142233142234142235142236142237142238142239142240142241142242142243142244142245142246142247142248142249142250142251142252142253142254142255142256142257142258142259142260142261142262142263142264142265142266142267142268142269142270142271142272142273142274142275142276142277142278142279142280142281142282142283142284142285142286142287142288142289142290142291142292142293142294142295142296142297142298142299142300142301142302142303142304142305142306142307142308142309142310142311142312142313142314142315142316142317142318142319142320142321142322142323142324142325142326142327142328142329142330142331142332142333142334142335142336142337142338142339142340142341142342142343142344142345142346142347142348142349142350142351142352142353142354142355142356142357142358142359142360142361142362142363142364142365142366142367142368142369142370142371142372142373142374142375142376142377142378142379142380142381142382142383142384142385142386142387142388142389142390142391142392142393142394142395142396142397142398142399142400142401142402142403142404142405142406142407142408142409142410142411142412142413142414142415142416142417142418142419142420142421142422142423142424142425142426142427142428142429142430142431142432142433142434142435142436142437142438142439142440142441142442142443142444142445142446142447142448142449142450142451142452142453142454142455142456142457142458142459142460142461142462142463142464142465142466142467142468142469142470142471142472142473142474142475142476142477142478142479142480142481142482142483142484142485142486142487142488142489142490142491142492142493142494142495142496142497142498142499142500142501142502142503142504142505142506142507142508142509142510142511142512142513142514142515142516142517142518142519142520142521142522142523142524142525142526142527142528142529142530142531142532142533142534142535142536142537142538142539142540142541142542142543142544142545142546142547142548142549142550142551142552142553142554142555142556142557142558142559142560142561142562142563142564142565142566142567142568142569142570142571142572142573142574142575142576142577142578142579142580142581142582142583142584142585142586142587142588142589142590142591142592142593142594142595142596142597142598142599142600142601142602142603142604142605142606142607142608142609142610142611142612142613142614142615142616142617142618142619142620142621142622142623142624142625142626142627142628142629142630142631142632142633142634142635142636142637142638142639142640142641142642142643142644142645142646142647142648142649142650142651142652142653142654142655142656142657142658142659142660142661142662142663142664142665142666142667142668142669142670142671142672142673142674142675142676142677142678142679142680142681142682142683142684142685142686142687142688142689142690142691142692142693142694142695142696142697142698142699142700142701142702142703142704142705142706142707142708142709142710142711142712142713142714142715142716142717142718142719142720142721142722142723142724142725142726142727142728142729142730142731142732142733142734142735142736142737142738142739142740142741142742142743142744142745142746142747142748142749142750142751142752142753142754142755142756142757142758142759142760142761142762142763142764142765142766142767142768142769142770142771142772142773142774142775142776142777142778142779142780142781142782142783142784142785142786142787142788142789142790142791142792142793142794142795142796142797142798142799142800142801142802142803142804142805142806142807142808142809142810142811142812142813142814142815142816142817142818142819142820142821142822142823142824142825142826142827142828142829142830142831142832142833142834142835142836142837142838142839142840142841142842142843142844142845142846142847142848142849142850142851142852142853142854142855142856142857142858142859142860142861142862142863142864142865142866142867142868142869142870142871142872142873142874142875142876142877142878142879142880142881142882142883142884142885142886142887142888142889142890142891142892142893142894142895142896142897142898142899142900142901142902142903142904142905142906142907142908142909142910142911142912142913142914142915142916142917142918142919142920142921142922142923142924142925142926142927142928142929142930142931142932142933142934142935142936142937142938142939142940142941142942142943142944142945142946142947142948142949142950142951142952142953142954142955142956142957142958142959142960142961142962142963142964142965142966142967142968142969142970142971142972142973142974142975142976142977142978142979142980142981142982142983142984142985142986142987142988142989142990142991142992142993142994142995142996142997142998142999143000143001143002143003143004143005143006143007143008143009143010143011143012143013143014143015143016143017143018143019143020143021143022143023143024143025143026143027143028143029143030143031143032143033143034143035143036143037143038143039143040143041143042143043143044143045143046143047143048143049143050143051143052143053143054143055143056143057143058143059143060143061143062143063143064143065143066143067143068143069143070143071143072143073143074143075143076143077143078143079143080143081143082143083143084143085143086143087143088143089143090143091143092143093143094143095143096143097143098143099143100143101143102143103143104143105143106143107143108143109143110143111143112143113143114143115143116143117143118143119143120143121143122143123143124143125143126143127143128143129143130143131143132143133143134143135143136143137143138143139143140143141143142143143143144143145143146143147143148143149143150143151143152143153143154143155143156143157143158143159143160143161143162143163143164143165143166143167143168143169143170143171143172143173143174143175143176143177143178143179143180143181143182143183143184143185143186143187143188143189143190143191143192143193143194143195143196143197143198143199143200143201143202143203143204143205143206143207143208143209143210143211143212143213143214143215143216143217143218143219143220143221143222143223143224143225143226143227143228143229143230143231143232143233143234143235143236143237143238143239143240143241143242143243143244143245143246143247143248143249143250143251143252143253143254143255143256143257143258143259143260143261143262143263143264143265143266143267143268143269143270143271143272143273143274143275143276143277143278143279143280143281143282143283143284143285143286143287143288143289143290143291143292143293143294143295143296143297143298143299143300143301143302143303143304143305143306143307143308143309143310143311143312143313143314143315143316143317143318143319143320143321143322143323143324143325143326143327143328143329143330143331143332143333143334143335143336143337143338143339143340143341143342143343143344143345143346143347143348143349143350143351143352143353143354143355143356143357143358143359143360143361143362143363143364143365143366143367143368143369143370143371143372143373143374143375143376143377143378143379143380143381143382143383143384143385143386143387143388143389143390143391143392143393143394143395143396143397143398143399143400143401143402143403143404143405143406143407143408143409143410143411143412143413143414143415143416143417143418143419143420143421143422143423143424143425143426143427143428143429143430143431143432143433143434143435143436143437143438143439143440143441143442143443143444143445143446143447143448143449143450143451143452143453143454143455143456143457143458143459143460143461143462143463143464143465143466143467143468143469143470143471143472143473143474143475143476143477143478143479143480143481143482143483143484143485143486143487143488143489143490143491143492143493143494143495143496143497143498143499143500143501143502143503143504143505143506143507143508143509143510143511143512143513143514143515143516143517143518143519143520143521143522143523143524143525143526143527143528143529143530143531143532143533143534143535143536143537143538143539143540143541143542143543143544143545143546143547143548143549143550143551143552143553143554143555143556143557143558143559143560143561143562143563143564143565143566143567143568143569143570143571143572143573143574143575143576143577143578143579143580143581143582143583143584143585143586143587143588143589143590143591143592143593143594143595143596143597143598143599143600143601143602143603143604143605143606143607143608143609143610143611143612143613143614143615143616143617143618143619143620143621143622143623143624143625143626143627143628143629143630143631143632143633143634143635143636143637143638143639143640143641143642143643143644143645143646143647143648143649143650143651143652143653143654143655143656143657143658143659143660143661143662143663143664143665143666143667143668143669143670143671143672143673143674143675143676143677143678143679143680143681143682143683143684143685143686143687143688143689143690143691143692143693143694143695143696143697143698143699143700143701143702143703143704143705143706143707143708143709143710143711143712143713143714143715143716143717143718143719143720143721143722143723143724143725143726143727143728143729143730143731143732143733143734143735143736143737143738143739143740143741143742143743143744143745143746143747143748143749143750143751143752143753143754143755143756143757143758143759143760143761143762143763143764143765143766143767143768143769143770143771143772143773143774143775143776143777143778143779143780143781143782143783143784143785143786143787143788143789143790143791143792143793143794143795143796143797143798143799143800143801143802143803143804143805143806143807143808143809143810143811143812143813143814143815143816143817143818143819143820143821143822143823143824143825143826143827143828143829143830143831143832143833143834143835143836143837143838143839143840143841143842143843143844143845143846143847143848143849143850143851143852143853143854143855143856143857143858143859143860143861143862143863143864143865143866143867143868143869143870143871143872143873143874143875143876143877143878143879143880143881143882143883143884143885143886143887143888143889143890143891143892143893143894143895143896143897143898143899143900143901143902143903143904143905143906143907143908143909143910143911143912143913143914143915143916143917143918143919143920143921143922143923143924143925143926143927143928143929143930143931143932143933143934143935143936143937143938143939143940143941143942143943143944143945143946143947143948143949143950143951143952143953143954143955143956143957143958143959143960143961143962143963143964143965143966143967143968143969143970143971143972143973143974143975143976143977143978143979143980143981143982143983143984143985143986143987143988143989143990143991143992143993143994143995143996143997143998143999144000144001144002144003144004144005144006144007144008144009144010144011144012144013144014144015144016144017144018144019144020144021144022144023144024144025144026144027144028144029144030144031144032144033144034144035144036144037144038144039144040144041144042144043144044144045144046144047144048144049144050144051144052144053144054144055144056144057144058144059144060144061144062144063144064144065144066144067144068144069144070144071144072144073144074144075144076144077144078144079144080144081144082144083144084144085144086144087144088144089144090144091144092144093144094144095144096144097144098144099144100144101144102144103144104144105144106144107144108144109144110144111144112144113144114144115144116144117144118144119144120144121144122144123144124144125144126144127144128144129144130144131144132144133144134144135144136144137144138144139144140144141144142144143144144144145144146144147144148144149144150144151144152144153144154144155144156144157144158144159144160144161144162144163144164144165144166144167144168144169144170144171144172144173144174144175144176144177144178144179144180144181144182144183144184144185144186144187144188144189144190144191144192144193144194144195144196144197144198144199144200144201144202144203144204144205144206144207144208144209144210144211144212144213144214144215144216144217144218144219144220144221144222144223144224144225144226144227144228144229144230144231144232144233144234144235144236144237144238144239144240144241144242144243144244144245144246144247144248144249144250144251144252144253144254144255144256144257144258144259144260144261144262144263144264144265144266144267144268144269144270144271144272144273144274144275144276144277144278144279144280144281144282144283144284144285144286144287144288144289144290144291144292144293144294144295144296144297144298144299144300144301144302144303144304144305144306144307144308144309144310144311144312144313144314144315144316144317144318144319144320144321144322144323144324144325144326144327144328144329144330144331144332144333144334144335144336144337144338144339144340144341144342144343144344144345144346144347144348144349144350144351144352144353144354144355144356144357144358144359144360144361144362144363144364144365144366144367144368144369144370144371144372144373144374144375144376144377144378144379144380144381144382144383144384144385144386144387144388144389144390144391144392144393144394144395144396144397144398144399144400144401144402144403144404144405144406144407144408144409144410144411144412144413144414144415144416144417144418144419144420144421144422144423144424144425144426144427144428144429144430144431144432144433144434144435144436144437144438144439144440144441144442144443144444144445144446144447144448144449144450144451144452144453144454144455144456144457144458144459144460144461144462144463144464144465144466144467144468144469144470144471144472144473144474144475144476144477144478144479144480144481144482144483144484144485144486144487144488144489144490144491144492144493144494144495144496144497144498144499144500144501144502144503144504144505144506144507144508144509144510144511144512144513144514144515144516144517144518144519144520144521144522144523144524144525144526144527144528144529144530144531144532144533144534144535144536144537144538144539144540144541144542144543144544144545144546144547144548144549144550144551144552144553144554144555144556144557144558144559144560144561144562144563144564144565144566144567144568144569144570144571144572144573144574144575144576144577144578144579144580144581144582144583144584144585144586144587144588144589144590144591144592144593144594144595144596144597144598144599144600144601144602144603144604144605144606144607144608144609144610144611144612144613144614144615144616144617144618144619144620144621144622144623144624144625144626144627144628144629144630144631144632144633144634144635144636144637144638144639144640144641144642144643144644144645144646144647144648144649144650144651144652144653144654144655144656144657144658144659144660144661144662144663144664144665144666144667144668144669144670144671144672144673144674144675144676144677144678144679144680144681144682144683144684144685144686144687144688144689144690144691144692144693144694144695144696144697144698144699144700144701144702144703144704144705144706144707144708144709144710144711144712144713144714144715144716144717144718144719144720144721144722144723144724144725144726144727144728144729144730144731144732144733144734144735144736144737144738144739144740144741144742144743144744144745144746144747144748144749144750144751144752144753144754144755144756144757144758144759144760144761144762144763144764144765144766144767144768144769144770144771144772144773144774144775144776144777144778144779144780144781144782144783144784144785144786144787144788144789144790144791144792144793144794144795144796144797144798144799144800144801144802144803144804144805144806144807144808144809144810144811144812144813144814144815144816144817144818144819144820144821144822144823144824144825144826144827144828144829144830144831144832144833144834144835144836144837144838144839144840144841144842144843144844144845144846144847144848144849144850144851144852144853144854144855144856144857144858144859144860144861144862144863144864144865144866144867144868144869144870144871144872144873144874144875144876144877144878144879144880144881144882144883144884144885144886144887144888144889144890144891144892144893144894144895144896144897144898144899144900144901144902144903144904144905144906144907144908144909144910144911144912144913144914144915144916144917144918144919144920144921144922144923144924144925144926144927144928144929144930144931144932144933144934144935144936144937144938144939144940144941144942144943144944144945144946144947144948144949144950144951144952144953144954144955144956144957144958144959144960144961144962144963144964144965144966144967144968144969144970144971144972144973144974144975144976144977144978144979144980144981144982144983144984144985144986144987144988144989144990144991144992144993144994144995144996144997144998144999145000145001145002145003145004145005145006145007145008145009145010145011145012145013145014145015145016145017145018145019145020145021145022145023145024145025145026145027145028145029145030145031145032145033145034145035145036145037145038145039145040145041145042145043145044145045145046145047145048145049145050145051145052145053145054145055145056145057145058145059145060145061145062145063145064145065145066145067145068145069145070145071145072145073145074145075145076145077145078145079145080145081145082145083145084145085145086145087145088145089145090145091145092145093145094145095145096145097145098145099145100145101145102145103145104145105145106145107145108145109145110145111145112145113145114145115145116145117145118145119145120145121145122145123145124145125145126145127145128145129145130145131145132145133145134145135145136145137145138145139145140145141145142145143145144145145145146145147145148145149145150145151145152145153145154145155145156145157145158145159145160145161145162145163145164145165145166145167145168145169145170145171145172145173145174145175145176145177145178145179145180145181145182145183145184145185145186145187145188145189145190145191145192145193145194145195145196145197145198145199145200145201145202145203145204145205145206145207145208145209145210145211145212145213145214145215145216145217145218145219145220145221145222145223145224145225145226145227145228145229145230145231145232145233145234145235145236145237145238145239145240145241145242145243145244145245145246145247145248145249145250145251145252145253145254145255145256145257145258145259145260145261145262145263145264145265145266145267145268145269145270145271145272145273145274145275145276145277145278145279145280145281145282145283145284145285145286145287145288145289145290145291145292145293145294145295145296145297145298145299145300145301145302145303145304145305145306145307145308145309145310145311145312145313145314145315145316145317145318145319145320145321145322145323145324145325145326145327145328145329145330145331145332145333145334145335145336145337145338145339145340145341145342145343145344145345145346145347145348145349145350145351145352145353145354145355145356145357145358145359145360145361145362145363145364145365145366145367145368145369145370145371145372145373145374145375145376145377145378145379145380145381145382145383145384145385145386145387145388145389145390145391145392145393145394145395145396145397145398145399145400145401145402145403145404145405145406145407145408145409145410145411145412145413145414145415145416145417145418145419145420145421145422145423145424145425145426145427145428145429145430145431145432145433145434145435145436145437145438145439145440145441145442145443145444145445145446145447145448145449145450145451145452145453145454145455145456145457145458145459145460145461145462145463145464145465145466145467145468145469145470145471145472145473145474145475145476145477145478145479145480145481145482145483145484145485145486145487145488145489145490145491145492145493145494145495145496145497145498145499145500145501145502145503145504145505145506145507145508145509145510145511145512145513145514145515145516145517145518145519145520145521145522145523145524145525145526145527145528145529145530145531145532145533145534145535145536145537145538145539145540145541145542145543145544145545145546145547145548145549145550145551145552145553145554145555145556145557145558145559145560145561145562145563145564145565145566145567145568145569145570145571145572145573145574145575145576145577145578145579145580145581145582145583145584145585145586145587145588145589145590145591145592145593145594145595145596145597145598145599145600145601145602145603145604145605145606145607145608145609145610145611145612145613145614145615145616145617145618145619145620145621145622145623145624145625145626145627145628145629145630145631145632145633145634145635145636145637145638145639145640145641145642145643145644145645145646145647145648145649145650145651145652145653145654145655145656145657145658145659145660145661145662145663145664145665145666145667145668145669145670145671145672145673145674145675145676145677145678145679145680145681145682145683145684145685145686145687145688145689145690145691145692145693145694145695145696145697145698145699145700145701145702145703145704145705145706145707145708145709145710145711145712145713145714145715145716145717145718145719145720145721145722145723145724145725145726145727145728145729145730145731145732145733145734145735145736145737145738145739145740145741145742145743145744145745145746145747145748145749145750145751145752145753145754145755145756145757145758145759145760145761145762145763145764145765145766145767145768145769145770145771145772145773145774145775145776145777145778145779145780145781145782145783145784145785145786145787145788145789145790145791145792145793145794145795145796145797145798145799145800145801145802145803145804145805145806145807145808145809145810145811145812145813145814145815145816145817145818145819145820145821145822145823145824145825145826145827145828145829145830145831145832145833145834145835145836145837145838145839145840145841145842145843145844145845145846145847145848145849145850145851145852145853145854145855145856145857145858145859145860145861145862145863145864145865145866145867145868145869145870145871145872145873145874145875145876145877145878145879145880145881145882145883145884145885145886145887145888145889145890145891145892145893145894145895145896145897145898145899145900145901145902145903145904145905145906145907145908145909145910145911145912145913145914145915145916145917145918145919145920145921145922145923145924145925145926145927145928145929145930145931145932145933145934145935145936145937145938145939145940145941145942145943145944145945145946145947145948145949145950145951145952145953145954145955145956145957145958145959145960145961145962145963145964145965145966145967145968145969145970145971145972145973145974145975145976145977145978145979145980145981145982145983145984145985145986145987145988145989145990145991145992145993145994145995145996145997145998145999146000146001146002146003146004146005146006146007146008146009146010146011146012146013146014146015146016146017146018146019146020146021146022146023146024146025146026146027146028146029146030146031146032146033146034146035146036146037146038146039146040146041146042146043146044146045146046146047146048146049146050146051146052146053146054146055146056146057146058146059146060146061146062146063146064146065146066146067146068146069146070146071146072146073146074146075146076146077146078146079146080146081146082146083146084146085146086146087146088146089146090146091146092146093146094146095146096146097146098146099146100146101146102146103146104146105146106146107146108146109146110146111146112146113146114146115146116146117146118146119146120146121146122146123146124146125146126146127146128146129146130146131146132146133146134146135146136146137146138146139146140146141146142146143146144146145146146146147146148146149146150146151146152146153146154146155146156146157146158146159146160146161146162146163146164146165146166146167146168146169146170146171146172146173146174146175146176146177146178146179146180146181146182146183146184146185146186146187146188146189146190146191146192146193146194146195146196146197146198146199146200146201146202146203146204146205146206146207146208146209146210146211146212146213146214146215146216146217146218146219146220146221146222146223146224146225146226146227146228146229146230146231146232146233146234146235146236146237146238146239146240146241146242146243146244146245146246146247146248146249146250146251146252146253146254146255146256146257146258146259146260146261146262146263146264146265146266146267146268146269146270146271146272146273146274146275146276146277146278146279146280146281146282146283146284146285146286146287146288146289146290146291146292146293146294146295146296146297146298146299146300146301146302146303146304146305146306146307146308146309146310146311146312146313146314146315146316146317146318146319146320146321146322146323146324146325146326146327146328146329146330146331146332146333146334146335146336146337146338146339146340146341146342146343146344146345146346146347146348146349146350146351146352146353146354146355146356146357146358146359146360146361146362146363146364146365146366146367146368146369146370146371146372146373146374146375146376146377146378146379146380146381146382146383146384146385146386146387146388146389146390146391146392146393146394146395146396146397146398146399146400146401146402146403146404146405146406146407146408146409146410146411146412146413146414146415146416146417146418146419146420146421146422146423146424146425146426146427146428146429146430146431146432146433146434146435146436146437146438146439146440146441146442146443146444146445146446146447146448146449146450146451146452146453146454146455146456146457146458146459146460146461146462146463146464146465146466146467146468146469146470146471146472146473146474146475146476146477146478146479146480146481146482146483146484146485146486146487146488146489146490146491146492146493146494146495146496146497146498146499146500146501146502146503146504146505146506146507146508146509146510146511146512146513146514146515146516146517146518146519146520146521146522146523146524146525146526146527146528146529146530146531146532146533146534146535146536146537146538146539146540146541146542146543146544146545146546146547146548146549146550146551146552146553146554146555146556146557146558146559146560146561146562146563146564146565146566146567146568146569146570146571146572146573146574146575146576146577146578146579146580146581146582146583146584146585146586146587146588146589146590146591146592146593146594146595146596146597146598146599146600146601146602146603146604146605146606146607146608146609146610146611146612146613146614146615146616146617146618146619146620146621146622146623146624146625146626146627146628146629146630146631146632146633146634146635146636146637146638146639146640146641146642146643146644146645146646146647146648146649146650146651146652146653146654146655146656146657146658146659146660146661146662146663146664146665146666146667146668146669146670146671146672146673146674146675146676146677146678146679146680146681146682146683146684146685146686146687146688146689146690146691146692146693146694146695146696146697146698146699146700146701146702146703146704146705146706146707146708146709146710146711146712146713146714146715146716146717146718146719146720146721146722146723146724146725146726146727146728146729146730146731146732146733146734146735146736146737146738146739146740146741146742146743146744146745146746146747146748146749146750146751146752146753146754146755146756146757146758146759146760146761146762146763146764146765146766146767146768146769146770146771146772146773146774146775146776146777146778146779146780146781146782146783146784146785146786146787146788146789146790146791146792146793146794146795146796146797146798146799146800146801146802146803146804146805146806146807146808146809146810146811146812146813146814146815146816146817146818146819146820146821146822146823146824146825146826146827146828146829146830146831146832146833146834146835146836146837146838146839146840146841146842146843146844146845146846146847146848146849146850146851146852146853146854146855146856146857146858146859146860146861146862146863146864146865146866146867146868146869146870146871146872146873146874146875146876146877146878146879146880146881146882146883146884146885146886146887146888146889146890146891146892146893146894146895146896146897146898146899146900146901146902146903146904146905146906146907146908146909146910146911146912146913146914146915146916146917146918146919146920146921146922146923146924146925146926146927146928146929146930146931146932146933146934146935146936146937146938146939146940146941146942146943146944146945146946146947146948146949146950146951146952146953146954146955146956146957146958146959146960146961146962146963146964146965146966146967146968146969146970146971146972146973146974146975146976146977146978146979146980146981146982146983146984146985146986146987146988146989146990146991146992146993146994146995146996146997146998146999147000147001147002147003147004147005147006147007147008147009147010147011147012147013147014147015147016147017147018147019147020147021147022147023147024147025147026147027147028147029147030147031147032147033147034147035147036147037147038147039147040147041147042147043147044147045147046147047147048147049147050147051147052147053147054147055147056147057147058147059147060147061147062147063147064147065147066147067147068147069147070147071147072147073147074147075147076147077147078147079147080147081147082147083147084147085147086147087147088147089147090147091147092147093147094147095147096147097147098147099147100147101147102147103147104147105147106147107147108147109147110147111147112147113147114147115147116147117147118147119147120
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // install a JSONP callback for chunk loading
  3. /******/ function webpackJsonpCallback(data) {
  4. /******/ var chunkIds = data[0];
  5. /******/ var moreModules = data[1];
  6. /******/
  7. /******/
  8. /******/ // add "moreModules" to the modules object,
  9. /******/ // then flag all "chunkIds" as loaded and fire callback
  10. /******/ var moduleId, chunkId, i = 0, resolves = [];
  11. /******/ for(;i < chunkIds.length; i++) {
  12. /******/ chunkId = chunkIds[i];
  13. /******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
  14. /******/ resolves.push(installedChunks[chunkId][0]);
  15. /******/ }
  16. /******/ installedChunks[chunkId] = 0;
  17. /******/ }
  18. /******/ for(moduleId in moreModules) {
  19. /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
  20. /******/ modules[moduleId] = moreModules[moduleId];
  21. /******/ }
  22. /******/ }
  23. /******/ if(parentJsonpFunction) parentJsonpFunction(data);
  24. /******/
  25. /******/ while(resolves.length) {
  26. /******/ resolves.shift()();
  27. /******/ }
  28. /******/
  29. /******/ };
  30. /******/
  31. /******/
  32. /******/ // The module cache
  33. /******/ var installedModules = {};
  34. /******/
  35. /******/ // object to store loaded and loading chunks
  36. /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
  37. /******/ // Promise = chunk loading, 0 = chunk loaded
  38. /******/ var installedChunks = {
  39. /******/ "/js/app": 0
  40. /******/ };
  41. /******/
  42. /******/
  43. /******/
  44. /******/ // script path function
  45. /******/ function jsonpScriptSrc(chunkId) {
  46. /******/ return __webpack_require__.p + "js/chunks/" + ({}[chunkId]||chunkId) + ".js?id=" + {"0":"13c35861eb9ac0fc0484","1":"c1a388a8f1322a4e8192"}[chunkId] + ""
  47. /******/ }
  48. /******/
  49. /******/ // The require function
  50. /******/ function __webpack_require__(moduleId) {
  51. /******/
  52. /******/ // Check if module is in cache
  53. /******/ if(installedModules[moduleId]) {
  54. /******/ return installedModules[moduleId].exports;
  55. /******/ }
  56. /******/ // Create a new module (and put it into the cache)
  57. /******/ var module = installedModules[moduleId] = {
  58. /******/ i: moduleId,
  59. /******/ l: false,
  60. /******/ exports: {}
  61. /******/ };
  62. /******/
  63. /******/ // Execute the module function
  64. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  65. /******/
  66. /******/ // Flag the module as loaded
  67. /******/ module.l = true;
  68. /******/
  69. /******/ // Return the exports of the module
  70. /******/ return module.exports;
  71. /******/ }
  72. /******/
  73. /******/ // This file contains only the entry chunk.
  74. /******/ // The chunk loading function for additional chunks
  75. /******/ __webpack_require__.e = function requireEnsure(chunkId) {
  76. /******/ var promises = [];
  77. /******/
  78. /******/
  79. /******/ // JSONP chunk loading for javascript
  80. /******/
  81. /******/ var installedChunkData = installedChunks[chunkId];
  82. /******/ if(installedChunkData !== 0) { // 0 means "already installed".
  83. /******/
  84. /******/ // a Promise means "currently loading".
  85. /******/ if(installedChunkData) {
  86. /******/ promises.push(installedChunkData[2]);
  87. /******/ } else {
  88. /******/ // setup Promise in chunk cache
  89. /******/ var promise = new Promise(function(resolve, reject) {
  90. /******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
  91. /******/ });
  92. /******/ promises.push(installedChunkData[2] = promise);
  93. /******/
  94. /******/ // start chunk loading
  95. /******/ var script = document.createElement('script');
  96. /******/ var onScriptComplete;
  97. /******/
  98. /******/ script.charset = 'utf-8';
  99. /******/ script.timeout = 120;
  100. /******/ if (__webpack_require__.nc) {
  101. /******/ script.setAttribute("nonce", __webpack_require__.nc);
  102. /******/ }
  103. /******/ script.src = jsonpScriptSrc(chunkId);
  104. /******/
  105. /******/ // create error before stack unwound to get useful stacktrace later
  106. /******/ var error = new Error();
  107. /******/ onScriptComplete = function (event) {
  108. /******/ // avoid mem leaks in IE.
  109. /******/ script.onerror = script.onload = null;
  110. /******/ clearTimeout(timeout);
  111. /******/ var chunk = installedChunks[chunkId];
  112. /******/ if(chunk !== 0) {
  113. /******/ if(chunk) {
  114. /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
  115. /******/ var realSrc = event && event.target && event.target.src;
  116. /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
  117. /******/ error.name = 'ChunkLoadError';
  118. /******/ error.type = errorType;
  119. /******/ error.request = realSrc;
  120. /******/ chunk[1](error);
  121. /******/ }
  122. /******/ installedChunks[chunkId] = undefined;
  123. /******/ }
  124. /******/ };
  125. /******/ var timeout = setTimeout(function(){
  126. /******/ onScriptComplete({ type: 'timeout', target: script });
  127. /******/ }, 120000);
  128. /******/ script.onerror = script.onload = onScriptComplete;
  129. /******/ document.head.appendChild(script);
  130. /******/ }
  131. /******/ }
  132. /******/ return Promise.all(promises);
  133. /******/ };
  134. /******/
  135. /******/ // expose the modules object (__webpack_modules__)
  136. /******/ __webpack_require__.m = modules;
  137. /******/
  138. /******/ // expose the module cache
  139. /******/ __webpack_require__.c = installedModules;
  140. /******/
  141. /******/ // define getter function for harmony exports
  142. /******/ __webpack_require__.d = function(exports, name, getter) {
  143. /******/ if(!__webpack_require__.o(exports, name)) {
  144. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  145. /******/ }
  146. /******/ };
  147. /******/
  148. /******/ // define __esModule on exports
  149. /******/ __webpack_require__.r = function(exports) {
  150. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  151. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  152. /******/ }
  153. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  154. /******/ };
  155. /******/
  156. /******/ // create a fake namespace object
  157. /******/ // mode & 1: value is a module id, require it
  158. /******/ // mode & 2: merge all properties of value into the ns
  159. /******/ // mode & 4: return value when already ns object
  160. /******/ // mode & 8|1: behave like require
  161. /******/ __webpack_require__.t = function(value, mode) {
  162. /******/ if(mode & 1) value = __webpack_require__(value);
  163. /******/ if(mode & 8) return value;
  164. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  165. /******/ var ns = Object.create(null);
  166. /******/ __webpack_require__.r(ns);
  167. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  168. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  169. /******/ return ns;
  170. /******/ };
  171. /******/
  172. /******/ // getDefaultExport function for compatibility with non-harmony modules
  173. /******/ __webpack_require__.n = function(module) {
  174. /******/ var getter = module && module.__esModule ?
  175. /******/ function getDefault() { return module['default']; } :
  176. /******/ function getModuleExports() { return module; };
  177. /******/ __webpack_require__.d(getter, 'a', getter);
  178. /******/ return getter;
  179. /******/ };
  180. /******/
  181. /******/ // Object.prototype.hasOwnProperty.call
  182. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  183. /******/
  184. /******/ // __webpack_public_path__
  185. /******/ __webpack_require__.p = "/";
  186. /******/
  187. /******/ // on error function for async loading
  188. /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
  189. /******/
  190. /******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
  191. /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
  192. /******/ jsonpArray.push = webpackJsonpCallback;
  193. /******/ jsonpArray = jsonpArray.slice();
  194. /******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
  195. /******/ var parentJsonpFunction = oldJsonpFunction;
  196. /******/
  197. /******/
  198. /******/ // Load entry module and return exports
  199. /******/ return __webpack_require__(__webpack_require__.s = 0);
  200. /******/ })
  201. /************************************************************************/
  202. /******/ ({
  203. /***/ "./node_modules/@opentok/client/dist/js/opentok.js":
  204. /*!*********************************************************!*\
  205. !*** ./node_modules/@opentok/client/dist/js/opentok.js ***!
  206. \*********************************************************/
  207. /*! no static exports found */
  208. /*! all exports used */
  209. /***/ (function(module, exports, __webpack_require__) {
  210. /* WEBPACK VAR INJECTION */(function(global) {/**
  211. * @license OpenTok.js 2.17.3 32ce4158c
  212. *
  213. * Copyright (c) 2010-2020 TokBox, Inc.
  214. * Subject to the applicable Software Development Kit (SDK) License Agreement:
  215. * https://tokbox.com/support/sdk_license
  216. *
  217. * Date: Thu, 28 May 2020 09:27:20 GMT
  218. */
  219. (function webpackUniversalModuleDefinition(root, factory) {
  220. if(true)
  221. module.exports = factory();
  222. else {}
  223. })(window, function() {
  224. return /******/ (function(modules) { // webpackBootstrap
  225. /******/ // The module cache
  226. /******/ var installedModules = {};
  227. /******/
  228. /******/ // The require function
  229. /******/ function __webpack_require__(moduleId) {
  230. /******/
  231. /******/ // Check if module is in cache
  232. /******/ if(installedModules[moduleId]) {
  233. /******/ return installedModules[moduleId].exports;
  234. /******/ }
  235. /******/ // Create a new module (and put it into the cache)
  236. /******/ var module = installedModules[moduleId] = {
  237. /******/ i: moduleId,
  238. /******/ l: false,
  239. /******/ exports: {}
  240. /******/ };
  241. /******/
  242. /******/ // Execute the module function
  243. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  244. /******/
  245. /******/ // Flag the module as loaded
  246. /******/ module.l = true;
  247. /******/
  248. /******/ // Return the exports of the module
  249. /******/ return module.exports;
  250. /******/ }
  251. /******/
  252. /******/
  253. /******/ // expose the modules object (__webpack_modules__)
  254. /******/ __webpack_require__.m = modules;
  255. /******/
  256. /******/ // expose the module cache
  257. /******/ __webpack_require__.c = installedModules;
  258. /******/
  259. /******/ // define getter function for harmony exports
  260. /******/ __webpack_require__.d = function(exports, name, getter) {
  261. /******/ if(!__webpack_require__.o(exports, name)) {
  262. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  263. /******/ }
  264. /******/ };
  265. /******/
  266. /******/ // define __esModule on exports
  267. /******/ __webpack_require__.r = function(exports) {
  268. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  269. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  270. /******/ }
  271. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  272. /******/ };
  273. /******/
  274. /******/ // create a fake namespace object
  275. /******/ // mode & 1: value is a module id, require it
  276. /******/ // mode & 2: merge all properties of value into the ns
  277. /******/ // mode & 4: return value when already ns object
  278. /******/ // mode & 8|1: behave like require
  279. /******/ __webpack_require__.t = function(value, mode) {
  280. /******/ if(mode & 1) value = __webpack_require__(value);
  281. /******/ if(mode & 8) return value;
  282. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  283. /******/ var ns = Object.create(null);
  284. /******/ __webpack_require__.r(ns);
  285. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  286. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  287. /******/ return ns;
  288. /******/ };
  289. /******/
  290. /******/ // getDefaultExport function for compatibility with non-harmony modules
  291. /******/ __webpack_require__.n = function(module) {
  292. /******/ var getter = module && module.__esModule ?
  293. /******/ function getDefault() { return module['default']; } :
  294. /******/ function getModuleExports() { return module; };
  295. /******/ __webpack_require__.d(getter, 'a', getter);
  296. /******/ return getter;
  297. /******/ };
  298. /******/
  299. /******/ // Object.prototype.hasOwnProperty.call
  300. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  301. /******/
  302. /******/ // __webpack_public_path__
  303. /******/ __webpack_require__.p = "";
  304. /******/
  305. /******/
  306. /******/ // Load entry module and return exports
  307. /******/ return __webpack_require__(__webpack_require__.s = 309);
  308. /******/ })
  309. /************************************************************************/
  310. /******/ ([
  311. /* 0 */
  312. /***/ (function(module, exports, __webpack_require__) {
  313. /* WEBPACK VAR INJECTION */(function(process) {/*!
  314. * @overview es6-promise - a tiny implementation of Promises/A+.
  315. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  316. * @license Licensed under MIT license
  317. * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
  318. * @version v4.2.8+1e68dce6
  319. */
  320. (function (global, factory) {
  321. true ? module.exports = factory() :
  322. undefined;
  323. }(this, (function () { 'use strict';
  324. function objectOrFunction(x) {
  325. var type = typeof x;
  326. return x !== null && (type === 'object' || type === 'function');
  327. }
  328. function isFunction(x) {
  329. return typeof x === 'function';
  330. }
  331. var _isArray = void 0;
  332. if (Array.isArray) {
  333. _isArray = Array.isArray;
  334. } else {
  335. _isArray = function (x) {
  336. return Object.prototype.toString.call(x) === '[object Array]';
  337. };
  338. }
  339. var isArray = _isArray;
  340. var len = 0;
  341. var vertxNext = void 0;
  342. var customSchedulerFn = void 0;
  343. var asap = function asap(callback, arg) {
  344. queue[len] = callback;
  345. queue[len + 1] = arg;
  346. len += 2;
  347. if (len === 2) {
  348. // If len is 2, that means that we need to schedule an async flush.
  349. // If additional callbacks are queued before the queue is flushed, they
  350. // will be processed by this flush that we are scheduling.
  351. if (customSchedulerFn) {
  352. customSchedulerFn(flush);
  353. } else {
  354. scheduleFlush();
  355. }
  356. }
  357. };
  358. function setScheduler(scheduleFn) {
  359. customSchedulerFn = scheduleFn;
  360. }
  361. function setAsap(asapFn) {
  362. asap = asapFn;
  363. }
  364. var browserWindow = typeof window !== 'undefined' ? window : undefined;
  365. var browserGlobal = browserWindow || {};
  366. var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
  367. var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
  368. // test for web worker but not in IE10
  369. var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
  370. // node
  371. function useNextTick() {
  372. // node version 0.10.x displays a deprecation warning when nextTick is used recursively
  373. // see https://github.com/cujojs/when/issues/410 for details
  374. return function () {
  375. return process.nextTick(flush);
  376. };
  377. }
  378. // vertx
  379. function useVertxTimer() {
  380. if (typeof vertxNext !== 'undefined') {
  381. return function () {
  382. vertxNext(flush);
  383. };
  384. }
  385. return useSetTimeout();
  386. }
  387. function useMutationObserver() {
  388. var iterations = 0;
  389. var observer = new BrowserMutationObserver(flush);
  390. var node = document.createTextNode('');
  391. observer.observe(node, { characterData: true });
  392. return function () {
  393. node.data = iterations = ++iterations % 2;
  394. };
  395. }
  396. // web worker
  397. function useMessageChannel() {
  398. var channel = new MessageChannel();
  399. channel.port1.onmessage = flush;
  400. return function () {
  401. return channel.port2.postMessage(0);
  402. };
  403. }
  404. function useSetTimeout() {
  405. // Store setTimeout reference so es6-promise will be unaffected by
  406. // other code modifying setTimeout (like sinon.useFakeTimers())
  407. var globalSetTimeout = setTimeout;
  408. return function () {
  409. return globalSetTimeout(flush, 1);
  410. };
  411. }
  412. var queue = new Array(1000);
  413. function flush() {
  414. for (var i = 0; i < len; i += 2) {
  415. var callback = queue[i];
  416. var arg = queue[i + 1];
  417. callback(arg);
  418. queue[i] = undefined;
  419. queue[i + 1] = undefined;
  420. }
  421. len = 0;
  422. }
  423. function attemptVertx() {
  424. try {
  425. var vertx = Function('return this')().require('vertx');
  426. vertxNext = vertx.runOnLoop || vertx.runOnContext;
  427. return useVertxTimer();
  428. } catch (e) {
  429. return useSetTimeout();
  430. }
  431. }
  432. var scheduleFlush = void 0;
  433. // Decide what async method to use to triggering processing of queued callbacks:
  434. if (isNode) {
  435. scheduleFlush = useNextTick();
  436. } else if (BrowserMutationObserver) {
  437. scheduleFlush = useMutationObserver();
  438. } else if (isWorker) {
  439. scheduleFlush = useMessageChannel();
  440. } else if (browserWindow === undefined && "function" === 'function') {
  441. scheduleFlush = attemptVertx();
  442. } else {
  443. scheduleFlush = useSetTimeout();
  444. }
  445. function then(onFulfillment, onRejection) {
  446. var parent = this;
  447. var child = new this.constructor(noop);
  448. if (child[PROMISE_ID] === undefined) {
  449. makePromise(child);
  450. }
  451. var _state = parent._state;
  452. if (_state) {
  453. var callback = arguments[_state - 1];
  454. asap(function () {
  455. return invokeCallback(_state, child, callback, parent._result);
  456. });
  457. } else {
  458. subscribe(parent, child, onFulfillment, onRejection);
  459. }
  460. return child;
  461. }
  462. /**
  463. `Promise.resolve` returns a promise that will become resolved with the
  464. passed `value`. It is shorthand for the following:
  465. ```javascript
  466. let promise = new Promise(function(resolve, reject){
  467. resolve(1);
  468. });
  469. promise.then(function(value){
  470. // value === 1
  471. });
  472. ```
  473. Instead of writing the above, your code now simply becomes the following:
  474. ```javascript
  475. let promise = Promise.resolve(1);
  476. promise.then(function(value){
  477. // value === 1
  478. });
  479. ```
  480. @method resolve
  481. @static
  482. @param {Any} value value that the returned promise will be resolved with
  483. Useful for tooling.
  484. @return {Promise} a promise that will become fulfilled with the given
  485. `value`
  486. */
  487. function resolve$1(object) {
  488. /*jshint validthis:true */
  489. var Constructor = this;
  490. if (object && typeof object === 'object' && object.constructor === Constructor) {
  491. return object;
  492. }
  493. var promise = new Constructor(noop);
  494. resolve(promise, object);
  495. return promise;
  496. }
  497. var PROMISE_ID = Math.random().toString(36).substring(2);
  498. function noop() {}
  499. var PENDING = void 0;
  500. var FULFILLED = 1;
  501. var REJECTED = 2;
  502. function selfFulfillment() {
  503. return new TypeError("You cannot resolve a promise with itself");
  504. }
  505. function cannotReturnOwn() {
  506. return new TypeError('A promises callback cannot return that same promise.');
  507. }
  508. function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
  509. try {
  510. then$$1.call(value, fulfillmentHandler, rejectionHandler);
  511. } catch (e) {
  512. return e;
  513. }
  514. }
  515. function handleForeignThenable(promise, thenable, then$$1) {
  516. asap(function (promise) {
  517. var sealed = false;
  518. var error = tryThen(then$$1, thenable, function (value) {
  519. if (sealed) {
  520. return;
  521. }
  522. sealed = true;
  523. if (thenable !== value) {
  524. resolve(promise, value);
  525. } else {
  526. fulfill(promise, value);
  527. }
  528. }, function (reason) {
  529. if (sealed) {
  530. return;
  531. }
  532. sealed = true;
  533. reject(promise, reason);
  534. }, 'Settle: ' + (promise._label || ' unknown promise'));
  535. if (!sealed && error) {
  536. sealed = true;
  537. reject(promise, error);
  538. }
  539. }, promise);
  540. }
  541. function handleOwnThenable(promise, thenable) {
  542. if (thenable._state === FULFILLED) {
  543. fulfill(promise, thenable._result);
  544. } else if (thenable._state === REJECTED) {
  545. reject(promise, thenable._result);
  546. } else {
  547. subscribe(thenable, undefined, function (value) {
  548. return resolve(promise, value);
  549. }, function (reason) {
  550. return reject(promise, reason);
  551. });
  552. }
  553. }
  554. function handleMaybeThenable(promise, maybeThenable, then$$1) {
  555. if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
  556. handleOwnThenable(promise, maybeThenable);
  557. } else {
  558. if (then$$1 === undefined) {
  559. fulfill(promise, maybeThenable);
  560. } else if (isFunction(then$$1)) {
  561. handleForeignThenable(promise, maybeThenable, then$$1);
  562. } else {
  563. fulfill(promise, maybeThenable);
  564. }
  565. }
  566. }
  567. function resolve(promise, value) {
  568. if (promise === value) {
  569. reject(promise, selfFulfillment());
  570. } else if (objectOrFunction(value)) {
  571. var then$$1 = void 0;
  572. try {
  573. then$$1 = value.then;
  574. } catch (error) {
  575. reject(promise, error);
  576. return;
  577. }
  578. handleMaybeThenable(promise, value, then$$1);
  579. } else {
  580. fulfill(promise, value);
  581. }
  582. }
  583. function publishRejection(promise) {
  584. if (promise._onerror) {
  585. promise._onerror(promise._result);
  586. }
  587. publish(promise);
  588. }
  589. function fulfill(promise, value) {
  590. if (promise._state !== PENDING) {
  591. return;
  592. }
  593. promise._result = value;
  594. promise._state = FULFILLED;
  595. if (promise._subscribers.length !== 0) {
  596. asap(publish, promise);
  597. }
  598. }
  599. function reject(promise, reason) {
  600. if (promise._state !== PENDING) {
  601. return;
  602. }
  603. promise._state = REJECTED;
  604. promise._result = reason;
  605. asap(publishRejection, promise);
  606. }
  607. function subscribe(parent, child, onFulfillment, onRejection) {
  608. var _subscribers = parent._subscribers;
  609. var length = _subscribers.length;
  610. parent._onerror = null;
  611. _subscribers[length] = child;
  612. _subscribers[length + FULFILLED] = onFulfillment;
  613. _subscribers[length + REJECTED] = onRejection;
  614. if (length === 0 && parent._state) {
  615. asap(publish, parent);
  616. }
  617. }
  618. function publish(promise) {
  619. var subscribers = promise._subscribers;
  620. var settled = promise._state;
  621. if (subscribers.length === 0) {
  622. return;
  623. }
  624. var child = void 0,
  625. callback = void 0,
  626. detail = promise._result;
  627. for (var i = 0; i < subscribers.length; i += 3) {
  628. child = subscribers[i];
  629. callback = subscribers[i + settled];
  630. if (child) {
  631. invokeCallback(settled, child, callback, detail);
  632. } else {
  633. callback(detail);
  634. }
  635. }
  636. promise._subscribers.length = 0;
  637. }
  638. function invokeCallback(settled, promise, callback, detail) {
  639. var hasCallback = isFunction(callback),
  640. value = void 0,
  641. error = void 0,
  642. succeeded = true;
  643. if (hasCallback) {
  644. try {
  645. value = callback(detail);
  646. } catch (e) {
  647. succeeded = false;
  648. error = e;
  649. }
  650. if (promise === value) {
  651. reject(promise, cannotReturnOwn());
  652. return;
  653. }
  654. } else {
  655. value = detail;
  656. }
  657. if (promise._state !== PENDING) {
  658. // noop
  659. } else if (hasCallback && succeeded) {
  660. resolve(promise, value);
  661. } else if (succeeded === false) {
  662. reject(promise, error);
  663. } else if (settled === FULFILLED) {
  664. fulfill(promise, value);
  665. } else if (settled === REJECTED) {
  666. reject(promise, value);
  667. }
  668. }
  669. function initializePromise(promise, resolver) {
  670. try {
  671. resolver(function resolvePromise(value) {
  672. resolve(promise, value);
  673. }, function rejectPromise(reason) {
  674. reject(promise, reason);
  675. });
  676. } catch (e) {
  677. reject(promise, e);
  678. }
  679. }
  680. var id = 0;
  681. function nextId() {
  682. return id++;
  683. }
  684. function makePromise(promise) {
  685. promise[PROMISE_ID] = id++;
  686. promise._state = undefined;
  687. promise._result = undefined;
  688. promise._subscribers = [];
  689. }
  690. function validationError() {
  691. return new Error('Array Methods must be provided an Array');
  692. }
  693. var Enumerator = function () {
  694. function Enumerator(Constructor, input) {
  695. this._instanceConstructor = Constructor;
  696. this.promise = new Constructor(noop);
  697. if (!this.promise[PROMISE_ID]) {
  698. makePromise(this.promise);
  699. }
  700. if (isArray(input)) {
  701. this.length = input.length;
  702. this._remaining = input.length;
  703. this._result = new Array(this.length);
  704. if (this.length === 0) {
  705. fulfill(this.promise, this._result);
  706. } else {
  707. this.length = this.length || 0;
  708. this._enumerate(input);
  709. if (this._remaining === 0) {
  710. fulfill(this.promise, this._result);
  711. }
  712. }
  713. } else {
  714. reject(this.promise, validationError());
  715. }
  716. }
  717. Enumerator.prototype._enumerate = function _enumerate(input) {
  718. for (var i = 0; this._state === PENDING && i < input.length; i++) {
  719. this._eachEntry(input[i], i);
  720. }
  721. };
  722. Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {
  723. var c = this._instanceConstructor;
  724. var resolve$$1 = c.resolve;
  725. if (resolve$$1 === resolve$1) {
  726. var _then = void 0;
  727. var error = void 0;
  728. var didError = false;
  729. try {
  730. _then = entry.then;
  731. } catch (e) {
  732. didError = true;
  733. error = e;
  734. }
  735. if (_then === then && entry._state !== PENDING) {
  736. this._settledAt(entry._state, i, entry._result);
  737. } else if (typeof _then !== 'function') {
  738. this._remaining--;
  739. this._result[i] = entry;
  740. } else if (c === Promise$1) {
  741. var promise = new c(noop);
  742. if (didError) {
  743. reject(promise, error);
  744. } else {
  745. handleMaybeThenable(promise, entry, _then);
  746. }
  747. this._willSettleAt(promise, i);
  748. } else {
  749. this._willSettleAt(new c(function (resolve$$1) {
  750. return resolve$$1(entry);
  751. }), i);
  752. }
  753. } else {
  754. this._willSettleAt(resolve$$1(entry), i);
  755. }
  756. };
  757. Enumerator.prototype._settledAt = function _settledAt(state, i, value) {
  758. var promise = this.promise;
  759. if (promise._state === PENDING) {
  760. this._remaining--;
  761. if (state === REJECTED) {
  762. reject(promise, value);
  763. } else {
  764. this._result[i] = value;
  765. }
  766. }
  767. if (this._remaining === 0) {
  768. fulfill(promise, this._result);
  769. }
  770. };
  771. Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
  772. var enumerator = this;
  773. subscribe(promise, undefined, function (value) {
  774. return enumerator._settledAt(FULFILLED, i, value);
  775. }, function (reason) {
  776. return enumerator._settledAt(REJECTED, i, reason);
  777. });
  778. };
  779. return Enumerator;
  780. }();
  781. /**
  782. `Promise.all` accepts an array of promises, and returns a new promise which
  783. is fulfilled with an array of fulfillment values for the passed promises, or
  784. rejected with the reason of the first passed promise to be rejected. It casts all
  785. elements of the passed iterable to promises as it runs this algorithm.
  786. Example:
  787. ```javascript
  788. let promise1 = resolve(1);
  789. let promise2 = resolve(2);
  790. let promise3 = resolve(3);
  791. let promises = [ promise1, promise2, promise3 ];
  792. Promise.all(promises).then(function(array){
  793. // The array here would be [ 1, 2, 3 ];
  794. });
  795. ```
  796. If any of the `promises` given to `all` are rejected, the first promise
  797. that is rejected will be given as an argument to the returned promises's
  798. rejection handler. For example:
  799. Example:
  800. ```javascript
  801. let promise1 = resolve(1);
  802. let promise2 = reject(new Error("2"));
  803. let promise3 = reject(new Error("3"));
  804. let promises = [ promise1, promise2, promise3 ];
  805. Promise.all(promises).then(function(array){
  806. // Code here never runs because there are rejected promises!
  807. }, function(error) {
  808. // error.message === "2"
  809. });
  810. ```
  811. @method all
  812. @static
  813. @param {Array} entries array of promises
  814. @param {String} label optional string for labeling the promise.
  815. Useful for tooling.
  816. @return {Promise} promise that is fulfilled when all `promises` have been
  817. fulfilled, or rejected if any of them become rejected.
  818. @static
  819. */
  820. function all(entries) {
  821. return new Enumerator(this, entries).promise;
  822. }
  823. /**
  824. `Promise.race` returns a new promise which is settled in the same way as the
  825. first passed promise to settle.
  826. Example:
  827. ```javascript
  828. let promise1 = new Promise(function(resolve, reject){
  829. setTimeout(function(){
  830. resolve('promise 1');
  831. }, 200);
  832. });
  833. let promise2 = new Promise(function(resolve, reject){
  834. setTimeout(function(){
  835. resolve('promise 2');
  836. }, 100);
  837. });
  838. Promise.race([promise1, promise2]).then(function(result){
  839. // result === 'promise 2' because it was resolved before promise1
  840. // was resolved.
  841. });
  842. ```
  843. `Promise.race` is deterministic in that only the state of the first
  844. settled promise matters. For example, even if other promises given to the
  845. `promises` array argument are resolved, but the first settled promise has
  846. become rejected before the other promises became fulfilled, the returned
  847. promise will become rejected:
  848. ```javascript
  849. let promise1 = new Promise(function(resolve, reject){
  850. setTimeout(function(){
  851. resolve('promise 1');
  852. }, 200);
  853. });
  854. let promise2 = new Promise(function(resolve, reject){
  855. setTimeout(function(){
  856. reject(new Error('promise 2'));
  857. }, 100);
  858. });
  859. Promise.race([promise1, promise2]).then(function(result){
  860. // Code here never runs
  861. }, function(reason){
  862. // reason.message === 'promise 2' because promise 2 became rejected before
  863. // promise 1 became fulfilled
  864. });
  865. ```
  866. An example real-world use case is implementing timeouts:
  867. ```javascript
  868. Promise.race([ajax('foo.json'), timeout(5000)])
  869. ```
  870. @method race
  871. @static
  872. @param {Array} promises array of promises to observe
  873. Useful for tooling.
  874. @return {Promise} a promise which settles in the same way as the first passed
  875. promise to settle.
  876. */
  877. function race(entries) {
  878. /*jshint validthis:true */
  879. var Constructor = this;
  880. if (!isArray(entries)) {
  881. return new Constructor(function (_, reject) {
  882. return reject(new TypeError('You must pass an array to race.'));
  883. });
  884. } else {
  885. return new Constructor(function (resolve, reject) {
  886. var length = entries.length;
  887. for (var i = 0; i < length; i++) {
  888. Constructor.resolve(entries[i]).then(resolve, reject);
  889. }
  890. });
  891. }
  892. }
  893. /**
  894. `Promise.reject` returns a promise rejected with the passed `reason`.
  895. It is shorthand for the following:
  896. ```javascript
  897. let promise = new Promise(function(resolve, reject){
  898. reject(new Error('WHOOPS'));
  899. });
  900. promise.then(function(value){
  901. // Code here doesn't run because the promise is rejected!
  902. }, function(reason){
  903. // reason.message === 'WHOOPS'
  904. });
  905. ```
  906. Instead of writing the above, your code now simply becomes the following:
  907. ```javascript
  908. let promise = Promise.reject(new Error('WHOOPS'));
  909. promise.then(function(value){
  910. // Code here doesn't run because the promise is rejected!
  911. }, function(reason){
  912. // reason.message === 'WHOOPS'
  913. });
  914. ```
  915. @method reject
  916. @static
  917. @param {Any} reason value that the returned promise will be rejected with.
  918. Useful for tooling.
  919. @return {Promise} a promise rejected with the given `reason`.
  920. */
  921. function reject$1(reason) {
  922. /*jshint validthis:true */
  923. var Constructor = this;
  924. var promise = new Constructor(noop);
  925. reject(promise, reason);
  926. return promise;
  927. }
  928. function needsResolver() {
  929. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  930. }
  931. function needsNew() {
  932. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  933. }
  934. /**
  935. Promise objects represent the eventual result of an asynchronous operation. The
  936. primary way of interacting with a promise is through its `then` method, which
  937. registers callbacks to receive either a promise's eventual value or the reason
  938. why the promise cannot be fulfilled.
  939. Terminology
  940. -----------
  941. - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
  942. - `thenable` is an object or function that defines a `then` method.
  943. - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
  944. - `exception` is a value that is thrown using the throw statement.
  945. - `reason` is a value that indicates why a promise was rejected.
  946. - `settled` the final resting state of a promise, fulfilled or rejected.
  947. A promise can be in one of three states: pending, fulfilled, or rejected.
  948. Promises that are fulfilled have a fulfillment value and are in the fulfilled
  949. state. Promises that are rejected have a rejection reason and are in the
  950. rejected state. A fulfillment value is never a thenable.
  951. Promises can also be said to *resolve* a value. If this value is also a
  952. promise, then the original promise's settled state will match the value's
  953. settled state. So a promise that *resolves* a promise that rejects will
  954. itself reject, and a promise that *resolves* a promise that fulfills will
  955. itself fulfill.
  956. Basic Usage:
  957. ------------
  958. ```js
  959. let promise = new Promise(function(resolve, reject) {
  960. // on success
  961. resolve(value);
  962. // on failure
  963. reject(reason);
  964. });
  965. promise.then(function(value) {
  966. // on fulfillment
  967. }, function(reason) {
  968. // on rejection
  969. });
  970. ```
  971. Advanced Usage:
  972. ---------------
  973. Promises shine when abstracting away asynchronous interactions such as
  974. `XMLHttpRequest`s.
  975. ```js
  976. function getJSON(url) {
  977. return new Promise(function(resolve, reject){
  978. let xhr = new XMLHttpRequest();
  979. xhr.open('GET', url);
  980. xhr.onreadystatechange = handler;
  981. xhr.responseType = 'json';
  982. xhr.setRequestHeader('Accept', 'application/json');
  983. xhr.send();
  984. function handler() {
  985. if (this.readyState === this.DONE) {
  986. if (this.status === 200) {
  987. resolve(this.response);
  988. } else {
  989. reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
  990. }
  991. }
  992. };
  993. });
  994. }
  995. getJSON('/posts.json').then(function(json) {
  996. // on fulfillment
  997. }, function(reason) {
  998. // on rejection
  999. });
  1000. ```
  1001. Unlike callbacks, promises are great composable primitives.
  1002. ```js
  1003. Promise.all([
  1004. getJSON('/posts'),
  1005. getJSON('/comments')
  1006. ]).then(function(values){
  1007. values[0] // => postsJSON
  1008. values[1] // => commentsJSON
  1009. return values;
  1010. });
  1011. ```
  1012. @class Promise
  1013. @param {Function} resolver
  1014. Useful for tooling.
  1015. @constructor
  1016. */
  1017. var Promise$1 = function () {
  1018. function Promise(resolver) {
  1019. this[PROMISE_ID] = nextId();
  1020. this._result = this._state = undefined;
  1021. this._subscribers = [];
  1022. if (noop !== resolver) {
  1023. typeof resolver !== 'function' && needsResolver();
  1024. this instanceof Promise ? initializePromise(this, resolver) : needsNew();
  1025. }
  1026. }
  1027. /**
  1028. The primary way of interacting with a promise is through its `then` method,
  1029. which registers callbacks to receive either a promise's eventual value or the
  1030. reason why the promise cannot be fulfilled.
  1031. ```js
  1032. findUser().then(function(user){
  1033. // user is available
  1034. }, function(reason){
  1035. // user is unavailable, and you are given the reason why
  1036. });
  1037. ```
  1038. Chaining
  1039. --------
  1040. The return value of `then` is itself a promise. This second, 'downstream'
  1041. promise is resolved with the return value of the first promise's fulfillment
  1042. or rejection handler, or rejected if the handler throws an exception.
  1043. ```js
  1044. findUser().then(function (user) {
  1045. return user.name;
  1046. }, function (reason) {
  1047. return 'default name';
  1048. }).then(function (userName) {
  1049. // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
  1050. // will be `'default name'`
  1051. });
  1052. findUser().then(function (user) {
  1053. throw new Error('Found user, but still unhappy');
  1054. }, function (reason) {
  1055. throw new Error('`findUser` rejected and we're unhappy');
  1056. }).then(function (value) {
  1057. // never reached
  1058. }, function (reason) {
  1059. // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
  1060. // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
  1061. });
  1062. ```
  1063. If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
  1064. ```js
  1065. findUser().then(function (user) {
  1066. throw new PedagogicalException('Upstream error');
  1067. }).then(function (value) {
  1068. // never reached
  1069. }).then(function (value) {
  1070. // never reached
  1071. }, function (reason) {
  1072. // The `PedgagocialException` is propagated all the way down to here
  1073. });
  1074. ```
  1075. Assimilation
  1076. ------------
  1077. Sometimes the value you want to propagate to a downstream promise can only be
  1078. retrieved asynchronously. This can be achieved by returning a promise in the
  1079. fulfillment or rejection handler. The downstream promise will then be pending
  1080. until the returned promise is settled. This is called *assimilation*.
  1081. ```js
  1082. findUser().then(function (user) {
  1083. return findCommentsByAuthor(user);
  1084. }).then(function (comments) {
  1085. // The user's comments are now available
  1086. });
  1087. ```
  1088. If the assimliated promise rejects, then the downstream promise will also reject.
  1089. ```js
  1090. findUser().then(function (user) {
  1091. return findCommentsByAuthor(user);
  1092. }).then(function (comments) {
  1093. // If `findCommentsByAuthor` fulfills, we'll have the value here
  1094. }, function (reason) {
  1095. // If `findCommentsByAuthor` rejects, we'll have the reason here
  1096. });
  1097. ```
  1098. Simple Example
  1099. --------------
  1100. Synchronous Example
  1101. ```javascript
  1102. let result;
  1103. try {
  1104. result = findResult();
  1105. // success
  1106. } catch(reason) {
  1107. // failure
  1108. }
  1109. ```
  1110. Errback Example
  1111. ```js
  1112. findResult(function(result, err){
  1113. if (err) {
  1114. // failure
  1115. } else {
  1116. // success
  1117. }
  1118. });
  1119. ```
  1120. Promise Example;
  1121. ```javascript
  1122. findResult().then(function(result){
  1123. // success
  1124. }, function(reason){
  1125. // failure
  1126. });
  1127. ```
  1128. Advanced Example
  1129. --------------
  1130. Synchronous Example
  1131. ```javascript
  1132. let author, books;
  1133. try {
  1134. author = findAuthor();
  1135. books = findBooksByAuthor(author);
  1136. // success
  1137. } catch(reason) {
  1138. // failure
  1139. }
  1140. ```
  1141. Errback Example
  1142. ```js
  1143. function foundBooks(books) {
  1144. }
  1145. function failure(reason) {
  1146. }
  1147. findAuthor(function(author, err){
  1148. if (err) {
  1149. failure(err);
  1150. // failure
  1151. } else {
  1152. try {
  1153. findBoooksByAuthor(author, function(books, err) {
  1154. if (err) {
  1155. failure(err);
  1156. } else {
  1157. try {
  1158. foundBooks(books);
  1159. } catch(reason) {
  1160. failure(reason);
  1161. }
  1162. }
  1163. });
  1164. } catch(error) {
  1165. failure(err);
  1166. }
  1167. // success
  1168. }
  1169. });
  1170. ```
  1171. Promise Example;
  1172. ```javascript
  1173. findAuthor().
  1174. then(findBooksByAuthor).
  1175. then(function(books){
  1176. // found books
  1177. }).catch(function(reason){
  1178. // something went wrong
  1179. });
  1180. ```
  1181. @method then
  1182. @param {Function} onFulfilled
  1183. @param {Function} onRejected
  1184. Useful for tooling.
  1185. @return {Promise}
  1186. */
  1187. /**
  1188. `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
  1189. as the catch block of a try/catch statement.
  1190. ```js
  1191. function findAuthor(){
  1192. throw new Error('couldn't find that author');
  1193. }
  1194. // synchronous
  1195. try {
  1196. findAuthor();
  1197. } catch(reason) {
  1198. // something went wrong
  1199. }
  1200. // async with promises
  1201. findAuthor().catch(function(reason){
  1202. // something went wrong
  1203. });
  1204. ```
  1205. @method catch
  1206. @param {Function} onRejection
  1207. Useful for tooling.
  1208. @return {Promise}
  1209. */
  1210. Promise.prototype.catch = function _catch(onRejection) {
  1211. return this.then(null, onRejection);
  1212. };
  1213. /**
  1214. `finally` will be invoked regardless of the promise's fate just as native
  1215. try/catch/finally behaves
  1216. Synchronous example:
  1217. ```js
  1218. findAuthor() {
  1219. if (Math.random() > 0.5) {
  1220. throw new Error();
  1221. }
  1222. return new Author();
  1223. }
  1224. try {
  1225. return findAuthor(); // succeed or fail
  1226. } catch(error) {
  1227. return findOtherAuther();
  1228. } finally {
  1229. // always runs
  1230. // doesn't affect the return value
  1231. }
  1232. ```
  1233. Asynchronous example:
  1234. ```js
  1235. findAuthor().catch(function(reason){
  1236. return findOtherAuther();
  1237. }).finally(function(){
  1238. // author was either found, or not
  1239. });
  1240. ```
  1241. @method finally
  1242. @param {Function} callback
  1243. @return {Promise}
  1244. */
  1245. Promise.prototype.finally = function _finally(callback) {
  1246. var promise = this;
  1247. var constructor = promise.constructor;
  1248. if (isFunction(callback)) {
  1249. return promise.then(function (value) {
  1250. return constructor.resolve(callback()).then(function () {
  1251. return value;
  1252. });
  1253. }, function (reason) {
  1254. return constructor.resolve(callback()).then(function () {
  1255. throw reason;
  1256. });
  1257. });
  1258. }
  1259. return promise.then(callback, callback);
  1260. };
  1261. return Promise;
  1262. }();
  1263. Promise$1.prototype.then = then;
  1264. Promise$1.all = all;
  1265. Promise$1.race = race;
  1266. Promise$1.resolve = resolve$1;
  1267. Promise$1.reject = reject$1;
  1268. Promise$1._setScheduler = setScheduler;
  1269. Promise$1._setAsap = setAsap;
  1270. Promise$1._asap = asap;
  1271. /*global self*/
  1272. function polyfill() {
  1273. var local = void 0;
  1274. if (typeof (typeof window !== undefined ? window : global) !== 'undefined') {
  1275. local = (typeof window !== undefined ? window : global);
  1276. } else if (typeof self !== 'undefined') {
  1277. local = self;
  1278. } else {
  1279. try {
  1280. local = Function('return this')();
  1281. } catch (e) {
  1282. throw new Error('polyfill failed because global object is unavailable in this environment');
  1283. }
  1284. }
  1285. var P = local.Promise;
  1286. if (P) {
  1287. var promiseToString = null;
  1288. try {
  1289. promiseToString = Object.prototype.toString.call(P.resolve());
  1290. } catch (e) {
  1291. // silently ignored
  1292. }
  1293. if (promiseToString === '[object Promise]' && !P.cast) {
  1294. return;
  1295. }
  1296. }
  1297. local.Promise = Promise$1;
  1298. }
  1299. // Strange compat..
  1300. Promise$1.polyfill = polyfill;
  1301. Promise$1.Promise = Promise$1;
  1302. return Promise$1;
  1303. })));
  1304. //# sourceMappingURL=es6-promise.map
  1305. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(67)))
  1306. /***/ }),
  1307. /* 1 */
  1308. /***/ (function(module, exports, __webpack_require__) {
  1309. "use strict";
  1310. const debug = __webpack_require__(449);
  1311. const memoize = __webpack_require__(215);
  1312. const logLevels = __webpack_require__(127);
  1313. /**
  1314. * @typedef {Object} Logger
  1315. * @property {Function} error
  1316. * @property {Function} warn
  1317. * @property {Function} info
  1318. * @property {Function} log
  1319. * @property {Function} debug
  1320. * @property {Function} spam
  1321. */
  1322. const createLogger = memoize(namespace => {
  1323. /** @type Logger */
  1324. const API = {};
  1325. const setMethods = () => {
  1326. Object.keys(logLevels).forEach(name => {
  1327. const method = logLevels[name].method;
  1328. const log = debug("OpenTok:" + namespace + ":" + name.toLowerCase());
  1329. log.log = console[method].bind(console);
  1330. API[name.toLowerCase()] = log;
  1331. });
  1332. };
  1333. setMethods();
  1334. return API;
  1335. });
  1336. createLogger.setLogLevel = level => {
  1337. let oldRules;
  1338. try {
  1339. oldRules = (typeof window !== undefined ? window : global).localStorage.debug;
  1340. } catch (err) {
  1341. // will get Uncaught DOMException: Failed to read the 'localStorage' property from 'Window':
  1342. // The document is sandboxed and lacks the 'allow-same-origin' flag.
  1343. oldRules = '';
  1344. }
  1345. const newDebugRules = Object.keys(logLevels).map(name => (level >= logLevels[name].priority ? '' : '-') + "(autogen)?OpenTok:*:" + name.toLowerCase());
  1346. const debugStr = [...newDebugRules, ...(oldRules || '').split(/[\s,]/).filter(rule => rule.indexOf('(autogen)?') === -1)].filter(x => x).join(',');
  1347. debug.enable(debugStr);
  1348. };
  1349. module.exports = createLogger;
  1350. /***/ }),
  1351. /* 2 */
  1352. /***/ (function(module, exports) {
  1353. function _interopRequireDefault(obj) {
  1354. return obj && obj.__esModule ? obj : {
  1355. default: obj
  1356. };
  1357. }
  1358. module.exports = _interopRequireDefault;
  1359. /***/ }),
  1360. /* 3 */
  1361. /***/ (function(module, exports, __webpack_require__) {
  1362. "use strict";
  1363. /* WEBPACK VAR INJECTION */(function(process) {
  1364. /*
  1365. * Environment details
  1366. *
  1367. * Contains information about the current environment.
  1368. *
  1369. * @property name The name of the Environment (Chrome, FF, Node, etc)
  1370. * @property version Usually a Float, except in Node which uses a String
  1371. * @property userAgent The raw user agent
  1372. *
  1373. */
  1374. const env = {
  1375. version: -1,
  1376. // @todo why is the default -1?
  1377. name: 'unknown'
  1378. };
  1379. if (process && process.versions && typeof process.versions.node === 'string') {
  1380. env.name = 'Node';
  1381. env.isNode = true;
  1382. env.version = parseInt(process.versions.node, 10);
  1383. env.userAgent = env.name + " " + env.version;
  1384. } else {
  1385. env.userAgent = (typeof window !== undefined ? window : global).navigator.userAgent.toLowerCase(); // @todo why lowercase?
  1386. env.appName = (typeof window !== undefined ? window : global).navigator.appName;
  1387. env.navigatorVendor = undefined;
  1388. env.name = 'unknown';
  1389. if (env.userAgent.indexOf('opera') > -1 || env.userAgent.indexOf('opr/') > -1) {
  1390. env.name = 'Opera';
  1391. env.isOpera = true;
  1392. if (/opr\/([0-9]{1,}[.0-9]{0,})/.exec(env.userAgent) !== null) {
  1393. env.version = parseFloat(RegExp.$1);
  1394. }
  1395. } else if (env.userAgent.indexOf('firefox') > -1) {
  1396. env.name = 'Firefox';
  1397. env.isFirefox = true;
  1398. if (/firefox\/([0-9]{1,}[.0-9]{0,})/.exec(env.userAgent) !== null) {
  1399. env.version = parseFloat(RegExp.$1);
  1400. }
  1401. } else if (env.appName === 'Microsoft Internet Explorer') {
  1402. // IE 10 and below
  1403. env.name = 'IE';
  1404. env.isIE = true;
  1405. if (/msie ([0-9]{1,}[.0-9]{0,})/.exec(env.userAgent) !== null) {
  1406. env.version = parseFloat(RegExp.$1);
  1407. }
  1408. } else if (env.userAgent.match(/edge?\/(\d+)(?:\.\d+)+$/)) {
  1409. env.name = 'Edge';
  1410. env.isEdge = true;
  1411. const version = RegExp.$1;
  1412. env.version = parseInt(version, 10);
  1413. } else if (env.appName === 'Netscape' && env.userAgent.indexOf('trident') > -1) {
  1414. // IE 11+
  1415. env.name = 'IE';
  1416. env.isIE = true;
  1417. if (/trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(env.userAgent) !== null) {
  1418. env.version = parseFloat(RegExp.$1);
  1419. }
  1420. } else if (env.userAgent.indexOf('chrome') > -1) {
  1421. env.name = 'Chrome';
  1422. env.isElectron = env.userAgent.indexOf('electron/') > -1;
  1423. if (!env.isElectron) {
  1424. env.isChrome = true;
  1425. }
  1426. if (/chrome\/([0-9]{1,}[.0-9]{0,})/.exec(env.userAgent) !== null) {
  1427. env.version = parseFloat(RegExp.$1);
  1428. }
  1429. } else if ((typeof window !== undefined ? window : global).navigator.vendor && (typeof window !== undefined ? window : global).navigator.vendor.toLowerCase().indexOf('apple') > -1) {
  1430. env.name = 'Safari';
  1431. env.isSafari = true;
  1432. if (/version\/([0-9]{1,}[.0-9]{0,})/.exec(env.userAgent) !== null) {
  1433. env.version = parseFloat(RegExp.$1);
  1434. }
  1435. } // The Chromium-based Edge was released on this version
  1436. env.isChromiumEdge = env.name === 'Edge' && env.version >= 79; // Prior versions ofo Edge versions were based on a proprietary, non-Chromium
  1437. // code base
  1438. env.isLegacyEdge = env.name === 'Edge' && env.version < 79;
  1439. env.userAgent = (typeof window !== undefined ? window : global).navigator.userAgent;
  1440. env.protocol = (typeof window !== undefined ? window : global).location.protocol;
  1441. env.hostName = (typeof window !== undefined ? window : global).location.hostName;
  1442. }
  1443. module.exports = env;
  1444. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(67)))
  1445. /***/ }),
  1446. /* 4 */
  1447. /***/ (function(module, exports, __webpack_require__) {
  1448. "use strict";
  1449. /* eslint-disable no-underscore-dangle */
  1450. // The top-level namespace, also performs basic DOMElement selecting.
  1451. //
  1452. // @example Get the DOM element with the id of 'domId'
  1453. // OTHelpers('#domId')
  1454. //
  1455. // @example Get all video elements
  1456. // OTHelpers('video')
  1457. //
  1458. // @example Get all elements with the class name of 'foo'
  1459. // OTHelpers('.foo')
  1460. //
  1461. // @example Get all elements with the class name of 'foo',
  1462. // and do something with the first.
  1463. // var collection = OTHelpers('.foo');
  1464. // console.log(collection.first);
  1465. //
  1466. //
  1467. // The second argument is the context, that is document or parent Element, to
  1468. // select from.
  1469. //
  1470. // @example Get a video element within the element with the id of 'domId'
  1471. // OTHelpers('video', OTHelpers('#domId'))
  1472. //
  1473. //
  1474. //
  1475. // OTHelpers will accept any of the following and return a collection:
  1476. // OTHelpers()
  1477. // OTHelpers('css selector', optionalParentNode)
  1478. // OTHelpers(DomNode)
  1479. // OTHelpers([array of DomNode])
  1480. //
  1481. // The collection is a ElementCollection object, see the ElementCollection docs for usage info.
  1482. //
  1483. const OTHelpers = __webpack_require__(221);
  1484. const setDeprecatedProperty = __webpack_require__(223);
  1485. const eventing = __webpack_require__(5);
  1486. const log = __webpack_require__(1);
  1487. OTHelpers.logging = log('OT.$');
  1488. OTHelpers.ElementCollection = __webpack_require__(222);
  1489. OTHelpers.env = __webpack_require__(3);
  1490. OTHelpers.ajax = __webpack_require__(236);
  1491. OTHelpers.statable = __webpack_require__(513);
  1492. OTHelpers.Analytics = __webpack_require__(238);
  1493. OTHelpers.Collection = __webpack_require__(241);
  1494. OTHelpers.domExtras = __webpack_require__(517);
  1495. OTHelpers.Error = __webpack_require__(242);
  1496. setDeprecatedProperty(OTHelpers, 'useLogHelpers', {
  1497. value(mixin) {
  1498. const logging = log('useLogHelpersDeprecatedMixin'); // eslint-disable-next-line no-param-reassign
  1499. Object.keys(logging).forEach(key => {
  1500. mixin[key] = logging[key];
  1501. });
  1502. return mixin;
  1503. },
  1504. name: 'OT.useLogHelpers',
  1505. getWarning: 'Please use an external library for your debugging needs'
  1506. });
  1507. OTHelpers.defaults = __webpack_require__(133);
  1508. setDeprecatedProperty(OTHelpers, 'eventing', {
  1509. value: eventing,
  1510. name: 'OT.$.eventing',
  1511. getWarning: 'Please use an external library to create an event emitter.'
  1512. }); // TODO: Remove the need for this kind of bazzadry.
  1513. Object.keys(OTHelpers).forEach(key => {
  1514. const component = OTHelpers[key];
  1515. const attachments = component._attachToOTHelpers || {};
  1516. Object.keys(attachments).forEach(attachmentName => {
  1517. if (Object.hasOwnProperty.call(OTHelpers, attachmentName) && !(key === 'util' && attachmentName === 'bind')) {
  1518. console.warn("More than one module is trying to define " + attachmentName + " on OTHelpers.");
  1519. }
  1520. OTHelpers[attachmentName] = attachments[attachmentName];
  1521. });
  1522. });
  1523. module.exports = OTHelpers;
  1524. /***/ }),
  1525. /* 5 */
  1526. /***/ (function(module, exports, __webpack_require__) {
  1527. "use strict";
  1528. const Events = __webpack_require__(43);
  1529. const isFunction = __webpack_require__(13);
  1530. const logging = __webpack_require__(1)('Events');
  1531. const assign = __webpack_require__(6);
  1532. const weakMemoizeBind = __webpack_require__(463);
  1533. /**
  1534. * This base class defines the <code>on</code>, <code>once</code>, and <code>off</code>
  1535. * methods of objects that can dispatch events.
  1536. *
  1537. * @class EventDispatcher
  1538. */
  1539. module.exports = function eventing(self) {
  1540. const ee = new Events();
  1541. ee.on('newListener', eventName => {
  1542. ee.emit(eventName + ":added");
  1543. });
  1544. ee.on('removeListener', eventName => {
  1545. ee.emit(eventName + ":removed");
  1546. });
  1547. const eventingMixin = {
  1548. /**
  1549. * Adds an event handler function for one or more events.
  1550. *
  1551. * <p>
  1552. * The following code adds an event handler for one event:
  1553. * </p>
  1554. *
  1555. * <pre>
  1556. * obj.on("eventName", function (event) {
  1557. * // This is the event handler.
  1558. * });
  1559. * </pre>
  1560. *
  1561. * <p>If you pass in multiple event names and a handler method, the handler is
  1562. * registered for each of those events:</p>
  1563. *
  1564. * <pre>
  1565. * obj.on("eventName1 eventName2",
  1566. * function (event) {
  1567. * // This is the event handler.
  1568. * });
  1569. * </pre>
  1570. *
  1571. * <p>You can also pass in a third <code>context</code> parameter (which is optional) to
  1572. * define the value of <code>this</code> in the handler method:</p>
  1573. *
  1574. * <pre>obj.on("eventName",
  1575. * function (event) {
  1576. * // This is the event handler.
  1577. * },
  1578. * obj);
  1579. * </pre>
  1580. *
  1581. * <p>
  1582. * The method also supports an alternate syntax, in which the first parameter is an object
  1583. * that is a hash map of event names and handler functions and the second parameter (optional)
  1584. * is the context for this in each handler:
  1585. * </p>
  1586. * <pre>
  1587. * obj.on(
  1588. * {
  1589. * eventName1: function (event) {
  1590. * // This is the handler for eventName1.
  1591. * },
  1592. * eventName2: function (event) {
  1593. * // This is the handler for eventName2.
  1594. * }
  1595. * },
  1596. * obj);
  1597. * </pre>
  1598. *
  1599. * <p>
  1600. * If you do not add a handler for an event, the event is ignored locally.
  1601. * </p>
  1602. *
  1603. * @param {String} type The string identifying the type of event. You can specify multiple event
  1604. * names in this string, separating them with a space. The event handler will process each of
  1605. * the events.
  1606. * @param {Function} handler The handler function to process the event. This function takes
  1607. * the event object as a parameter.
  1608. * @param {Object} context (Optional) Defines the value of <code>this</code> in the event
  1609. * handler function.
  1610. *
  1611. * @returns {EventDispatcher} The EventDispatcher object.
  1612. *
  1613. * @memberOf EventDispatcher
  1614. * @method #on
  1615. * @see <a href="#off">off()</a>
  1616. * @see <a href="#once">once()</a>
  1617. * @see <a href="#events">Events</a>
  1618. */
  1619. on(eventNames, handlerOrContext, context) {
  1620. if (typeof eventNames === 'string' && handlerOrContext) {
  1621. eventNames.split(' ').forEach(eventName => {
  1622. ee.on(eventName, weakMemoizeBind(handlerOrContext, context));
  1623. });
  1624. } else {
  1625. Object.keys(eventNames).forEach(eventName => {
  1626. ee.on(eventName, weakMemoizeBind(eventNames[eventName], handlerOrContext));
  1627. });
  1628. }
  1629. return this;
  1630. },
  1631. /**
  1632. * Removes an event handler or handlers.
  1633. *
  1634. * <p>If you pass in one event name and a handler method, the handler is removed for that
  1635. * event:</p>
  1636. *
  1637. * <pre>obj.off("eventName", eventHandler);</pre>
  1638. *
  1639. * <p>If you pass in multiple event names and a handler method, the handler is removed for
  1640. * those events:</p>
  1641. *
  1642. * <pre>obj.off("eventName1 eventName2", eventHandler);</pre>
  1643. *
  1644. * <p>If you pass in an event name (or names) and <i>no</i> handler method, all handlers are
  1645. * removed for those events:</p>
  1646. *
  1647. * <pre>obj.off("event1Name event2Name");</pre>
  1648. *
  1649. * <p>If you pass in no arguments, <i>all</i> event handlers are removed for all events
  1650. * dispatched by the object:</p>
  1651. *
  1652. * <pre>obj.off();</pre>
  1653. *
  1654. * <p>
  1655. * The method also supports an alternate syntax, in which the first parameter is an object that
  1656. * is a hash map of event names and handler functions and the second parameter (optional) is
  1657. * the context for this in each handler:
  1658. * </p>
  1659. * <pre>
  1660. * obj.off(
  1661. * {
  1662. * eventName1: event1Handler,
  1663. * eventName2: event2Handler
  1664. * });
  1665. * </pre>
  1666. *
  1667. * @param {String} type (Optional) The string identifying the type of event. You can
  1668. * use a space to specify multiple events, as in "accessAllowed accessDenied
  1669. * accessDialogClosed". If you pass in no <code>type</code> value (or other arguments),
  1670. * all event handlers are removed for the object.
  1671. * @param {Function} handler (Optional) The event handler function to remove. The handler
  1672. * must be the same function object as was passed into <code>on()</code>. Be careful with
  1673. * helpers like <code>bind()</code> that return a new function when called. If you pass in
  1674. * no <code>handler</code>, all event handlers are removed for the specified event
  1675. * <code>type</code>.
  1676. * @param {Object} context (Optional) If you specify a <code>context</code>, the event handler
  1677. * is removed for all specified events and handlers that use the specified context. (The
  1678. * context must match the context passed into <code>on()</code>.)
  1679. *
  1680. * @returns {Object} The object that dispatched the event.
  1681. *
  1682. * @memberOf EventDispatcher
  1683. * @method #off
  1684. * @see <a href="#on">on()</a>
  1685. * @see <a href="#once">once()</a>
  1686. * @see <a href="#events">Events</a>
  1687. */
  1688. off(eventNames, handlerOrContext, context) {
  1689. if (typeof eventNames === 'string') {
  1690. this.off(eventNames.split(' '), handlerOrContext, context);
  1691. } else if (Array.isArray(eventNames)) {
  1692. eventNames.forEach(eventName => {
  1693. if (handlerOrContext && isFunction(handlerOrContext)) {
  1694. ee.removeListener(eventName, weakMemoizeBind(handlerOrContext, context));
  1695. } else {
  1696. ee.removeAllListeners(eventName);
  1697. }
  1698. });
  1699. } else if (!eventNames) {
  1700. ee.removeAllListeners();
  1701. } else {
  1702. Object.keys(eventNames).forEach(eventName => {
  1703. // @todo was {foo: undefined} expected to remove all foo events?
  1704. ee.removeListener(eventName, weakMemoizeBind(eventNames[eventName], handlerOrContext));
  1705. });
  1706. }
  1707. return this;
  1708. },
  1709. /**
  1710. * Adds an event handler function for one or more events. Once the handler is called,
  1711. * the specified handler method is removed as a handler for this event. (When you use
  1712. * the <code>on()</code> method to add an event handler, the handler is <i>not</i>
  1713. * removed when it is called.) The <code>once()</code> method is the equivilent of
  1714. * calling the <code>on()</code>
  1715. * method and calling <code>off()</code> the first time the handler is invoked.
  1716. *
  1717. * <p>
  1718. * The following code adds a one-time event handler for one event:
  1719. * </p>
  1720. *
  1721. * <pre>
  1722. * obj.once("eventName", function (event) {
  1723. * // This is the event handler.
  1724. * });
  1725. * </pre>
  1726. *
  1727. * <p>If you pass in multiple event names and a handler method, the handler is registered
  1728. * for each of those events:</p>
  1729. *
  1730. * <pre>obj.once("eventName1 eventName2"
  1731. * function (event) {
  1732. * // This is the event handler.
  1733. * });
  1734. * </pre>
  1735. *
  1736. * <p>You can also pass in a third <code>context</code> parameter (which is optional) to define
  1737. * the value of
  1738. * <code>this</code> in the handler method:</p>
  1739. *
  1740. * <pre>obj.once("eventName",
  1741. * function (event) {
  1742. * // This is the event handler.
  1743. * },
  1744. * obj);
  1745. * </pre>
  1746. *
  1747. * <p>
  1748. * The method also supports an alternate syntax, in which the first parameter is an object that
  1749. * is a hash map of event names and handler functions and the second parameter (optional) is the
  1750. * context for this in each handler:
  1751. * </p>
  1752. * <pre>
  1753. * obj.once(
  1754. * {
  1755. * eventName1: function (event) {
  1756. * // This is the event handler for eventName1.
  1757. * },
  1758. * eventName2: function (event) {
  1759. * // This is the event handler for eventName1.
  1760. * }
  1761. * },
  1762. * obj);
  1763. * </pre>
  1764. *
  1765. * @param {String} type The string identifying the type of event. You can specify multiple
  1766. * event names in this string, separating them with a space. The event handler will process
  1767. * the first occurence of the events. After the first event, the handler is removed (for
  1768. * all specified events).
  1769. * @param {Function} handler The handler function to process the event. This function takes
  1770. * the event object as a parameter.
  1771. * @param {Object} context (Optional) Defines the value of <code>this</code> in the event
  1772. * handler function.
  1773. *
  1774. * @returns {Object} The object that dispatched the event.
  1775. *
  1776. * @memberOf EventDispatcher
  1777. * @method #once
  1778. * @see <a href="#on">on()</a>
  1779. * @see <a href="#off">off()</a>
  1780. * @see <a href="#events">Events</a>
  1781. */
  1782. once(eventNames, handlerOrContext, context) {
  1783. if (typeof eventNames === 'string' && handlerOrContext) {
  1784. eventNames.split(' ').forEach(eventName => {
  1785. ee.once(eventName, weakMemoizeBind(handlerOrContext, context));
  1786. });
  1787. } else {
  1788. Object.keys(eventNames).forEach(eventName => {
  1789. ee.once(eventName, weakMemoizeBind(eventNames[eventName], handlerOrContext));
  1790. });
  1791. }
  1792. return this;
  1793. },
  1794. /**
  1795. * Execute any listeners bound to the +event+ Event.
  1796. *
  1797. * Each handler will be executed.
  1798. *
  1799. * @param [Event] event An Event object.
  1800. * @return this
  1801. */
  1802. dispatchEvent(event) {
  1803. if (!event.type) {
  1804. throw new Error('dispatchEvent: Event has no type');
  1805. }
  1806. if (!event.target) {
  1807. event.target = this; // eslint-disable-line no-param-reassign
  1808. }
  1809. this.trigger(event.type, event);
  1810. return this;
  1811. },
  1812. /**
  1813. * Execute each handler for the event called +name+.
  1814. *
  1815. * Each handler will be executed, and any exceptions that they throw will
  1816. * be caught and logged
  1817. *
  1818. * @example
  1819. * foo.on('bar', function(name, message) {
  1820. * alert("Hello " + name + ": " + message);
  1821. * });
  1822. *
  1823. * foo.trigger('OpenTok', 'asdf'); // -> Hello OpenTok: asdf
  1824. *
  1825. * @param {String} eventName The name of this event.
  1826. * @param {Array} arguments The arguments handlers will be called with
  1827. *
  1828. * @return this
  1829. */
  1830. trigger(eventName) {
  1831. try {
  1832. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1833. args[_key - 1] = arguments[_key];
  1834. }
  1835. ee.emit(eventName, ...args);
  1836. } catch (e) {
  1837. console.error('An error occurred in an event handler', e);
  1838. }
  1839. return this;
  1840. },
  1841. // Alias of trigger for easier node compatibility
  1842. emit() {
  1843. return self.trigger(...arguments);
  1844. },
  1845. /**
  1846. * @deprecated use <a href="#on">on()</a> or <a href="#once">once()</a> instead.
  1847. * <p>
  1848. * This method registers a method as an event listener for a specific event.
  1849. * <p>
  1850. *
  1851. * <p>
  1852. * If a handler is not registered for an event, the event is ignored locally. If the
  1853. * event listener function does not exist, the event is ignored locally.
  1854. * </p>
  1855. * <p>
  1856. * Throws an exception if the <code>listener</code> name is invalid.
  1857. * </p>
  1858. *
  1859. * @param {String} type The string identifying the type of event.
  1860. *
  1861. * @param {Function} listener The function to be invoked when the object dispatches the event.
  1862. *
  1863. * @param {Object} context (Optional) Defines the value of <code>this</code> in the event
  1864. * handler function.
  1865. *
  1866. * @memberOf EventDispatcher
  1867. * @method #addEventListener
  1868. * @see <a href="#on">on()</a>
  1869. * @see <a href="#once">once()</a>
  1870. * @see <a href="#events">Events</a>
  1871. */
  1872. addEventListener(eventName, handler, context) {
  1873. logging.warn('The addEventListener() method is deprecated. Use on() or once() instead.');
  1874. return self.on(eventName, handler, context);
  1875. },
  1876. /**
  1877. * @deprecated use <a href="#off">off()</a> instead.
  1878. * <p>
  1879. * Removes an event listener for a specific event.
  1880. * <p>
  1881. *
  1882. * <p>
  1883. * Throws an exception if the <code>listener</code> name is invalid.
  1884. * </p>
  1885. *
  1886. * @param {String} type The string identifying the type of event.
  1887. *
  1888. * @param {Function} listener The event listener function to remove.
  1889. *
  1890. * @param {Object} context (Optional) If you specify a <code>context</code>, the event
  1891. * handler is removed for all specified events and event listeners that use the specified
  1892. context. (The context must match the context passed into
  1893. * <code>addEventListener()</code>.)
  1894. *
  1895. * @memberOf EventDispatcher
  1896. * @method #removeEventListener
  1897. * @see <a href="#off">off()</a>
  1898. * @see <a href="#events">Events</a>
  1899. */
  1900. // See 'off' for usage.
  1901. // @depreciated will become a private helper function in the future.
  1902. removeEventListener(eventName, handler, context) {
  1903. logging.warn('The removeEventListener() method is deprecated. Use off() instead.');
  1904. return self.off(eventName, handler, context);
  1905. },
  1906. listenerCount(eventName) {
  1907. return ee.listenerCount(eventName);
  1908. }
  1909. };
  1910. return assign(self, eventingMixin);
  1911. };
  1912. /***/ }),
  1913. /* 6 */
  1914. /***/ (function(module, exports, __webpack_require__) {
  1915. var assignValue = __webpack_require__(80),
  1916. copyObject = __webpack_require__(38),
  1917. createAssigner = __webpack_require__(224),
  1918. isArrayLike = __webpack_require__(21),
  1919. isPrototype = __webpack_require__(65),
  1920. keys = __webpack_require__(27);
  1921. /** Used for built-in method references. */
  1922. var objectProto = Object.prototype;
  1923. /** Used to check objects for own properties. */
  1924. var hasOwnProperty = objectProto.hasOwnProperty;
  1925. /**
  1926. * Assigns own enumerable string keyed properties of source objects to the
  1927. * destination object. Source objects are applied from left to right.
  1928. * Subsequent sources overwrite property assignments of previous sources.
  1929. *
  1930. * **Note:** This method mutates `object` and is loosely based on
  1931. * [`Object.assign`](https://mdn.io/Object/assign).
  1932. *
  1933. * @static
  1934. * @memberOf _
  1935. * @since 0.10.0
  1936. * @category Object
  1937. * @param {Object} object The destination object.
  1938. * @param {...Object} [sources] The source objects.
  1939. * @returns {Object} Returns `object`.
  1940. * @see _.assignIn
  1941. * @example
  1942. *
  1943. * function Foo() {
  1944. * this.a = 1;
  1945. * }
  1946. *
  1947. * function Bar() {
  1948. * this.c = 3;
  1949. * }
  1950. *
  1951. * Foo.prototype.b = 2;
  1952. * Bar.prototype.d = 4;
  1953. *
  1954. * _.assign({ 'a': 0 }, new Foo, new Bar);
  1955. * // => { 'a': 1, 'c': 3 }
  1956. */
  1957. var assign = createAssigner(function(object, source) {
  1958. if (isPrototype(source) || isArrayLike(source)) {
  1959. copyObject(source, keys(source), object);
  1960. return;
  1961. }
  1962. for (var key in source) {
  1963. if (hasOwnProperty.call(source, key)) {
  1964. assignValue(object, key, source[key]);
  1965. }
  1966. }
  1967. });
  1968. module.exports = assign;
  1969. /***/ }),
  1970. /* 7 */
  1971. /***/ (function(module, exports) {
  1972. /**
  1973. * Checks if `value` is the
  1974. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1975. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1976. *
  1977. * @static
  1978. * @memberOf _
  1979. * @since 0.1.0
  1980. * @category Lang
  1981. * @param {*} value The value to check.
  1982. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1983. * @example
  1984. *
  1985. * _.isObject({});
  1986. * // => true
  1987. *
  1988. * _.isObject([1, 2, 3]);
  1989. * // => true
  1990. *
  1991. * _.isObject(_.noop);
  1992. * // => true
  1993. *
  1994. * _.isObject(null);
  1995. * // => false
  1996. */
  1997. function isObject(value) {
  1998. var type = typeof value;
  1999. return value != null && (type == 'object' || type == 'function');
  2000. }
  2001. module.exports = isObject;
  2002. /***/ }),
  2003. /* 8 */
  2004. /***/ (function(module, exports, __webpack_require__) {
  2005. "use strict";
  2006. // Note: Some of these descriptions here are more specific than the name would suggest, because we
  2007. // only use them in one place. However, this shouldn't prevent us from using the error elsewhere if
  2008. // the name fits, and we should update the description to be more general when this happens.
  2009. module.exports = {
  2010. // The API key does not match the token or session.
  2011. AUTHENTICATION_ERROR: 'OT_AUTHENTICATION_ERROR',
  2012. // JSON response was badly formed.
  2013. BADLY_FORMED_RESPONSE: 'OT_BADLY_FORMED_RESPONSE',
  2014. // Unable to publish because your browser failed to get access to your microphone. You may need to
  2015. // fully quit and restart your browser to get it to work.
  2016. // See https://bugs.chromium.org/p/webrtc/issues/detail?id=4799 for more details.
  2017. CHROME_MICROPHONE_ACQUISITION_ERROR: 'OT_CHROME_MICROPHONE_ACQUISITION_ERROR',
  2018. // Failed to connect to session.
  2019. CONNECT_FAILED: 'OT_CONNECT_FAILED',
  2020. // The session has exceded the maximum number of simultaneous connections.
  2021. CONNECTION_LIMIT_EXCEEDED: 'OT_CONNECTION_LIMIT_EXCEEDED',
  2022. // The constraints for getting user media could not be satisfied.
  2023. CONSTRAINTS_NOT_SATISFIED: 'OT_CONSTRAINTS_NOT_SATISFIED',
  2024. // Failed to create peer connection.
  2025. CREATE_PEER_CONNECTION_FAILED: 'OT_CREATE_PEER_CONNECTION_FAILED',
  2026. // Action failed due to session disconnection.
  2027. DISCONNECTED: 'OT_DISCONNECTED',
  2028. // Received an unexpected empty response from the server.
  2029. EMPTY_RESPONSE_BODY: 'OT_EMPTY_RESPONSE_BODY',
  2030. // The hardware to fulfil the user media request appears to exist but could not be acquired. It
  2031. // might be in use by another application.
  2032. HARDWARE_UNAVAILABLE: 'OT_HARDWARE_UNAVAILABLE',
  2033. // Something went wrong while establishing WebRTC connectivity.
  2034. ICE_WORKFLOW_FAILED: 'OT_ICE_WORKFLOW_FAILED',
  2035. // Received an invalid HTTP status. This may be considered invalid for the endpoint only and not
  2036. // HTTP in general.
  2037. INVALID_HTTP_STATUS: 'OT_INVALID_HTTP_STATUS',
  2038. // One or more parameters was not valid or not provided.
  2039. INVALID_PARAMETER: 'OT_INVALID_PARAMETER',
  2040. // The session id was invalid.
  2041. INVALID_SESSION_ID: 'OT_INVALID_SESSION_ID',
  2042. // The fetching of the stream for the video element has been aborted.
  2043. MEDIA_ERR_ABORTED: 'OT_MEDIA_ERR_ABORTED',
  2044. // A decoding error occurred while trying to play the stream in the video element.
  2045. MEDIA_ERR_DECODE: 'OT_MEDIA_ERR_DECODE',
  2046. // A network error caused the stream to stop being fetched.
  2047. MEDIA_ERR_NETWORK: 'OT_MEDIA_ERR_NETWORK',
  2048. // The stream has been detected to be not suitable for playback.
  2049. MEDIA_ERR_SRC_NOT_SUPPORTED: 'OT_MEDIA_ERR_SRC_NOT_SUPPORTED',
  2050. // The ended event on the video element fired
  2051. MEDIA_ENDED: 'OT_MEDIA_ENDED',
  2052. // No devices were found to provide the media stream.
  2053. NO_DEVICES_FOUND: 'OT_NO_DEVICES_FOUND',
  2054. // Video and audio was disabled. You need to enable at least one.
  2055. NO_VALID_CONSTRAINTS: 'OT_NO_VALID_CONSTRAINTS',
  2056. // Couldn't perform action due to not being connected.
  2057. NOT_CONNECTED: 'OT_NOT_CONNECTED',
  2058. // A resource was not found.
  2059. NOT_FOUND: 'OT_NOT_FOUND',
  2060. // Something in the user media request is not supported.
  2061. NOT_SUPPORTED: 'OT_NOT_SUPPORTED',
  2062. // An action was not permitted.
  2063. PERMISSION_DENIED: 'OT_PERMISSION_DENIED',
  2064. // The signal could not be sent due to the rate limit.
  2065. RATE_LIMIT_EXCEEDED: 'OT_RATE_LIMIT_EXCEEDED',
  2066. // Error calling OT.reportIssue(). Check the client\'s network connection.
  2067. REPORT_ISSUE_FAILED: 'OT_REPORT_ISSUE_FAILED',
  2068. // Screen-sharing support in this browser requires an extension, but the extension is not
  2069. // installed.
  2070. SCREEN_SHARING_EXTENSION_NOT_INSTALLED: 'OT_SCREEN_SHARING_EXTENSION_NOT_INSTALLED',
  2071. // Screen-sharing support in this browser requires an extension, but one has not been registered.
  2072. SCREEN_SHARING_EXTENSION_NOT_REGISTERED: 'OT_SCREEN_SHARING_EXTENSION_NOT_REGISTERED',
  2073. // Screen sharing is not supported in the browser.
  2074. SCREEN_SHARING_NOT_SUPPORTED: 'OT_SCREEN_SHARING_NOT_SUPPORTED',
  2075. // The WebRTC connection failed during setDescription.
  2076. SET_REMOTE_DESCRIPTION_FAILED: 'OT_SET_REMOTE_DESCRIPTION_FAILED',
  2077. // Rumor.Socket cannot connect when it is already connecting or connected.
  2078. SOCKET_ALREADY_CONNECTED_CONNECTING: 'OT_SOCKET_ALREADY_CONNECTED_CONNECTING',
  2079. // A connection was closed abnormally (that is, with no close frame being sent) when a status code
  2080. // is expected.
  2081. SOCKET_CLOSE_ABNORMAL: 'OT_SOCKET_CLOSE_ABNORMAL',
  2082. // Exception was thrown during Rumor connection, possibly because of a blocked port.
  2083. SOCKET_CLOSE_CONNECT_EXCEPTION: 'OT_SOCKET_CLOSE_CONNECT_EXCEPTION',
  2084. // Connectivity loss was detected as it was too long since the socket received the last PONG
  2085. // message.
  2086. SOCKET_CLOSE_CONNECTIVITY_LOSS: 'OT_SOCKET_CLOSE_CONNECTIVITY_LOSS',
  2087. // Falling back on this error for socket close because a more suitable one was not found.
  2088. SOCKET_CLOSE_FALLBACK_CODE: 'OT_SOCKET_CLOSE_FALLBACK_CODE',
  2089. // An endpoint received data within a message that was not consistent with the type of the message
  2090. // (e.g., non-UTF-8 [RFC3629] data within a text message)
  2091. SOCKET_CLOSE_INCONSISTENT_DATA: 'OT_SOCKET_CLOSE_INCONSISTENT_DATA',
  2092. // No status code was provided even though one was expected.
  2093. SOCKET_CLOSE_NO_STATUS: 'OT_SOCKET_CLOSE_NO_STATUS',
  2094. // An endpoint received a message that violates its policy. This is a generic status code that
  2095. // can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if
  2096. // there is a need to hide specific details about the policy.
  2097. SOCKET_CLOSE_POLICY_VIOLATION: 'OT_SOCKET_CLOSE_POLICY_VIOLATION',
  2098. // The endpoint is going away, either because of a server failure or because the browser is
  2099. // navigating away from the page that opened the connection.
  2100. SOCKET_CLOSE_GOING_AWAY: 'OT_SOCKET_CLOSE_GOING_AWAY',
  2101. // A protocol error occurred.
  2102. SOCKET_CLOSE_PROTOCOL_ERROR: 'OT_SOCKET_CLOSE_PROTOCOL_ERROR',
  2103. // Timed out while waiting for the Rumor socket to connect.
  2104. SOCKET_CLOSE_TIMEOUT: 'OT_SOCKET_CLOSE_TIMEOUT',
  2105. // An endpoint received a message that is too big for it to process
  2106. SOCKET_CLOSE_TOO_LARGE: 'OT_SOCKET_CLOSE_TOO_LARGE',
  2107. // An endpoint encountered an unexpected condition that prevented it from fulfilling the request.
  2108. SOCKET_CLOSE_UNEXPECTED_CONDITION: 'OT_SOCKET_CLOSE_UNEXPECTED_CONDITION',
  2109. // An endpoint has indicated that reconnections are not available.
  2110. SOCKET_CLOSE_UNSUPPORTED: 'OT_SOCKET_CLOSE_UNSUPPORTED',
  2111. // Failed to create the stream in the server model.
  2112. STREAM_CREATE_FAILED: 'OT_STREAM_CREATE_FAILED',
  2113. // The stream was destroyed before it could be subscribed to.
  2114. STREAM_DESTROYED: 'OT_STREAM_DESTROYED',
  2115. // The session has exceded the maximum number of simultaneous streams.
  2116. STREAM_LIMIT_EXCEEDED: 'OT_STREAM_LIMIT_EXCEEDED',
  2117. // Couldn't subscribe to the stream because it was not found.
  2118. STREAM_NOT_FOUND: 'OT_STREAM_NOT_FOUND',
  2119. // Couldn't connect due to a terms of service violation.
  2120. TERMS_OF_SERVICE_FAILURE: 'OT_TERMS_OF_SERVICE_FAILURE',
  2121. // A timer expired while waiting for an action to occur.
  2122. TIMEOUT: 'OT_TIMEOUT',
  2123. // The operation was cancelled
  2124. CANCEL: 'OT_CANCEL',
  2125. // Generic media abort error
  2126. UNABLE_TO_CAPTURE_MEDIA: 'OT_UNABLE_TO_CAPTURE_MEDIA',
  2127. // Generic/ Unknown screen share error
  2128. UNABLE_TO_CAPTURE_SCREEN: 'OT_UNABLE_TO_CAPTURE_SCREEN',
  2129. // The error code received was unexpected.
  2130. UNEXPECTED_ERROR_CODE: 'OT_UNEXPECTED_ERROR_CODE',
  2131. // Received an unexpected HTTP status.
  2132. UNEXPECTED_HTTP_STATUS: 'OT_UNEXPECTED_HTTP_STATUS',
  2133. // An unexpected server response was received which could not be handled.
  2134. UNEXPECTED_SERVER_RESPONSE: 'OT_UNEXPECTED_SERVER_RESPONSE',
  2135. // An unknown anvil error occurred.
  2136. UNKNOWN_HTTP_ERROR: 'OT_UNKNOWN_HTTP_ERROR',
  2137. UNSUPPORTED_BROWSER: 'OT_UNSUPPORTED_BROWSER',
  2138. // Access to user media was denied.
  2139. USER_MEDIA_ACCESS_DENIED: 'OT_USER_MEDIA_ACCESS_DENIED',
  2140. // There was a cross domain error or the server responded with invalid JSON.
  2141. XDOMAIN_OR_PARSING_ERROR: 'OT_XDOMAIN_OR_PARSING_ERROR',
  2142. API_KEY_DISABLED: 'OT_API_KEY_DISABLED',
  2143. // There was an error when trying to get the list of supported codecs.
  2144. UNABLE_TO_ACCESS_MEDIA_ENGINE: 'OT_UNABLE_TO_ACCESS_MEDIA_ENGINE'
  2145. };
  2146. /***/ }),
  2147. /* 9 */
  2148. /***/ (function(module, exports) {
  2149. /**
  2150. * Checks if `value` is classified as an `Array` object.
  2151. *
  2152. * @static
  2153. * @memberOf _
  2154. * @since 0.1.0
  2155. * @category Lang
  2156. * @param {*} value The value to check.
  2157. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  2158. * @example
  2159. *
  2160. * _.isArray([1, 2, 3]);
  2161. * // => true
  2162. *
  2163. * _.isArray(document.body.children);
  2164. * // => false
  2165. *
  2166. * _.isArray('abc');
  2167. * // => false
  2168. *
  2169. * _.isArray(_.noop);
  2170. * // => false
  2171. */
  2172. var isArray = Array.isArray;
  2173. module.exports = isArray;
  2174. /***/ }),
  2175. /* 10 */
  2176. /***/ (function(module, exports, __webpack_require__) {
  2177. var freeGlobal = __webpack_require__(168);
  2178. /** Detect free variable `self`. */
  2179. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  2180. /** Used as a reference to the global object. */
  2181. var root = freeGlobal || freeSelf || Function('return this')();
  2182. module.exports = root;
  2183. /***/ }),
  2184. /* 11 */
  2185. /***/ (function(module, exports, __webpack_require__) {
  2186. "use strict";
  2187. module.exports = {
  2188. JS_EXCEPTION: 2000,
  2189. AUTHENTICATION_ERROR: 1004,
  2190. INVALID_SESSION_ID: 1005,
  2191. CONNECT_FAILED: 1006,
  2192. CONNECT_REJECTED: 1007,
  2193. CONNECTION_TIMEOUT: 1008,
  2194. NOT_CONNECTED: 1010,
  2195. INVALID_PARAMETER: 1011,
  2196. P2P_CONNECTION_FAILED: 1013,
  2197. API_RESPONSE_FAILURE: 1014,
  2198. TERMS_OF_SERVICE_FAILURE: 1026,
  2199. CONNECTION_LIMIT_EXCEEDED: 1027,
  2200. UNABLE_TO_PUBLISH: 1500,
  2201. UNABLE_TO_SUBSCRIBE: 1501,
  2202. UNSUPPORTED_VIDEO_CODEC: 1502,
  2203. UNABLE_TO_FORCE_DISCONNECT: 1520,
  2204. UNABLE_TO_FORCE_UNPUBLISH: 1530,
  2205. PUBLISHER_ICE_WORKFLOW_FAILED: 1553,
  2206. SUBSCRIBER_ICE_WORKFLOW_FAILED: 1554,
  2207. STREAM_LIMIT_EXCEEDED: 1605,
  2208. UNEXPECTED_SERVER_RESPONSE: 2001,
  2209. REPORT_ISSUE_ERROR: 2011,
  2210. ANVIL_BADLY_FORMED_RESPONSE: 3001,
  2211. ANVIL_INVALID_HTTP_STATUS: 3002,
  2212. ANVIL_XDOMAIN_OR_PARSING_ERROR: 3003,
  2213. ANVIL_UNKNOWN_HTTP_ERROR: 3004,
  2214. ANVIL_UNEXPECTED_ERROR_CODE: 3005,
  2215. ANVIL_EMPTY_RESPONSE_BODY: 3006,
  2216. ANVIL_CONNECT_FAILED: 3007,
  2217. UNABLE_TO_ACCESS_MEDIA_ENGINE: 5001
  2218. };
  2219. /***/ }),
  2220. /* 12 */
  2221. /***/ (function(module, exports, __webpack_require__) {
  2222. "use strict";
  2223. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  2224. /* eslint-disable no-param-reassign, global-require */
  2225. module.exports = function otErrorFactory(deps) {
  2226. if (deps === void 0) {
  2227. deps = {};
  2228. }
  2229. const errorReporting = deps.errorReporting || __webpack_require__(185)();
  2230. const Errors = deps.Errors || __webpack_require__(8);
  2231. const OTErrorClass = deps.OTErrorClass || __webpack_require__(33);
  2232. const names = Object.keys(Errors).map(shortName => Errors[shortName]);
  2233. return function otError(name, plainError, code) {
  2234. if (names.indexOf(name) === -1) {
  2235. return new Error("Attempt to use invalid error name (" + name + "). Original message: " + plainError.message);
  2236. }
  2237. if (!(plainError instanceof Error || /^\[object .*Error\]$/.test(Object.prototype.toString.call(plainError)))) {
  2238. return new Error("Did not pass Error as second argument: " + plainError);
  2239. } // OTErrorClass is the deprecated OT.Error class from the docs.
  2240. const error = new OTErrorClass(undefined, plainError.message);
  2241. error.name = name;
  2242. if (!plainError.stack) {
  2243. try {
  2244. throw plainError;
  2245. } catch (e) {// IE populates the error's .stack when it is thrown, nothing to do here
  2246. }
  2247. }
  2248. error.stack = plainError.stack;
  2249. if (code) {
  2250. error.code = code;
  2251. }
  2252. errorReporting.send(error);
  2253. return error;
  2254. };
  2255. };
  2256. /***/ }),
  2257. /* 13 */
  2258. /***/ (function(module, exports, __webpack_require__) {
  2259. var baseGetTag = __webpack_require__(26),
  2260. isObject = __webpack_require__(7);
  2261. /** `Object#toString` result references. */
  2262. var asyncTag = '[object AsyncFunction]',
  2263. funcTag = '[object Function]',
  2264. genTag = '[object GeneratorFunction]',
  2265. proxyTag = '[object Proxy]';
  2266. /**
  2267. * Checks if `value` is classified as a `Function` object.
  2268. *
  2269. * @static
  2270. * @memberOf _
  2271. * @since 0.1.0
  2272. * @category Lang
  2273. * @param {*} value The value to check.
  2274. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2275. * @example
  2276. *
  2277. * _.isFunction(_);
  2278. * // => true
  2279. *
  2280. * _.isFunction(/abc/);
  2281. * // => false
  2282. */
  2283. function isFunction(value) {
  2284. if (!isObject(value)) {
  2285. return false;
  2286. }
  2287. // The use of `Object#toString` avoids issues with the `typeof` operator
  2288. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  2289. var tag = baseGetTag(value);
  2290. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  2291. }
  2292. module.exports = isFunction;
  2293. /***/ }),
  2294. /* 14 */
  2295. /***/ (function(module, exports) {
  2296. /**
  2297. * Checks if `value` is object-like. A value is object-like if it's not `null`
  2298. * and has a `typeof` result of "object".
  2299. *
  2300. * @static
  2301. * @memberOf _
  2302. * @since 4.0.0
  2303. * @category Lang
  2304. * @param {*} value The value to check.
  2305. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  2306. * @example
  2307. *
  2308. * _.isObjectLike({});
  2309. * // => true
  2310. *
  2311. * _.isObjectLike([1, 2, 3]);
  2312. * // => true
  2313. *
  2314. * _.isObjectLike(_.noop);
  2315. * // => false
  2316. *
  2317. * _.isObjectLike(null);
  2318. * // => false
  2319. */
  2320. function isObjectLike(value) {
  2321. return value != null && typeof value == 'object';
  2322. }
  2323. module.exports = isObjectLike;
  2324. /***/ }),
  2325. /* 15 */
  2326. /***/ (function(module, exports, __webpack_require__) {
  2327. var v1 = __webpack_require__(515);
  2328. var v4 = __webpack_require__(516);
  2329. var uuid = v4;
  2330. uuid.v1 = v1;
  2331. uuid.v4 = v4;
  2332. module.exports = uuid;
  2333. /***/ }),
  2334. /* 16 */
  2335. /***/ (function(module, exports, __webpack_require__) {
  2336. "use strict";
  2337. var bind = __webpack_require__(187);
  2338. var isBuffer = __webpack_require__(378);
  2339. /*global toString:true*/
  2340. // utils is a library of generic helper functions non-specific to axios
  2341. var toString = Object.prototype.toString;
  2342. /**
  2343. * Determine if a value is an Array
  2344. *
  2345. * @param {Object} val The value to test
  2346. * @returns {boolean} True if value is an Array, otherwise false
  2347. */
  2348. function isArray(val) {
  2349. return toString.call(val) === '[object Array]';
  2350. }
  2351. /**
  2352. * Determine if a value is an ArrayBuffer
  2353. *
  2354. * @param {Object} val The value to test
  2355. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  2356. */
  2357. function isArrayBuffer(val) {
  2358. return toString.call(val) === '[object ArrayBuffer]';
  2359. }
  2360. /**
  2361. * Determine if a value is a FormData
  2362. *
  2363. * @param {Object} val The value to test
  2364. * @returns {boolean} True if value is an FormData, otherwise false
  2365. */
  2366. function isFormData(val) {
  2367. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  2368. }
  2369. /**
  2370. * Determine if a value is a view on an ArrayBuffer
  2371. *
  2372. * @param {Object} val The value to test
  2373. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  2374. */
  2375. function isArrayBufferView(val) {
  2376. var result;
  2377. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  2378. result = ArrayBuffer.isView(val);
  2379. } else {
  2380. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  2381. }
  2382. return result;
  2383. }
  2384. /**
  2385. * Determine if a value is a String
  2386. *
  2387. * @param {Object} val The value to test
  2388. * @returns {boolean} True if value is a String, otherwise false
  2389. */
  2390. function isString(val) {
  2391. return typeof val === 'string';
  2392. }
  2393. /**
  2394. * Determine if a value is a Number
  2395. *
  2396. * @param {Object} val The value to test
  2397. * @returns {boolean} True if value is a Number, otherwise false
  2398. */
  2399. function isNumber(val) {
  2400. return typeof val === 'number';
  2401. }
  2402. /**
  2403. * Determine if a value is undefined
  2404. *
  2405. * @param {Object} val The value to test
  2406. * @returns {boolean} True if the value is undefined, otherwise false
  2407. */
  2408. function isUndefined(val) {
  2409. return typeof val === 'undefined';
  2410. }
  2411. /**
  2412. * Determine if a value is an Object
  2413. *
  2414. * @param {Object} val The value to test
  2415. * @returns {boolean} True if value is an Object, otherwise false
  2416. */
  2417. function isObject(val) {
  2418. return val !== null && typeof val === 'object';
  2419. }
  2420. /**
  2421. * Determine if a value is a Date
  2422. *
  2423. * @param {Object} val The value to test
  2424. * @returns {boolean} True if value is a Date, otherwise false
  2425. */
  2426. function isDate(val) {
  2427. return toString.call(val) === '[object Date]';
  2428. }
  2429. /**
  2430. * Determine if a value is a File
  2431. *
  2432. * @param {Object} val The value to test
  2433. * @returns {boolean} True if value is a File, otherwise false
  2434. */
  2435. function isFile(val) {
  2436. return toString.call(val) === '[object File]';
  2437. }
  2438. /**
  2439. * Determine if a value is a Blob
  2440. *
  2441. * @param {Object} val The value to test
  2442. * @returns {boolean} True if value is a Blob, otherwise false
  2443. */
  2444. function isBlob(val) {
  2445. return toString.call(val) === '[object Blob]';
  2446. }
  2447. /**
  2448. * Determine if a value is a Function
  2449. *
  2450. * @param {Object} val The value to test
  2451. * @returns {boolean} True if value is a Function, otherwise false
  2452. */
  2453. function isFunction(val) {
  2454. return toString.call(val) === '[object Function]';
  2455. }
  2456. /**
  2457. * Determine if a value is a Stream
  2458. *
  2459. * @param {Object} val The value to test
  2460. * @returns {boolean} True if value is a Stream, otherwise false
  2461. */
  2462. function isStream(val) {
  2463. return isObject(val) && isFunction(val.pipe);
  2464. }
  2465. /**
  2466. * Determine if a value is a URLSearchParams object
  2467. *
  2468. * @param {Object} val The value to test
  2469. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  2470. */
  2471. function isURLSearchParams(val) {
  2472. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  2473. }
  2474. /**
  2475. * Trim excess whitespace off the beginning and end of a string
  2476. *
  2477. * @param {String} str The String to trim
  2478. * @returns {String} The String freed of excess whitespace
  2479. */
  2480. function trim(str) {
  2481. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  2482. }
  2483. /**
  2484. * Determine if we're running in a standard browser environment
  2485. *
  2486. * This allows axios to run in a web worker, and react-native.
  2487. * Both environments support XMLHttpRequest, but not fully standard globals.
  2488. *
  2489. * web workers:
  2490. * typeof window -> undefined
  2491. * typeof document -> undefined
  2492. *
  2493. * react-native:
  2494. * navigator.product -> 'ReactNative'
  2495. */
  2496. function isStandardBrowserEnv() {
  2497. if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
  2498. return false;
  2499. }
  2500. return (
  2501. typeof window !== 'undefined' &&
  2502. typeof document !== 'undefined'
  2503. );
  2504. }
  2505. /**
  2506. * Iterate over an Array or an Object invoking a function for each item.
  2507. *
  2508. * If `obj` is an Array callback will be called passing
  2509. * the value, index, and complete array for each item.
  2510. *
  2511. * If 'obj' is an Object callback will be called passing
  2512. * the value, key, and complete object for each property.
  2513. *
  2514. * @param {Object|Array} obj The object to iterate
  2515. * @param {Function} fn The callback to invoke for each item
  2516. */
  2517. function forEach(obj, fn) {
  2518. // Don't bother if no value provided
  2519. if (obj === null || typeof obj === 'undefined') {
  2520. return;
  2521. }
  2522. // Force an array if not already something iterable
  2523. if (typeof obj !== 'object') {
  2524. /*eslint no-param-reassign:0*/
  2525. obj = [obj];
  2526. }
  2527. if (isArray(obj)) {
  2528. // Iterate over array values
  2529. for (var i = 0, l = obj.length; i < l; i++) {
  2530. fn.call(null, obj[i], i, obj);
  2531. }
  2532. } else {
  2533. // Iterate over object keys
  2534. for (var key in obj) {
  2535. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  2536. fn.call(null, obj[key], key, obj);
  2537. }
  2538. }
  2539. }
  2540. }
  2541. /**
  2542. * Accepts varargs expecting each argument to be an object, then
  2543. * immutably merges the properties of each object and returns result.
  2544. *
  2545. * When multiple objects contain the same key the later object in
  2546. * the arguments list will take precedence.
  2547. *
  2548. * Example:
  2549. *
  2550. * ```js
  2551. * var result = merge({foo: 123}, {foo: 456});
  2552. * console.log(result.foo); // outputs 456
  2553. * ```
  2554. *
  2555. * @param {Object} obj1 Object to merge
  2556. * @returns {Object} Result of all merge properties
  2557. */
  2558. function merge(/* obj1, obj2, obj3, ... */) {
  2559. var result = {};
  2560. function assignValue(val, key) {
  2561. if (typeof result[key] === 'object' && typeof val === 'object') {
  2562. result[key] = merge(result[key], val);
  2563. } else {
  2564. result[key] = val;
  2565. }
  2566. }
  2567. for (var i = 0, l = arguments.length; i < l; i++) {
  2568. forEach(arguments[i], assignValue);
  2569. }
  2570. return result;
  2571. }
  2572. /**
  2573. * Extends object a by mutably adding to it the properties of object b.
  2574. *
  2575. * @param {Object} a The object to be extended
  2576. * @param {Object} b The object to copy properties from
  2577. * @param {Object} thisArg The object to bind function to
  2578. * @return {Object} The resulting value of object a
  2579. */
  2580. function extend(a, b, thisArg) {
  2581. forEach(b, function assignValue(val, key) {
  2582. if (thisArg && typeof val === 'function') {
  2583. a[key] = bind(val, thisArg);
  2584. } else {
  2585. a[key] = val;
  2586. }
  2587. });
  2588. return a;
  2589. }
  2590. module.exports = {
  2591. isArray: isArray,
  2592. isArrayBuffer: isArrayBuffer,
  2593. isBuffer: isBuffer,
  2594. isFormData: isFormData,
  2595. isArrayBufferView: isArrayBufferView,
  2596. isString: isString,
  2597. isNumber: isNumber,
  2598. isObject: isObject,
  2599. isUndefined: isUndefined,
  2600. isDate: isDate,
  2601. isFile: isFile,
  2602. isBlob: isBlob,
  2603. isFunction: isFunction,
  2604. isStream: isStream,
  2605. isURLSearchParams: isURLSearchParams,
  2606. isStandardBrowserEnv: isStandardBrowserEnv,
  2607. forEach: forEach,
  2608. merge: merge,
  2609. extend: extend,
  2610. trim: trim
  2611. };
  2612. /***/ }),
  2613. /* 17 */
  2614. /***/ (function(module, exports) {
  2615. function _defineProperty(obj, key, value) {
  2616. if (key in obj) {
  2617. Object.defineProperty(obj, key, {
  2618. value: value,
  2619. enumerable: true,
  2620. configurable: true,
  2621. writable: true
  2622. });
  2623. } else {
  2624. obj[key] = value;
  2625. }
  2626. return obj;
  2627. }
  2628. module.exports = _defineProperty;
  2629. /***/ }),
  2630. /* 18 */
  2631. /***/ (function(module, exports, __webpack_require__) {
  2632. module.exports = __webpack_require__(583);
  2633. /***/ }),
  2634. /* 19 */
  2635. /***/ (function(module, exports, __webpack_require__) {
  2636. /* WEBPACK VAR INJECTION */(function(Promise) {function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  2637. try {
  2638. var info = gen[key](arg);
  2639. var value = info.value;
  2640. } catch (error) {
  2641. reject(error);
  2642. return;
  2643. }
  2644. if (info.done) {
  2645. resolve(value);
  2646. } else {
  2647. Promise.resolve(value).then(_next, _throw);
  2648. }
  2649. }
  2650. function _asyncToGenerator(fn) {
  2651. return function () {
  2652. var self = this,
  2653. args = arguments;
  2654. return new Promise(function (resolve, reject) {
  2655. var gen = fn.apply(self, args);
  2656. function _next(value) {
  2657. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  2658. }
  2659. function _throw(err) {
  2660. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  2661. }
  2662. _next(undefined);
  2663. });
  2664. };
  2665. }
  2666. module.exports = _asyncToGenerator;
  2667. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  2668. /***/ }),
  2669. /* 20 */
  2670. /***/ (function(module, exports, __webpack_require__) {
  2671. "use strict";
  2672. var _interopRequireDefault = __webpack_require__(2);
  2673. var _createClass2 = _interopRequireDefault(__webpack_require__(40));
  2674. var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(55));
  2675. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  2676. /* eslint-disable no-param-reassign, global-require, max-len */
  2677. const Event = __webpack_require__(135);
  2678. const eventNames = __webpack_require__(24);
  2679. module.exports = function EventsFactory(deps) {
  2680. if (deps === void 0) {
  2681. deps = {};
  2682. }
  2683. const logging = deps.logging || __webpack_require__(1)('Events');
  2684. const Events = {};
  2685. /**
  2686. * The Event object defines the basic OpenTok event object that is passed to
  2687. * event listeners. Other OpenTok event classes implement the properties and methods of
  2688. * the Event object.</p>
  2689. *
  2690. * <p>For example, the Stream object dispatches a <code>streamPropertyChanged</code> event when
  2691. * the stream's properties are updated. You add a callback for an event using the
  2692. * <code>on()</code> method of the Stream object:</p>
  2693. *
  2694. * <pre>
  2695. * stream.on("streamPropertyChanged", function (event) {
  2696. * alert("Properties changed for stream " + event.target.streamId);
  2697. * });</pre>
  2698. *
  2699. * @class Event
  2700. * @property {Boolean} cancelable Whether the event has a default behavior that is cancelable
  2701. * (<code>true</code>) or not (<code>false</code>). You can cancel the default behavior by
  2702. * calling the <code>preventDefault()</code> method of the Event object in the callback
  2703. * function. (See <a href="#preventDefault">preventDefault()</a>.)
  2704. *
  2705. * @property {Object} target The object that dispatched the event.
  2706. *
  2707. * @property {String} type The type of event.
  2708. */
  2709. /**
  2710. * Prevents the default behavior associated with the event from taking place.
  2711. *
  2712. * <p>To see whether an event has a default behavior, check the <code>cancelable</code> property
  2713. * of the event object. </p>
  2714. *
  2715. * <p>Call the <code>preventDefault()</code> method in the callback function for the event.</p>
  2716. *
  2717. * <p>The following events have default behaviors:</p>
  2718. *
  2719. * <ul>
  2720. *
  2721. * <li><code>sessionDisconnect</code> &#151; See
  2722. * <a href="SessionDisconnectEvent.html#preventDefault">
  2723. * SessionDisconnectEvent.preventDefault()</a>.</li>
  2724. *
  2725. * <li><code>streamDestroyed</code> &#151; See <a href="StreamEvent.html#preventDefault">
  2726. * StreamEvent.preventDefault()</a>.</li>
  2727. *
  2728. * <li><code>accessDialogOpened</code> &#151; See the
  2729. * <a href="Publisher.html#event:accessDialogOpened">accessDialogOpened event</a>.</li>
  2730. *
  2731. * <li><code>accessDenied</code> &#151; See the <a href="Publisher.html#event:accessDenied">
  2732. * accessDenied event</a>.</li>
  2733. *
  2734. * </ul>
  2735. *
  2736. * @method #preventDefault
  2737. * @memberof Event
  2738. */
  2739. /**
  2740. * Whether the default event behavior has been prevented via a call to
  2741. * <code>preventDefault()</code> (<code>true</code>) or not (<code>false</code>).
  2742. * See <a href="#preventDefault">preventDefault()</a>.
  2743. * @method #isDefaultPrevented
  2744. * @return {Boolean}
  2745. * @memberof Event
  2746. */
  2747. /**
  2748. * The {@link OT} class dispatches <code>exception</code> events when the OpenTok API encounters
  2749. * an exception (error). The ExceptionEvent object defines the properties of the event
  2750. * object that is dispatched.
  2751. *
  2752. * <p>Note that you set up a callback for the <code>exception</code> event by calling the
  2753. * <code>OT.on()</code> method.</p>
  2754. *
  2755. * @class ExceptionEvent
  2756. * @property {Number} code The error code. The following is a list of error codes:</p>
  2757. *
  2758. * <table class="docs_table">
  2759. * <tbody><tr>
  2760. * <td>
  2761. * <b>code</b>
  2762. *
  2763. * </td>
  2764. * <td>
  2765. * <b>title</b>
  2766. * </td>
  2767. * </tr>
  2768. *
  2769. * <tr>
  2770. * <td>
  2771. * 1004
  2772. *
  2773. * </td>
  2774. * <td>
  2775. * Authentication error
  2776. * </td>
  2777. * </tr>
  2778. *
  2779. * <tr>
  2780. * <td>
  2781. * 1005
  2782. *
  2783. * </td>
  2784. * <td>
  2785. * Invalid Session ID
  2786. * </td>
  2787. * </tr>
  2788. * <tr>
  2789. * <td>
  2790. * 1006
  2791. *
  2792. * </td>
  2793. * <td>
  2794. * Connect Failed
  2795. * </td>
  2796. * </tr>
  2797. * <tr>
  2798. * <td>
  2799. * 1007
  2800. *
  2801. * </td>
  2802. * <td>
  2803. * Connect Rejected
  2804. * </td>
  2805. * </tr>
  2806. * <tr>
  2807. * <td>
  2808. * 1008
  2809. *
  2810. * </td>
  2811. * <td>
  2812. * Connect Time-out
  2813. * </td>
  2814. * </tr>
  2815. * <tr>
  2816. * <td>
  2817. * 1009
  2818. *
  2819. * </td>
  2820. * <td>
  2821. * Security Error
  2822. * </td>
  2823. * </tr>
  2824. * <tr>
  2825. * <td>
  2826. * 1010
  2827. *
  2828. * </td>
  2829. * <td>
  2830. * Not Connected
  2831. * </td>
  2832. * </tr>
  2833. * <tr>
  2834. * <td>
  2835. * 1011
  2836. *
  2837. * </td>
  2838. * <td>
  2839. * Invalid Parameter
  2840. * </td>
  2841. * </tr>
  2842. * <tr>
  2843. * <td>
  2844. * 1013
  2845. * </td>
  2846. * <td>
  2847. * Connection Failed
  2848. * </td>
  2849. * </tr>
  2850. * <tr>
  2851. * <td>
  2852. * 1014
  2853. * </td>
  2854. * <td>
  2855. * API Response Failure
  2856. * </td>
  2857. * </tr>
  2858. * <tr>
  2859. * <td>
  2860. * 1026
  2861. * </td>
  2862. * <td>
  2863. * Terms of Service Violation: Export Compliance
  2864. * </td>
  2865. * </tr>
  2866. * <tr>
  2867. * <td>
  2868. * 1500
  2869. * </td>
  2870. * <td>
  2871. * Unable to Publish
  2872. * </td>
  2873. * </tr>
  2874. *
  2875. * <tr>
  2876. * <td>
  2877. * 1520
  2878. * </td>
  2879. * <td>
  2880. * Unable to Force Disconnect
  2881. * </td>
  2882. * </tr>
  2883. *
  2884. * <tr>
  2885. * <td>
  2886. * 1530
  2887. * </td>
  2888. * <td>
  2889. * Unable to Force Unpublish
  2890. * </td>
  2891. * </tr>
  2892. * <tr>
  2893. * <td>
  2894. * 1535
  2895. * </td>
  2896. * <td>
  2897. * Force Unpublish on Invalid Stream
  2898. * </td>
  2899. * </tr>
  2900. *
  2901. * <tr>
  2902. * <td>
  2903. * 2000
  2904. *
  2905. * </td>
  2906. * <td>
  2907. * Internal Error
  2908. * </td>
  2909. * </tr>
  2910. *
  2911. * <tr>
  2912. * <td>
  2913. * 2010
  2914. *
  2915. * </td>
  2916. * <td>
  2917. * Report Issue Failure
  2918. * </td>
  2919. * </tr>
  2920. *
  2921. *
  2922. * </tbody></table>
  2923. *
  2924. * <p>Check the <code>message</code> property for more details about the error.</p>
  2925. *
  2926. * @property {String} message The error message.
  2927. *
  2928. * @property {Object} target The object that the event pertains to. For an
  2929. * <code>exception</code> event, this will be an object other than the OT object
  2930. * (such as a Session object or a Publisher object).
  2931. *
  2932. * @property {String} title The error title.
  2933. * @augments Event
  2934. */
  2935. Events.ExceptionEvent = function ExceptionEvent(type, message, title, code, component, target, error) {
  2936. return new Event(type, false, {
  2937. error,
  2938. message,
  2939. title,
  2940. code,
  2941. component,
  2942. target
  2943. });
  2944. };
  2945. Events.IssueReportedEvent = function IssueReportedEvent(type, issueId) {
  2946. return new Event(type, false, {
  2947. issueId
  2948. });
  2949. }; // Triggered when the JS dynamic config and the DOM have loaded.
  2950. Events.EnvLoadedEvent = function EnvLoadedEvent(type) {
  2951. return new Event(type, false);
  2952. };
  2953. /**
  2954. * Defines <code>connectionCreated</code> and <code>connectionDestroyed</code> events dispatched
  2955. * by the {@link Session} object.
  2956. * <p>
  2957. * The Session object dispatches a <code>connectionCreated</code> event when a client (including
  2958. * your own) connects to a Session. It also dispatches a <code>connectionCreated</code> event for
  2959. * every client in the session when you first connect. (when your local client connects, the
  2960. * Session object also dispatches a <code>sessionConnected</code> event, defined by the
  2961. * {@link SessionConnectEvent} class.)
  2962. * <p>
  2963. * While you are connected to the session, the Session object dispatches a
  2964. * <code>connectionDestroyed</code> event when another client disconnects from the Session.
  2965. * (When you disconnect, the Session object also dispatches a <code>sessionDisconnected</code>
  2966. * event, defined by the {@link SessionDisconnectEvent} class.)
  2967. *
  2968. * <h5><a name="example"></a>Example</h5>
  2969. *
  2970. * <p>The following code keeps a running total of the number of connections to a session
  2971. * by monitoring the <code>connections</code> property of the <code>sessionConnect</code>,
  2972. * <code>connectionCreated</code> and <code>connectionDestroyed</code> events:</p>
  2973. *
  2974. * <pre>var apiKey = ""; // Replace with your API key. See https://tokbox.com/account
  2975. * var sessionID = ""; // Replace with your own session ID.
  2976. * // See https://tokbox.com/developer/guides/create-session/.
  2977. * var token = ""; // Replace with a generated token that has been assigned the moderator role.
  2978. * // See https://tokbox.com/developer/guides/create-token/.
  2979. * var connectionCount = 0;
  2980. *
  2981. * var session = OT.initSession(apiKey, sessionID);
  2982. * session.on("connectionCreated", function(event) {
  2983. * connectionCount++;
  2984. * displayConnectionCount();
  2985. * });
  2986. * session.on("connectionDestroyed", function(event) {
  2987. * connectionCount--;
  2988. * displayConnectionCount();
  2989. * });
  2990. * session.connect(token);
  2991. *
  2992. * function displayConnectionCount() {
  2993. * document.getElementById("connectionCountField").value = connectionCount.toString();
  2994. * }</pre>
  2995. *
  2996. * <p>This example assumes that there is an input text field in the HTML DOM
  2997. * with the <code>id</code> set to <code>"connectionCountField"</code>:</p>
  2998. *
  2999. * <pre>&lt;input type="text" id="connectionCountField" value="0"&gt;&lt;/input&gt;</pre>
  3000. *
  3001. *
  3002. * @property {Connection} connection A Connection object for the connection that was
  3003. * created or deleted.
  3004. *
  3005. * @property {Array} connections Deprecated. Use the <code>connection</code> property. A
  3006. * <code>connectionCreated</code> or <code>connectionDestroyed</code> event is dispatched
  3007. * for each connection created and destroyed in the session.
  3008. *
  3009. * @property {String} reason For a <code>connectionDestroyed</code> event,
  3010. * a description of why the connection ended. This property can have the following values:
  3011. * </p>
  3012. * <ul>
  3013. * <li><code>"clientDisconnected"</code> &#151; A client disconnected from the session by calling
  3014. * the <code>disconnect()</code> method of the Session object or by closing the browser.
  3015. * (See <a href="Session.html#disconnect">Session.disconnect()</a>.)</li>
  3016. *
  3017. * <li><code>"forceDisconnected"</code> &#151; A moderator has disconnected the publisher
  3018. * from the session, by calling the <code>forceDisconnect()</code> method of the Session
  3019. * object. (See <a href="Session.html#forceDisconnect">Session.forceDisconnect()</a>.)</li>
  3020. *
  3021. * <li><code>"networkDisconnected"</code> &#151; The network connection terminated abruptly
  3022. * (for example, the client lost their internet connection).</li>
  3023. * </ul>
  3024. *
  3025. * <p>Depending on the context, this description may allow the developer to refine
  3026. * the course of action they take in response to an event.</p>
  3027. *
  3028. * <p>For a <code>connectionCreated</code> event, this string is undefined.</p>
  3029. *
  3030. * @class ConnectionEvent
  3031. * @augments Event
  3032. */
  3033. let connectionEventPluralDeprecationWarningShown = false;
  3034. Events.ConnectionEvent = /*#__PURE__*/function (_Event) {
  3035. (0, _inheritsLoose2.default)(ConnectionEvent, _Event);
  3036. function ConnectionEvent(type, connection, reason) {
  3037. return _Event.call(this, type, false, {
  3038. connection,
  3039. reason
  3040. }) || this;
  3041. }
  3042. (0, _createClass2.default)(ConnectionEvent, [{
  3043. key: "connections",
  3044. get: function get() {
  3045. if (!connectionEventPluralDeprecationWarningShown) {
  3046. logging.warn('OT.ConnectionEvent connections property is deprecated, ' + 'use connection instead.');
  3047. connectionEventPluralDeprecationWarningShown = true;
  3048. }
  3049. return [this.connection];
  3050. }
  3051. }]);
  3052. return ConnectionEvent;
  3053. }(Event);
  3054. /**
  3055. * StreamEvent is an event that can have the type "streamCreated" or "streamDestroyed".
  3056. * These events are dispatched by the Session object when another client starts or
  3057. * stops publishing a stream to a {@link Session}. For a local client's stream, the
  3058. * Publisher object dispatches the event.
  3059. *
  3060. * <h4><a name="example_streamCreated"></a>Example &#151; streamCreated event dispatched
  3061. * by the Session object</h4>
  3062. * <p>The following code initializes a session and sets up an event listener for when
  3063. * a stream published by another client is created:</p>
  3064. *
  3065. * <pre>
  3066. * session.on("streamCreated", function(event) {
  3067. * // streamContainer is a DOM element
  3068. * subscriber = session.subscribe(event.stream, targetElement);
  3069. * }).connect(token);
  3070. * </pre>
  3071. *
  3072. * <h4><a name="example_streamDestroyed"></a>Example &#151; streamDestroyed event dispatched
  3073. * by the Session object</h4>
  3074. *
  3075. * <p>The following code initializes a session and sets up an event listener for when
  3076. * other clients' streams end:</p>
  3077. *
  3078. * <pre>
  3079. * session.on("streamDestroyed", function(event) {
  3080. * console.log("Stream " + event.stream.name + " ended. " + event.reason);
  3081. * }).connect(token);
  3082. * </pre>
  3083. *
  3084. * <h4><a name="example_streamCreated_publisher"></a>Example &#151; streamCreated event dispatched
  3085. * by a Publisher object</h4>
  3086. * <p>The following code publishes a stream and adds an event listener for when the streaming
  3087. * starts</p>
  3088. *
  3089. * <pre>
  3090. * var publisher = session.publish(targetElement)
  3091. * .on("streamCreated", function(event) {
  3092. * console.log("Publisher started streaming.");
  3093. * );
  3094. * </pre>
  3095. *
  3096. * <h4><a name="example_streamDestroyed_publisher"></a>Example &#151; streamDestroyed event
  3097. * dispatched by a Publisher object</h4>
  3098. *
  3099. * <p>The following code publishes a stream, and leaves the Publisher in the HTML DOM
  3100. * when the streaming stops:</p>
  3101. *
  3102. * <pre>
  3103. * var publisher = session.publish(targetElement)
  3104. * .on("streamDestroyed", function(event) {
  3105. * event.preventDefault();
  3106. * console.log("Publisher stopped streaming.");
  3107. * );
  3108. * </pre>
  3109. *
  3110. * @class StreamEvent
  3111. *
  3112. * @property {Boolean} cancelable Whether the event has a default behavior that is cancelable
  3113. * (<code>true</code>) or not (<code>false</code>). You can cancel the default behavior by
  3114. * calling the <code>preventDefault()</code> method of the StreamEvent object in the event
  3115. * listener function. The <code>streamDestroyed</code> event is cancelable.
  3116. * (See <a href="#preventDefault">preventDefault()</a>.)
  3117. *
  3118. * @property {String} reason For a <code>streamDestroyed</code> event,
  3119. * a description of why the session disconnected. This property can have one of the following
  3120. * values:
  3121. * </p>
  3122. * <ul>
  3123. * <li><code>"clientDisconnected"</code> &#151; A client disconnected from the session by calling
  3124. * the <code>disconnect()</code> method of the Session object or by closing the browser.
  3125. * (See <a href="Session.html#disconnect">Session.disconnect()</a>.)</li>
  3126. *
  3127. * <li><code>"forceDisconnected"</code> &#151; A moderator has disconnected the publisher of the
  3128. * stream from the session, by calling the <code>forceDisconnect()</code> method of the Session
  3129. * object. (See <a href="Session.html#forceDisconnect">Session.forceDisconnect()</a>.)</li>
  3130. *
  3131. * <li><code>"forceUnpublished"</code> &#151; A moderator has forced the publisher of the stream
  3132. * to stop publishing the stream, by calling the <code>forceUnpublish()</code> method of the
  3133. * Session object.
  3134. * (See <a href="Session.html#forceUnpublish">Session.forceUnpublish()</a>.)</li>
  3135. *
  3136. * <li><code>"mediaStopped"</code> &#151; The user publishing the stream has stopped sharing
  3137. * media. For example, the user closed the window that is a source for a screen-sharing
  3138. * stream. Or the user disconnected a microphone that was the audio source for an audio-only
  3139. * stream. Or the video and audio sources are MediaStreamTrack elements and the sources of
  3140. * the media are stopped or destroyed.</li>
  3141. *
  3142. * <li><code>"networkDisconnected"</code> &#151; The network connection terminated abruptly (for
  3143. * example, the client lost their internet connection).</li>
  3144. *
  3145. * </ul>
  3146. *
  3147. * <p>Depending on the context, this description may allow the developer to refine
  3148. * the course of action they take in response to an event.</p>
  3149. *
  3150. * <p>For a <code>streamCreated</code> event, this string is undefined.</p>
  3151. *
  3152. * @property {Stream} stream A Stream object corresponding to the stream that was added (in the
  3153. * case of a <code>streamCreated</code> event) or deleted (in the case of a
  3154. * <code>streamDestroyed</code> event).
  3155. *
  3156. * @property {Array} streams Deprecated. Use the <code>stream</code> property. A
  3157. * <code>streamCreated</code> or <code>streamDestroyed</code> event is dispatched for
  3158. * each stream added or destroyed.
  3159. *
  3160. * @augments Event
  3161. */
  3162. let streamEventPluralDeprecationWarningShown = false;
  3163. Events.StreamEvent = /*#__PURE__*/function (_Event2) {
  3164. (0, _inheritsLoose2.default)(StreamEvent, _Event2);
  3165. function StreamEvent(type, stream, reason, cancelable) {
  3166. return _Event2.call(this, type, cancelable, {
  3167. stream,
  3168. reason
  3169. }) || this;
  3170. }
  3171. (0, _createClass2.default)(StreamEvent, [{
  3172. key: "streams",
  3173. get: function get() {
  3174. if (!streamEventPluralDeprecationWarningShown) {
  3175. logging.warn('OT.StreamEvent streams property is deprecated, use stream instead.');
  3176. streamEventPluralDeprecationWarningShown = true;
  3177. }
  3178. return [this.stream];
  3179. }
  3180. }]);
  3181. return StreamEvent;
  3182. }(Event);
  3183. /**
  3184. * Prevents the default behavior associated with the event from taking place.
  3185. *
  3186. * <p>For the <code>streamDestroyed</code> event dispatched by the Session object,
  3187. * the default behavior is that all Subscriber objects that are subscribed to the stream are
  3188. * unsubscribed and removed from the HTML DOM. Each Subscriber object dispatches a
  3189. * <code>destroyed</code> event when the element is removed from the HTML DOM. If you call the
  3190. * <code>preventDefault()</code> method in the event listener for the <code>streamDestroyed</code>
  3191. * event, the default behavior is prevented and you can clean up Subscriber objects using your
  3192. * own code. See
  3193. * <a href="Session.html#getSubscribersForStream">Session.getSubscribersForStream()</a>.</p>
  3194. * <p>
  3195. * For the <code>streamDestroyed</code> event dispatched by a Publisher object, the default
  3196. * behavior is that the Publisher object is removed from the HTML DOM. The Publisher object
  3197. * dispatches a <code>destroyed</code> event when the element is removed from the HTML DOM.
  3198. * If you call the <code>preventDefault()</code> method in the event listener for the
  3199. * <code>streamDestroyed</code> event, the default behavior is prevented, and you can
  3200. * retain the Publisher for reuse or clean it up using your own code.
  3201. *</p>
  3202. * <p>To see whether an event has a default behavior, check the <code>cancelable</code> property of
  3203. * the event object. </p>
  3204. *
  3205. * <p>
  3206. * Call the <code>preventDefault()</code> method in the event listener function for the event.
  3207. * </p>
  3208. *
  3209. * @method #preventDefault
  3210. * @memberof StreamEvent
  3211. */
  3212. /**
  3213. * The Session object dispatches SessionConnectEvent object when a session has successfully
  3214. * connected in response to a call to the <code>connect()</code> method of the Session object.
  3215. * <p>
  3216. * In version 2.2, the completionHandler of the <code>Session.connect()</code> method
  3217. * indicates success or failure in connecting to the session.
  3218. *
  3219. * @class SessionConnectEvent
  3220. * @property {Array} connections Deprecated in version 2.2 (and set to an empty array). In
  3221. * version 2.2, listen for the <code>connectionCreated</code> event dispatched by the Session
  3222. * object. In version 2.2, the Session object dispatches a <code>connectionCreated</code> event
  3223. * for each connection (including your own). This includes connections present when you first
  3224. * connect to the session.
  3225. *
  3226. * @property {Array} streams Deprecated in version 2.2 (and set to an empty array). In version
  3227. * 2.2, listen for the <code>streamCreated</code> event dispatched by the Session object. In
  3228. * version 2.2, the Session object dispatches a <code>streamCreated</code> event for each stream
  3229. * other than those published by your client. This includes streams
  3230. * present when you first connect to the session.
  3231. *
  3232. * @see <a href="Session.html#connect">Session.connect()</a></p>
  3233. * @augments Event
  3234. */
  3235. let sessionConnectedConnectionsDeprecationWarningShown = false;
  3236. let sessionConnectedStreamsDeprecationWarningShown = false;
  3237. let sessionConnectedArchivesDeprecationWarningShown = false;
  3238. Events.SessionConnectEvent = /*#__PURE__*/function (_Event3) {
  3239. (0, _inheritsLoose2.default)(SessionConnectEvent, _Event3);
  3240. function SessionConnectEvent(type) {
  3241. return _Event3.call(this, type, false) || this;
  3242. } // eslint-disable-next-line class-methods-use-this
  3243. (0, _createClass2.default)(SessionConnectEvent, [{
  3244. key: "connections",
  3245. get: function get() {
  3246. if (!sessionConnectedConnectionsDeprecationWarningShown) {
  3247. logging.warn('OT.SessionConnectedEvent no longer includes connections. Listen ' + 'for connectionCreated events instead.');
  3248. sessionConnectedConnectionsDeprecationWarningShown = true;
  3249. }
  3250. return [];
  3251. } // eslint-disable-next-line class-methods-use-this
  3252. }, {
  3253. key: "streams",
  3254. get: function get() {
  3255. if (!sessionConnectedStreamsDeprecationWarningShown) {
  3256. logging.warn('OT.SessionConnectedEvent no longer includes streams. Listen for ' + 'streamCreated events instead.');
  3257. sessionConnectedStreamsDeprecationWarningShown = true;
  3258. }
  3259. return [];
  3260. } // eslint-disable-next-line class-methods-use-this
  3261. }, {
  3262. key: "archives",
  3263. get: function get() {
  3264. if (!sessionConnectedArchivesDeprecationWarningShown) {
  3265. logging.warn('OT.SessionConnectedEvent no longer includes archives. Listen for ' + 'archiveStarted events instead.');
  3266. sessionConnectedArchivesDeprecationWarningShown = true;
  3267. }
  3268. return [];
  3269. }
  3270. }]);
  3271. return SessionConnectEvent;
  3272. }(Event);
  3273. Events.SessionReconnectingEvent = function SessionReconnectedEvent() {
  3274. return new Event(eventNames.SESSION_RECONNECTING, false);
  3275. };
  3276. Events.SessionReconnectedEvent = function SessionReconnectedEvent() {
  3277. return new Event(eventNames.SESSION_RECONNECTED);
  3278. };
  3279. /**
  3280. * The Session object dispatches SessionDisconnectEvent object when a session has disconnected.
  3281. * This event may be dispatched asynchronously in response to a successful call to the
  3282. * <code>disconnect()</code> method of the session object.
  3283. *
  3284. * <h4>
  3285. * <a href="example"></a>Example
  3286. * </h4>
  3287. * <p>
  3288. * The following code initializes a session and sets up an event listener for when a session is
  3289. * disconnected.
  3290. * </p>
  3291. * <pre>var apiKey = ""; // Replace with your API key. See https://tokbox.com/account
  3292. * var sessionID = ""; // Replace with your own session ID.
  3293. * // See https://tokbox.com/developer/guides/create-session/
  3294. * var token = ""; // Replace with a generated token that has been assigned the moderator role.
  3295. * // See https://tokbox.com/developer/guides/create-token/
  3296. *
  3297. * var session = OT.initSession(apiKey, sessionID);
  3298. * session.on("sessionDisconnected", function(event) {
  3299. * alert("The session disconnected. " + event.reason);
  3300. * });
  3301. * session.connect(token);
  3302. * </pre>
  3303. *
  3304. * @property {String} reason A description of why the session disconnected.
  3305. * This property can have the following values:
  3306. * </p>
  3307. * <ul>
  3308. * <li>
  3309. * <code>"clientDisconnected"</code> &mdash; A client disconnected from the
  3310. * session by calling the <code>disconnect()</code> method of the Session
  3311. * object or by closing the browser. ( See <a href=
  3312. * "Session.html#disconnect">Session.disconnect()</a>.)
  3313. * </li>
  3314. *
  3315. * <li>
  3316. * <code>"forceDisconnected"</code> &mdash; A moderator has disconnected you from
  3317. * the session by calling the <code>forceDisconnect()</code> method of the
  3318. * Session object. (See <a href=
  3319. * "Session.html#forceDisconnect">Session.forceDisconnect()</a>.)
  3320. * </li>
  3321. *
  3322. * <li><code>"networkDisconnected"</code> &mdash; The network connection terminated
  3323. * abruptly (for example, the client lost its internet connection).
  3324. * <p>
  3325. * Prior to dispatching a
  3326. * <code>sessionDisconnected</code> event for this reason, the Session object dispatches a
  3327. * <code>reconnecting</code> event, and the client attempts to reconnect to the OpenTok session.
  3328. * If the reconnection fails, the Session object dispatches a <code>sessionDisconnected</code>
  3329. * event with the <code>reason</code> property set to <code>"networkDisconnected"</code>.
  3330. * </ul>
  3331. * <ul>
  3332. *
  3333. * @class SessionDisconnectEvent
  3334. * @augments Event
  3335. */
  3336. Events.SessionDisconnectEvent = function SessionDisconnectEvent(type, reason, cancelable) {
  3337. return new Event(type, cancelable, {
  3338. reason
  3339. });
  3340. };
  3341. /**
  3342. * Prevents the default behavior associated with the event from taking place.
  3343. *
  3344. * <p>
  3345. * For the <code>sessionDisconnectEvent</code>, the default behavior is that all
  3346. * Subscriber objects are unsubscribed and removed from the HTML DOM. Each
  3347. * Subscriber object dispatches a <code>destroyed</code> event when the element
  3348. * is removed from the HTML DOM. If you call the <code>preventDefault()</code>
  3349. * method in the event listener for the <code>sessionDisconnect</code> event,
  3350. * the default behavior is prevented, and you can, optionally, clean up
  3351. * Subscriber objects using your own code).
  3352. * </p>
  3353. * <p>
  3354. * To see whether an event has a default behavior, check the
  3355. * <code>cancelable</code> property of the event object.
  3356. * </p>
  3357. * <p>
  3358. * Call the <code>preventDefault()</code> method in the event listener function
  3359. * for the event.
  3360. * </p>
  3361. *
  3362. * @method #preventDefault
  3363. * @memberof SessionDisconnectEvent
  3364. */
  3365. /**
  3366. * The Session object dispatches a <code>streamPropertyChanged</code> event in the
  3367. * following circumstances:
  3368. *
  3369. * <ul>
  3370. * <li> A stream has started or stopped publishing audio or video (see
  3371. * <a href="Publisher.html#publishAudio">Publisher.publishAudio()</a> and
  3372. * <a href="Publisher.html#publishVideo">Publisher.publishVideo()</a>).
  3373. * This change results from a call to the <code>publishAudio()</code> or
  3374. * <code>publishVideo()</code> methods of the Publish object. Note that a
  3375. * subscriber's video can be disabled or enabled for reasons other than the
  3376. * publisher disabling or enabling it. A Subscriber object dispatches
  3377. * <code>videoDisabled</code> and <code>videoEnabled</code> events in all
  3378. * conditions that cause the subscriber's stream to be disabled or enabled.
  3379. * </li>
  3380. * <li> The <code>videoDimensions</code> property of the Stream object has
  3381. * changed (see <a href="Stream.html#properties">Stream.videoDimensions</a>).
  3382. * </li>
  3383. * <li> The <code>videoType</code> property of the Stream object has changed.
  3384. * This can happen in a stream published by a mobile device. (See
  3385. * <a href="Stream.html#properties">Stream.videoType</a>.)
  3386. * </li>
  3387. * </ul>
  3388. *
  3389. * @class StreamPropertyChangedEvent
  3390. * @property {String} changedProperty The property of the stream that changed. This value
  3391. * is either <code>"hasAudio"</code>, <code>"hasVideo"</code>, or <code>"videoDimensions"</code>.
  3392. * @property {Object} newValue The new value of the property (after the change).
  3393. * @property {Object} oldValue The old value of the property (before the change).
  3394. * @property {Stream} stream The Stream object for which a property has changed.
  3395. *
  3396. * @see <a href="Publisher.html#publishAudio">Publisher.publishAudio()</a></p>
  3397. * @see <a href="Publisher.html#publishVideo">Publisher.publishVideo()</a></p>
  3398. * @see <a href="Stream.html#properties">Stream.videoDimensions</a></p>
  3399. * @augments Event
  3400. */
  3401. Events.StreamPropertyChangedEvent = function StreamPropertyChangedEvent(type, stream, changedProperty, oldValue, newValue) {
  3402. return new Event(type, false, {
  3403. stream,
  3404. changedProperty,
  3405. oldValue,
  3406. newValue
  3407. });
  3408. };
  3409. /**
  3410. * Dispatched when the video dimensions of the video change for a screen-sharing
  3411. * video stream (when the user resizes the window being captured).
  3412. *
  3413. * @class VideoDimensionsChangedEvent
  3414. * @property {Object} newValue The new video dimensions (after the change). This object has two
  3415. * properties: <code>height</code> (the height, in pixels) and <code>width</code> (the width,
  3416. * in pixels).
  3417. * @property {Object} oldValue The old video dimensions (before the change). This object has two
  3418. * properties: <code>height</code> (the old height, in pixels) and <code>width</code> (the old
  3419. * width, in pixels).
  3420. *
  3421. * @see <a href="Publisher.html#event:videoDimensionsChanged">Publisher videoDimensionsChanged
  3422. * event</a>
  3423. * @see <a href="Subscriber.html#event:videoDimensionsChanged">Subscriber videoDimensionsChanged
  3424. * event</a>
  3425. * @augments Event
  3426. */
  3427. Events.VideoDimensionsChangedEvent = function VideoDimensionsChangedEvent(target, oldValue, newValue) {
  3428. return new Event('videoDimensionsChanged', false, {
  3429. target,
  3430. oldValue,
  3431. newValue
  3432. });
  3433. };
  3434. /**
  3435. * Defines event objects for the <code>archiveStarted</code> and <code>archiveStopped</code>
  3436. * events. The Session object dispatches these events when an archive recording of the session
  3437. * starts and stops.
  3438. *
  3439. * @property {String} id The archive ID.
  3440. * @property {String} name The name of the archive. You can assign an archive a name when you
  3441. * create it, using the <a href="http://www.tokbox.com/opentok/api">OpenTok REST API</a> or one
  3442. * of the <a href="http://www.tokbox.com/opentok/libraries/server">OpenTok server SDKs</a>.
  3443. *
  3444. * @class ArchiveEvent
  3445. * @augments Event
  3446. */
  3447. Events.ArchiveEvent = function ArchiveEvent(type, archive) {
  3448. return new Event(type, false, {
  3449. id: archive.id,
  3450. name: archive.name,
  3451. status: archive.status,
  3452. archive
  3453. });
  3454. };
  3455. Events.ArchiveUpdatedEvent = function ArchiveUpdatedEvent(stream, key, oldValue, newValue) {
  3456. return new Event('updated', false, {
  3457. target: stream,
  3458. changedProperty: key,
  3459. oldValue,
  3460. newValue
  3461. });
  3462. };
  3463. /**
  3464. * The Session object dispatches a signal event when the client receives a signal from the
  3465. * session.
  3466. *
  3467. * @class SignalEvent
  3468. * @property {String} type The type assigned to the signal (if there is one). Use the type to
  3469. * filter signals received (by adding an event handler for signal:type1 or signal:type2, etc.)
  3470. * @property {String} data The data string sent with the signal (if there is one).
  3471. * @property {Connection} from The Connection corresponding to the client that sent the
  3472. * signal.
  3473. *
  3474. * @see <a href="Session.html#signal">Session.signal()</a></p>
  3475. * @see <a href="Session.html#events">Session events (signal and signal:type)</a></p>
  3476. * @augments Event
  3477. */
  3478. Events.SignalEvent = function SignalEvent(type, data, from) {
  3479. return new Event(type ? "signal:" + type : eventNames.SIGNAL, false, {
  3480. data,
  3481. from
  3482. });
  3483. };
  3484. Events.StreamUpdatedEvent = function StreamUpdatedEvent(stream, key, oldValue, newValue) {
  3485. return new Event('updated', false, {
  3486. target: stream,
  3487. changedProperty: key,
  3488. oldValue,
  3489. newValue
  3490. });
  3491. };
  3492. Events.DestroyedEvent = function DestroyedEvent(type, target, reason) {
  3493. return new Event(type, false, {
  3494. target,
  3495. reason
  3496. });
  3497. };
  3498. Events.ConnectionStateChangedEvent = function ConnectionStateChangedEvent(type, target) {
  3499. return new Event(type, false, {
  3500. target
  3501. });
  3502. };
  3503. /**
  3504. * Defines the event object for the <code>videoDisabled</code> and <code>videoEnabled</code>
  3505. * events dispatched by the Subscriber.
  3506. *
  3507. * @class VideoEnabledChangedEvent
  3508. *
  3509. * @property {Boolean} cancelable Whether the event has a default behavior that is cancelable
  3510. * (<code>true</code>) or not (<code>false</code>). You can cancel the default behavior by
  3511. * calling the <code>preventDefault()</code> method of the event object in the callback
  3512. * function. (See <a href="#preventDefault">preventDefault()</a>.)
  3513. *
  3514. * @property {String} reason The reason the video was disabled or enabled. This can be set to one
  3515. * of the following values:
  3516. *
  3517. * <ul>
  3518. *
  3519. * <li><code>"publishVideo"</code> &mdash; The publisher started or stopped publishing video,
  3520. * by calling <code>publishVideo(true)</code> or <code>publishVideo(false)</code>.</li>
  3521. *
  3522. * <li><code>"quality"</code> &mdash; The OpenTok Media Router starts or stops sending video
  3523. * to the subscriber based on stream quality changes. This feature of the OpenTok Media
  3524. * Router has a subscriber drop the video stream when connectivity degrades. (The subscriber
  3525. * continues to receive the audio stream, if there is one.)
  3526. * <p>
  3527. * If connectivity improves to support video again, the Subscriber object dispatches
  3528. * a <code>videoEnabled</code> event, and the Subscriber resumes receiving video.
  3529. * <p>
  3530. * By default, the Subscriber displays a video disabled indicator when a
  3531. * <code>videoDisabled</code> event with this reason is dispatched and removes the indicator
  3532. * when the <code>videoEnabled</code> event with this reason is dispatched. You can control
  3533. * the display of this icon by calling the <code>setStyle()</code> method of the Subscriber,
  3534. * setting the <code>videoDisabledDisplayMode</code> property(or you can set the style when
  3535. * calling the <code>Session.subscribe()</code> method, setting the <code>style</code> property
  3536. * of the <code>properties</code> parameter).
  3537. * <p>
  3538. * This feature is only available in sessions that use the OpenTok Media Router (sessions with
  3539. * the <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
  3540. * set to routed), not in sessions with the media mode set to relayed.
  3541. * </li>
  3542. *
  3543. * <li><code>"subscribeToVideo"</code> &mdash; The subscriber started or stopped subscribing to
  3544. * video, by calling <code>subscribeToVideo(true)</code> or
  3545. * <code>subscribeToVideo(false)</code>.</li>
  3546. *
  3547. * <li><code>"codecNotSupported"</code> &mdash; The subscriber stopped subscribing to video due
  3548. * to an incompatible codec.</li>
  3549. *
  3550. * <li><code>"codecChanged"</code> &mdash; The subscriber video was enabled after a codec change
  3551. * from an incompatible codec.</li>
  3552. *
  3553. * </ul>
  3554. *
  3555. * @property {Object} target The object that dispatched the event.
  3556. *
  3557. * @property {String} type The type of event: <code>"videoDisabled"</code> or
  3558. * <code>"videoEnabled"</code>.
  3559. *
  3560. * @see <a href="Subscriber.html#event:videoDisabled">Subscriber videoDisabled event</a></p>
  3561. * @see <a href="Subscriber.html#event:videoEnabled">Subscriber videoEnabled event</a></p>
  3562. * @augments Event
  3563. */
  3564. Events.VideoEnabledChangedEvent = function VideoEnabledChangedEvent(type, properties) {
  3565. return new Event(type, false, {
  3566. reason: properties.reason
  3567. });
  3568. };
  3569. Events.VideoDisableWarningEvent = function VideoDisableWarningEvent(type
  3570. /* , properties */
  3571. ) {
  3572. return new Event(type, false);
  3573. };
  3574. /**
  3575. * Dispatched periodically by a Subscriber or Publisher object to indicate the audio
  3576. * level. This event is dispatched up to 60 times per second, depending on the browser.
  3577. *
  3578. * @property {Number} audioLevel The audio level, from 0 to 1.0. Adjust this value logarithmically
  3579. * for use in adjusting a user interface element, such as a volume meter. Use a moving average
  3580. * to smooth the data.
  3581. *
  3582. * @class AudioLevelUpdatedEvent
  3583. * @augments Event
  3584. */
  3585. Events.AudioLevelUpdatedEvent = function AudioLevelUpdatedEvent(audioLevel) {
  3586. return new Event(eventNames.AUDIO_LEVEL_UPDATED, false, {
  3587. audioLevel
  3588. });
  3589. };
  3590. /**
  3591. * Dispatched by a Publisher when the user has stopped sharing one or all media types
  3592. * (video, audio, or screen).
  3593. *
  3594. * @property {MediaStreamTrack} track The media track that has ended. This property is undefined
  3595. * if all media tracks have stopped. Check the <code>kind</code> property of this object to
  3596. * see if the track is an audio track or a video track.
  3597. *
  3598. * @class MediaStoppedEvent
  3599. * @augments Event
  3600. * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack
  3601. */
  3602. Events.MediaStoppedEvent = function MediaStoppedEvent(target, track) {
  3603. return new Event(eventNames.MEDIA_STOPPED, true, {
  3604. target,
  3605. track
  3606. });
  3607. };
  3608. /**
  3609. * Dispatched by a Subscriber or Publisher object to indicate the <code>video</code> element
  3610. * (or <code>object</code> element in Internet Explorer) was created. Add a listener for this event
  3611. * when you set the <code>insertDefaultUI</code> option to <code>false</code> in the call to the
  3612. * <a href="OT.html#initPublisher">OT.initPublisher()</a> method or the
  3613. * <a href="Session.html#subscribe">Session.subscribe()</a> method. The <code>element</code>
  3614. * property of the event object is a reference to the Publisher's <code>video</code> element
  3615. * (or the <code>object</code> element in Internet Explorer). Add it to the HTML DOM to display the
  3616. * video. (When you set the <code>insertDefaultUI</code> option to <code>false</code>, the
  3617. * <code>video</code> element is not inserted into the DOM automatically.)
  3618. * <p>
  3619. * Add a listener for this event only if you have set the <code>insertDefaultUI</code> option to
  3620. * <code>false</code>. If you have not set <code>insertDefaultUI</code> option
  3621. * to <code>false</code>, do not move the <code>video</code> element (or the <code>object</code>
  3622. * element containing the video in Internet Explorer) in the HTML DOM. Doing so causes the
  3623. * Publisher or Subscriber object to be destroyed.
  3624. *
  3625. * @property {Number} element A reference to the Publisher or Subscriber's <code>video</code>
  3626. * element (or in Internet Explorer the <code>object</code> element containing the video).
  3627. * Add it to the HTML DOM to display the video.
  3628. *
  3629. * @class VideoElementCreatedEvent
  3630. * @augments Event
  3631. */
  3632. Events.VideoElementCreatedEvent = function VideoElementCreatedEvent(element) {
  3633. return new Event(eventNames.VIDEO_ELEMENT_CREATED, false, {
  3634. element
  3635. });
  3636. };
  3637. return Events;
  3638. };
  3639. /***/ }),
  3640. /* 21 */
  3641. /***/ (function(module, exports, __webpack_require__) {
  3642. var isFunction = __webpack_require__(13),
  3643. isLength = __webpack_require__(109);
  3644. /**
  3645. * Checks if `value` is array-like. A value is considered array-like if it's
  3646. * not a function and has a `value.length` that's an integer greater than or
  3647. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  3648. *
  3649. * @static
  3650. * @memberOf _
  3651. * @since 4.0.0
  3652. * @category Lang
  3653. * @param {*} value The value to check.
  3654. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  3655. * @example
  3656. *
  3657. * _.isArrayLike([1, 2, 3]);
  3658. * // => true
  3659. *
  3660. * _.isArrayLike(document.body.children);
  3661. * // => true
  3662. *
  3663. * _.isArrayLike('abc');
  3664. * // => true
  3665. *
  3666. * _.isArrayLike(_.noop);
  3667. * // => false
  3668. */
  3669. function isArrayLike(value) {
  3670. return value != null && isLength(value.length) && !isFunction(value);
  3671. }
  3672. module.exports = isArrayLike;
  3673. /***/ }),
  3674. /* 22 */
  3675. /***/ (function(module, exports, __webpack_require__) {
  3676. "use strict";
  3677. // TODO: Eliminate the need for this module, which is globally tracking these objects.
  3678. const Collection = __webpack_require__(241);
  3679. const sessionObjects = {
  3680. // Publishers are id'd by their guid
  3681. publishers: new Collection('guid'),
  3682. // Subscribers are id'd by their widgetId
  3683. subscribers: new Collection('widgetId'),
  3684. sessions: new Collection()
  3685. };
  3686. module.exports = sessionObjects;
  3687. /***/ }),
  3688. /* 23 */
  3689. /***/ (function(module, exports) {
  3690. function _extends() {
  3691. module.exports = _extends = Object.assign || function (target) {
  3692. for (var i = 1; i < arguments.length; i++) {
  3693. var source = arguments[i];
  3694. for (var key in source) {
  3695. if (Object.prototype.hasOwnProperty.call(source, key)) {
  3696. target[key] = source[key];
  3697. }
  3698. }
  3699. }
  3700. return target;
  3701. };
  3702. return _extends.apply(this, arguments);
  3703. }
  3704. module.exports = _extends;
  3705. /***/ }),
  3706. /* 24 */
  3707. /***/ (function(module, exports, __webpack_require__) {
  3708. "use strict";
  3709. // Event names lookup
  3710. module.exports = {
  3711. // Activity Status for cams/mics
  3712. ACTIVE: 'active',
  3713. INACTIVE: 'inactive',
  3714. UNKNOWN: 'unknown',
  3715. // Archive types
  3716. PER_SESSION: 'perSession',
  3717. PER_STREAM: 'perStream',
  3718. // Events
  3719. EXCEPTION: 'exception',
  3720. ISSUE_REPORTED: 'issueReported',
  3721. // Session Events
  3722. SESSION_CONNECTED: 'sessionConnected',
  3723. SESSION_RECONNECTING: 'sessionReconnecting',
  3724. SESSION_RECONNECTED: 'sessionReconnected',
  3725. SESSION_DISCONNECTED: 'sessionDisconnected',
  3726. STREAM_CREATED: 'streamCreated',
  3727. STREAM_DESTROYED: 'streamDestroyed',
  3728. CONNECTION_CREATED: 'connectionCreated',
  3729. CONNECTION_DESTROYED: 'connectionDestroyed',
  3730. SIGNAL: 'signal',
  3731. STREAM_PROPERTY_CHANGED: 'streamPropertyChanged',
  3732. MICROPHONE_LEVEL_CHANGED: 'microphoneLevelChanged',
  3733. // Publisher Events
  3734. RESIZE: 'resize',
  3735. SETTINGS_BUTTON_CLICK: 'settingsButtonClick',
  3736. DEVICE_INACTIVE: 'deviceInactive',
  3737. INVALID_DEVICE_NAME: 'invalidDeviceName',
  3738. ACCESS_ALLOWED: 'accessAllowed',
  3739. ACCESS_DENIED: 'accessDenied',
  3740. ACCESS_DIALOG_OPENED: 'accessDialogOpened',
  3741. ACCESS_DIALOG_CLOSED: 'accessDialogClosed',
  3742. ECHO_CANCELLATION_MODE_CHANGED: 'echoCancellationModeChanged',
  3743. MEDIA_STOPPED: 'mediaStopped',
  3744. PUBLISHER_DESTROYED: 'destroyed',
  3745. // Subscriber Events
  3746. SUBSCRIBER_DESTROYED: 'destroyed',
  3747. SUBSCRIBER_CONNECTED: 'connected',
  3748. SUBSCRIBER_DISCONNECTED: 'disconnected',
  3749. // DeviceManager Events
  3750. DEVICES_DETECTED: 'devicesDetected',
  3751. // DevicePanel Events
  3752. DEVICES_SELECTED: 'devicesSelected',
  3753. CLOSE_BUTTON_CLICK: 'closeButtonClick',
  3754. MICLEVEL: 'microphoneActivityLevel',
  3755. MICGAINCHANGED: 'microphoneGainChanged',
  3756. // Environment Loader
  3757. ENV_LOADED: 'envLoaded',
  3758. ENV_UNLOADED: 'envUnloaded',
  3759. // Audio activity Events
  3760. AUDIO_LEVEL_UPDATED: 'audioLevelUpdated',
  3761. VIDEO_ELEMENT_CREATED: 'videoElementCreated'
  3762. };
  3763. /***/ }),
  3764. /* 25 */
  3765. /***/ (function(module, exports, __webpack_require__) {
  3766. "use strict";
  3767. /*
  3768. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  3769. *
  3770. * Use of this source code is governed by a BSD-style license
  3771. * that can be found in the LICENSE file in the root of the source
  3772. * tree.
  3773. */
  3774. /* eslint-env node */
  3775. var logDisabled_ = true;
  3776. var deprecationWarnings_ = true;
  3777. /**
  3778. * Extract browser version out of the provided user agent string.
  3779. *
  3780. * @param {!string} uastring userAgent string.
  3781. * @param {!string} expr Regular expression used as match criteria.
  3782. * @param {!number} pos position in the version string to be returned.
  3783. * @return {!number} browser version.
  3784. */
  3785. function extractVersion(uastring, expr, pos) {
  3786. var match = uastring.match(expr);
  3787. return match && match.length >= pos && parseInt(match[pos], 10);
  3788. }
  3789. // Wraps the peerconnection event eventNameToWrap in a function
  3790. // which returns the modified event object (or false to prevent
  3791. // the event).
  3792. function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) {
  3793. if (!window.RTCPeerConnection) {
  3794. return;
  3795. }
  3796. var proto = window.RTCPeerConnection.prototype;
  3797. var nativeAddEventListener = proto.addEventListener;
  3798. proto.addEventListener = function(nativeEventName, cb) {
  3799. if (nativeEventName !== eventNameToWrap) {
  3800. return nativeAddEventListener.apply(this, arguments);
  3801. }
  3802. var wrappedCallback = function(e) {
  3803. var modifiedEvent = wrapper(e);
  3804. if (modifiedEvent) {
  3805. cb(modifiedEvent);
  3806. }
  3807. };
  3808. this._eventMap = this._eventMap || {};
  3809. this._eventMap[cb] = wrappedCallback;
  3810. return nativeAddEventListener.apply(this, [nativeEventName,
  3811. wrappedCallback]);
  3812. };
  3813. var nativeRemoveEventListener = proto.removeEventListener;
  3814. proto.removeEventListener = function(nativeEventName, cb) {
  3815. if (nativeEventName !== eventNameToWrap || !this._eventMap
  3816. || !this._eventMap[cb]) {
  3817. return nativeRemoveEventListener.apply(this, arguments);
  3818. }
  3819. var unwrappedCb = this._eventMap[cb];
  3820. delete this._eventMap[cb];
  3821. return nativeRemoveEventListener.apply(this, [nativeEventName,
  3822. unwrappedCb]);
  3823. };
  3824. Object.defineProperty(proto, 'on' + eventNameToWrap, {
  3825. get: function() {
  3826. return this['_on' + eventNameToWrap];
  3827. },
  3828. set: function(cb) {
  3829. if (this['_on' + eventNameToWrap]) {
  3830. this.removeEventListener(eventNameToWrap,
  3831. this['_on' + eventNameToWrap]);
  3832. delete this['_on' + eventNameToWrap];
  3833. }
  3834. if (cb) {
  3835. this.addEventListener(eventNameToWrap,
  3836. this['_on' + eventNameToWrap] = cb);
  3837. }
  3838. },
  3839. enumerable: true,
  3840. configurable: true
  3841. });
  3842. }
  3843. // Utility methods.
  3844. module.exports = {
  3845. extractVersion: extractVersion,
  3846. wrapPeerConnectionEvent: wrapPeerConnectionEvent,
  3847. disableLog: function(bool) {
  3848. if (typeof bool !== 'boolean') {
  3849. return new Error('Argument type: ' + typeof bool +
  3850. '. Please use a boolean.');
  3851. }
  3852. logDisabled_ = bool;
  3853. return (bool) ? 'adapter.js logging disabled' :
  3854. 'adapter.js logging enabled';
  3855. },
  3856. /**
  3857. * Disable or enable deprecation warnings
  3858. * @param {!boolean} bool set to true to disable warnings.
  3859. */
  3860. disableWarnings: function(bool) {
  3861. if (typeof bool !== 'boolean') {
  3862. return new Error('Argument type: ' + typeof bool +
  3863. '. Please use a boolean.');
  3864. }
  3865. deprecationWarnings_ = !bool;
  3866. return 'adapter.js deprecation warnings ' + (bool ? 'disabled' : 'enabled');
  3867. },
  3868. log: function() {
  3869. if (typeof window === 'object') {
  3870. if (logDisabled_) {
  3871. return;
  3872. }
  3873. if (typeof console !== 'undefined' && typeof console.log === 'function') {
  3874. console.log.apply(console, arguments);
  3875. }
  3876. }
  3877. },
  3878. /**
  3879. * Shows a deprecation warning suggesting the modern and spec-compatible API.
  3880. */
  3881. deprecated: function(oldMethod, newMethod) {
  3882. if (!deprecationWarnings_) {
  3883. return;
  3884. }
  3885. console.warn(oldMethod + ' is deprecated, please use ' + newMethod +
  3886. ' instead.');
  3887. },
  3888. /**
  3889. * Browser detector.
  3890. *
  3891. * @return {object} result containing browser and version
  3892. * properties.
  3893. */
  3894. detectBrowser: function(window) {
  3895. var navigator = window && window.navigator;
  3896. // Returned result object.
  3897. var result = {};
  3898. result.browser = null;
  3899. result.version = null;
  3900. // Fail early if it's not a browser
  3901. if (typeof window === 'undefined' || !window.navigator) {
  3902. result.browser = 'Not a browser.';
  3903. return result;
  3904. }
  3905. if (navigator.mozGetUserMedia) { // Firefox.
  3906. result.browser = 'firefox';
  3907. result.version = extractVersion(navigator.userAgent,
  3908. /Firefox\/(\d+)\./, 1);
  3909. } else if (navigator.webkitGetUserMedia) {
  3910. // Chrome, Chromium, Webview, Opera.
  3911. // Version matches Chrome/WebRTC version.
  3912. result.browser = 'chrome';
  3913. result.version = extractVersion(navigator.userAgent,
  3914. /Chrom(e|ium)\/(\d+)\./, 2);
  3915. } else if (navigator.mediaDevices &&
  3916. navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) { // Edge.
  3917. result.browser = 'edge';
  3918. result.version = extractVersion(navigator.userAgent,
  3919. /Edge\/(\d+).(\d+)$/, 2);
  3920. } else if (window.RTCPeerConnection &&
  3921. navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) { // Safari.
  3922. result.browser = 'safari';
  3923. result.version = extractVersion(navigator.userAgent,
  3924. /AppleWebKit\/(\d+)\./, 1);
  3925. } else { // Default fallthrough: not supported.
  3926. result.browser = 'Not a supported browser.';
  3927. return result;
  3928. }
  3929. return result;
  3930. }
  3931. };
  3932. /***/ }),
  3933. /* 26 */
  3934. /***/ (function(module, exports, __webpack_require__) {
  3935. var Symbol = __webpack_require__(37),
  3936. getRawTag = __webpack_require__(338),
  3937. objectToString = __webpack_require__(339);
  3938. /** `Object#toString` result references. */
  3939. var nullTag = '[object Null]',
  3940. undefinedTag = '[object Undefined]';
  3941. /** Built-in value references. */
  3942. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  3943. /**
  3944. * The base implementation of `getTag` without fallbacks for buggy environments.
  3945. *
  3946. * @private
  3947. * @param {*} value The value to query.
  3948. * @returns {string} Returns the `toStringTag`.
  3949. */
  3950. function baseGetTag(value) {
  3951. if (value == null) {
  3952. return value === undefined ? undefinedTag : nullTag;
  3953. }
  3954. return (symToStringTag && symToStringTag in Object(value))
  3955. ? getRawTag(value)
  3956. : objectToString(value);
  3957. }
  3958. module.exports = baseGetTag;
  3959. /***/ }),
  3960. /* 27 */
  3961. /***/ (function(module, exports, __webpack_require__) {
  3962. var arrayLikeKeys = __webpack_require__(172),
  3963. baseKeys = __webpack_require__(111),
  3964. isArrayLike = __webpack_require__(21);
  3965. /**
  3966. * Creates an array of the own enumerable property names of `object`.
  3967. *
  3968. * **Note:** Non-object values are coerced to objects. See the
  3969. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  3970. * for more details.
  3971. *
  3972. * @static
  3973. * @since 0.1.0
  3974. * @memberOf _
  3975. * @category Object
  3976. * @param {Object} object The object to query.
  3977. * @returns {Array} Returns the array of property names.
  3978. * @example
  3979. *
  3980. * function Foo() {
  3981. * this.a = 1;
  3982. * this.b = 2;
  3983. * }
  3984. *
  3985. * Foo.prototype.c = 3;
  3986. *
  3987. * _.keys(new Foo);
  3988. * // => ['a', 'b'] (iteration order is not guaranteed)
  3989. *
  3990. * _.keys('hi');
  3991. * // => ['0', '1']
  3992. */
  3993. function keys(object) {
  3994. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  3995. }
  3996. module.exports = keys;
  3997. /***/ }),
  3998. /* 28 */
  3999. /***/ (function(module, exports, __webpack_require__) {
  4000. "use strict";
  4001. /* WEBPACK VAR INJECTION */(function(Promise) {
  4002. var _interopRequireDefault = __webpack_require__(2);
  4003. var _extends2 = _interopRequireDefault(__webpack_require__(23));
  4004. var _createClass2 = _interopRequireDefault(__webpack_require__(40));
  4005. /* global __PROPERTIES__ */
  4006. const defaultAxios = __webpack_require__(186);
  4007. const cloneDeep = __webpack_require__(50);
  4008. const pick = __webpack_require__(394);
  4009. const mapKeys = __webpack_require__(446);
  4010. const logging = __webpack_require__(1)('StaticConfig');
  4011. const _require = __webpack_require__(128),
  4012. prependProxyToUrlIfNeeded = _require.prependProxyToUrlIfNeeded;
  4013. /**
  4014. * @typedef {Object} builtInConfig properties that are baked in and are injected through webpack
  4015. * @property {String} version Build version (comes from package.json)
  4016. * @property {String} buildHash Commit hash this build was built from
  4017. * @property {Object} minimumVersion
  4018. * @property {String} minimumVersion.firefox Minimum version of Firefox needed to support OpenTok
  4019. * @property {String} minimumVersion.chrome Minimum version of Chrome needed to support OpenTok
  4020. * @property {Boolean} debug If true sets logging level to DEBUG else sets it to WARN
  4021. * @property {String} websiteURL Used to construct urls to the TokBox website
  4022. * @property {String} loggingURL Where to send analytical events
  4023. * @property {String} apiURL The API to talk to (Anvil)
  4024. */
  4025. /** @type builtInConfig */
  4026. const builtInConfig = cloneDeep({"version":"v2.17.3","buildHash":"32ce4158c","minimumVersion":{"firefox":52,"chrome":49},"debug":"false","websiteURL":"http://www.tokbox.com","configURL":"https://config.opentok.com","ipWhitelistConfigURL":"","cdnURL":"https://static.opentok.com","loggingURL":"https://hlg.tokbox.com/prod","apiURL":"https://anvil.opentok.com","sentryDSN":"https://40bf769a2f474b2a8ef66d2809c7cfe0@sentry.io/104064"});
  4027. const whitelistAllowedRuntimeProperties = pick(['apiURL', 'assetURL', 'cdnURL', 'enableErrorReporting', 'sessionInfoOverrides', 'loggingURL']);
  4028. const liveConfigMap = {
  4029. apiUrl: 'apiURL',
  4030. loggingUrl: 'loggingURL'
  4031. };
  4032. const normalizeLiveConfig = mapKeys(key => liveConfigMap[key]);
  4033. function staticConfigFactory(_temp) {
  4034. let _ref = _temp === void 0 ? {} : _temp,
  4035. _ref$axios = _ref.axios,
  4036. axios = _ref$axios === void 0 ? defaultAxios : _ref$axios;
  4037. /**
  4038. * @class StaticConfig
  4039. */
  4040. let StaticConfig = /*#__PURE__*/function () {
  4041. StaticConfig.onlyLocal = function onlyLocal() {
  4042. const runtimeProperties = cloneDeep((typeof window !== undefined ? window : global).OTProperties);
  4043. return new StaticConfig((0, _extends2.default)({}, builtInConfig, {}, whitelistAllowedRuntimeProperties(runtimeProperties)));
  4044. }
  4045. /**
  4046. * Construct a StaticConfig instance with baked in, runtime, and live configuration
  4047. *
  4048. * @static
  4049. * @param {any} { sessionId, token, useIpWhitelistConfigUrl }
  4050. * @memberof StaticConfig
  4051. * @return {Promise<StaticConfig>} A promise to an instance of StaticConfig
  4052. */
  4053. ;
  4054. StaticConfig.get = function get(_ref2) {
  4055. let partnerId = _ref2.partnerId,
  4056. token = _ref2.token,
  4057. useIpWhitelistConfigUrl = _ref2.useIpWhitelistConfigUrl,
  4058. proxyUrl = _ref2.proxyUrl;
  4059. const getLiveConfig = () => {
  4060. const localStaticConfig = this.onlyLocal();
  4061. if (!localStaticConfig.configUrl) {
  4062. return Promise.resolve({});
  4063. }
  4064. if (useIpWhitelistConfigUrl === true && !localStaticConfig.ipWhitelistConfigUrl) {
  4065. return Promise.resolve({});
  4066. }
  4067. let finalConfigUrl = useIpWhitelistConfigUrl === true ? localStaticConfig.ipWhitelistConfigUrl : localStaticConfig.configUrl;
  4068. finalConfigUrl = prependProxyToUrlIfNeeded(finalConfigUrl, proxyUrl);
  4069. return axios.get(finalConfigUrl + "/project/" + partnerId + "/config.json", {
  4070. headers: {
  4071. 'X-TB-TOKEN-AUTH': token
  4072. }
  4073. }).then((_ref3) => {
  4074. let data = _ref3.data;
  4075. return data;
  4076. });
  4077. };
  4078. return getLiveConfig().catch(err => {
  4079. logging.error('could not reach live config service', err);
  4080. return {};
  4081. }).then(liveConfig => {
  4082. const runtimeProperties = cloneDeep((typeof window !== undefined ? window : global).OTProperties);
  4083. const config = (0, _extends2.default)({}, builtInConfig, {}, whitelistAllowedRuntimeProperties(runtimeProperties), {}, normalizeLiveConfig(liveConfig));
  4084. return new StaticConfig(config);
  4085. });
  4086. };
  4087. function StaticConfig(config) {
  4088. Object.defineProperty(this, 'config', {
  4089. value: Object.freeze(cloneDeep(config))
  4090. });
  4091. }
  4092. (0, _createClass2.default)(StaticConfig, [{
  4093. key: "configUrl",
  4094. get: function get() {
  4095. return this.config.configURL;
  4096. }
  4097. }, {
  4098. key: "ipWhitelistConfigUrl",
  4099. get: function get() {
  4100. return this.config.ipWhitelistConfigURL;
  4101. }
  4102. }, {
  4103. key: "apiUrl",
  4104. get: function get() {
  4105. return this.config.apiURL;
  4106. }
  4107. }, {
  4108. key: "loggingUrl",
  4109. get: function get() {
  4110. return this.config.loggingURL;
  4111. }
  4112. }, {
  4113. key: "enableErrorReporting",
  4114. get: function get() {
  4115. return Boolean(this.config.enableErrorReporting);
  4116. }
  4117. }, {
  4118. key: "apiEnabled",
  4119. get: function get() {
  4120. return typeof this.config.apiEnabled !== 'undefined' ? this.config.apiEnabled : true;
  4121. }
  4122. }, {
  4123. key: "version",
  4124. get: function get() {
  4125. return this.config.version;
  4126. }
  4127. }, {
  4128. key: "clientVersion",
  4129. get: function get() {
  4130. return "js-" + (this.version || 'unknown').replace('v', '');
  4131. }
  4132. }, {
  4133. key: "buildHash",
  4134. get: function get() {
  4135. return this.config.buildHash;
  4136. }
  4137. }, {
  4138. key: "minimumVersion",
  4139. get: function get() {
  4140. return this.config.minimumVersion;
  4141. }
  4142. }, {
  4143. key: "sentryDSN",
  4144. get: function get() {
  4145. return this.config.sentryDSN;
  4146. }
  4147. }, {
  4148. key: "websiteUrl",
  4149. get: function get() {
  4150. return this.config.websiteURL;
  4151. }
  4152. }, {
  4153. key: "debug",
  4154. get: function get() {
  4155. return this.config.debug === 'true' || this.config.debug === true;
  4156. }
  4157. }, {
  4158. key: "sessionInfoOverrides",
  4159. get: function get() {
  4160. return this.config.sessionInfoOverrides;
  4161. }
  4162. }, {
  4163. key: "cdnUrl",
  4164. get: function get() {
  4165. return this.config.cdnURL || (typeof window !== undefined ? window : global).location.protocol + "//" + (typeof window !== undefined ? window : global).location.host;
  4166. }
  4167. }, {
  4168. key: "assetUrl",
  4169. get: function get() {
  4170. return this.config.assetURL || this.cdnUrl + "/webrtc/" + this.version;
  4171. }
  4172. }]);
  4173. return StaticConfig;
  4174. }();
  4175. return StaticConfig;
  4176. }
  4177. module.exports = staticConfigFactory;
  4178. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  4179. /***/ }),
  4180. /* 29 */
  4181. /***/ (function(module, exports, __webpack_require__) {
  4182. var baseMatches = __webpack_require__(423),
  4183. baseMatchesProperty = __webpack_require__(431),
  4184. identity = __webpack_require__(84),
  4185. isArray = __webpack_require__(9),
  4186. property = __webpack_require__(436);
  4187. /**
  4188. * The base implementation of `_.iteratee`.
  4189. *
  4190. * @private
  4191. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4192. * @returns {Function} Returns the iteratee.
  4193. */
  4194. function baseIteratee(value) {
  4195. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4196. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4197. if (typeof value == 'function') {
  4198. return value;
  4199. }
  4200. if (value == null) {
  4201. return identity;
  4202. }
  4203. if (typeof value == 'object') {
  4204. return isArray(value)
  4205. ? baseMatchesProperty(value[0], value[1])
  4206. : baseMatches(value);
  4207. }
  4208. return property(value);
  4209. }
  4210. module.exports = baseIteratee;
  4211. /***/ }),
  4212. /* 30 */
  4213. /***/ (function(module, exports) {
  4214. /**
  4215. * A specialized version of `_.map` for arrays without support for iteratee
  4216. * shorthands.
  4217. *
  4218. * @private
  4219. * @param {Array} [array] The array to iterate over.
  4220. * @param {Function} iteratee The function invoked per iteration.
  4221. * @returns {Array} Returns the new mapped array.
  4222. */
  4223. function arrayMap(array, iteratee) {
  4224. var index = -1,
  4225. length = array == null ? 0 : array.length,
  4226. result = Array(length);
  4227. while (++index < length) {
  4228. result[index] = iteratee(array[index], index, array);
  4229. }
  4230. return result;
  4231. }
  4232. module.exports = arrayMap;
  4233. /***/ }),
  4234. /* 31 */
  4235. /***/ (function(module, exports, __webpack_require__) {
  4236. "use strict";
  4237. var isValue = __webpack_require__(44);
  4238. module.exports = function (value) {
  4239. if (!isValue(value)) throw new TypeError("Cannot use null or undefined");
  4240. return value;
  4241. };
  4242. /***/ }),
  4243. /* 32 */
  4244. /***/ (function(module, exports, __webpack_require__) {
  4245. "use strict";
  4246. var isValue = __webpack_require__(53)
  4247. , isPlainFunction = __webpack_require__(229)
  4248. , assign = __webpack_require__(132)
  4249. , normalizeOpts = __webpack_require__(230)
  4250. , contains = __webpack_require__(231);
  4251. var d = (module.exports = function (dscr, value/*, options*/) {
  4252. var c, e, w, options, desc;
  4253. if (arguments.length < 2 || typeof dscr !== "string") {
  4254. options = value;
  4255. value = dscr;
  4256. dscr = null;
  4257. } else {
  4258. options = arguments[2];
  4259. }
  4260. if (isValue(dscr)) {
  4261. c = contains.call(dscr, "c");
  4262. e = contains.call(dscr, "e");
  4263. w = contains.call(dscr, "w");
  4264. } else {
  4265. c = w = true;
  4266. e = false;
  4267. }
  4268. desc = { value: value, configurable: c, enumerable: e, writable: w };
  4269. return !options ? desc : assign(normalizeOpts(options), desc);
  4270. });
  4271. d.gs = function (dscr, get, set/*, options*/) {
  4272. var c, e, options, desc;
  4273. if (typeof dscr !== "string") {
  4274. options = set;
  4275. set = get;
  4276. get = dscr;
  4277. dscr = null;
  4278. } else {
  4279. options = arguments[3];
  4280. }
  4281. if (!isValue(get)) {
  4282. get = undefined;
  4283. } else if (!isPlainFunction(get)) {
  4284. options = get;
  4285. get = set = undefined;
  4286. } else if (!isValue(set)) {
  4287. set = undefined;
  4288. } else if (!isPlainFunction(set)) {
  4289. options = set;
  4290. set = undefined;
  4291. }
  4292. if (isValue(dscr)) {
  4293. c = contains.call(dscr, "c");
  4294. e = contains.call(dscr, "e");
  4295. } else {
  4296. c = true;
  4297. e = false;
  4298. }
  4299. desc = { get: get, set: set, configurable: c, enumerable: e };
  4300. return !options ? desc : assign(normalizeOpts(options), desc);
  4301. };
  4302. /***/ }),
  4303. /* 33 */
  4304. /***/ (function(module, exports, __webpack_require__) {
  4305. "use strict";
  4306. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  4307. /* eslint-disable no-underscore-dangle, no-param-reassign */
  4308. const logging = __webpack_require__(1)('GlobalExceptionHandler');
  4309. const eventing = __webpack_require__(5);
  4310. const eventNames = __webpack_require__(24);
  4311. const Events = __webpack_require__(20)();
  4312. /**
  4313. * The Error class is used to define the error object passed into completion handlers.
  4314. * Each of the following methods, which execute asynchronously, includes a
  4315. * <code>completionHandler</code> parameter:
  4316. *
  4317. * <ul>
  4318. * <li><a href="OT.html#initPublisher">OT.initPublisher()</a></li>
  4319. * <li><a href="OT.html#reportIssue">OT.reportIssue()</a></li>
  4320. * <li><a href="Session.html#connect">Session.connect()</a></li>
  4321. * <li><a href="Session.html#forceDisconnect">Session.forceDisconnect()</a></li>
  4322. * <li><a href="Session.html#forceUnpublish">Session.forceUnpublish()</a></li>
  4323. * <li><a href="Session.html#publish">Session.publish()</a></li>
  4324. * <li><a href="Session.html#subscribe">Session.subscribe()</a></li>
  4325. * <li><a href="Subscriber.html#getStats">Subscriber.getStats()</a></li>
  4326. * </ul>
  4327. *
  4328. * <p>
  4329. * The Error class defines the Error thrown when the promise returned by
  4330. * the <a href="OT.html#unblockAudio">OT.#unblockAudio()</a> method is rejected.
  4331. *
  4332. * <p>
  4333. * The <code>completionHandler</code> parameter is a function that is called when the call to
  4334. * the asynchronous method succeeds or fails. If the asynchronous call fails, the completion
  4335. * handler function is passed an error object (defined by the Error class). The <code>code</code>
  4336. * and <code>message</code> properties of the error object provide details about the error.
  4337. *
  4338. * <p>
  4339. * <b>Deprecation notice:</b>
  4340. * <code>OT.Error</code> will not be defined in an upcoming version of OpenTok. When this happens,
  4341. * errors emitted by the SDK will simply be instances of standard <code>Error</code> objects.
  4342. * If your code currently checks <code>if (error instanceof OT.Error)</code> please replace it
  4343. * <code>if (/^OT_/.test(error.name))</code>. (The <code>name</code> property for all OpenTok
  4344. * errors with begins with <code>'OT_'</code>.) Note however that this code is for the
  4345. * purposes of smoothly upgrading, and it may be more appropriate for your code to simply compare
  4346. * against the specific error you want to handle, such as
  4347. * <code>if (error.name === 'OT_USER_MEDIA_ACCESS_DENIED')</code>.
  4348. *
  4349. * @property {Number} code Deprecated &mdash; the error code. Use the <code>name</code> property,
  4350. * not the <code>code</code> property, to identify the error programatically.
  4351. *
  4352. * <p>
  4353. * The <code>code</code> property of the Error object can be set to one of the values
  4354. * listed below. This property can also be set to other values, and you may want to report
  4355. * this value when discussing an issue with TokBox support.
  4356. * </p>
  4357. *
  4358. * <p>Errors when calling <code>Session.connect()</code>:</p>
  4359. *
  4360. * <table class="docs_table"><tbody>
  4361. * <tr>
  4362. * <td><b><code>code</code></b></td>
  4363. * <td><b>Description</b></td>
  4364. * </tr>
  4365. * <tr>
  4366. * <td>1004</td>
  4367. * <td>Authentication error. Check the error message for details. This error can result if you
  4368. * pass in an expired token when trying to connect to a session. It can also occur if you pass
  4369. * in an invalid token or API key. Make sure that you are generating the token using the
  4370. * current version of one of the
  4371. * <a href="http://tokbox.com/opentok/libraries/server">OpenTok server SDKs</a>.</td>
  4372. * </tr>
  4373. * <tr>
  4374. * <td>1005</td>
  4375. * <td>Invalid Session ID. Make sure you generate the session ID using the current version of
  4376. * one of the <a href="http://tokbox.com/opentok/libraries/server">OpenTok server
  4377. * SDKs</a>.</td>
  4378. * </tr>
  4379. * <tr>
  4380. * <td>1006</td>
  4381. * <td>Connect Failed. Unable to connect to the session. You may want to have the client check
  4382. * the network connection.</td>
  4383. * </tr>
  4384. * <tr>
  4385. * <td>1026</td>
  4386. * <td>Terms of service violation: export compliance. See the
  4387. * <a href="https://tokbox.com/support/tos">Terms of Service</a>.</td>
  4388. * </tr>
  4389. * <tr>
  4390. * <td>1027</td>
  4391. * <td>Connection limit exceeded. The client tried to connect to a session that has exceeded
  4392. * limit for simultaneous connections.</td>
  4393. * </tr>
  4394. * <tr>
  4395. * <td>2001</td>
  4396. * <td>Connect Failed. Unexpected response from the OpenTok server. Try connecting again
  4397. * later.</td>
  4398. * </tr>
  4399. * </tbody></table>
  4400. *
  4401. * <p>Errors when calling <code>Session.forceDisconnect()</code>:</p>
  4402. *
  4403. * <table class="docs_table"><tbody>
  4404. * <tr>
  4405. * <td><b>
  4406. * <code>code</code>
  4407. * </b></td>
  4408. * <td><b>Description</b></td>
  4409. * </tr>
  4410. * <tr>
  4411. * <td>1010</td>
  4412. * <td>The client is not connected to the OpenTok session. Check that client connects
  4413. * successfully and has not disconnected before calling forceDisconnect().</td>
  4414. * </tr>
  4415. * <tr>
  4416. * <td>1520</td>
  4417. * <td>Unable to force disconnect. The client's token does not have the role set to moderator.
  4418. * Once the client has connected to the session, the <code>capabilities</code> property of
  4419. * the Session object lists the client's capabilities.</td>
  4420. * </tr>
  4421. * </tbody></table>
  4422. *
  4423. * <p>Errors when calling <code>Session.forceUnpublish()</code>:</p>
  4424. *
  4425. * <table class="docs_table"><tbody>
  4426. * <tr>
  4427. * <td><b><code>code</code></b></td>
  4428. * <td><b>Description</b></td>
  4429. * </tr>
  4430. * <tr>
  4431. * <td>1010</td>
  4432. * <td>The client is not connected to the OpenTok session. Check that client connects
  4433. * successfully and has not disconnected before calling forceUnpublish().</td>
  4434. * </tr>
  4435. * <tr>
  4436. * <td>1530</td>
  4437. * <td>Unable to force unpublish. The client's token does not have the role set to moderator.
  4438. * Once the client has connected to the session, the <code>capabilities</code> property of
  4439. * the Session object lists the client's capabilities.</td>
  4440. * </tr>
  4441. * <tr>
  4442. * <td>1535</td>
  4443. * <td>Force Unpublish on an invalid stream. Make sure that the stream has not left the
  4444. * session before you call the <code>forceUnpublish()</code> method.</td>
  4445. * </tr>
  4446. * </tbody></table>
  4447. *
  4448. * <p>Errors when calling <code>Session.publish()</code>:</p>
  4449. *
  4450. * <table class="docs_table"><tbody>
  4451. * <tr>
  4452. * <td><b><code>code</code></b></td>
  4453. * <td><b>Description</b></td>
  4454. * </tr>
  4455. * <tr>
  4456. * <td>1010</td>
  4457. * <td>The client is not connected to the OpenTok session. Check that the client connects
  4458. * successfully before trying to publish. And check that the client has not disconnected
  4459. * before trying to publish.</td>
  4460. * </tr>
  4461. * <tr>
  4462. * <td>1500</td>
  4463. * <td>Unable to Publish. This can be caused by the following:
  4464. *
  4465. * <ul>
  4466. * <li>The client's token does not have the role set to publish or
  4467. * moderator. Once the client has connected to the session, the <code>capabilities</code>
  4468. * property of the Session object lists the client's capabilities.</li>
  4469. *
  4470. * <li>The end-user has denied access to the camera or microphone.</li>
  4471. *
  4472. * <li>The page is loaded on HTTP in Chrome, which requires HTTPS to access the camera and
  4473. * microphone.</li>
  4474. * </ul>
  4475. * </td>
  4476. * </tr>
  4477. * <tr>
  4478. * <td>1553</td>
  4479. * <td>WebRTC ICE workflow error. This is an error that occurs when trying to establish
  4480. * communication between clients in the session. Try publishing again or reconnecting to
  4481. * the session.</td>
  4482. * </tr>
  4483. * <tr>
  4484. * <td>1601</td>
  4485. * <td>Internal error -- WebRTC publisher error. Try republishing or reconnecting to the
  4486. * session.</td>
  4487. * </tr>
  4488. * <tr>
  4489. * <td>2001</td>
  4490. * <td>Publish Failed. Unexpected response from the OpenTok server. Try publishing again
  4491. * later.</td>
  4492. * </tr>
  4493. * </tbody></table>
  4494. *
  4495. * <p>Errors when calling <code>Session.signal()</code>:</p>
  4496. *
  4497. * <table class="docs_table" style="width:100%"><tbody>
  4498. * <tr>
  4499. * <td><b><code>code</code></b></td>
  4500. * <td><b>Description</b></td>
  4501. * </tr>
  4502. * <tr>
  4503. * <td>400</td>
  4504. * <td>One of the signal properties &mdash; data, type, or to &mdash;
  4505. * is invalid. Or the data cannot be parsed as JSON.</td>
  4506. * </tr>
  4507. * <tr>
  4508. * <td>404</td> <td>The to connection does not exist.</td>
  4509. * </tr>
  4510. * <tr>
  4511. * <td>413</td> <td>The type string exceeds the maximum length (128 bytes),
  4512. * or the data string exceeds the maximum size (8 kB).</td>
  4513. * </tr>
  4514. * <tr>
  4515. * <td>500</td>
  4516. * <td>The client is not connected to the OpenTok session. Check that the client connects
  4517. * successfully before trying to signal. And check that the client has not disconnected before
  4518. * trying to signal.</td>
  4519. * </tr>
  4520. * <tr>
  4521. * <td>2001</td>
  4522. * <td>Signal Failed. Unexpected response from the OpenTok server. Try sending the signal again
  4523. * later.</td>
  4524. * </tr>
  4525. * </tbody></table>
  4526. *
  4527. * <p>Errors when calling <code>Session.subscribe()</code>:</p>
  4528. *
  4529. * <table class="docs_table" style="width:100%"><tbody>
  4530. * <tr>
  4531. * <td><b>
  4532. * <code>code</code>
  4533. * </b></td>
  4534. * <td><b>Description</b></td>
  4535. * </tr>
  4536. * <tr>
  4537. * <td>1013</td>
  4538. * <td>WebRTC PeerConnection error. Try resubscribing to the stream or
  4539. * reconnecting to the session.</td>
  4540. * </tr>
  4541. * <tr>
  4542. * <td>1554</td>
  4543. * <td>WebRTC ICE workflow error. This is an error that occurs when trying to establish
  4544. * communication between clients in the session. Try resubscribing to the stream or
  4545. * reconnecting to the session.</td>
  4546. * </tr>
  4547. * <tr>
  4548. * <td>1600</td>
  4549. * <td>Internal error -- WebRTC subscriber error. Try resubscribing to the stream or
  4550. * reconnecting to the session.</td>
  4551. * </tr>
  4552. * <tr>
  4553. * <td>1605</td>
  4554. * <td>Stream limit exceeded. The client tried to subscribe to a stream in a session
  4555. * that has exceeded the limit for simultaneous streams.</td>
  4556. * </tr>
  4557. * <tr>
  4558. * <td>2001</td>
  4559. * <td>Subscribe Failed. Unexpected response from the OpenTok server. Try subscribing again
  4560. * later.</td>
  4561. * </tr>
  4562. * </tbody></table>
  4563. *
  4564. * <p>Errors when calling <code>OT.initPublisher()</code>:</p>
  4565. *
  4566. * <table class="docs_table"><tbody>
  4567. * <tr>
  4568. * <td><b><code>code</code></b></td>
  4569. * <td><b>Description</b></td>
  4570. * </tr>
  4571. * <tr>
  4572. * <td>1004</td>
  4573. * <td>Authentication error. Check the error message for details. This error can result if you
  4574. * pass in an expired token when trying to connect to a session. It can also occur if you
  4575. * pass in an invalid token or API key. Make sure that you are generating the token using
  4576. * the current version of one of the
  4577. * <a href="http://tokbox.com/opentok/libraries/server">OpenTok server SDKs</a>.</td>
  4578. * </tr>
  4579. * <tr>
  4580. * <td>1550</td>
  4581. * <td>Screen sharing is not supported (and you set the <code>videoSource</code> property
  4582. * of the <code>options</code> parameter of <code>OT.initPublisher()</code> to
  4583. * <code>"application"</code>, <code>"screen"</code>, or <code>"window"</code>).
  4584. * Before calling <code>OT.initPublisher()</code>, you can call
  4585. * <a href="OT.html#checkScreenSharingCapability">OT.checkScreenSharingCapability()</a>
  4586. * to check if screen sharing is supported.</td>
  4587. * </tr>
  4588. * <tr>
  4589. * <td>1551</td>
  4590. * <td>A screen-sharing extension needs to be registered but it is not. This error can occur
  4591. * when you set the <code>videoSource</code> property of the <code>options</code> parameter
  4592. * of <code>OT.initPublisher()</code> to <code>"application"</code>, <code>"screen"</code>,
  4593. * or <code>"window"</code>. Before calling <code>OT.initPublisher()</code>, you can call
  4594. * <a href="OT.html#checkScreenSharingCapability">OT.checkScreenSharingCapability()</a>
  4595. * to check if screen sharing requires an extension to be registered.</td>
  4596. * </tr>
  4597. * <tr>
  4598. * <td>1552</td>
  4599. * <td>A screen-sharing extension is required, but it is not installed. This error can occur
  4600. * when you set the <code>videoSource</code> property of the <code>options</code> parameter
  4601. * of <code>OT.initPublisher()</code> to <code>"screen"</code>. Before calling
  4602. * <code>OT.initPublisher()</code>, you can call
  4603. * <a href="OT.html#checkScreenSharingCapability">OT.checkScreenSharingCapability()</a>
  4604. * to check if screen sharing requires an extension to be installed.</td>
  4605. * </tr>
  4606. * </tbody></table>
  4607. *
  4608. * <p>Errors when calling <code>OT.reportIssue()</code>:</p>
  4609. *
  4610. * <table class="docs_table"><tbody>
  4611. * <tr>
  4612. * <td><b><code>code</code></b></td>
  4613. * <td><b>Description</b></td>
  4614. * </tr>
  4615. * <tr>
  4616. * <td>2011</td>
  4617. * <td>Error calling OT.reportIssue(). Check the client's network connection.</td>
  4618. * </tr>
  4619. * </tbody></table>
  4620. *
  4621. * <p>General errors that can occur when calling any method:</p>
  4622. *
  4623. * <table class="docs_table" style="width:100%"><tbody>
  4624. * <tr>
  4625. * <td><b><code>code</code></b></td>
  4626. * <td><b>Description</b></td>
  4627. * </tr>
  4628. * <tr>
  4629. * <td>1011</td>
  4630. * <td>Invalid Parameter. Check that you have passed valid parameter values into the method
  4631. * call.</td>
  4632. * </tr>
  4633. * <tr>
  4634. * <td>2000</td>
  4635. * <td>Internal Error. Try reconnecting to the OpenTok session and trying the action again.</td>
  4636. * </tr>
  4637. * </tbody></table>
  4638. *
  4639. * @property {String} message The message string provides details about the error.
  4640. *
  4641. * <p>
  4642. * Use the <code>name</code> property (not the <code>message</code> property) to identify the error
  4643. * programatically.
  4644. *
  4645. * @property {String} name A string identifying the error. Use this property (not the
  4646. * <code>code</code> property) to identify the error.
  4647. *
  4648. * <p>Note that for all errors, this string starts with <code>'OT_'</code>.
  4649. *
  4650. * <p>
  4651. * The <code>name</code> property of the Error object can be set to one of the values
  4652. * listed below. For unexpected errors, this property can be undefined or set to other
  4653. * values. You may want to report this value when discussing an issue with TokBox support.
  4654. * </p>
  4655. *
  4656. * <p>Errors that can occur when calling <code>OT.initPublisher()</code>:</p>
  4657. *
  4658. * <table class="docs_table" style="width:100%"><tbody>
  4659. * <tr>
  4660. * <td><b><code>name</code></b></td>
  4661. * <td><b>Description</b></td>
  4662. * </tr>
  4663. * <tr>
  4664. * <td><code>'OT_HARDWARE_UNAVAILABLE'</code></td>
  4665. * <td>The hardware to fulfill the user media request appears to exist but could not be acquired.
  4666. * It might be in use by another application.</td>
  4667. * </tr>
  4668. * <tr>
  4669. * <td><code>'OT_INVALID_PARAMETER'</code></td>
  4670. * <td>One or more parameters was not valid or not provided.</td>
  4671. * </tr>
  4672. * <tr>
  4673. * <td><code>'OT_MEDIA_ERR_ABORTED'</code></td>
  4674. * <td>The fetching of the stream for the video element has been aborted.</td>
  4675. * </tr>
  4676. * <tr>
  4677. * <td><code>'OT_MEDIA_ERR_DECODE'</code></td>
  4678. * <td>A decoding error occurred while trying to play the stream in the video element.</td>
  4679. * </tr>
  4680. * <tr>
  4681. * <td><code>'OT_MEDIA_ERR_NETWORK'</code></td>
  4682. * <td>A network error caused the stream to stop being fetched.</td>
  4683. * </tr>
  4684. * <tr>
  4685. * <td><code>'OT_MEDIA_ERR_SRC_NOT_SUPPORTED'</code></td>
  4686. * <td>The stream has been detected to be not suitable for playback.</td>
  4687. * </tr>
  4688. * <tr>
  4689. * <td><code>'OT_NOT_SUPPORTED'</code></td>
  4690. * <td>Something in the user media request is not supported.</td>
  4691. * </tr>
  4692. * <tr>
  4693. * <td><code>'OT_NO_DEVICES_FOUND'</code></td>
  4694. * <td>No devices were found to provide the media stream.</td>
  4695. * </tr>
  4696. * <tr>
  4697. * <td><code>'OT_NO_VALID_CONSTRAINTS'</code></td>
  4698. * <td>Video and audio were both disabled. You need to enable at least one.</td>
  4699. * </tr>
  4700. * <tr>
  4701. * <td><code>'OT_SCREEN_SHARING_NOT_SUPPORTED'</code></td>
  4702. * <td>Screen sharing is not supported in the browser.</td>
  4703. * </tr>
  4704. * <tr>
  4705. * <td><code>'OT_SCREEN_SHARING_EXTENSION_NOT_REGISTERED'</code></td>
  4706. * <td>Screen-sharing support in this browser requires an extension, but one has not been
  4707. * registered.</td>
  4708. * </tr>
  4709. * <tr>
  4710. * <td><code>'OT_SCREEN_SHARING_EXTENSION_NOT_INSTALLED'</code></td>
  4711. * <td>Screen-sharing support in this browser requires an extension, but the extension is not
  4712. * installed.</td>
  4713. * </tr>
  4714. * </table>
  4715. *
  4716. * <p>Errors that can occur when calling <code>OT.reportIssue()</code>:</p>
  4717. *
  4718. * <table class="docs_table" style="width:100%"><tbody>
  4719. * <tr>
  4720. * <td><b><code>name</code></b></td>
  4721. * <td><b>Description</b></td>
  4722. * </tr>
  4723. * <tr>
  4724. * <td><code>'OT_REPORT_ISSUE_FAILED'</code></td>
  4725. * <td>Error calling OT.reportIssue(). Check the client\'s network connection.</td>
  4726. * </tr>
  4727. * </table>
  4728. *
  4729. * <p>Errors that can occur when calling <code>Session.connect()</code>:</p>
  4730. *
  4731. * <table class="docs_table" style="width:100%"><tbody>
  4732. * <tr>
  4733. * <td><b><code>name</code></b></td>
  4734. * <td><b>Description</b></td>
  4735. * </tr>
  4736. * <tr>
  4737. * <td><code>'OT_AUTHENTICATION_ERROR'</code></td>
  4738. * <td>The API key does not match the token or session.</td>
  4739. * </tr>
  4740. * <tr>
  4741. * <td><code>'OT_BADLY_FORMED_RESPONSE'</code></td>
  4742. * <td>The JSON response from the OpenTok server was badly formed.</td>
  4743. * </tr>
  4744. * <tr>
  4745. * <td><code>'OT_CONNECT_FAILED'</code></td>
  4746. * <td>Failed to connect to session.</td>
  4747. * </tr>
  4748. * <tr>
  4749. * <td><code>'OT_CONNECTION_LIMIT_EXCEEDED'</code></td>
  4750. * <td>The client tried to connect to a session that has exceeded the limit for
  4751. * simultaneous connections.</td>
  4752. * </tr>
  4753. * <tr>
  4754. * <td><code>'OT_EMPTY_RESPONSE_BODY'</code></td>
  4755. * <td>Received an unexpected empty response from the OpenTok server.</td>
  4756. * </tr>
  4757. * <tr>
  4758. * <td><code>'OT_INVALID_SESSION_ID'</code></td>
  4759. * <td>The session ID was invalid.</td>
  4760. * </tr>
  4761. * <tr>
  4762. * <td><code>'OT_INVALID_PARAMETER'</code></td>
  4763. * <td>One or more parameters was not valid or not provided.</td>
  4764. * </tr>
  4765. * <tr>
  4766. * <td><code>'OT_NOT_CONNECTED'</code></td>
  4767. * <td>Couldn't perform action because you are not connected to the network.</td>
  4768. * </tr>
  4769. * <tr>
  4770. * <td><code>'OT_TERMS_OF_SERVICE_FAILURE'</code></td>
  4771. * <td>Couldn't connect due to a terms of service violation.</td>
  4772. * </tr>
  4773. * <tr>
  4774. * <td><code>'OT_INVALID_HTTP_STATUS'</code></td>
  4775. * <td>Received an unexpected HTTP status.</td>
  4776. * </tr>
  4777. * <tr>
  4778. * <td><code>'OT_XDOMAIN_OR_PARSING_ERROR'</code></td>
  4779. * <td>There was a cross domain error or the server responded with invalid JSON.</td>
  4780. * </tr>
  4781. * </table>
  4782. *
  4783. * <p>Errors that can occur when calling <code>Session.forceDisconnect()</code>:</p>
  4784. *
  4785. * <table class="docs_table" style="width:100%"><tbody>
  4786. * <tr>
  4787. * <td><b><code>name</code></b></td>
  4788. * <td><b>Description</b></td>
  4789. * </tr>
  4790. * <tr>
  4791. * <td><code>'OT_INVALID_PARAMETER'</code></td>
  4792. * <td>One or more parameters was not valid or not provided.</td>
  4793. * </tr>
  4794. * <tr>
  4795. * <td><code>'OT_NOT_CONNECTED'</code></td>
  4796. * <td>Couldn't perform action because you are not connected to the network.</td>
  4797. * </tr>
  4798. * <tr>
  4799. * <td><code>'OT_PERMISSION_DENIED'</code></td>
  4800. * <td>This token does not allow this action. The role must be at least moderator.</td>
  4801. * </tr>
  4802. * </table>
  4803. *
  4804. * <p>Errors that can occur when calling <code>Session.forceUnpublish()</code>:</p>
  4805. *
  4806. * <table class="docs_table" style="width:100%"><tbody>
  4807. * <tr>
  4808. * <td><b><code>name</code></b></td>
  4809. * <td><b>Description</b></td>
  4810. * </tr>
  4811. * <tr>
  4812. * <td><code>'OT_INVALID_PARAMETER'</code></td>
  4813. * <td>One or more parameters was not valid or not provided.</td>
  4814. * </tr>
  4815. * <tr>
  4816. * <td><code>'OT_NOT_CONNECTED'</code></td>
  4817. * <td>Couldn't perform action because you are not connected to the network.</td>
  4818. * </tr>
  4819. * <tr>
  4820. * <td><code>'OT_PERMISSION_DENIED'</code></td>
  4821. * <td>This token does not allow this action. The role must be at least moderator.</td>
  4822. * </tr>
  4823. * </table>
  4824. *
  4825. * <p>Errors that can occur when calling <code>Session.publish()</code>:</p>
  4826. *
  4827. * <table class="docs_table" style="width:100%"><tbody>
  4828. * <tr>
  4829. * <td><b><code>name</code></b></td>
  4830. * <td><b>Description</b></td>
  4831. * </tr>
  4832. * <tr>
  4833. * <td><code>'OT_CHROME_MICROPHONE_ACQUISITION_ERROR'</code></td>
  4834. * <td>Chrome fails to get access to the microphone, due to a Chrome error. To work
  4835. * around this issue, the end-user must restart Chrome and reload your site. This is a
  4836. * <a href="https://bugs.chromium.org/p/webrtc/issues/detail?id=4799">known issue</a>
  4837. * to be fixed in Chrome.</td>
  4838. * </tr>
  4839. * <tr>
  4840. * <td><code>'OT_CONSTRAINTS_NOT_SATISFIED'</code></td>
  4841. * <td>The constraints for getting user media could not be satisfied.</td>
  4842. * </tr>
  4843. * <tr>
  4844. * <td><code>'OT_CREATE_PEER_CONNECTION_FAILED'</code></td>
  4845. * <td>Failed to create a connection between this client and the subscriber or the
  4846. * OpenTok Media Router.</td>
  4847. * </tr>
  4848. * <tr>
  4849. * <td><code>'OT_HARDWARE_UNAVAILABLE'</code></td>
  4850. * <td>The hardware to fulfill the user media request appears to exist but could not be acquired.
  4851. * It might be in use by another application.</td>
  4852. * </tr>
  4853. * <tr>
  4854. * <td><code>'OT_ICE_WORKFLOW_FAILED'</code></td>
  4855. * <td>Something went wrong while establishing WebRTC connectivity.</td>
  4856. * </tr>
  4857. * <tr>
  4858. * <td><code>'OT_INVALID_PARAMETER'</code></td>
  4859. * <td>One or more parameters was not valid or not provided.</td>
  4860. * </tr>
  4861. * <tr>
  4862. * <td><code>'OT_MEDIA_ERR_ABORTED'</code></td>
  4863. * <td>The fetching of the stream for the video element has been aborted.</td>
  4864. * </tr>
  4865. * <tr>
  4866. * <td><code>'OT_MEDIA_ERR_DECODE'</code></td>
  4867. * <td>A decoding error occurred while trying to play the stream in the video element.</td>
  4868. * </tr>
  4869. * <tr>
  4870. * <td><code>'OT_MEDIA_ERR_NETWORK'</code></td>
  4871. * <td>A network error caused the stream to stop being fetched.</td>
  4872. * </tr>
  4873. * <tr>
  4874. * <td><code>'OT_MEDIA_ERR_SRC_NOT_SUPPORTED'</code></td>
  4875. * <td>The stream has been detected to be not suitable for playback.</td>
  4876. * </tr>
  4877. * <tr>
  4878. * <td><code>'OT_NO_DEVICES_FOUND'</code></td>
  4879. * <td>No devices were found to provide the media stream.</td>
  4880. * </tr>
  4881. * <tr>
  4882. * <td><code>'OT_NO_VALID_CONSTRAINTS'</code></td>
  4883. * <td>Video and audio were both disabled. You need to enable at least one.</td>
  4884. * </tr>
  4885. * <tr>
  4886. * <td><code>'OT_NOT_CONNECTED'</code></td>
  4887. * <td>Couldn't perform action because you are not connected to the network.</td>
  4888. * </tr>
  4889. * <tr>
  4890. * <td><code>'OT_NOT_SUPPORTED'</code></td>
  4891. * <td>Something in the user media request is not supported.</td>
  4892. * </tr>
  4893. * <tr>
  4894. * <td><code>'OT_PERMISSION_DENIED'</code></td>
  4895. * <td>This token does not allow publishing. The role must be at least publisher to enable
  4896. * this funcitonality.</td>
  4897. * </tr>
  4898. * <tr>
  4899. * <td><code>'OT_SCREEN_SHARING_NOT_SUPPORTED'</code></td>
  4900. * <td>Screen sharing is not supported in the browser.</td>
  4901. * </tr>
  4902. * <tr>
  4903. * <td><code>'OT_SCREEN_SHARING_EXTENSION_NOT_REGISTERED'</code></td>
  4904. * <td>Screen-sharing support in this browser requires an extension, but one has not been
  4905. * registered.</td>
  4906. * </tr>
  4907. * <tr>
  4908. * <td><code>'OT_SCREEN_SHARING_EXTENSION_NOT_INSTALLED'</code></td>
  4909. * <td>Screen-sharing support in this browser requires an extension, but the extension is not
  4910. * installed.</td>
  4911. * </tr>
  4912. * <tr>
  4913. * <td><code>'OT_SET_REMOTE_DESCRIPTION_FAILED'</code></td>
  4914. * <td>The WebRTC connection failed during setDescription.</td>
  4915. * </tr>
  4916. * <tr>
  4917. * <td><code>'OT_STREAM_CREATE_FAILED'</code></td>
  4918. * <td>Failed to create the stream in the server model.</td>
  4919. * </tr>
  4920. * <tr>
  4921. * <td><code>'OT_TIMEOUT'</code></td>
  4922. * <td>Could not publish in a reasonable amount of time.</td>
  4923. * </tr>
  4924. * <tr>
  4925. * <td><code>'OT_USER_MEDIA_ACCESS_DENIED'</code></td>
  4926. * <td>The end-user denied permission to access hardware devices, or the end-user
  4927. * denied access to the screen (for a screen-sharing stream).</td>
  4928. * </tr>
  4929. * <tr>
  4930. * <td><code>'OT_UNEXPECTED_SERVER_RESPONSE'</code></td>
  4931. * <td>This indicates an unexpected error from the OpenTok server.</td>
  4932. * </tr>
  4933. * </table>
  4934. *
  4935. * <p>Errors that can occur when calling <code>Session.signal()</code>:</p>
  4936. *
  4937. * <table class="docs_table" style="width:100%"><tbody>
  4938. * <tr>
  4939. * <td><b><code>name</code></b></td>
  4940. * <td><b>Description</b></td>
  4941. * </tr>
  4942. * <tr>
  4943. * <td><code>'OT_INVALID_PARAMETER'</code></td>
  4944. * <td>One or more parameters was not valid or not provided.</td>
  4945. * </tr>
  4946. * <tr>
  4947. * <td><code>'OT_NOT_CONNECTED'</code></td>
  4948. * <td>Couldn't perform action because you are not connected to the network.</td>
  4949. * </tr>
  4950. * <tr>
  4951. * <td><code>'OT_NOT_FOUND'</code></td>
  4952. * <td>A resource was not found.</td>
  4953. * </tr>
  4954. * <tr>
  4955. * <td><code>'OT_RATE_LIMIT_EXCEEDED'</code></td>
  4956. * <td>The signal could not be sent due to the rate limit.</td>
  4957. * </tr>
  4958. * </table>
  4959. *
  4960. * <p>Errors that can occur when calling <code>Session.subscribe()</code>:</p>
  4961. *
  4962. * <table class="docs_table" style="width:100%"><tbody>
  4963. * <tr>
  4964. * <td><b><code>name</code></b></td>
  4965. * <td><b>Description</b></td>
  4966. * </tr>
  4967. * <tr>
  4968. * <td><code>'OT_CREATE_PEER_CONNECTION_FAILED'</code></td>
  4969. * <td>Failed to create a connection between this client and the stream's publisher or the
  4970. * OpenTok Media Router.</td>
  4971. * </tr>
  4972. * <tr>
  4973. * <td><code>'OT_DISCONNECTED'</code></td>
  4974. * <td>Action failed because the client is not connected to the session.</td>
  4975. * </tr>
  4976. * <tr>
  4977. * <td><code>'OT_INVALID_PARAMETER'</code></td>
  4978. * <td>One or more parameters was not valid or not provided.</td>
  4979. * </tr>
  4980. * <tr>
  4981. * <td><code>'OT_ICE_WORKFLOW_FAILED'</code></td>
  4982. * <td>Something went wrong while establishing WebRTC connectivity.</td>
  4983. * </tr>
  4984. * <tr>
  4985. * <td><code>'OT_MEDIA_ERR_ABORTED'</code></td>
  4986. * <td>The fetching of the stream for the video element has been aborted.</td>
  4987. * </tr>
  4988. * <tr>
  4989. * <td><code>'OT_MEDIA_ERR_DECODE'</code></td>
  4990. * <td>A decoding error occurred while trying to play the stream in the video element.</td>
  4991. * </tr>
  4992. * <tr>
  4993. * <td><code>'OT_MEDIA_ERR_NETWORK'</code></td>
  4994. * <td>A network error caused the stream to stop being fetched.</td>
  4995. * </tr>
  4996. * <tr>
  4997. * <td><code>'OT_MEDIA_ERR_SRC_NOT_SUPPORTED'</code></td>
  4998. * <td>The stream has been detected to be not suitable for playback.</td>
  4999. * </tr>
  5000. * <tr>
  5001. * <td><code>'OT_NOT_CONNECTED'</code></td>
  5002. * <td>Couldn't perform action because you are not connected to the network.</td>
  5003. * </tr>
  5004. * <tr>
  5005. * <td><code>'OT_SET_REMOTE_DESCRIPTION_FAILED'</code></td>
  5006. * <td>The WebRTC connection failed during setDescription.</td>
  5007. * </tr>
  5008. * <tr>
  5009. * <td><code>'OT_STREAM_DESTROYED'</code></td>
  5010. * <td>The stream was destroyed before it could be subscribed to.</td>
  5011. * </tr>
  5012. * <tr>
  5013. * <td><code>'OT_STREAM_LIMIT_EXCEEDED'</code></td>
  5014. * <td>The client tried to subscribe to a stream in a session that has exceeded the limit
  5015. * for simultaneous streams.</td>
  5016. * </tr>
  5017. * <tr>
  5018. * <td><code>'OT_STREAM_NOT_FOUND'</code></td>
  5019. * <td>Couldn't subscribe to the stream because it was not found.</td>
  5020. * </tr>
  5021. * </table>
  5022. *
  5023. * <p>Errors that can occur when calling <code>Subscriber.getStats()</code>:</p>
  5024. *
  5025. * <table class="docs_table" style="width:100%"><tbody>
  5026. * <tr>
  5027. * <td><b><code>name</code></b></td>
  5028. * <td><b>Description</b></td>
  5029. * </tr>
  5030. * <tr>
  5031. * <td><code>'OT_NOT_CONNECTED'</code></td>
  5032. * <td>Couldn't perform action because you are not connected to the network.</td>
  5033. * </tr>
  5034. * </table>
  5035. *
  5036. * <p>Errors that can occur when the Promise returned by the <code>OT.unblockAudio()</code>
  5037. * method is rejected:</p>
  5038. *
  5039. * <table class="docs_table" style="width:100%"><tbody>
  5040. * <tr>
  5041. * <td><b><code>name</code></b></td>
  5042. * <td><b>Description</b></td>
  5043. * </tr>
  5044. * <tr>
  5045. * <td><code>'OT_MEDIA_ERR_ABORTED'</code></td>
  5046. * <td>The fetching of an audio stream has been aborted.</td>
  5047. * </tr>
  5048. * <tr>
  5049. * <td><code>'OT_MEDIA_ERR_NETWORK'</code></td>
  5050. * <td>A network error caused a stream to stop being fetched.</td>
  5051. * </tr>
  5052. * <tr>
  5053. * <td><code>'OT_MEDIA_ERR_DECODE'</code></td>
  5054. * <td>A decoding error occurred while trying to play a stream.</td>
  5055. * </tr>
  5056. * <tr>
  5057. * <td><code>'OT_MEDIA_ERR_SRC_NOT_SUPPORTED'</code></td>
  5058. * <td>A stream has been detected to be not suitable for playback.</td>
  5059. * </tr>
  5060. * </table>
  5061. *
  5062. * @class Error
  5063. * @augments Event
  5064. */
  5065. const OTErrorClass = function OTErrorClass(code, message) {
  5066. Error.call(this);
  5067. this.code = code;
  5068. this.message = message;
  5069. };
  5070. OTErrorClass.prototype = Object.create(Error.prototype);
  5071. OTErrorClass.prototype.constructor = OTErrorClass;
  5072. module.exports = OTErrorClass;
  5073. eventing(OTErrorClass);
  5074. const errorsCodesToTitle = {
  5075. 1004: 'Authentication error',
  5076. 1005: 'Invalid Session ID',
  5077. 1006: 'Connect Failed',
  5078. 1007: 'Connect Rejected',
  5079. 1008: 'Connect Time-out',
  5080. 1009: 'Security Error',
  5081. 1010: 'Not Connected',
  5082. 1011: 'Invalid Parameter',
  5083. 1012: 'Peer-to-peer Stream Play Failed',
  5084. 1013: 'Connection Failed',
  5085. 1014: 'API Response Failure',
  5086. 1015: 'PeerConnection not connected, cannot call this method',
  5087. 1021: 'Request Timeout',
  5088. 1026: 'Terms of Service Violation: Export Compliance',
  5089. 1027: 'Connection Limit Exceeded',
  5090. 1500: 'Unable to Publish',
  5091. 1501: 'Unable to Subscribe',
  5092. 1502: 'Unsupported Video Codec',
  5093. 1503: 'No TURN server found',
  5094. 1520: 'Unable to Force Disconnect',
  5095. 1530: 'Unable to Force Unpublish',
  5096. 1553: 'ICEWorkflow failed',
  5097. 1600: 'createOffer, createAnswer, setLocalDescription, setRemoteDescription',
  5098. 1605: 'Stream Limit Exceeded',
  5099. 2000: 'Internal Error',
  5100. 2001: 'Unexpected Server Response',
  5101. 4000: 'WebSocket Connection Failed',
  5102. 4001: 'WebSocket Network Disconnected',
  5103. 5001: 'Unable to access media engine'
  5104. };
  5105. /**
  5106. * Get the title of an error by error code
  5107. *
  5108. * @property {Number|String} code The error code to lookup
  5109. * @return {String} The title of the message with that code
  5110. *
  5111. * @example
  5112. *
  5113. * OTError.getTitleByCode(1006) === 'Connect Failed'
  5114. */
  5115. OTErrorClass.getTitleByCode = function (code) {
  5116. return errorsCodesToTitle[+code];
  5117. }; // @todo redo this when we have time to tidy up
  5118. //
  5119. // @example
  5120. //
  5121. // OTError.handleJsException("Descriptive error message", 2000, {
  5122. // session: session,
  5123. // target: stream|publisher|subscriber|session|etc
  5124. // });
  5125. //
  5126. OTErrorClass.handleJsException = (_ref) => {
  5127. let error = _ref.error,
  5128. errorMsg = _ref.errorMsg,
  5129. code = _ref.code,
  5130. target = _ref.target,
  5131. analytics = _ref.analytics;
  5132. if (!target) {
  5133. throw new Error('handleJsException requires target');
  5134. }
  5135. const getCode = () => code !== undefined ? code : error && error.code;
  5136. const getMessage = () => errorMsg !== undefined ? errorMsg : error && error.message;
  5137. const title = OTErrorClass.getTitleByCode(getCode());
  5138. logging.error("OT.exception :: title: " + title + " (" + getCode() + ") msg: " + getMessage());
  5139. try {
  5140. const options = {
  5141. partnerId: target.session ? target.session.apiKey : target.apiKey,
  5142. sessionId: target.session ? target.session.sessionId : target.sessionId
  5143. };
  5144. analytics.logError(getCode(), 'tb.exception', title, {
  5145. details: getMessage()
  5146. }, options);
  5147. const event = new Events.ExceptionEvent(eventNames.EXCEPTION, getMessage(), title, getCode(), target, target, error);
  5148. if (error) {
  5149. event.stack = error.stack;
  5150. } else {
  5151. // Augment the event object with a stacktrace for error reporting purposes
  5152. try {
  5153. throw new Error();
  5154. } catch (caughtError) {
  5155. event.stack = caughtError.stack;
  5156. }
  5157. }
  5158. OTErrorClass.dispatchEvent(event);
  5159. } catch (err) {
  5160. logging.error("OT.exception :: Failed to dispatch exception - " + err.toString()); // Don't throw an error because this is asynchronous
  5161. // don't do an exceptionHandler because that would be recursive
  5162. }
  5163. };
  5164. /***/ }),
  5165. /* 34 */
  5166. /***/ (function(module, exports, __webpack_require__) {
  5167. "use strict";
  5168. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  5169. /* eslint-disable no-underscore-dangle, no-param-reassign */
  5170. const OTHelpers = __webpack_require__(4); // A mixin to encapsulate the basic widget behaviour. This needs a better name,
  5171. // it's not actually a widget. It's actually "Behaviour that can be applied to
  5172. // an object to make it support the basic Chrome widget workflow"...but that would
  5173. // probably been too long a name.
  5174. module.exports = function Widget(widget, options) {
  5175. let _mode;
  5176. const _options = options || {}; //
  5177. // @param [String] mode
  5178. // 'on', 'off', or 'auto'
  5179. //
  5180. widget.setDisplayMode = function (mode) {
  5181. const newMode = mode || 'auto';
  5182. if (_mode === newMode) {
  5183. return;
  5184. }
  5185. OTHelpers.removeClass(this.domElement, "OT_mode-" + _mode);
  5186. OTHelpers.addClass(this.domElement, "OT_mode-" + newMode);
  5187. _mode = newMode;
  5188. };
  5189. widget.getDisplayMode = function () {
  5190. return _mode;
  5191. };
  5192. widget.showAfterLoading = function () {
  5193. OTHelpers.removeClass(this.domElement, 'OT_hide-forced');
  5194. };
  5195. widget.hideWhileLoading = function () {
  5196. OTHelpers.addClass(this.domElement, 'OT_hide-forced');
  5197. };
  5198. widget.destroy = function () {
  5199. if (_options.onDestroy) {
  5200. _options.onDestroy(this.domElement);
  5201. }
  5202. if (this.domElement) {
  5203. OTHelpers.removeElement(this.domElement);
  5204. }
  5205. return widget;
  5206. };
  5207. widget.appendTo = function (parent) {
  5208. // create the element under parent
  5209. this.domElement = OTHelpers.createElement(_options.nodeName || 'div', _options.htmlAttributes, _options.htmlContent);
  5210. if (_options.onCreate) {
  5211. _options.onCreate(this.domElement);
  5212. }
  5213. widget.setDisplayMode(_options.mode);
  5214. if (_options.mode === 'auto') {
  5215. // if the mode is auto we hold the "on mode" for 2 seconds
  5216. // this will let the proper widgets nicely fade away and help discoverability
  5217. OTHelpers.addClass(widget.domElement, 'OT_mode-on-hold');
  5218. setTimeout(() => {
  5219. OTHelpers.removeClass(widget.domElement, 'OT_mode-on-hold');
  5220. }, 2000);
  5221. } // add the widget to the parent
  5222. parent.appendChild(this.domElement);
  5223. return widget;
  5224. };
  5225. };
  5226. /***/ }),
  5227. /* 35 */
  5228. /***/ (function(module, exports, __webpack_require__) {
  5229. var baseClone = __webpack_require__(74);
  5230. /** Used to compose bitmasks for cloning. */
  5231. var CLONE_SYMBOLS_FLAG = 4;
  5232. /**
  5233. * Creates a shallow clone of `value`.
  5234. *
  5235. * **Note:** This method is loosely based on the
  5236. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  5237. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  5238. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  5239. * arrays. The own enumerable properties of `arguments` objects are cloned
  5240. * as plain objects. An empty object is returned for uncloneable values such
  5241. * as error objects, functions, DOM nodes, and WeakMaps.
  5242. *
  5243. * @static
  5244. * @memberOf _
  5245. * @since 0.1.0
  5246. * @category Lang
  5247. * @param {*} value The value to clone.
  5248. * @returns {*} Returns the cloned value.
  5249. * @see _.cloneDeep
  5250. * @example
  5251. *
  5252. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  5253. *
  5254. * var shallow = _.clone(objects);
  5255. * console.log(shallow[0] === objects[0]);
  5256. * // => true
  5257. */
  5258. function clone(value) {
  5259. return baseClone(value, CLONE_SYMBOLS_FLAG);
  5260. }
  5261. module.exports = clone;
  5262. /***/ }),
  5263. /* 36 */
  5264. /***/ (function(module, exports, __webpack_require__) {
  5265. var baseIsNative = __webpack_require__(337),
  5266. getValue = __webpack_require__(342);
  5267. /**
  5268. * Gets the native function at `key` of `object`.
  5269. *
  5270. * @private
  5271. * @param {Object} object The object to query.
  5272. * @param {string} key The key of the method to get.
  5273. * @returns {*} Returns the function if it's native, else `undefined`.
  5274. */
  5275. function getNative(object, key) {
  5276. var value = getValue(object, key);
  5277. return baseIsNative(value) ? value : undefined;
  5278. }
  5279. module.exports = getNative;
  5280. /***/ }),
  5281. /* 37 */
  5282. /***/ (function(module, exports, __webpack_require__) {
  5283. var root = __webpack_require__(10);
  5284. /** Built-in value references. */
  5285. var Symbol = root.Symbol;
  5286. module.exports = Symbol;
  5287. /***/ }),
  5288. /* 38 */
  5289. /***/ (function(module, exports, __webpack_require__) {
  5290. var assignValue = __webpack_require__(80),
  5291. baseAssignValue = __webpack_require__(60);
  5292. /**
  5293. * Copies properties of `source` to `object`.
  5294. *
  5295. * @private
  5296. * @param {Object} source The object to copy properties from.
  5297. * @param {Array} props The property identifiers to copy.
  5298. * @param {Object} [object={}] The object to copy properties to.
  5299. * @param {Function} [customizer] The function to customize copied values.
  5300. * @returns {Object} Returns `object`.
  5301. */
  5302. function copyObject(source, props, object, customizer) {
  5303. var isNew = !object;
  5304. object || (object = {});
  5305. var index = -1,
  5306. length = props.length;
  5307. while (++index < length) {
  5308. var key = props[index];
  5309. var newValue = customizer
  5310. ? customizer(object[key], source[key], key, object, source)
  5311. : undefined;
  5312. if (newValue === undefined) {
  5313. newValue = source[key];
  5314. }
  5315. if (isNew) {
  5316. baseAssignValue(object, key, newValue);
  5317. } else {
  5318. assignValue(object, key, newValue);
  5319. }
  5320. }
  5321. return object;
  5322. }
  5323. module.exports = copyObject;
  5324. /***/ }),
  5325. /* 39 */
  5326. /***/ (function(module, exports, __webpack_require__) {
  5327. var DataView = __webpack_require__(366),
  5328. Map = __webpack_require__(106),
  5329. Promise = __webpack_require__(367),
  5330. Set = __webpack_require__(180),
  5331. WeakMap = __webpack_require__(181),
  5332. baseGetTag = __webpack_require__(26),
  5333. toSource = __webpack_require__(169);
  5334. /** `Object#toString` result references. */
  5335. var mapTag = '[object Map]',
  5336. objectTag = '[object Object]',
  5337. promiseTag = '[object Promise]',
  5338. setTag = '[object Set]',
  5339. weakMapTag = '[object WeakMap]';
  5340. var dataViewTag = '[object DataView]';
  5341. /** Used to detect maps, sets, and weakmaps. */
  5342. var dataViewCtorString = toSource(DataView),
  5343. mapCtorString = toSource(Map),
  5344. promiseCtorString = toSource(Promise),
  5345. setCtorString = toSource(Set),
  5346. weakMapCtorString = toSource(WeakMap);
  5347. /**
  5348. * Gets the `toStringTag` of `value`.
  5349. *
  5350. * @private
  5351. * @param {*} value The value to query.
  5352. * @returns {string} Returns the `toStringTag`.
  5353. */
  5354. var getTag = baseGetTag;
  5355. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  5356. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  5357. (Map && getTag(new Map) != mapTag) ||
  5358. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  5359. (Set && getTag(new Set) != setTag) ||
  5360. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  5361. getTag = function(value) {
  5362. var result = baseGetTag(value),
  5363. Ctor = result == objectTag ? value.constructor : undefined,
  5364. ctorString = Ctor ? toSource(Ctor) : '';
  5365. if (ctorString) {
  5366. switch (ctorString) {
  5367. case dataViewCtorString: return dataViewTag;
  5368. case mapCtorString: return mapTag;
  5369. case promiseCtorString: return promiseTag;
  5370. case setCtorString: return setTag;
  5371. case weakMapCtorString: return weakMapTag;
  5372. }
  5373. }
  5374. return result;
  5375. };
  5376. }
  5377. module.exports = getTag;
  5378. /***/ }),
  5379. /* 40 */
  5380. /***/ (function(module, exports) {
  5381. function _defineProperties(target, props) {
  5382. for (var i = 0; i < props.length; i++) {
  5383. var descriptor = props[i];
  5384. descriptor.enumerable = descriptor.enumerable || false;
  5385. descriptor.configurable = true;
  5386. if ("value" in descriptor) descriptor.writable = true;
  5387. Object.defineProperty(target, descriptor.key, descriptor);
  5388. }
  5389. }
  5390. function _createClass(Constructor, protoProps, staticProps) {
  5391. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  5392. if (staticProps) _defineProperties(Constructor, staticProps);
  5393. return Constructor;
  5394. }
  5395. module.exports = _createClass;
  5396. /***/ }),
  5397. /* 41 */
  5398. /***/ (function(module, exports, __webpack_require__) {
  5399. var isSymbol = __webpack_require__(68);
  5400. /** Used as references for various `Number` constants. */
  5401. var INFINITY = 1 / 0;
  5402. /**
  5403. * Converts `value` to a string key if it's not a string or symbol.
  5404. *
  5405. * @private
  5406. * @param {*} value The value to inspect.
  5407. * @returns {string|symbol} Returns the key.
  5408. */
  5409. function toKey(value) {
  5410. if (typeof value == 'string' || isSymbol(value)) {
  5411. return value;
  5412. }
  5413. var result = (value + '');
  5414. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5415. }
  5416. module.exports = toKey;
  5417. /***/ }),
  5418. /* 42 */
  5419. /***/ (function(module, exports, __webpack_require__) {
  5420. var basePick = __webpack_require__(443),
  5421. flatRest = __webpack_require__(126);
  5422. /**
  5423. * Creates an object composed of the picked `object` properties.
  5424. *
  5425. * @static
  5426. * @since 0.1.0
  5427. * @memberOf _
  5428. * @category Object
  5429. * @param {Object} object The source object.
  5430. * @param {...(string|string[])} [paths] The property paths to pick.
  5431. * @returns {Object} Returns the new object.
  5432. * @example
  5433. *
  5434. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  5435. *
  5436. * _.pick(object, ['a', 'c']);
  5437. * // => { 'a': 1, 'c': 3 }
  5438. */
  5439. var pick = flatRest(function(object, paths) {
  5440. return object == null ? {} : basePick(object, paths);
  5441. });
  5442. module.exports = pick;
  5443. /***/ }),
  5444. /* 43 */
  5445. /***/ (function(module, exports, __webpack_require__) {
  5446. "use strict";
  5447. // Copyright Joyent, Inc. and other Node contributors.
  5448. //
  5449. // Permission is hereby granted, free of charge, to any person obtaining a
  5450. // copy of this software and associated documentation files (the
  5451. // "Software"), to deal in the Software without restriction, including
  5452. // without limitation the rights to use, copy, modify, merge, publish,
  5453. // distribute, sublicense, and/or sell copies of the Software, and to permit
  5454. // persons to whom the Software is furnished to do so, subject to the
  5455. // following conditions:
  5456. //
  5457. // The above copyright notice and this permission notice shall be included
  5458. // in all copies or substantial portions of the Software.
  5459. //
  5460. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  5461. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  5462. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  5463. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  5464. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  5465. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  5466. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  5467. var R = typeof Reflect === 'object' ? Reflect : null
  5468. var ReflectApply = R && typeof R.apply === 'function'
  5469. ? R.apply
  5470. : function ReflectApply(target, receiver, args) {
  5471. return Function.prototype.apply.call(target, receiver, args);
  5472. }
  5473. var ReflectOwnKeys
  5474. if (R && typeof R.ownKeys === 'function') {
  5475. ReflectOwnKeys = R.ownKeys
  5476. } else if (Object.getOwnPropertySymbols) {
  5477. ReflectOwnKeys = function ReflectOwnKeys(target) {
  5478. return Object.getOwnPropertyNames(target)
  5479. .concat(Object.getOwnPropertySymbols(target));
  5480. };
  5481. } else {
  5482. ReflectOwnKeys = function ReflectOwnKeys(target) {
  5483. return Object.getOwnPropertyNames(target);
  5484. };
  5485. }
  5486. function ProcessEmitWarning(warning) {
  5487. if (console && console.warn) console.warn(warning);
  5488. }
  5489. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  5490. return value !== value;
  5491. }
  5492. function EventEmitter() {
  5493. EventEmitter.init.call(this);
  5494. }
  5495. module.exports = EventEmitter;
  5496. // Backwards-compat with node 0.10.x
  5497. EventEmitter.EventEmitter = EventEmitter;
  5498. EventEmitter.prototype._events = undefined;
  5499. EventEmitter.prototype._eventsCount = 0;
  5500. EventEmitter.prototype._maxListeners = undefined;
  5501. // By default EventEmitters will print a warning if more than 10 listeners are
  5502. // added to it. This is a useful default which helps finding memory leaks.
  5503. var defaultMaxListeners = 10;
  5504. function checkListener(listener) {
  5505. if (typeof listener !== 'function') {
  5506. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  5507. }
  5508. }
  5509. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  5510. enumerable: true,
  5511. get: function() {
  5512. return defaultMaxListeners;
  5513. },
  5514. set: function(arg) {
  5515. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  5516. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  5517. }
  5518. defaultMaxListeners = arg;
  5519. }
  5520. });
  5521. EventEmitter.init = function() {
  5522. if (this._events === undefined ||
  5523. this._events === Object.getPrototypeOf(this)._events) {
  5524. this._events = Object.create(null);
  5525. this._eventsCount = 0;
  5526. }
  5527. this._maxListeners = this._maxListeners || undefined;
  5528. };
  5529. // Obviously not all Emitters should be limited to 10. This function allows
  5530. // that to be increased. Set to zero for unlimited.
  5531. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  5532. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  5533. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  5534. }
  5535. this._maxListeners = n;
  5536. return this;
  5537. };
  5538. function _getMaxListeners(that) {
  5539. if (that._maxListeners === undefined)
  5540. return EventEmitter.defaultMaxListeners;
  5541. return that._maxListeners;
  5542. }
  5543. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  5544. return _getMaxListeners(this);
  5545. };
  5546. EventEmitter.prototype.emit = function emit(type) {
  5547. var args = [];
  5548. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  5549. var doError = (type === 'error');
  5550. var events = this._events;
  5551. if (events !== undefined)
  5552. doError = (doError && events.error === undefined);
  5553. else if (!doError)
  5554. return false;
  5555. // If there is no 'error' event listener then throw.
  5556. if (doError) {
  5557. var er;
  5558. if (args.length > 0)
  5559. er = args[0];
  5560. if (er instanceof Error) {
  5561. // Note: The comments on the `throw` lines are intentional, they show
  5562. // up in Node's output if this results in an unhandled exception.
  5563. throw er; // Unhandled 'error' event
  5564. }
  5565. // At least give some kind of context to the user
  5566. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  5567. err.context = er;
  5568. throw err; // Unhandled 'error' event
  5569. }
  5570. var handler = events[type];
  5571. if (handler === undefined)
  5572. return false;
  5573. if (typeof handler === 'function') {
  5574. ReflectApply(handler, this, args);
  5575. } else {
  5576. var len = handler.length;
  5577. var listeners = arrayClone(handler, len);
  5578. for (var i = 0; i < len; ++i)
  5579. ReflectApply(listeners[i], this, args);
  5580. }
  5581. return true;
  5582. };
  5583. function _addListener(target, type, listener, prepend) {
  5584. var m;
  5585. var events;
  5586. var existing;
  5587. checkListener(listener);
  5588. events = target._events;
  5589. if (events === undefined) {
  5590. events = target._events = Object.create(null);
  5591. target._eventsCount = 0;
  5592. } else {
  5593. // To avoid recursion in the case that type === "newListener"! Before
  5594. // adding it to the listeners, first emit "newListener".
  5595. if (events.newListener !== undefined) {
  5596. target.emit('newListener', type,
  5597. listener.listener ? listener.listener : listener);
  5598. // Re-assign `events` because a newListener handler could have caused the
  5599. // this._events to be assigned to a new object
  5600. events = target._events;
  5601. }
  5602. existing = events[type];
  5603. }
  5604. if (existing === undefined) {
  5605. // Optimize the case of one listener. Don't need the extra array object.
  5606. existing = events[type] = listener;
  5607. ++target._eventsCount;
  5608. } else {
  5609. if (typeof existing === 'function') {
  5610. // Adding the second element, need to change to array.
  5611. existing = events[type] =
  5612. prepend ? [listener, existing] : [existing, listener];
  5613. // If we've already got an array, just append.
  5614. } else if (prepend) {
  5615. existing.unshift(listener);
  5616. } else {
  5617. existing.push(listener);
  5618. }
  5619. // Check for listener leak
  5620. m = _getMaxListeners(target);
  5621. if (m > 0 && existing.length > m && !existing.warned) {
  5622. existing.warned = true;
  5623. // No error code for this since it is a Warning
  5624. // eslint-disable-next-line no-restricted-syntax
  5625. var w = new Error('Possible EventEmitter memory leak detected. ' +
  5626. existing.length + ' ' + String(type) + ' listeners ' +
  5627. 'added. Use emitter.setMaxListeners() to ' +
  5628. 'increase limit');
  5629. w.name = 'MaxListenersExceededWarning';
  5630. w.emitter = target;
  5631. w.type = type;
  5632. w.count = existing.length;
  5633. ProcessEmitWarning(w);
  5634. }
  5635. }
  5636. return target;
  5637. }
  5638. EventEmitter.prototype.addListener = function addListener(type, listener) {
  5639. return _addListener(this, type, listener, false);
  5640. };
  5641. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  5642. EventEmitter.prototype.prependListener =
  5643. function prependListener(type, listener) {
  5644. return _addListener(this, type, listener, true);
  5645. };
  5646. function onceWrapper() {
  5647. if (!this.fired) {
  5648. this.target.removeListener(this.type, this.wrapFn);
  5649. this.fired = true;
  5650. if (arguments.length === 0)
  5651. return this.listener.call(this.target);
  5652. return this.listener.apply(this.target, arguments);
  5653. }
  5654. }
  5655. function _onceWrap(target, type, listener) {
  5656. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  5657. var wrapped = onceWrapper.bind(state);
  5658. wrapped.listener = listener;
  5659. state.wrapFn = wrapped;
  5660. return wrapped;
  5661. }
  5662. EventEmitter.prototype.once = function once(type, listener) {
  5663. checkListener(listener);
  5664. this.on(type, _onceWrap(this, type, listener));
  5665. return this;
  5666. };
  5667. EventEmitter.prototype.prependOnceListener =
  5668. function prependOnceListener(type, listener) {
  5669. checkListener(listener);
  5670. this.prependListener(type, _onceWrap(this, type, listener));
  5671. return this;
  5672. };
  5673. // Emits a 'removeListener' event if and only if the listener was removed.
  5674. EventEmitter.prototype.removeListener =
  5675. function removeListener(type, listener) {
  5676. var list, events, position, i, originalListener;
  5677. checkListener(listener);
  5678. events = this._events;
  5679. if (events === undefined)
  5680. return this;
  5681. list = events[type];
  5682. if (list === undefined)
  5683. return this;
  5684. if (list === listener || list.listener === listener) {
  5685. if (--this._eventsCount === 0)
  5686. this._events = Object.create(null);
  5687. else {
  5688. delete events[type];
  5689. if (events.removeListener)
  5690. this.emit('removeListener', type, list.listener || listener);
  5691. }
  5692. } else if (typeof list !== 'function') {
  5693. position = -1;
  5694. for (i = list.length - 1; i >= 0; i--) {
  5695. if (list[i] === listener || list[i].listener === listener) {
  5696. originalListener = list[i].listener;
  5697. position = i;
  5698. break;
  5699. }
  5700. }
  5701. if (position < 0)
  5702. return this;
  5703. if (position === 0)
  5704. list.shift();
  5705. else {
  5706. spliceOne(list, position);
  5707. }
  5708. if (list.length === 1)
  5709. events[type] = list[0];
  5710. if (events.removeListener !== undefined)
  5711. this.emit('removeListener', type, originalListener || listener);
  5712. }
  5713. return this;
  5714. };
  5715. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  5716. EventEmitter.prototype.removeAllListeners =
  5717. function removeAllListeners(type) {
  5718. var listeners, events, i;
  5719. events = this._events;
  5720. if (events === undefined)
  5721. return this;
  5722. // not listening for removeListener, no need to emit
  5723. if (events.removeListener === undefined) {
  5724. if (arguments.length === 0) {
  5725. this._events = Object.create(null);
  5726. this._eventsCount = 0;
  5727. } else if (events[type] !== undefined) {
  5728. if (--this._eventsCount === 0)
  5729. this._events = Object.create(null);
  5730. else
  5731. delete events[type];
  5732. }
  5733. return this;
  5734. }
  5735. // emit removeListener for all listeners on all events
  5736. if (arguments.length === 0) {
  5737. var keys = Object.keys(events);
  5738. var key;
  5739. for (i = 0; i < keys.length; ++i) {
  5740. key = keys[i];
  5741. if (key === 'removeListener') continue;
  5742. this.removeAllListeners(key);
  5743. }
  5744. this.removeAllListeners('removeListener');
  5745. this._events = Object.create(null);
  5746. this._eventsCount = 0;
  5747. return this;
  5748. }
  5749. listeners = events[type];
  5750. if (typeof listeners === 'function') {
  5751. this.removeListener(type, listeners);
  5752. } else if (listeners !== undefined) {
  5753. // LIFO order
  5754. for (i = listeners.length - 1; i >= 0; i--) {
  5755. this.removeListener(type, listeners[i]);
  5756. }
  5757. }
  5758. return this;
  5759. };
  5760. function _listeners(target, type, unwrap) {
  5761. var events = target._events;
  5762. if (events === undefined)
  5763. return [];
  5764. var evlistener = events[type];
  5765. if (evlistener === undefined)
  5766. return [];
  5767. if (typeof evlistener === 'function')
  5768. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  5769. return unwrap ?
  5770. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  5771. }
  5772. EventEmitter.prototype.listeners = function listeners(type) {
  5773. return _listeners(this, type, true);
  5774. };
  5775. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  5776. return _listeners(this, type, false);
  5777. };
  5778. EventEmitter.listenerCount = function(emitter, type) {
  5779. if (typeof emitter.listenerCount === 'function') {
  5780. return emitter.listenerCount(type);
  5781. } else {
  5782. return listenerCount.call(emitter, type);
  5783. }
  5784. };
  5785. EventEmitter.prototype.listenerCount = listenerCount;
  5786. function listenerCount(type) {
  5787. var events = this._events;
  5788. if (events !== undefined) {
  5789. var evlistener = events[type];
  5790. if (typeof evlistener === 'function') {
  5791. return 1;
  5792. } else if (evlistener !== undefined) {
  5793. return evlistener.length;
  5794. }
  5795. }
  5796. return 0;
  5797. }
  5798. EventEmitter.prototype.eventNames = function eventNames() {
  5799. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  5800. };
  5801. function arrayClone(arr, n) {
  5802. var copy = new Array(n);
  5803. for (var i = 0; i < n; ++i)
  5804. copy[i] = arr[i];
  5805. return copy;
  5806. }
  5807. function spliceOne(list, index) {
  5808. for (; index + 1 < list.length; index++)
  5809. list[index] = list[index + 1];
  5810. list.pop();
  5811. }
  5812. function unwrapListeners(arr) {
  5813. var ret = new Array(arr.length);
  5814. for (var i = 0; i < ret.length; ++i) {
  5815. ret[i] = arr[i].listener || arr[i];
  5816. }
  5817. return ret;
  5818. }
  5819. /***/ }),
  5820. /* 44 */
  5821. /***/ (function(module, exports, __webpack_require__) {
  5822. "use strict";
  5823. var _undefined = __webpack_require__(466)(); // Support ES3 engines
  5824. module.exports = function (val) { return val !== _undefined && val !== null; };
  5825. /***/ }),
  5826. /* 45 */
  5827. /***/ (function(module, exports, __webpack_require__) {
  5828. "use strict";
  5829. module.exports = __webpack_require__(480)()
  5830. ? __webpack_require__(97).Symbol
  5831. : __webpack_require__(483);
  5832. /***/ }),
  5833. /* 46 */
  5834. /***/ (function(module, exports, __webpack_require__) {
  5835. "use strict";
  5836. const performance = (typeof window !== undefined ? window : global).performance || {};
  5837. /**
  5838. * Returns the number of milliseconds since the the UNIX epoch
  5839. *
  5840. * When available (performance api exists), this function will not be skewed
  5841. * by clock adjustments. Only use if you require this functionality, otherwise
  5842. * use Date.now().
  5843. *
  5844. * @returns {number} Number of milliseconds since UNIX epoch
  5845. */
  5846. module.exports = function highResolutionNow() {
  5847. if (performance.now) {
  5848. return performance.timing.navigationStart + performance.now();
  5849. }
  5850. return Date.now();
  5851. };
  5852. /***/ }),
  5853. /* 47 */
  5854. /***/ (function(module, exports, __webpack_require__) {
  5855. var before = __webpack_require__(560);
  5856. /**
  5857. * Creates a function that is restricted to invoking `func` once. Repeat calls
  5858. * to the function return the value of the first invocation. The `func` is
  5859. * invoked with the `this` binding and arguments of the created function.
  5860. *
  5861. * @static
  5862. * @memberOf _
  5863. * @since 0.1.0
  5864. * @category Function
  5865. * @param {Function} func The function to restrict.
  5866. * @returns {Function} Returns the new restricted function.
  5867. * @example
  5868. *
  5869. * var initialize = _.once(createApplication);
  5870. * initialize();
  5871. * initialize();
  5872. * // => `createApplication` is invoked once
  5873. */
  5874. function once(func) {
  5875. return before(2, func);
  5876. }
  5877. module.exports = once;
  5878. /***/ }),
  5879. /* 48 */
  5880. /***/ (function(module, exports) {
  5881. /**
  5882. * Performs a
  5883. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  5884. * comparison between two values to determine if they are equivalent.
  5885. *
  5886. * @static
  5887. * @memberOf _
  5888. * @since 4.0.0
  5889. * @category Lang
  5890. * @param {*} value The value to compare.
  5891. * @param {*} other The other value to compare.
  5892. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  5893. * @example
  5894. *
  5895. * var object = { 'a': 1 };
  5896. * var other = { 'a': 1 };
  5897. *
  5898. * _.eq(object, object);
  5899. * // => true
  5900. *
  5901. * _.eq(object, other);
  5902. * // => false
  5903. *
  5904. * _.eq('a', 'a');
  5905. * // => true
  5906. *
  5907. * _.eq('a', Object('a'));
  5908. * // => false
  5909. *
  5910. * _.eq(NaN, NaN);
  5911. * // => true
  5912. */
  5913. function eq(value, other) {
  5914. return value === other || (value !== value && other !== other);
  5915. }
  5916. module.exports = eq;
  5917. /***/ }),
  5918. /* 49 */
  5919. /***/ (function(module, exports) {
  5920. /**
  5921. * Copies the values of `source` to `array`.
  5922. *
  5923. * @private
  5924. * @param {Array} source The array to copy values from.
  5925. * @param {Array} [array=[]] The array to copy values to.
  5926. * @returns {Array} Returns `array`.
  5927. */
  5928. function copyArray(source, array) {
  5929. var index = -1,
  5930. length = source.length;
  5931. array || (array = Array(length));
  5932. while (++index < length) {
  5933. array[index] = source[index];
  5934. }
  5935. return array;
  5936. }
  5937. module.exports = copyArray;
  5938. /***/ }),
  5939. /* 50 */
  5940. /***/ (function(module, exports, __webpack_require__) {
  5941. var baseClone = __webpack_require__(74);
  5942. /** Used to compose bitmasks for cloning. */
  5943. var CLONE_DEEP_FLAG = 1,
  5944. CLONE_SYMBOLS_FLAG = 4;
  5945. /**
  5946. * This method is like `_.clone` except that it recursively clones `value`.
  5947. *
  5948. * @static
  5949. * @memberOf _
  5950. * @since 1.0.0
  5951. * @category Lang
  5952. * @param {*} value The value to recursively clone.
  5953. * @returns {*} Returns the deep cloned value.
  5954. * @see _.clone
  5955. * @example
  5956. *
  5957. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  5958. *
  5959. * var deep = _.cloneDeep(objects);
  5960. * console.log(deep[0] === objects[0]);
  5961. * // => false
  5962. */
  5963. function cloneDeep(value) {
  5964. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  5965. }
  5966. module.exports = cloneDeep;
  5967. /***/ }),
  5968. /* 51 */
  5969. /***/ (function(module, exports, __webpack_require__) {
  5970. var baseGet = __webpack_require__(91);
  5971. /**
  5972. * Gets the value at `path` of `object`. If the resolved value is
  5973. * `undefined`, the `defaultValue` is returned in its place.
  5974. *
  5975. * @static
  5976. * @memberOf _
  5977. * @since 3.7.0
  5978. * @category Object
  5979. * @param {Object} object The object to query.
  5980. * @param {Array|string} path The path of the property to get.
  5981. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  5982. * @returns {*} Returns the resolved value.
  5983. * @example
  5984. *
  5985. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  5986. *
  5987. * _.get(object, 'a[0].b.c');
  5988. * // => 3
  5989. *
  5990. * _.get(object, ['a', '0', 'b', 'c']);
  5991. * // => 3
  5992. *
  5993. * _.get(object, 'a.b.c', 'default');
  5994. * // => 'default'
  5995. */
  5996. function get(object, path, defaultValue) {
  5997. var result = object == null ? undefined : baseGet(object, path);
  5998. return result === undefined ? defaultValue : result;
  5999. }
  6000. module.exports = get;
  6001. /***/ }),
  6002. /* 52 */
  6003. /***/ (function(module, exports, __webpack_require__) {
  6004. var isArray = __webpack_require__(9),
  6005. isKey = __webpack_require__(125),
  6006. stringToPath = __webpack_require__(214),
  6007. toString = __webpack_require__(92);
  6008. /**
  6009. * Casts `value` to a path array if it's not one.
  6010. *
  6011. * @private
  6012. * @param {*} value The value to inspect.
  6013. * @param {Object} [object] The object to query keys on.
  6014. * @returns {Array} Returns the cast property path array.
  6015. */
  6016. function castPath(value, object) {
  6017. if (isArray(value)) {
  6018. return value;
  6019. }
  6020. return isKey(value, object) ? [value] : stringToPath(toString(value));
  6021. }
  6022. module.exports = castPath;
  6023. /***/ }),
  6024. /* 53 */
  6025. /***/ (function(module, exports, __webpack_require__) {
  6026. "use strict";
  6027. // ES3 safe
  6028. var _undefined = void 0;
  6029. module.exports = function (value) { return value !== _undefined && value !== null; };
  6030. /***/ }),
  6031. /* 54 */
  6032. /***/ (function(module, exports, __webpack_require__) {
  6033. "use strict";
  6034. var _interopRequireDefault = __webpack_require__(2);
  6035. var _extends2 = _interopRequireDefault(__webpack_require__(23));
  6036. var _createClass2 = _interopRequireDefault(__webpack_require__(40));
  6037. /* eslint-disable no-underscore-dangle */
  6038. const guidStorage = __webpack_require__(245);
  6039. const Analytics = __webpack_require__(238);
  6040. const SessionInfo = __webpack_require__(246);
  6041. const StaticConfig = __webpack_require__(28)();
  6042. const eventing = __webpack_require__(5);
  6043. const sanitizeQosData = __webpack_require__(526);
  6044. const _require = __webpack_require__(128),
  6045. prependProxyToUrlIfNeeded = _require.prependProxyToUrlIfNeeded;
  6046. const LOG_VERSION = '2';
  6047. let AnalyticsHelper = /*#__PURE__*/function () {
  6048. function AnalyticsHelper(_temp) {
  6049. let _ref = _temp === void 0 ? {} : _temp,
  6050. _ref$staticConfig = _ref.staticConfig,
  6051. staticConfig = _ref$staticConfig === void 0 ? StaticConfig.onlyLocal() : _ref$staticConfig,
  6052. _ref$sessionInfo = _ref.sessionInfo,
  6053. sessionInfo = _ref$sessionInfo === void 0 ? new SessionInfo() : _ref$sessionInfo,
  6054. ajax = _ref.ajax,
  6055. queue = _ref.queue,
  6056. proxyUrl = _ref.proxyUrl;
  6057. this.proxyUrl = proxyUrl;
  6058. this.ajax = ajax;
  6059. this.queue = queue;
  6060. this.sessionInfo = sessionInfo;
  6061. this.staticConfig = staticConfig;
  6062. }
  6063. var _proto = AnalyticsHelper.prototype;
  6064. _proto._getCommon = function _getCommon() {
  6065. return {
  6066. clientVersion: this.staticConfig.clientVersion,
  6067. buildHash: this.staticConfig.buildHash,
  6068. source: (typeof window !== undefined ? window : global).location && (typeof window !== undefined ? window : global).location.href,
  6069. logVersion: LOG_VERSION,
  6070. apiServer: this.staticConfig.apiUrl,
  6071. clientSystemTime: new Date().getTime(),
  6072. sessionId: this.sessionInfo.sessionId,
  6073. mediaServerName: this.sessionInfo.mediaServerName,
  6074. p2p: this.sessionInfo.p2pEnabled,
  6075. messagingServer: this.sessionInfo.messagingServer,
  6076. messagingUrl: this.sessionInfo.messagingURL,
  6077. version: this.staticConfig.version,
  6078. partnerId: this.sessionInfo.partnerId
  6079. };
  6080. };
  6081. _proto.logError = function logError(code, type, message, details, options) {
  6082. if (options === void 0) {
  6083. options = {};
  6084. }
  6085. guidStorage.get((error, guid) => {
  6086. if (error) {
  6087. // @todo
  6088. return;
  6089. }
  6090. const args = [code, type, message, details, (0, _extends2.default)({
  6091. guid
  6092. }, this.combineWithCommon(options))];
  6093. AnalyticsHelper.emit('logError', ...args);
  6094. this._analytics.logError(...args);
  6095. });
  6096. };
  6097. _proto.combineWithCommon = function combineWithCommon(options) {
  6098. return (0, _extends2.default)({}, this._getCommon(), {}, options);
  6099. };
  6100. _proto.logEvent = function logEvent(options, throttle, completionHandler) {
  6101. if (options === void 0) {
  6102. options = {};
  6103. }
  6104. guidStorage.get((error, guid) => {
  6105. if (error) {
  6106. // @todo
  6107. return;
  6108. }
  6109. const logData = (0, _extends2.default)({
  6110. guid
  6111. }, this.combineWithCommon(options));
  6112. AnalyticsHelper.emit('logEvent', logData);
  6113. this._analytics.logEvent(logData, false, throttle, completionHandler);
  6114. });
  6115. };
  6116. _proto.logQOS = function logQOS(options) {
  6117. if (options === void 0) {
  6118. options = {};
  6119. }
  6120. guidStorage.get((error, guid) => {
  6121. if (error) {
  6122. // @todo
  6123. return;
  6124. }
  6125. const qosData = (0, _extends2.default)({
  6126. guid,
  6127. duration: 0
  6128. }, this.combineWithCommon(options));
  6129. sanitizeQosData(qosData);
  6130. AnalyticsHelper.emit('logQOS', qosData);
  6131. this._analytics.logQOS(qosData);
  6132. });
  6133. };
  6134. (0, _createClass2.default)(AnalyticsHelper, [{
  6135. key: "staticConfig",
  6136. get: function get() {
  6137. return this._staticConfig;
  6138. },
  6139. set: function set(staticConfig) {
  6140. this._staticConfig = staticConfig;
  6141. this._analytics = new Analytics({
  6142. loggingUrl: prependProxyToUrlIfNeeded(this.staticConfig.loggingUrl, this.proxyUrl),
  6143. ajax: this.ajax,
  6144. queue: this.queue
  6145. });
  6146. }
  6147. }]);
  6148. return AnalyticsHelper;
  6149. }();
  6150. eventing(AnalyticsHelper);
  6151. module.exports = AnalyticsHelper;
  6152. /***/ }),
  6153. /* 55 */
  6154. /***/ (function(module, exports) {
  6155. function _inheritsLoose(subClass, superClass) {
  6156. subClass.prototype = Object.create(superClass.prototype);
  6157. subClass.prototype.constructor = subClass;
  6158. subClass.__proto__ = superClass;
  6159. }
  6160. module.exports = _inheritsLoose;
  6161. /***/ }),
  6162. /* 56 */
  6163. /***/ (function(module, exports, __webpack_require__) {
  6164. "use strict";
  6165. /* eslint-disable global-require */
  6166. const once = __webpack_require__(47);
  6167. const StaticConfig = __webpack_require__(28)(); // Indicates whether this client supports WebRTC
  6168. //
  6169. // This is defined as: getUserMedia + PeerConnection + exceeds min browser version
  6170. //
  6171. exports.check = function (deps) {
  6172. if (deps === void 0) {
  6173. deps = {};
  6174. }
  6175. const env = deps.env || __webpack_require__(3);
  6176. const hasPeerConnectionCapability = deps.hasPeerConnectionCapability || __webpack_require__(569);
  6177. const logging = deps.logging || __webpack_require__(1)('hasOpenTokSupport');
  6178. /** @type StaticConfig */
  6179. const staticConfig = deps.staticConfig || StaticConfig.onlyLocal();
  6180. const minimumVersions = staticConfig.minimumVersion || {};
  6181. const minimumVersion = minimumVersions[env.name.toLowerCase()];
  6182. if (minimumVersion && minimumVersion > env.version) {
  6183. logging.debug('Support for', env.name, 'is disabled because we require', minimumVersion, 'but this is', env.version);
  6184. return false;
  6185. }
  6186. if (env.name === 'Node') {
  6187. // Node works, even though it doesn't have getUserMedia
  6188. return true;
  6189. }
  6190. return hasPeerConnectionCapability();
  6191. };
  6192. exports.once = once(() => exports.check());
  6193. /***/ }),
  6194. /* 57 */
  6195. /***/ (function(module, exports, __webpack_require__) {
  6196. "use strict";
  6197. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  6198. /* eslint-disable no-void, one-var, prefer-const, no-shadow, vars-on-top, no-var */
  6199. /* eslint-disable no-mixed-operators */
  6200. const assign = __webpack_require__(6);
  6201. const find = __webpack_require__(58);
  6202. const findIndex = __webpack_require__(265);
  6203. const logging = __webpack_require__(1)('SDPHelpers');
  6204. const START_MEDIA_SSRC = 10000;
  6205. const START_RTX_SSRC = 20000; // Here are the structure of the rtpmap attribute and the media line, most of the
  6206. // complex Regular Expressions in this code are matching against one of these two
  6207. // formats:
  6208. // * a=rtpmap:<payload type> <encoding name>/<clock rate> [/<encoding parameters>]
  6209. // * m=<media> <port>/<number of ports> <proto> <fmts>
  6210. //
  6211. // References:
  6212. // * https://tools.ietf.org/html/rfc4566
  6213. // * http://en.wikipedia.org/wiki/Session_Description_Protocol
  6214. //
  6215. //
  6216. const SDPHelpers = {
  6217. getSections(sdp) {
  6218. return sdp.split(/\r\n|\r|\n/).reduce((accum, line) => {
  6219. const match = line.match(/^m=(\w+) \d+/);
  6220. if (match) {
  6221. accum.sections[accum.section = match[1]] = []; // eslint-disable-line no-param-reassign
  6222. }
  6223. accum.sections[accum.section].push(line);
  6224. return accum;
  6225. }, {
  6226. sections: {
  6227. header: []
  6228. },
  6229. section: 'header'
  6230. }).sections;
  6231. },
  6232. getCodecsAndCodecMap(sdp, mediaType) {
  6233. const section = SDPHelpers.getSections(sdp)[mediaType];
  6234. if (!section) {
  6235. throw new Error("no mediaType " + mediaType);
  6236. }
  6237. const codecs = section[0].match(/m=\w+ \d+ [A-Z/]+ ([\d ]+)$/)[1].split(' ');
  6238. const codecMap = assign(...section.filter(line => line.match(/^a=rtpmap:\d+/)).map(line => line.match(/^a=rtpmap:(\d+) ([\w-]+)/).splice(1)).map((_ref) => {
  6239. let num = _ref[0],
  6240. codec = _ref[1];
  6241. return {
  6242. [num]: codec
  6243. };
  6244. }));
  6245. return {
  6246. codecs,
  6247. codecMap
  6248. };
  6249. },
  6250. getCodecs(sdp, mediaType) {
  6251. const codecsAndCodecMap = SDPHelpers.getCodecsAndCodecMap(sdp, mediaType);
  6252. return codecsAndCodecMap.codecs.map(num => codecsAndCodecMap.codecMap[num] || 'Unknown codec');
  6253. }
  6254. };
  6255. module.exports = SDPHelpers; // Search through sdpLines to find the Media Line of type +mediaType+.
  6256. SDPHelpers.getMLineIndex = function getMLineIndex(sdpLines, mediaType) {
  6257. const targetMLine = "m=" + mediaType; // Find the index of the media line for +type+
  6258. return findIndex(sdpLines, line => {
  6259. if (line.indexOf(targetMLine) !== -1) {
  6260. return true;
  6261. }
  6262. return false;
  6263. });
  6264. }; // Grab a M line of a particular +mediaType+ from sdpLines.
  6265. SDPHelpers.getMLine = function getMLine(sdpLines, mediaType) {
  6266. const mLineIndex = SDPHelpers.getMLineIndex(sdpLines, mediaType);
  6267. return mLineIndex > -1 ? sdpLines[mLineIndex] : void 0;
  6268. };
  6269. SDPHelpers.hasMediaType = (sdp, mediaType) => {
  6270. const mLineRegex = new RegExp("^m=" + mediaType);
  6271. const sdpLines = sdp.split('\r\n');
  6272. return findIndex(sdpLines, line => mLineRegex.test(line)) >= 0;
  6273. };
  6274. SDPHelpers.hasMLinePayloadType = function hasMLinePayloadType(sdpLines, mediaType, payloadType) {
  6275. const mLine = SDPHelpers.getMLine(sdpLines, mediaType);
  6276. const payloadTypes = SDPHelpers.getMLinePayloadTypes(mLine, mediaType);
  6277. return payloadTypes.indexOf(payloadType) > -1;
  6278. }; // Extract the payload types for a give Media Line.
  6279. //
  6280. SDPHelpers.getMLinePayloadTypes = function getMLinePayloadTypes(mediaLine, mediaType) {
  6281. const mLineSelector = new RegExp("^m=" + mediaType + " \\d+(/\\d+)? [a-zA-Z0-9/]+(( [a-zA-Z0-9/]+)+)$", 'i'); // Get all payload types that the line supports
  6282. const payloadTypes = mediaLine.match(mLineSelector);
  6283. if (!payloadTypes || payloadTypes.length < 2) {
  6284. // Error, invalid M line?
  6285. return [];
  6286. }
  6287. return payloadTypes[2].trim().split(' ');
  6288. };
  6289. SDPHelpers.removeTypesFromMLine = function removeTypesFromMLine(mediaLine, payloadTypes) {
  6290. const typesSuffix = /[0-9 ]*$/.exec(mediaLine)[0];
  6291. const newTypes = typesSuffix.split(' ').filter(type => type !== '' && payloadTypes.indexOf(type) === -1);
  6292. return mediaLine.replace(typesSuffix, " " + newTypes.join(' '));
  6293. }; // Remove all references to a particular encodingName from a particular media type
  6294. //
  6295. SDPHelpers.removeMediaEncoding = function removeMediaEncoding(sdp, mediaType, encodingName) {
  6296. let payloadTypes, i, j, parts;
  6297. let sdpLines = sdp.split('\r\n');
  6298. const mLineIndex = SDPHelpers.getMLineIndex(sdpLines, mediaType);
  6299. const mLine = mLineIndex > -1 ? sdpLines[mLineIndex] : void 0;
  6300. const typesToRemove = [];
  6301. if (mLineIndex === -1) {
  6302. // Error, missing M line
  6303. return sdpLines.join('\r\n');
  6304. } // Get all payload types that the line supports
  6305. payloadTypes = SDPHelpers.getMLinePayloadTypes(mLine, mediaType);
  6306. if (payloadTypes.length === 0) {
  6307. // Error, invalid M line?
  6308. return sdpLines.join('\r\n');
  6309. } // Find the payloadTypes of the codecs.
  6310. // Allows multiple matches e.g. for CN.
  6311. for (i = mLineIndex; i < sdpLines.length; i++) {
  6312. const codecRegex = new RegExp(encodingName, 'i');
  6313. if (sdpLines[i].indexOf('a=rtpmap:') === 0) {
  6314. parts = sdpLines[i].split(' ');
  6315. if (parts.length === 2 && codecRegex.test(parts[1])) {
  6316. typesToRemove.push(parts[0].substr(9));
  6317. }
  6318. }
  6319. }
  6320. if (!typesToRemove.length) {
  6321. // Not found.
  6322. return sdpLines.join('\r\n');
  6323. } // Also find any rtx which reference the removed codec.
  6324. for (i = mLineIndex; i < sdpLines.length; i++) {
  6325. if (sdpLines[i].indexOf('a=fmtp:') === 0) {
  6326. parts = sdpLines[i].split(' ');
  6327. for (j = 0; j < typesToRemove.length; j++) {
  6328. if (parts.length === 2 && parts[1] === "apt=" + typesToRemove[j]) {
  6329. typesToRemove.push(parts[0].substr(7));
  6330. }
  6331. }
  6332. }
  6333. } // Remove any rtpmap, fmtp or rtcp-fb.
  6334. sdpLines = sdpLines.filter(line => {
  6335. for (let i = 0; i < typesToRemove.length; i++) {
  6336. if (line.indexOf("a=rtpmap:" + typesToRemove[i] + " ") === 0 || line.indexOf("a=fmtp:" + typesToRemove[i] + " ") === 0 || line.indexOf("a=rtcp-fb:" + typesToRemove[i] + " ") === 0) {
  6337. return false;
  6338. }
  6339. }
  6340. return true;
  6341. });
  6342. if (typesToRemove.length > 0 && mLineIndex > -1) {
  6343. // Remove all the payload types and we've removed from the media line
  6344. sdpLines[mLineIndex] = SDPHelpers.removeTypesFromMLine(mLine, typesToRemove);
  6345. }
  6346. return sdpLines.join('\r\n');
  6347. };
  6348. SDPHelpers.disableMediaType = function disableMediaType(sdp, mediaType) {
  6349. const lines = sdp.split('\r\n');
  6350. const blocks = [];
  6351. let block; // Separating SDP into blocks. This usually follows the form:
  6352. // Header block:
  6353. // v=0
  6354. // ...
  6355. // Audio block:
  6356. // m=audio
  6357. // ...
  6358. // Video block:
  6359. // m=video
  6360. // ...
  6361. lines.forEach(lineParam => {
  6362. let line = lineParam;
  6363. if (/^m=/.test(line)) {
  6364. block = undefined;
  6365. }
  6366. if (!block) {
  6367. block = [];
  6368. blocks.push(block);
  6369. }
  6370. block.push(line);
  6371. }); // Now disable the block for the specified media type
  6372. const mLineRegex = new RegExp("^m=" + mediaType + " \\d+ ([^ ]+) [0-9 ]+$");
  6373. const fixedBlocks = blocks.map(block => {
  6374. const match = block[0].match(mLineRegex);
  6375. if (match) {
  6376. return ["m=" + mediaType + " 0 " + match[1] + " 0", 'a=inactive', ...block.filter(line => /^c=/.test(line) || /^a=mid:/.test(line) || line === '' // This preserves the trailing newline
  6377. )];
  6378. }
  6379. return block;
  6380. });
  6381. return [].concat(...fixedBlocks).join('\r\n');
  6382. };
  6383. SDPHelpers.removeVideoCodec = function removeVideoCodec(sdp, codec) {
  6384. return SDPHelpers.removeMediaEncoding(sdp, 'video', codec);
  6385. }; // Used to identify whether Video media (for a given set of SDP) supports
  6386. // retransmissions.
  6387. //
  6388. // The algorithm to do could be summarised as:
  6389. //
  6390. // IF ssrc-group:FID exists AND IT HAS AT LEAST TWO IDS THEN
  6391. // we are using RTX
  6392. // ELSE IF "a=rtpmap: (\\d+):rtxPayloadId(/\\d+)? rtx/90000"
  6393. // AND SDPHelpers.hasMLinePayloadType(sdpLines, 'Video', rtxPayloadId)
  6394. // we are using RTX
  6395. // ELSE
  6396. // we are not using RTX
  6397. //
  6398. // The ELSE IF clause basically covers the case where ssrc-group:FID
  6399. // is probably malformed or missing. In that case we verify whether
  6400. // we want RTX by looking at whether it's mentioned in the video
  6401. // media line instead.
  6402. //
  6403. const isUsingRTX = function isUsingRTX(sdpLines, videoAttrs) {
  6404. let groupFID = videoAttrs.filterByName('ssrc-group:FID');
  6405. const missingFID = groupFID.length === 0;
  6406. if (!missingFID) {
  6407. groupFID = groupFID[0].value.split(' ');
  6408. } else {
  6409. groupFID = [];
  6410. }
  6411. switch (groupFID.length) {
  6412. case 0:
  6413. case 1:
  6414. // possibly no RTX, double check for the RTX payload type and that
  6415. // the Video Media line contains that payload type
  6416. //
  6417. // Details: Look for a rtpmap line for rtx/90000
  6418. // If there is one, grab the payload ID for rtx
  6419. // Look to see if that payload ID is listed under the payload types for the m=Video line
  6420. // If it is: RTX
  6421. // else: No RTX for you
  6422. var rtxAttr = videoAttrs.find(attr => attr.name.indexOf('rtpmap:') === 0 && attr.value.indexOf('rtx/90000') > -1);
  6423. if (!rtxAttr) {
  6424. return false;
  6425. }
  6426. var rtxPayloadId = rtxAttr.name.split(':')[1];
  6427. if (rtxPayloadId.indexOf('/') > -1) {
  6428. rtxPayloadId = rtxPayloadId.split('/')[0];
  6429. }
  6430. return SDPHelpers.hasMLinePayloadType(sdpLines, 'video', rtxPayloadId);
  6431. default:
  6432. // two or more: definitely RTX
  6433. logging.debug('SDP Helpers: There are more than two FIDs, RTX is definitely enabled');
  6434. return true;
  6435. }
  6436. }; // This returns an Array, which is decorated with several
  6437. // SDP specific helper methods.
  6438. //
  6439. SDPHelpers.getAttributesForMediaType = function getAttributesForMediaType(sdpLines, mediaType) {
  6440. let ssrcStartIndex, ssrcEndIndex, regResult, ssrc, ssrcGroup, msidMatch, msid, mid, midIndex;
  6441. const mLineIndex = SDPHelpers.getMLineIndex(sdpLines, mediaType);
  6442. const matchOtherMLines = new RegExp("m=(?!" + mediaType + ").+ ", 'i');
  6443. const matchSSRCLines = new RegExp('a=ssrc:\\d+ .*', 'i');
  6444. const matchSSRCGroup = new RegExp('a=ssrc-group:FID (\\d+).*?', 'i');
  6445. const matchAttrLine = new RegExp('a=([a-z0-9:/-]+) (.*)', 'i');
  6446. const attrs = [];
  6447. for (let i = mLineIndex + 1; i < sdpLines.length; i++) {
  6448. if (matchOtherMLines.test(sdpLines[i])) {
  6449. break;
  6450. } // Get the ssrc
  6451. ssrcGroup = sdpLines[i].match(matchSSRCGroup);
  6452. if (ssrcGroup) {
  6453. ssrcStartIndex = i;
  6454. ssrc = ssrcGroup[1];
  6455. } // Get the msid
  6456. msidMatch = sdpLines[i].match("a=ssrc:" + ssrc + " msid:(.+)");
  6457. if (msidMatch) {
  6458. msid = msidMatch[1];
  6459. } // find where the ssrc lines end
  6460. const isSSRCLine = matchSSRCLines.test(sdpLines[i]);
  6461. if (ssrcStartIndex !== undefined && ssrcEndIndex === undefined && !isSSRCLine || i === sdpLines.length - 1) {
  6462. ssrcEndIndex = i;
  6463. }
  6464. const midMatch = sdpLines[i].match(/a=mid:(.+)/);
  6465. if (midMatch) {
  6466. mid = midMatch[1];
  6467. midIndex = i;
  6468. }
  6469. regResult = matchAttrLine.exec(sdpLines[i]);
  6470. if (regResult && regResult.length === 3) {
  6471. attrs.push({
  6472. lineIndex: i,
  6473. name: regResult[1],
  6474. value: regResult[2]
  6475. });
  6476. }
  6477. } // / The next section decorates the attributes array
  6478. // / with some useful helpers.
  6479. // Store references to the start and end indices
  6480. // of the media section for this mediaType
  6481. attrs.ssrcStartIndex = ssrcStartIndex;
  6482. attrs.ssrcEndIndex = ssrcEndIndex;
  6483. attrs.msid = msid;
  6484. attrs.mid = mid;
  6485. attrs.midIndex = midIndex;
  6486. attrs.isUsingRTX = isUsingRTX.bind(null, sdpLines, attrs);
  6487. attrs.filterByName = function (name) {
  6488. return this.filter(attr => attr.name === name);
  6489. };
  6490. attrs.getRtpNumber = mediaEncoding => {
  6491. const namePattern = new RegExp('rtpmap:(.+)');
  6492. return find(attrs.map(attr => {
  6493. const nameMatch = attr.name.match(namePattern);
  6494. if (nameMatch && attr.value.indexOf(mediaEncoding) >= 0) {
  6495. return nameMatch[1];
  6496. }
  6497. return null;
  6498. }), attr => attr !== null);
  6499. };
  6500. return attrs;
  6501. };
  6502. const modifyStereo = (type, sdp, enable) => {
  6503. const sdpLines = sdp.split('\r\n');
  6504. if (!SDPHelpers.getMLine(sdpLines, 'audio')) {
  6505. logging.debug('No audio m-line, not enabling stereo.');
  6506. return sdp;
  6507. }
  6508. const audioAttrs = SDPHelpers.getAttributesForMediaType(sdpLines, 'audio');
  6509. const rtpNumber = audioAttrs.getRtpNumber('opus');
  6510. if (!rtpNumber) {
  6511. logging.debug('Could not find rtp number for opus, not enabling stereo.');
  6512. return sdp;
  6513. }
  6514. const fmtpAttr = audioAttrs.find(attr => attr.name === "fmtp:" + rtpNumber);
  6515. if (!fmtpAttr) {
  6516. logging.debug('Could not find a=fmtp line for opus, not enabling stereo.');
  6517. return sdp;
  6518. }
  6519. let line = sdpLines[fmtpAttr.lineIndex];
  6520. let pattern;
  6521. switch (type) {
  6522. case 'send':
  6523. pattern = /sprop-stereo=\d+([\s;]*)/;
  6524. if (pattern.test(fmtpAttr.value)) {
  6525. line = line.replace(pattern, enable ? 'sprop-stereo=1$1' : '');
  6526. } else if (enable) {
  6527. line += '; sprop-stereo=1';
  6528. }
  6529. break;
  6530. case 'receive':
  6531. pattern = /([^-])stereo=\d+([\s;]*)/;
  6532. if (pattern.test(fmtpAttr.value)) {
  6533. line = line.replace(pattern, enable ? '$1stereo=1$2' : '$1');
  6534. } else if (enable) {
  6535. line += '; stereo=1';
  6536. }
  6537. break;
  6538. default:
  6539. throw new Error("Invalid type " + type + " passed into enableStereo");
  6540. } // Trim any trailing whitespace and semicolons
  6541. line = line.replace(/[;\s]*$/, '');
  6542. sdpLines[fmtpAttr.lineIndex] = line;
  6543. return sdpLines.join('\r\n');
  6544. };
  6545. SDPHelpers.modifySendStereo = modifyStereo.bind(null, 'send');
  6546. SDPHelpers.modifyReceiveStereo = modifyStereo.bind(null, 'receive');
  6547. SDPHelpers.setAudioBitrate = (sdp, audioBitrate) => {
  6548. const existingValue = SDPHelpers.getAudioBitrate(sdp);
  6549. if (existingValue !== undefined) {
  6550. logging.debug("Audio bitrate already set to " + existingValue + ", not setting audio bitrate");
  6551. return sdp;
  6552. }
  6553. const sdpLines = sdp.split('\r\n');
  6554. if (!SDPHelpers.getMLine(sdpLines, 'audio')) {
  6555. logging.debug('No audio m-line, not setting audio bitrate.');
  6556. return sdp;
  6557. }
  6558. const audioAttrs = SDPHelpers.getAttributesForMediaType(sdpLines, 'audio');
  6559. if (!audioAttrs.midIndex) {
  6560. logging.debug('No audio mid line, not setting audio bitrate.');
  6561. return sdp;
  6562. } // SDP expects audio bitrate in kbit/s
  6563. const audioBitrateKbps = Math.floor(audioBitrate / 1000);
  6564. sdpLines.splice(audioAttrs.midIndex + 1, 0, "b=AS:" + audioBitrateKbps);
  6565. return sdpLines.join('\r\n');
  6566. };
  6567. SDPHelpers.hasSendStereo = sdp => /[\s;]sprop-stereo=1/.test(sdp);
  6568. SDPHelpers.getAudioBitrate = sdp => {
  6569. const result = sdp.match(/\sb=AS:(\d+)/);
  6570. if (result) {
  6571. return Number(result[1]) * 1000;
  6572. }
  6573. return undefined;
  6574. }; // Modifies +sdp+ to enable Simulcast for +numberOfStreams+.
  6575. //
  6576. // Ok, here's the plan:
  6577. // - add the 'a=ssrc-group:SIM' line, it will have numberOfStreams ssrcs
  6578. // - if RTX then add one 'a=ssrc-group:FID', we need to add numberOfStreams lines
  6579. // - add numberOfStreams 'a=ssrc:...' lines for the media ssrc
  6580. // - if RTX then add numberOfStreams 'a=ssrc:...' lines for the RTX ssrc
  6581. //
  6582. // Re: media and rtx ssrcs:
  6583. // We just generate these. The Mantis folk would like us to use sequential numbers
  6584. // here for ease of debugging. We can use the same starting number each time as well.
  6585. // We should confirm with Oscar/Jose that whether we need to verify that the numbers
  6586. // that we choose don't clash with any other ones in the SDP.
  6587. //
  6588. // I think we do need to check but I can't remember.
  6589. //
  6590. // Re: The format of the 'a=ssrc:' lines
  6591. // Just use the following pattern:
  6592. // a=ssrc:<Media or RTX SSRC> cname:localCname
  6593. // a=ssrc:<Media or RTX SSRC> msid:<MSID>
  6594. //
  6595. // It doesn't matter that they are all the same and are static.
  6596. //
  6597. //
  6598. SDPHelpers.enableSimulcast = function enableSimulcast(sdp, numberOfStreams) {
  6599. let linesToAdd, i;
  6600. const sdpLines = sdp.split('\r\n');
  6601. if (!SDPHelpers.getMLine(sdpLines, 'video')) {
  6602. logging.debug('No video m-line, not enabling simulcast.');
  6603. return sdp;
  6604. }
  6605. const videoAttrs = SDPHelpers.getAttributesForMediaType(sdpLines, 'video');
  6606. if (videoAttrs.filterByName('ssrc-group:SIM').length > 0) {
  6607. logging.debug('Simulcast is already enabled in this SDP, not attempting to enable again.');
  6608. return sdp;
  6609. }
  6610. if (!videoAttrs.msid) {
  6611. logging.debug('No local stream attached, not enabling simulcast.');
  6612. return sdp;
  6613. }
  6614. const usingRTX = videoAttrs.isUsingRTX();
  6615. const mediaSSRC = [];
  6616. const rtxSSRC = []; // generate new media (and rtx if needed) ssrcs
  6617. for (i = 0; i < numberOfStreams; ++i) {
  6618. mediaSSRC.push(START_MEDIA_SSRC + i);
  6619. if (usingRTX) {
  6620. rtxSSRC.push(START_RTX_SSRC + i);
  6621. }
  6622. }
  6623. linesToAdd = ["a=ssrc-group:SIM " + mediaSSRC.join(' ')];
  6624. if (usingRTX) {
  6625. for (i = 0; i < numberOfStreams; ++i) {
  6626. linesToAdd.push("a=ssrc-group:FID " + mediaSSRC[i] + " " + rtxSSRC[i]);
  6627. }
  6628. }
  6629. for (i = 0; i < numberOfStreams; ++i) {
  6630. linesToAdd.push("a=ssrc:" + mediaSSRC[i] + " cname:localCname", "a=ssrc:" + mediaSSRC[i] + " msid:" + videoAttrs.msid);
  6631. }
  6632. if (usingRTX) {
  6633. for (i = 0; i < numberOfStreams; ++i) {
  6634. linesToAdd.push("a=ssrc:" + rtxSSRC[i] + " cname:localCname", "a=ssrc:" + rtxSSRC[i] + " msid:" + videoAttrs.msid);
  6635. }
  6636. } // Replace the previous video ssrc section with our new video ssrc section by
  6637. // deleting the old ssrcs section and inserting the new lines
  6638. linesToAdd.unshift(videoAttrs.ssrcStartIndex, videoAttrs.ssrcEndIndex - videoAttrs.ssrcStartIndex);
  6639. sdpLines.splice(...linesToAdd);
  6640. return sdpLines.join('\r\n');
  6641. };
  6642. SDPHelpers.reprioritizeVideoCodec = function reprioritizeVideoCodec(sdp, codec, location) {
  6643. const lines = sdp.split('\r\n');
  6644. const mLineIndex = SDPHelpers.getMLineIndex(lines, 'video');
  6645. if (mLineIndex === -1) {
  6646. return sdp;
  6647. }
  6648. const payloadTypes = SDPHelpers.getMLinePayloadTypes(lines[mLineIndex], 'video');
  6649. const regex = new RegExp("^a=rtpmap:(\\d+).* " + codec, 'i');
  6650. const codecMatches = lines.map(line => line.match(regex)).filter(match => match !== null);
  6651. if (codecMatches.length === 0) {
  6652. return sdp;
  6653. }
  6654. const codecTypeCodes = codecMatches.map(match => match[1]);
  6655. let newPayloadTypes = payloadTypes.filter(t => codecTypeCodes.indexOf(t) === -1);
  6656. if (location === 'top') {
  6657. newPayloadTypes.unshift(...codecTypeCodes);
  6658. } else if (location === 'bottom') {
  6659. newPayloadTypes.push(...codecTypeCodes);
  6660. } else {
  6661. logging.error("Unexpected location param: " + location + "; not changing " + codec + " priority");
  6662. newPayloadTypes = payloadTypes;
  6663. }
  6664. const newMLine = lines[mLineIndex].replace(payloadTypes.join(' '), newPayloadTypes.join(' '));
  6665. lines[mLineIndex] = newMLine;
  6666. return lines.join('\r\n');
  6667. };
  6668. /***/ }),
  6669. /* 58 */
  6670. /***/ (function(module, exports, __webpack_require__) {
  6671. var createFind = __webpack_require__(581),
  6672. findIndex = __webpack_require__(265);
  6673. /**
  6674. * Iterates over elements of `collection`, returning the first element
  6675. * `predicate` returns truthy for. The predicate is invoked with three
  6676. * arguments: (value, index|key, collection).
  6677. *
  6678. * @static
  6679. * @memberOf _
  6680. * @since 0.1.0
  6681. * @category Collection
  6682. * @param {Array|Object} collection The collection to inspect.
  6683. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  6684. * @param {number} [fromIndex=0] The index to search from.
  6685. * @returns {*} Returns the matched element, else `undefined`.
  6686. * @example
  6687. *
  6688. * var users = [
  6689. * { 'user': 'barney', 'age': 36, 'active': true },
  6690. * { 'user': 'fred', 'age': 40, 'active': false },
  6691. * { 'user': 'pebbles', 'age': 1, 'active': true }
  6692. * ];
  6693. *
  6694. * _.find(users, function(o) { return o.age < 40; });
  6695. * // => object for 'barney'
  6696. *
  6697. * // The `_.matches` iteratee shorthand.
  6698. * _.find(users, { 'age': 1, 'active': true });
  6699. * // => object for 'pebbles'
  6700. *
  6701. * // The `_.matchesProperty` iteratee shorthand.
  6702. * _.find(users, ['active', false]);
  6703. * // => object for 'fred'
  6704. *
  6705. * // The `_.property` iteratee shorthand.
  6706. * _.find(users, 'active');
  6707. * // => object for 'barney'
  6708. */
  6709. var find = createFind(findIndex);
  6710. module.exports = find;
  6711. /***/ }),
  6712. /* 59 */
  6713. /***/ (function(module, exports, __webpack_require__) {
  6714. "use strict";
  6715. module.exports = function eventHelper(object) {
  6716. const eventHandlers = [];
  6717. return {
  6718. on(eventName, handler) {
  6719. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  6720. args[_key - 2] = arguments[_key];
  6721. }
  6722. eventHandlers.push({
  6723. eventName,
  6724. handler,
  6725. args
  6726. });
  6727. if (object.on) {
  6728. object.on(eventName, handler);
  6729. } else if (object.addEventListener) {
  6730. object.addEventListener(eventName, handler, ...args);
  6731. } else {
  6732. throw new Error('Object does not support events', object);
  6733. }
  6734. },
  6735. off(eventName, handler) {
  6736. if (object.off) {
  6737. object.off(eventName, handler);
  6738. } else if (object.removeEventListener) {
  6739. for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  6740. args[_key2 - 2] = arguments[_key2];
  6741. }
  6742. object.removeEventListener(eventName, handler, ...args);
  6743. } else {
  6744. throw new Error('Object does not support events', object);
  6745. }
  6746. },
  6747. once(eventName, handler) {
  6748. for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
  6749. args[_key3 - 2] = arguments[_key3];
  6750. }
  6751. eventHandlers.push({
  6752. eventName,
  6753. handler,
  6754. args
  6755. });
  6756. object.once(eventName, handler);
  6757. },
  6758. removeAll() {
  6759. eventHandlers.forEach((_ref) => {
  6760. let eventName = _ref.eventName,
  6761. handler = _ref.handler,
  6762. args = _ref.args;
  6763. this.off(eventName, handler, ...args);
  6764. });
  6765. eventHandlers.splice(0, eventHandlers.length);
  6766. }
  6767. };
  6768. };
  6769. /***/ }),
  6770. /* 60 */
  6771. /***/ (function(module, exports, __webpack_require__) {
  6772. var defineProperty = __webpack_require__(170);
  6773. /**
  6774. * The base implementation of `assignValue` and `assignMergeValue` without
  6775. * value checks.
  6776. *
  6777. * @private
  6778. * @param {Object} object The object to modify.
  6779. * @param {string} key The key of the property to assign.
  6780. * @param {*} value The value to assign.
  6781. */
  6782. function baseAssignValue(object, key, value) {
  6783. if (key == '__proto__' && defineProperty) {
  6784. defineProperty(object, key, {
  6785. 'configurable': true,
  6786. 'enumerable': true,
  6787. 'value': value,
  6788. 'writable': true
  6789. });
  6790. } else {
  6791. object[key] = value;
  6792. }
  6793. }
  6794. module.exports = baseAssignValue;
  6795. /***/ }),
  6796. /* 61 */
  6797. /***/ (function(module, exports, __webpack_require__) {
  6798. var baseIsArguments = __webpack_require__(356),
  6799. isObjectLike = __webpack_require__(14);
  6800. /** Used for built-in method references. */
  6801. var objectProto = Object.prototype;
  6802. /** Used to check objects for own properties. */
  6803. var hasOwnProperty = objectProto.hasOwnProperty;
  6804. /** Built-in value references. */
  6805. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  6806. /**
  6807. * Checks if `value` is likely an `arguments` object.
  6808. *
  6809. * @static
  6810. * @memberOf _
  6811. * @since 0.1.0
  6812. * @category Lang
  6813. * @param {*} value The value to check.
  6814. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  6815. * else `false`.
  6816. * @example
  6817. *
  6818. * _.isArguments(function() { return arguments; }());
  6819. * // => true
  6820. *
  6821. * _.isArguments([1, 2, 3]);
  6822. * // => false
  6823. */
  6824. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  6825. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  6826. !propertyIsEnumerable.call(value, 'callee');
  6827. };
  6828. module.exports = isArguments;
  6829. /***/ }),
  6830. /* 62 */
  6831. /***/ (function(module, exports, __webpack_require__) {
  6832. /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(10),
  6833. stubFalse = __webpack_require__(357);
  6834. /** Detect free variable `exports`. */
  6835. var freeExports = true && exports && !exports.nodeType && exports;
  6836. /** Detect free variable `module`. */
  6837. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  6838. /** Detect the popular CommonJS extension `module.exports`. */
  6839. var moduleExports = freeModule && freeModule.exports === freeExports;
  6840. /** Built-in value references. */
  6841. var Buffer = moduleExports ? root.Buffer : undefined;
  6842. /* Built-in method references for those with the same name as other `lodash` methods. */
  6843. var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
  6844. /**
  6845. * Checks if `value` is a buffer.
  6846. *
  6847. * @static
  6848. * @memberOf _
  6849. * @since 4.3.0
  6850. * @category Lang
  6851. * @param {*} value The value to check.
  6852. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  6853. * @example
  6854. *
  6855. * _.isBuffer(new Buffer(2));
  6856. * // => true
  6857. *
  6858. * _.isBuffer(new Uint8Array(2));
  6859. * // => false
  6860. */
  6861. var isBuffer = nativeIsBuffer || stubFalse;
  6862. module.exports = isBuffer;
  6863. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(81)(module)))
  6864. /***/ }),
  6865. /* 63 */
  6866. /***/ (function(module, exports) {
  6867. /** Used as references for various `Number` constants. */
  6868. var MAX_SAFE_INTEGER = 9007199254740991;
  6869. /** Used to detect unsigned integer values. */
  6870. var reIsUint = /^(?:0|[1-9]\d*)$/;
  6871. /**
  6872. * Checks if `value` is a valid array-like index.
  6873. *
  6874. * @private
  6875. * @param {*} value The value to check.
  6876. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6877. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6878. */
  6879. function isIndex(value, length) {
  6880. var type = typeof value;
  6881. length = length == null ? MAX_SAFE_INTEGER : length;
  6882. return !!length &&
  6883. (type == 'number' ||
  6884. (type != 'symbol' && reIsUint.test(value))) &&
  6885. (value > -1 && value % 1 == 0 && value < length);
  6886. }
  6887. module.exports = isIndex;
  6888. /***/ }),
  6889. /* 64 */
  6890. /***/ (function(module, exports) {
  6891. /**
  6892. * The base implementation of `_.unary` without support for storing metadata.
  6893. *
  6894. * @private
  6895. * @param {Function} func The function to cap arguments for.
  6896. * @returns {Function} Returns the new capped function.
  6897. */
  6898. function baseUnary(func) {
  6899. return function(value) {
  6900. return func(value);
  6901. };
  6902. }
  6903. module.exports = baseUnary;
  6904. /***/ }),
  6905. /* 65 */
  6906. /***/ (function(module, exports) {
  6907. /** Used for built-in method references. */
  6908. var objectProto = Object.prototype;
  6909. /**
  6910. * Checks if `value` is likely a prototype object.
  6911. *
  6912. * @private
  6913. * @param {*} value The value to check.
  6914. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  6915. */
  6916. function isPrototype(value) {
  6917. var Ctor = value && value.constructor,
  6918. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  6919. return value === proto;
  6920. }
  6921. module.exports = isPrototype;
  6922. /***/ }),
  6923. /* 66 */
  6924. /***/ (function(module, exports, __webpack_require__) {
  6925. var arrayLikeKeys = __webpack_require__(172),
  6926. baseKeysIn = __webpack_require__(361),
  6927. isArrayLike = __webpack_require__(21);
  6928. /**
  6929. * Creates an array of the own and inherited enumerable property names of `object`.
  6930. *
  6931. * **Note:** Non-object values are coerced to objects.
  6932. *
  6933. * @static
  6934. * @memberOf _
  6935. * @since 3.0.0
  6936. * @category Object
  6937. * @param {Object} object The object to query.
  6938. * @returns {Array} Returns the array of property names.
  6939. * @example
  6940. *
  6941. * function Foo() {
  6942. * this.a = 1;
  6943. * this.b = 2;
  6944. * }
  6945. *
  6946. * Foo.prototype.c = 3;
  6947. *
  6948. * _.keysIn(new Foo);
  6949. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  6950. */
  6951. function keysIn(object) {
  6952. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  6953. }
  6954. module.exports = keysIn;
  6955. /***/ }),
  6956. /* 67 */
  6957. /***/ (function(module, exports) {
  6958. // shim for using process in browser
  6959. var process = module.exports = {};
  6960. // cached from whatever global is present so that test runners that stub it
  6961. // don't break things. But we need to wrap it in a try catch in case it is
  6962. // wrapped in strict mode code which doesn't define any globals. It's inside a
  6963. // function because try/catches deoptimize in certain engines.
  6964. var cachedSetTimeout;
  6965. var cachedClearTimeout;
  6966. function defaultSetTimout() {
  6967. throw new Error('setTimeout has not been defined');
  6968. }
  6969. function defaultClearTimeout () {
  6970. throw new Error('clearTimeout has not been defined');
  6971. }
  6972. (function () {
  6973. try {
  6974. if (typeof setTimeout === 'function') {
  6975. cachedSetTimeout = setTimeout;
  6976. } else {
  6977. cachedSetTimeout = defaultSetTimout;
  6978. }
  6979. } catch (e) {
  6980. cachedSetTimeout = defaultSetTimout;
  6981. }
  6982. try {
  6983. if (typeof clearTimeout === 'function') {
  6984. cachedClearTimeout = clearTimeout;
  6985. } else {
  6986. cachedClearTimeout = defaultClearTimeout;
  6987. }
  6988. } catch (e) {
  6989. cachedClearTimeout = defaultClearTimeout;
  6990. }
  6991. } ())
  6992. function runTimeout(fun) {
  6993. if (cachedSetTimeout === setTimeout) {
  6994. //normal enviroments in sane situations
  6995. return setTimeout(fun, 0);
  6996. }
  6997. // if setTimeout wasn't available but was latter defined
  6998. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  6999. cachedSetTimeout = setTimeout;
  7000. return setTimeout(fun, 0);
  7001. }
  7002. try {
  7003. // when when somebody has screwed with setTimeout but no I.E. maddness
  7004. return cachedSetTimeout(fun, 0);
  7005. } catch(e){
  7006. try {
  7007. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  7008. return cachedSetTimeout.call(null, fun, 0);
  7009. } catch(e){
  7010. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  7011. return cachedSetTimeout.call(this, fun, 0);
  7012. }
  7013. }
  7014. }
  7015. function runClearTimeout(marker) {
  7016. if (cachedClearTimeout === clearTimeout) {
  7017. //normal enviroments in sane situations
  7018. return clearTimeout(marker);
  7019. }
  7020. // if clearTimeout wasn't available but was latter defined
  7021. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  7022. cachedClearTimeout = clearTimeout;
  7023. return clearTimeout(marker);
  7024. }
  7025. try {
  7026. // when when somebody has screwed with setTimeout but no I.E. maddness
  7027. return cachedClearTimeout(marker);
  7028. } catch (e){
  7029. try {
  7030. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  7031. return cachedClearTimeout.call(null, marker);
  7032. } catch (e){
  7033. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  7034. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  7035. return cachedClearTimeout.call(this, marker);
  7036. }
  7037. }
  7038. }
  7039. var queue = [];
  7040. var draining = false;
  7041. var currentQueue;
  7042. var queueIndex = -1;
  7043. function cleanUpNextTick() {
  7044. if (!draining || !currentQueue) {
  7045. return;
  7046. }
  7047. draining = false;
  7048. if (currentQueue.length) {
  7049. queue = currentQueue.concat(queue);
  7050. } else {
  7051. queueIndex = -1;
  7052. }
  7053. if (queue.length) {
  7054. drainQueue();
  7055. }
  7056. }
  7057. function drainQueue() {
  7058. if (draining) {
  7059. return;
  7060. }
  7061. var timeout = runTimeout(cleanUpNextTick);
  7062. draining = true;
  7063. var len = queue.length;
  7064. while(len) {
  7065. currentQueue = queue;
  7066. queue = [];
  7067. while (++queueIndex < len) {
  7068. if (currentQueue) {
  7069. currentQueue[queueIndex].run();
  7070. }
  7071. }
  7072. queueIndex = -1;
  7073. len = queue.length;
  7074. }
  7075. currentQueue = null;
  7076. draining = false;
  7077. runClearTimeout(timeout);
  7078. }
  7079. process.nextTick = function (fun) {
  7080. var args = new Array(arguments.length - 1);
  7081. if (arguments.length > 1) {
  7082. for (var i = 1; i < arguments.length; i++) {
  7083. args[i - 1] = arguments[i];
  7084. }
  7085. }
  7086. queue.push(new Item(fun, args));
  7087. if (queue.length === 1 && !draining) {
  7088. runTimeout(drainQueue);
  7089. }
  7090. };
  7091. // v8 likes predictible objects
  7092. function Item(fun, array) {
  7093. this.fun = fun;
  7094. this.array = array;
  7095. }
  7096. Item.prototype.run = function () {
  7097. this.fun.apply(null, this.array);
  7098. };
  7099. process.title = 'browser';
  7100. process.browser = true;
  7101. process.env = {};
  7102. process.argv = [];
  7103. process.version = ''; // empty string to avoid regexp issues
  7104. process.versions = {};
  7105. function noop() {}
  7106. process.on = noop;
  7107. process.addListener = noop;
  7108. process.once = noop;
  7109. process.off = noop;
  7110. process.removeListener = noop;
  7111. process.removeAllListeners = noop;
  7112. process.emit = noop;
  7113. process.prependListener = noop;
  7114. process.prependOnceListener = noop;
  7115. process.listeners = function (name) { return [] }
  7116. process.binding = function (name) {
  7117. throw new Error('process.binding is not supported');
  7118. };
  7119. process.cwd = function () { return '/' };
  7120. process.chdir = function (dir) {
  7121. throw new Error('process.chdir is not supported');
  7122. };
  7123. process.umask = function() { return 0; };
  7124. /***/ }),
  7125. /* 68 */
  7126. /***/ (function(module, exports, __webpack_require__) {
  7127. var baseGetTag = __webpack_require__(26),
  7128. isObjectLike = __webpack_require__(14);
  7129. /** `Object#toString` result references. */
  7130. var symbolTag = '[object Symbol]';
  7131. /**
  7132. * Checks if `value` is classified as a `Symbol` primitive or object.
  7133. *
  7134. * @static
  7135. * @memberOf _
  7136. * @since 4.0.0
  7137. * @category Lang
  7138. * @param {*} value The value to check.
  7139. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  7140. * @example
  7141. *
  7142. * _.isSymbol(Symbol.iterator);
  7143. * // => true
  7144. *
  7145. * _.isSymbol('abc');
  7146. * // => false
  7147. */
  7148. function isSymbol(value) {
  7149. return typeof value == 'symbol' ||
  7150. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  7151. }
  7152. module.exports = isSymbol;
  7153. /***/ }),
  7154. /* 69 */
  7155. /***/ (function(module, exports, __webpack_require__) {
  7156. "use strict";
  7157. const OTHelpers = __webpack_require__(4);
  7158. if (OTHelpers.env.name === 'Node') {
  7159. module.exports = {
  7160. value: ''
  7161. };
  7162. } else {
  7163. // Script embed
  7164. const scriptSrc = Array.prototype.slice.call(document.getElementsByTagName('script')).pop().getAttribute('src');
  7165. const _ref = scriptSrc && scriptSrc.match(/[?&]apikey=([^&]+)/i) || [],
  7166. apiKey = _ref[1]; // TODO: The indirection here is due to the need to set APIKEY in testing. We should find a better
  7167. // solution.
  7168. module.exports = {
  7169. value: apiKey || ''
  7170. };
  7171. }
  7172. /***/ }),
  7173. /* 70 */
  7174. /***/ (function(module, exports, __webpack_require__) {
  7175. "use strict";
  7176. module.exports = function (fn) {
  7177. if (typeof fn !== "function") throw new TypeError(fn + " is not a function");
  7178. return fn;
  7179. };
  7180. /***/ }),
  7181. /* 71 */
  7182. /***/ (function(module, exports, __webpack_require__) {
  7183. "use strict";
  7184. /*
  7185. * Executes the provided callback thanks to <code>global.setTimeout</code>.
  7186. *
  7187. * @param {function()} callback
  7188. * @param {number} frequency how many times per second we want to execute the callback
  7189. * @param {number} maxIterations the maximum amount of iterations for this runner
  7190. * @constructor
  7191. */
  7192. function IntervalRunner(callback, desiredFrequency, maxIterations) {
  7193. if (maxIterations === void 0) {
  7194. maxIterations = Infinity;
  7195. }
  7196. let timeoutId = null;
  7197. let running = false;
  7198. let iteration = 1;
  7199. const timeBetween = 1000 / desiredFrequency;
  7200. const loop = () => {
  7201. if (!running || iteration > maxIterations) {
  7202. return;
  7203. }
  7204. iteration += 1;
  7205. callback();
  7206. timeoutId = setTimeout(loop, timeBetween);
  7207. };
  7208. this.start = () => {
  7209. if (running) {
  7210. return;
  7211. }
  7212. running = true;
  7213. setTimeout(loop, timeBetween);
  7214. };
  7215. this.stop = () => {
  7216. (typeof window !== undefined ? window : global).clearTimeout(timeoutId);
  7217. running = false;
  7218. };
  7219. }
  7220. module.exports = IntervalRunner;
  7221. /***/ }),
  7222. /* 72 */
  7223. /***/ (function(module, exports, __webpack_require__) {
  7224. "use strict";
  7225. const pick = __webpack_require__(42);
  7226. const mapValues = __webpack_require__(620);
  7227. const isObject = __webpack_require__(7);
  7228. const frameRateTrackers = {};
  7229. function getFrameRate(stat) {
  7230. return Number(stat.framerateMean || stat.googFrameRateSent || stat.googFrameRateReceived || stat.googFrameRateInput || stat.googFrameRateOutput || 0);
  7231. }
  7232. function getFrames(stat) {
  7233. return Number(stat.framesEncoded || stat.framesDecoded);
  7234. }
  7235. function calcFrameRate(stat, startTime) {
  7236. if (getFrameRate(stat)) {
  7237. return getFrameRate(stat);
  7238. }
  7239. if (!getFrames(stat)) {
  7240. return undefined;
  7241. }
  7242. let frameRate = 0;
  7243. if (frameRateTrackers[stat.id] !== undefined) {
  7244. frameRate = (getFrames(stat) - frameRateTrackers[stat.id].frames) / ((stat.timestamp - frameRateTrackers[stat.id].timestamp) / 1000);
  7245. } else {
  7246. frameRate = getFrames(stat) / ((stat.timestamp - startTime) / 1000);
  7247. }
  7248. frameRateTrackers[stat.id] = {
  7249. frames: getFrames(stat),
  7250. timestamp: stat.timestamp
  7251. };
  7252. return Math.round(frameRate * 100) / 100;
  7253. }
  7254. function getLinkedTrack(stat, allStats) {
  7255. if (!allStats) {
  7256. return {};
  7257. }
  7258. const linkedTrack = allStats.filter(x => x.id === stat.mediaTrackId);
  7259. return linkedTrack.length ? linkedTrack[0] : {};
  7260. }
  7261. const getStatsHelpers = {
  7262. isVideoStat(stat, allStats) {
  7263. const linkedTrack = getLinkedTrack(stat, allStats);
  7264. return stat.mediaType === 'video' || // Chrome / Firefox
  7265. 'googFrameWidthReceived' in stat || // Old Chrome
  7266. 'googFrameWidthInput' in stat || // Old Chrome
  7267. stat.type === 'inbound-rtp' && stat.id.indexOf('Video') !== -1 || // Safari
  7268. stat.type === 'inboundrtp' && linkedTrack.frameWidth !== 0; // Edge
  7269. },
  7270. isVideoSenderStat(stat) {
  7271. // Chrome implementation only has this property for RTP video stat
  7272. return 'googFrameWidthSent' in stat || stat.mediaType === 'video' || stat.id !== undefined && stat.id.toLowerCase().indexOf('video') !== -1;
  7273. },
  7274. isAudioStat(stat, allStats) {
  7275. const linkedTrack = getLinkedTrack(stat, allStats);
  7276. return stat.mediaType === 'audio' || // Chrome / Firefox
  7277. 'audioInputLevel' in stat || // Old Chrome
  7278. 'audioOutputLevel' in stat || // Old Chrome
  7279. stat.type === 'inbound-rtp' && stat.id.indexOf('Audio') !== -1 || // Safari
  7280. stat.type === 'inboundrtp' && linkedTrack.frameWidth === 0; // Edge;
  7281. },
  7282. isInboundStat(stat) {
  7283. return 'bytesReceived' in stat || 'packetsReceived' in stat;
  7284. },
  7285. isOutboundStat(stat) {
  7286. return 'bytesSent' in stat || 'packetsSent' in stat;
  7287. },
  7288. isVideoTrackStat(stat) {
  7289. return stat.type === 'track' && (stat.frameHeight > 0 || stat.frameWidth > 0 || stat.framesCorrupted > 0 || stat.framesDecoded > 0 || stat.framesPerSecond > 0 || stat.framesSent > 0 || stat.framesReceived > 0);
  7290. },
  7291. parseStatCategory(stat) {
  7292. const statCategory = {
  7293. packetsLost: 0,
  7294. packetsReceived: 0,
  7295. bytesReceived: 0 // frameRate is only set for video stat
  7296. };
  7297. if ('packetsReceived' in stat) {
  7298. statCategory.packetsReceived = parseInt(stat.packetsReceived, 10);
  7299. }
  7300. if ('packetsLost' in stat) {
  7301. statCategory.packetsLost = parseInt(stat.packetsLost, 10);
  7302. }
  7303. if ('bytesReceived' in stat) {
  7304. statCategory.bytesReceived = parseInt(stat.bytesReceived, 10);
  7305. }
  7306. if (this.isVideoStat(stat)) {
  7307. if ('framerateMean' in stat) {
  7308. statCategory.frameRate = Number(stat.framerateMean);
  7309. } else if ('googFrameRateOutput' in stat) {
  7310. statCategory.frameRate = Number(stat.googFrameRateOutput);
  7311. } else if ('googFrameRateInput' in stat) {
  7312. statCategory.frameRate = Number(stat.googFrameRateInput);
  7313. }
  7314. }
  7315. return statCategory;
  7316. },
  7317. normalizeTimestamp(timestamp, now) {
  7318. if (now === void 0) {
  7319. now = Date.now();
  7320. }
  7321. if (isObject(timestamp) && 'getTime' in timestamp) {
  7322. // Chrome as of 39 delivers a "kind of Date" object for timestamps
  7323. // we duck check it and get the timestamp
  7324. return timestamp.getTime();
  7325. }
  7326. if (Math.abs(timestamp / (1000 * now) - 1) < 0.05) {
  7327. // If the timestamp is within 5% of 1000x now, we assume its unit is microseconds and
  7328. // divide by 1000 to correct for this.
  7329. return timestamp / 1000;
  7330. }
  7331. return timestamp;
  7332. },
  7333. normalizeStats(stats, inbound, startTime) {
  7334. if (inbound === void 0) {
  7335. inbound = true;
  7336. }
  7337. const video = stats.filter(stat => getStatsHelpers.isVideoStat(stat, stats)).filter(stat => getStatsHelpers.isInboundStat(stat) === inbound)[0];
  7338. const audio = stats.filter(stat => getStatsHelpers.isAudioStat(stat, stats)).filter(stat => getStatsHelpers.isInboundStat(stat) === inbound)[0];
  7339. if (!audio && !video) {
  7340. throw new Error('could not find stats for either audio or video');
  7341. }
  7342. const otStats = {
  7343. timestamp: getStatsHelpers.normalizeTimestamp(video ? video.timestamp : audio.timestamp)
  7344. };
  7345. const getOutboundStats = stat => pick(stat, ['packetsSent', 'packetsLost', 'bytesSent']);
  7346. const getInboundStats = stat => pick(stat, ['packetsReceived', 'packetsLost', 'bytesReceived']);
  7347. const getCommonStats = inbound ? getInboundStats : getOutboundStats;
  7348. if (video) {
  7349. otStats.video = Object.assign({
  7350. frameRate: calcFrameRate(video, startTime)
  7351. }, mapValues(getCommonStats(video), Number));
  7352. }
  7353. if (audio) {
  7354. otStats.audio = mapValues(getCommonStats(audio), Number);
  7355. }
  7356. return otStats;
  7357. }
  7358. };
  7359. module.exports = getStatsHelpers;
  7360. /***/ }),
  7361. /* 73 */
  7362. /***/ (function(module, exports, __webpack_require__) {
  7363. "use strict";
  7364. exports.__esModule = true;
  7365. exports.codes = exports.messages = void 0;
  7366. // https://tools.ietf.org/html/rfc6455#section-7.4.1
  7367. // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Close_codes
  7368. const messages = {
  7369. 1001: 'The endpoint is going away, either because of a server failure or because the browser ' + 'is navigating away from the page that opened the connection.',
  7370. 1002: 'The endpoint is terminating the connection due to a protocol error. ' + '(CLOSE_PROTOCOL_ERROR)',
  7371. 1003: 'The connection is being terminated because the endpoint has indicated ' + 'that reconnections are not available. (CLOSE_UNSUPPORTED)',
  7372. 1005: 'Indicates that no status code was provided even though one was expected. ' + '(CLOSE_NO_STATUS)',
  7373. 1006: 'Used to indicate that a connection was closed abnormally (that is, with no ' + 'close frame being sent) when a status code is expected. (CLOSE_ABNORMAL)',
  7374. 1007: 'Indicates that an endpoint is terminating the connection because it has received ' + 'data within a message that was not consistent with the type of the message (e.g., ' + 'non-UTF-8 [RFC3629] data within a text message)',
  7375. 1008: 'Indicates that an endpoint is terminating the connection because it has received a ' + 'message that violates its policy. This is a generic status code that can be returned ' + 'when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a ' + 'need to hide specific details about the policy',
  7376. 1009: 'Indicates that an endpoint is terminating the connection because it has received a ' + 'message that is too big for it to process (CLOSE_TOO_LARGE)',
  7377. 1011: 'Indicates that a server is terminating the connection because it encountered an ' + 'unexpected condition that prevented it from fulfilling the request',
  7378. // ... codes in the 4000-4999 range are available for use by applications.
  7379. 4001: 'Connectivity loss was detected as it was too long since the socket received the ' + 'last PONG message',
  7380. 4010: 'Timed out while waiting for the Rumor socket to connect.',
  7381. 4020: 'Error code unavailable.',
  7382. 4030: 'Exception was thrown during Rumor connection, possibly because of a blocked port.'
  7383. };
  7384. exports.messages = messages;
  7385. const codes = {
  7386. CLOSE_NORMAL: 1000,
  7387. CLOSE_GOING_AWAY: 1001,
  7388. CLOSE_PROTOCOL_ERROR: 1002,
  7389. CLOSE_UNSUPPORTED: 1003,
  7390. CLOSE_NO_STATUS: 1005,
  7391. CLOSE_ABNORMAL: 1006,
  7392. CLOSE_INCONSISTENT_DATA: 1007,
  7393. CLOSE_POLICY_VIOLATION: 1008,
  7394. CLOSE_TOO_LARGE: 1009,
  7395. CLOSE_UNEXPECTED_CONDITION: 1011,
  7396. CLOSE_CONNECTIVITY_LOSS: 4001,
  7397. CLOSE_TIMEOUT: 4010,
  7398. CLOSE_FALLBACK_CODE: 4020,
  7399. CLOSE_CONNECT_EXCEPTION: 4030,
  7400. ALREADY_CONNECTED_CONNECTING: null
  7401. };
  7402. exports.codes = codes;
  7403. /***/ }),
  7404. /* 74 */
  7405. /***/ (function(module, exports, __webpack_require__) {
  7406. var Stack = __webpack_require__(75),
  7407. arrayEach = __webpack_require__(108),
  7408. assignValue = __webpack_require__(80),
  7409. baseAssign = __webpack_require__(171),
  7410. baseAssignIn = __webpack_require__(360),
  7411. cloneBuffer = __webpack_require__(174),
  7412. copyArray = __webpack_require__(49),
  7413. copySymbols = __webpack_require__(363),
  7414. copySymbolsIn = __webpack_require__(365),
  7415. getAllKeys = __webpack_require__(177),
  7416. getAllKeysIn = __webpack_require__(179),
  7417. getTag = __webpack_require__(39),
  7418. initCloneArray = __webpack_require__(368),
  7419. initCloneByTag = __webpack_require__(369),
  7420. initCloneObject = __webpack_require__(184),
  7421. isArray = __webpack_require__(9),
  7422. isBuffer = __webpack_require__(62),
  7423. isMap = __webpack_require__(373),
  7424. isObject = __webpack_require__(7),
  7425. isSet = __webpack_require__(375),
  7426. keys = __webpack_require__(27);
  7427. /** Used to compose bitmasks for cloning. */
  7428. var CLONE_DEEP_FLAG = 1,
  7429. CLONE_FLAT_FLAG = 2,
  7430. CLONE_SYMBOLS_FLAG = 4;
  7431. /** `Object#toString` result references. */
  7432. var argsTag = '[object Arguments]',
  7433. arrayTag = '[object Array]',
  7434. boolTag = '[object Boolean]',
  7435. dateTag = '[object Date]',
  7436. errorTag = '[object Error]',
  7437. funcTag = '[object Function]',
  7438. genTag = '[object GeneratorFunction]',
  7439. mapTag = '[object Map]',
  7440. numberTag = '[object Number]',
  7441. objectTag = '[object Object]',
  7442. regexpTag = '[object RegExp]',
  7443. setTag = '[object Set]',
  7444. stringTag = '[object String]',
  7445. symbolTag = '[object Symbol]',
  7446. weakMapTag = '[object WeakMap]';
  7447. var arrayBufferTag = '[object ArrayBuffer]',
  7448. dataViewTag = '[object DataView]',
  7449. float32Tag = '[object Float32Array]',
  7450. float64Tag = '[object Float64Array]',
  7451. int8Tag = '[object Int8Array]',
  7452. int16Tag = '[object Int16Array]',
  7453. int32Tag = '[object Int32Array]',
  7454. uint8Tag = '[object Uint8Array]',
  7455. uint8ClampedTag = '[object Uint8ClampedArray]',
  7456. uint16Tag = '[object Uint16Array]',
  7457. uint32Tag = '[object Uint32Array]';
  7458. /** Used to identify `toStringTag` values supported by `_.clone`. */
  7459. var cloneableTags = {};
  7460. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  7461. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  7462. cloneableTags[boolTag] = cloneableTags[dateTag] =
  7463. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  7464. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  7465. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  7466. cloneableTags[numberTag] = cloneableTags[objectTag] =
  7467. cloneableTags[regexpTag] = cloneableTags[setTag] =
  7468. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  7469. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  7470. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  7471. cloneableTags[errorTag] = cloneableTags[funcTag] =
  7472. cloneableTags[weakMapTag] = false;
  7473. /**
  7474. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  7475. * traversed objects.
  7476. *
  7477. * @private
  7478. * @param {*} value The value to clone.
  7479. * @param {boolean} bitmask The bitmask flags.
  7480. * 1 - Deep clone
  7481. * 2 - Flatten inherited properties
  7482. * 4 - Clone symbols
  7483. * @param {Function} [customizer] The function to customize cloning.
  7484. * @param {string} [key] The key of `value`.
  7485. * @param {Object} [object] The parent object of `value`.
  7486. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  7487. * @returns {*} Returns the cloned value.
  7488. */
  7489. function baseClone(value, bitmask, customizer, key, object, stack) {
  7490. var result,
  7491. isDeep = bitmask & CLONE_DEEP_FLAG,
  7492. isFlat = bitmask & CLONE_FLAT_FLAG,
  7493. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  7494. if (customizer) {
  7495. result = object ? customizer(value, key, object, stack) : customizer(value);
  7496. }
  7497. if (result !== undefined) {
  7498. return result;
  7499. }
  7500. if (!isObject(value)) {
  7501. return value;
  7502. }
  7503. var isArr = isArray(value);
  7504. if (isArr) {
  7505. result = initCloneArray(value);
  7506. if (!isDeep) {
  7507. return copyArray(value, result);
  7508. }
  7509. } else {
  7510. var tag = getTag(value),
  7511. isFunc = tag == funcTag || tag == genTag;
  7512. if (isBuffer(value)) {
  7513. return cloneBuffer(value, isDeep);
  7514. }
  7515. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  7516. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  7517. if (!isDeep) {
  7518. return isFlat
  7519. ? copySymbolsIn(value, baseAssignIn(result, value))
  7520. : copySymbols(value, baseAssign(result, value));
  7521. }
  7522. } else {
  7523. if (!cloneableTags[tag]) {
  7524. return object ? value : {};
  7525. }
  7526. result = initCloneByTag(value, tag, isDeep);
  7527. }
  7528. }
  7529. // Check for circular references and return its corresponding clone.
  7530. stack || (stack = new Stack);
  7531. var stacked = stack.get(value);
  7532. if (stacked) {
  7533. return stacked;
  7534. }
  7535. stack.set(value, result);
  7536. if (isSet(value)) {
  7537. value.forEach(function(subValue) {
  7538. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  7539. });
  7540. } else if (isMap(value)) {
  7541. value.forEach(function(subValue, key) {
  7542. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  7543. });
  7544. }
  7545. var keysFunc = isFull
  7546. ? (isFlat ? getAllKeysIn : getAllKeys)
  7547. : (isFlat ? keysIn : keys);
  7548. var props = isArr ? undefined : keysFunc(value);
  7549. arrayEach(props || value, function(subValue, key) {
  7550. if (props) {
  7551. key = subValue;
  7552. subValue = value[key];
  7553. }
  7554. // Recursively populate clone (susceptible to call stack limits).
  7555. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  7556. });
  7557. return result;
  7558. }
  7559. module.exports = baseClone;
  7560. /***/ }),
  7561. /* 75 */
  7562. /***/ (function(module, exports, __webpack_require__) {
  7563. var ListCache = __webpack_require__(76),
  7564. stackClear = __webpack_require__(332),
  7565. stackDelete = __webpack_require__(333),
  7566. stackGet = __webpack_require__(334),
  7567. stackHas = __webpack_require__(335),
  7568. stackSet = __webpack_require__(336);
  7569. /**
  7570. * Creates a stack cache object to store key-value pairs.
  7571. *
  7572. * @private
  7573. * @constructor
  7574. * @param {Array} [entries] The key-value pairs to cache.
  7575. */
  7576. function Stack(entries) {
  7577. var data = this.__data__ = new ListCache(entries);
  7578. this.size = data.size;
  7579. }
  7580. // Add methods to `Stack`.
  7581. Stack.prototype.clear = stackClear;
  7582. Stack.prototype['delete'] = stackDelete;
  7583. Stack.prototype.get = stackGet;
  7584. Stack.prototype.has = stackHas;
  7585. Stack.prototype.set = stackSet;
  7586. module.exports = Stack;
  7587. /***/ }),
  7588. /* 76 */
  7589. /***/ (function(module, exports, __webpack_require__) {
  7590. var listCacheClear = __webpack_require__(327),
  7591. listCacheDelete = __webpack_require__(328),
  7592. listCacheGet = __webpack_require__(329),
  7593. listCacheHas = __webpack_require__(330),
  7594. listCacheSet = __webpack_require__(331);
  7595. /**
  7596. * Creates an list cache object.
  7597. *
  7598. * @private
  7599. * @constructor
  7600. * @param {Array} [entries] The key-value pairs to cache.
  7601. */
  7602. function ListCache(entries) {
  7603. var index = -1,
  7604. length = entries == null ? 0 : entries.length;
  7605. this.clear();
  7606. while (++index < length) {
  7607. var entry = entries[index];
  7608. this.set(entry[0], entry[1]);
  7609. }
  7610. }
  7611. // Add methods to `ListCache`.
  7612. ListCache.prototype.clear = listCacheClear;
  7613. ListCache.prototype['delete'] = listCacheDelete;
  7614. ListCache.prototype.get = listCacheGet;
  7615. ListCache.prototype.has = listCacheHas;
  7616. ListCache.prototype.set = listCacheSet;
  7617. module.exports = ListCache;
  7618. /***/ }),
  7619. /* 77 */
  7620. /***/ (function(module, exports, __webpack_require__) {
  7621. var eq = __webpack_require__(48);
  7622. /**
  7623. * Gets the index at which the `key` is found in `array` of key-value pairs.
  7624. *
  7625. * @private
  7626. * @param {Array} array The array to inspect.
  7627. * @param {*} key The key to search for.
  7628. * @returns {number} Returns the index of the matched value, else `-1`.
  7629. */
  7630. function assocIndexOf(array, key) {
  7631. var length = array.length;
  7632. while (length--) {
  7633. if (eq(array[length][0], key)) {
  7634. return length;
  7635. }
  7636. }
  7637. return -1;
  7638. }
  7639. module.exports = assocIndexOf;
  7640. /***/ }),
  7641. /* 78 */
  7642. /***/ (function(module, exports, __webpack_require__) {
  7643. var getNative = __webpack_require__(36);
  7644. /* Built-in method references that are verified to be native. */
  7645. var nativeCreate = getNative(Object, 'create');
  7646. module.exports = nativeCreate;
  7647. /***/ }),
  7648. /* 79 */
  7649. /***/ (function(module, exports, __webpack_require__) {
  7650. var isKeyable = __webpack_require__(351);
  7651. /**
  7652. * Gets the data for `map`.
  7653. *
  7654. * @private
  7655. * @param {Object} map The map to query.
  7656. * @param {string} key The reference key.
  7657. * @returns {*} Returns the map data.
  7658. */
  7659. function getMapData(map, key) {
  7660. var data = map.__data__;
  7661. return isKeyable(key)
  7662. ? data[typeof key == 'string' ? 'string' : 'hash']
  7663. : data.map;
  7664. }
  7665. module.exports = getMapData;
  7666. /***/ }),
  7667. /* 80 */
  7668. /***/ (function(module, exports, __webpack_require__) {
  7669. var baseAssignValue = __webpack_require__(60),
  7670. eq = __webpack_require__(48);
  7671. /** Used for built-in method references. */
  7672. var objectProto = Object.prototype;
  7673. /** Used to check objects for own properties. */
  7674. var hasOwnProperty = objectProto.hasOwnProperty;
  7675. /**
  7676. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  7677. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7678. * for equality comparisons.
  7679. *
  7680. * @private
  7681. * @param {Object} object The object to modify.
  7682. * @param {string} key The key of the property to assign.
  7683. * @param {*} value The value to assign.
  7684. */
  7685. function assignValue(object, key, value) {
  7686. var objValue = object[key];
  7687. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  7688. (value === undefined && !(key in object))) {
  7689. baseAssignValue(object, key, value);
  7690. }
  7691. }
  7692. module.exports = assignValue;
  7693. /***/ }),
  7694. /* 81 */
  7695. /***/ (function(module, exports) {
  7696. module.exports = function(module) {
  7697. if (!module.webpackPolyfill) {
  7698. module.deprecate = function() {};
  7699. module.paths = [];
  7700. // module.parent = undefined by default
  7701. if (!module.children) module.children = [];
  7702. Object.defineProperty(module, "loaded", {
  7703. enumerable: true,
  7704. get: function() {
  7705. return module.l;
  7706. }
  7707. });
  7708. Object.defineProperty(module, "id", {
  7709. enumerable: true,
  7710. get: function() {
  7711. return module.i;
  7712. }
  7713. });
  7714. module.webpackPolyfill = 1;
  7715. }
  7716. return module;
  7717. };
  7718. /***/ }),
  7719. /* 82 */
  7720. /***/ (function(module, exports, __webpack_require__) {
  7721. var baseIsTypedArray = __webpack_require__(358),
  7722. baseUnary = __webpack_require__(64),
  7723. nodeUtil = __webpack_require__(110);
  7724. /* Node.js helper references. */
  7725. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  7726. /**
  7727. * Checks if `value` is classified as a typed array.
  7728. *
  7729. * @static
  7730. * @memberOf _
  7731. * @since 3.0.0
  7732. * @category Lang
  7733. * @param {*} value The value to check.
  7734. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  7735. * @example
  7736. *
  7737. * _.isTypedArray(new Uint8Array);
  7738. * // => true
  7739. *
  7740. * _.isTypedArray([]);
  7741. * // => false
  7742. */
  7743. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  7744. module.exports = isTypedArray;
  7745. /***/ }),
  7746. /* 83 */
  7747. /***/ (function(module, exports, __webpack_require__) {
  7748. var isObject = __webpack_require__(7);
  7749. /** Built-in value references. */
  7750. var objectCreate = Object.create;
  7751. /**
  7752. * The base implementation of `_.create` without support for assigning
  7753. * properties to the created object.
  7754. *
  7755. * @private
  7756. * @param {Object} proto The object to inherit from.
  7757. * @returns {Object} Returns the new object.
  7758. */
  7759. var baseCreate = (function() {
  7760. function object() {}
  7761. return function(proto) {
  7762. if (!isObject(proto)) {
  7763. return {};
  7764. }
  7765. if (objectCreate) {
  7766. return objectCreate(proto);
  7767. }
  7768. object.prototype = proto;
  7769. var result = new object;
  7770. object.prototype = undefined;
  7771. return result;
  7772. };
  7773. }());
  7774. module.exports = baseCreate;
  7775. /***/ }),
  7776. /* 84 */
  7777. /***/ (function(module, exports) {
  7778. /**
  7779. * This method returns the first argument it receives.
  7780. *
  7781. * @static
  7782. * @since 0.1.0
  7783. * @memberOf _
  7784. * @category Util
  7785. * @param {*} value Any value.
  7786. * @returns {*} Returns `value`.
  7787. * @example
  7788. *
  7789. * var object = { 'a': 1 };
  7790. *
  7791. * console.log(_.identity(object) === object);
  7792. * // => true
  7793. */
  7794. function identity(value) {
  7795. return value;
  7796. }
  7797. module.exports = identity;
  7798. /***/ }),
  7799. /* 85 */
  7800. /***/ (function(module, exports, __webpack_require__) {
  7801. var baseCreate = __webpack_require__(83),
  7802. isObject = __webpack_require__(7);
  7803. /**
  7804. * Creates a function that produces an instance of `Ctor` regardless of
  7805. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  7806. *
  7807. * @private
  7808. * @param {Function} Ctor The constructor to wrap.
  7809. * @returns {Function} Returns the new wrapped function.
  7810. */
  7811. function createCtor(Ctor) {
  7812. return function() {
  7813. // Use a `switch` statement to work with class constructors. See
  7814. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  7815. // for more details.
  7816. var args = arguments;
  7817. switch (args.length) {
  7818. case 0: return new Ctor;
  7819. case 1: return new Ctor(args[0]);
  7820. case 2: return new Ctor(args[0], args[1]);
  7821. case 3: return new Ctor(args[0], args[1], args[2]);
  7822. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  7823. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  7824. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  7825. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  7826. }
  7827. var thisBinding = baseCreate(Ctor.prototype),
  7828. result = Ctor.apply(thisBinding, args);
  7829. // Mimic the constructor's `return` behavior.
  7830. // See https://es5.github.io/#x13.2.2 for more details.
  7831. return isObject(result) ? result : thisBinding;
  7832. };
  7833. }
  7834. module.exports = createCtor;
  7835. /***/ }),
  7836. /* 86 */
  7837. /***/ (function(module, exports, __webpack_require__) {
  7838. var baseIndexOf = __webpack_require__(412);
  7839. /**
  7840. * A specialized version of `_.includes` for arrays without support for
  7841. * specifying an index to search from.
  7842. *
  7843. * @private
  7844. * @param {Array} [array] The array to inspect.
  7845. * @param {*} target The value to search for.
  7846. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  7847. */
  7848. function arrayIncludes(array, value) {
  7849. var length = array == null ? 0 : array.length;
  7850. return !!length && baseIndexOf(array, value, 0) > -1;
  7851. }
  7852. module.exports = arrayIncludes;
  7853. /***/ }),
  7854. /* 87 */
  7855. /***/ (function(module, exports, __webpack_require__) {
  7856. var toFinite = __webpack_require__(418);
  7857. /**
  7858. * Converts `value` to an integer.
  7859. *
  7860. * **Note:** This method is loosely based on
  7861. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  7862. *
  7863. * @static
  7864. * @memberOf _
  7865. * @since 4.0.0
  7866. * @category Lang
  7867. * @param {*} value The value to convert.
  7868. * @returns {number} Returns the converted integer.
  7869. * @example
  7870. *
  7871. * _.toInteger(3.2);
  7872. * // => 3
  7873. *
  7874. * _.toInteger(Number.MIN_VALUE);
  7875. * // => 0
  7876. *
  7877. * _.toInteger(Infinity);
  7878. * // => 1.7976931348623157e+308
  7879. *
  7880. * _.toInteger('3.2');
  7881. * // => 3
  7882. */
  7883. function toInteger(value) {
  7884. var result = toFinite(value),
  7885. remainder = result % 1;
  7886. return result === result ? (remainder ? result - remainder : result) : 0;
  7887. }
  7888. module.exports = toInteger;
  7889. /***/ }),
  7890. /* 88 */
  7891. /***/ (function(module, exports, __webpack_require__) {
  7892. var MapCache = __webpack_require__(107),
  7893. setCacheAdd = __webpack_require__(426),
  7894. setCacheHas = __webpack_require__(427);
  7895. /**
  7896. *
  7897. * Creates an array cache object to store unique values.
  7898. *
  7899. * @private
  7900. * @constructor
  7901. * @param {Array} [values] The values to cache.
  7902. */
  7903. function SetCache(values) {
  7904. var index = -1,
  7905. length = values == null ? 0 : values.length;
  7906. this.__data__ = new MapCache;
  7907. while (++index < length) {
  7908. this.add(values[index]);
  7909. }
  7910. }
  7911. // Add methods to `SetCache`.
  7912. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  7913. SetCache.prototype.has = setCacheHas;
  7914. module.exports = SetCache;
  7915. /***/ }),
  7916. /* 89 */
  7917. /***/ (function(module, exports) {
  7918. /**
  7919. * Checks if a `cache` value for `key` exists.
  7920. *
  7921. * @private
  7922. * @param {Object} cache The cache to query.
  7923. * @param {string} key The key of the entry to check.
  7924. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  7925. */
  7926. function cacheHas(cache, key) {
  7927. return cache.has(key);
  7928. }
  7929. module.exports = cacheHas;
  7930. /***/ }),
  7931. /* 90 */
  7932. /***/ (function(module, exports) {
  7933. /**
  7934. * Converts `set` to an array of its values.
  7935. *
  7936. * @private
  7937. * @param {Object} set The set to convert.
  7938. * @returns {Array} Returns the values.
  7939. */
  7940. function setToArray(set) {
  7941. var index = -1,
  7942. result = Array(set.size);
  7943. set.forEach(function(value) {
  7944. result[++index] = value;
  7945. });
  7946. return result;
  7947. }
  7948. module.exports = setToArray;
  7949. /***/ }),
  7950. /* 91 */
  7951. /***/ (function(module, exports, __webpack_require__) {
  7952. var castPath = __webpack_require__(52),
  7953. toKey = __webpack_require__(41);
  7954. /**
  7955. * The base implementation of `_.get` without support for default values.
  7956. *
  7957. * @private
  7958. * @param {Object} object The object to query.
  7959. * @param {Array|string} path The path of the property to get.
  7960. * @returns {*} Returns the resolved value.
  7961. */
  7962. function baseGet(object, path) {
  7963. path = castPath(path, object);
  7964. var index = 0,
  7965. length = path.length;
  7966. while (object != null && index < length) {
  7967. object = object[toKey(path[index++])];
  7968. }
  7969. return (index && index == length) ? object : undefined;
  7970. }
  7971. module.exports = baseGet;
  7972. /***/ }),
  7973. /* 92 */
  7974. /***/ (function(module, exports, __webpack_require__) {
  7975. var baseToString = __webpack_require__(433);
  7976. /**
  7977. * Converts `value` to a string. An empty string is returned for `null`
  7978. * and `undefined` values. The sign of `-0` is preserved.
  7979. *
  7980. * @static
  7981. * @memberOf _
  7982. * @since 4.0.0
  7983. * @category Lang
  7984. * @param {*} value The value to convert.
  7985. * @returns {string} Returns the converted string.
  7986. * @example
  7987. *
  7988. * _.toString(null);
  7989. * // => ''
  7990. *
  7991. * _.toString(-0);
  7992. * // => '-0'
  7993. *
  7994. * _.toString([1, 2, 3]);
  7995. * // => '1,2,3'
  7996. */
  7997. function toString(value) {
  7998. return value == null ? '' : baseToString(value);
  7999. }
  8000. module.exports = toString;
  8001. /***/ }),
  8002. /* 93 */
  8003. /***/ (function(module, exports, __webpack_require__) {
  8004. var baseFor = __webpack_require__(219),
  8005. keys = __webpack_require__(27);
  8006. /**
  8007. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  8008. *
  8009. * @private
  8010. * @param {Object} object The object to iterate over.
  8011. * @param {Function} iteratee The function invoked per iteration.
  8012. * @returns {Object} Returns `object`.
  8013. */
  8014. function baseForOwn(object, iteratee) {
  8015. return object && baseFor(object, iteratee, keys);
  8016. }
  8017. module.exports = baseForOwn;
  8018. /***/ }),
  8019. /* 94 */
  8020. /***/ (function(module, exports, __webpack_require__) {
  8021. var identity = __webpack_require__(84),
  8022. overRest = __webpack_require__(218),
  8023. setToString = __webpack_require__(122);
  8024. /**
  8025. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  8026. *
  8027. * @private
  8028. * @param {Function} func The function to apply a rest parameter to.
  8029. * @param {number} [start=func.length-1] The start position of the rest parameter.
  8030. * @returns {Function} Returns the new function.
  8031. */
  8032. function baseRest(func, start) {
  8033. return setToString(overRest(func, start, identity), func + '');
  8034. }
  8035. module.exports = baseRest;
  8036. /***/ }),
  8037. /* 95 */
  8038. /***/ (function(module, exports, __webpack_require__) {
  8039. "use strict";
  8040. var objToString = Object.prototype.toString
  8041. , id = objToString.call((function () { return arguments; })());
  8042. module.exports = function (value) { return objToString.call(value) === id; };
  8043. /***/ }),
  8044. /* 96 */
  8045. /***/ (function(module, exports, __webpack_require__) {
  8046. "use strict";
  8047. var objToString = Object.prototype.toString, id = objToString.call("");
  8048. module.exports = function (value) {
  8049. return (
  8050. typeof value === "string" ||
  8051. (value &&
  8052. typeof value === "object" &&
  8053. (value instanceof String || objToString.call(value) === id)) ||
  8054. false
  8055. );
  8056. };
  8057. /***/ }),
  8058. /* 97 */
  8059. /***/ (function(module, exports, __webpack_require__) {
  8060. "use strict";
  8061. module.exports = __webpack_require__(481)() ? globalThis : __webpack_require__(482);
  8062. /***/ }),
  8063. /* 98 */
  8064. /***/ (function(module, exports, __webpack_require__) {
  8065. "use strict";
  8066. exports.adaptIceServers = function adaptIceServers(iceServers) {
  8067. return iceServers.map(iceServer => ({
  8068. url: iceServer.url,
  8069. // deprecated
  8070. urls: iceServer.urls || [iceServer.url],
  8071. username: iceServer.username,
  8072. credential: iceServer.credential
  8073. }));
  8074. };
  8075. exports.parseIceServers = function parseIceServers(message) {
  8076. let iceServers;
  8077. try {
  8078. iceServers = JSON.parse(message.data).content.iceServers;
  8079. } catch (e) {
  8080. return [];
  8081. }
  8082. return exports.adaptIceServers(iceServers);
  8083. };
  8084. /***/ }),
  8085. /* 99 */
  8086. /***/ (function(module, exports, __webpack_require__) {
  8087. "use strict";
  8088. /* WEBPACK VAR INJECTION */(function(Promise) {
  8089. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  8090. /* eslint-disable one-var, no-underscore-dangle, no-use-before-define, no-param-reassign */
  8091. /* eslint-disable max-len, no-var, vars-on-top, global-require */
  8092. const promiseTimeout = __webpack_require__(149);
  8093. const now = __webpack_require__(46);
  8094. const assign = __webpack_require__(6);
  8095. const cloneDeep = __webpack_require__(50);
  8096. const intersection = __webpack_require__(244);
  8097. const merge = __webpack_require__(143);
  8098. const omit = __webpack_require__(263);
  8099. const uuid = __webpack_require__(15);
  8100. const eventing = __webpack_require__(5);
  8101. const OTHelpersError = __webpack_require__(242);
  8102. const createCleanupJobs = __webpack_require__(150);
  8103. const SDPHelpers = __webpack_require__(57);
  8104. module.exports = function PeerConnectionFactory(deps) {
  8105. if (deps === void 0) {
  8106. deps = {};
  8107. }
  8108. const hasValidPeerConnection = deps.hasValidPeerConnection || __webpack_require__(582);
  8109. const applySdpTransform = deps.applySdpTransform || __webpack_require__(151);
  8110. const createPeerConnection = deps.createPeerConnection || __webpack_require__(585);
  8111. const env = deps.env || __webpack_require__(3);
  8112. const sdpTransformDefaults = deps.sdpTransformDefaults || __webpack_require__(587);
  8113. const getStatsAdapter = deps.getStatsAdapter || __webpack_require__(266);
  8114. const IceCandidateProcessor = deps.IceCandidateProcessor || __webpack_require__(592);
  8115. const createLog = deps.logging || __webpack_require__(1);
  8116. const offerProcessor = deps.offerProcessor || __webpack_require__(594);
  8117. const PeerConnectionChannels = deps.PeerConnectionChannels || __webpack_require__(596);
  8118. const subscribeProcessor = deps.subscribeProcessor || __webpack_require__(598);
  8119. const Qos = deps.Qos || __webpack_require__(268).default;
  8120. const windowMock = deps.global || (typeof window !== undefined ? window : global);
  8121. const debounce = deps.debounce || __webpack_require__(602);
  8122. const needsToSwapH264Profiles = deps.needsToSwapH264Profiles || __webpack_require__(604).once;
  8123. const futureIsPeerConnectionValid = hasValidPeerConnection(windowMock.RTCPeerConnection);
  8124. const NativeRTCIceCandidate = deps.NativeRTCIceCandidate || windowMock.RTCIceCandidate;
  8125. const NativeRTCSessionDescription = deps.NativeRTCSessionDescription || windowMock.RTCSessionDescription; // Helper function to forward Ice Candidates via +sendMessage+
  8126. const iceCandidateForwarder = (_ref) => {
  8127. let sendMessage = _ref.sendMessage,
  8128. logging = _ref.logging;
  8129. const sdpMids = {};
  8130. return event => {
  8131. if (event.candidate) {
  8132. // It would be better to read the mids from the SDP
  8133. sdpMids[event.candidate.sdpMid] = event.candidate.sdpMLineIndex;
  8134. sendMessage('candidate', {
  8135. candidate: event.candidate.candidate,
  8136. sdpMid: event.candidate.sdpMid || '',
  8137. sdpMLineIndex: event.candidate.sdpMLineIndex || 0
  8138. });
  8139. } else {
  8140. logging.debug('IceCandidateForwarder: No more ICE candidates.');
  8141. }
  8142. };
  8143. };
  8144. const noop = () => {};
  8145. /*
  8146. * Negotiates a WebRTC PeerConnection.
  8147. *
  8148. * Responsible for:
  8149. * * offer-answer exchange
  8150. * * iceCandidates
  8151. * * notification of remote streams being added/removed
  8152. *
  8153. */
  8154. return function PeerConnection(options) {
  8155. if (options === void 0) {
  8156. options = {};
  8157. }
  8158. let hasRelayCandidates = false;
  8159. const _options = options,
  8160. _options$iceConfig = _options.iceConfig,
  8161. iceConfig = _options$iceConfig === void 0 ? {
  8162. servers: []
  8163. } : _options$iceConfig,
  8164. isPublisher = _options.isPublisher,
  8165. _options$logAnalytics = _options.logAnalyticsEvent,
  8166. logAnalyticsEvent = _options$logAnalytics === void 0 ? noop : _options$logAnalytics,
  8167. offerOverrides = _options.offerOverrides,
  8168. answerOverrides = _options.answerOverrides,
  8169. sdpTransformOptions = _options.sdpTransformOptions,
  8170. originalSendMessage = _options.sendMessage,
  8171. p2p = _options.p2p,
  8172. codecFlags = _options.codecFlags;
  8173. let offerAnswerPending = false; // Whether we have an offer out and are waiting for an answer
  8174. let regenerateOffer = false;
  8175. let processingOffer = false; // Whether we are currently processing an offer
  8176. let pendingOfferMessage; // An offer we received that is pending waiting on a previous offer
  8177. const replaceBaselineProfile = needsToSwapH264Profiles();
  8178. let offerMessagesReceived = 0; // number of offer or generateoffer messages received
  8179. let renegotiationInProgress = false;
  8180. const cleanupJobs = createCleanupJobs();
  8181. function sendMessage(type, payload) {
  8182. if (!hasRelayCandidates) {
  8183. const shouldCheckForRelayCandidates = ['candidate', 'offer', 'answer', 'pranswer'].indexOf(type) > -1;
  8184. if (shouldCheckForRelayCandidates) {
  8185. const message = type === 'candidate' ? payload.candidate : payload.sdp;
  8186. hasRelayCandidates = message.indexOf('typ relay') !== -1;
  8187. }
  8188. }
  8189. originalSendMessage(type, payload);
  8190. }
  8191. const startConnectingTime = now();
  8192. logAnalyticsEvent('createPeerConnection', 'Attempt');
  8193. const api = {};
  8194. api.id = uuid();
  8195. const logging = createLog("PeerConnection:" + api.id);
  8196. logging.debug('construct', {
  8197. id: api.id,
  8198. options
  8199. });
  8200. const sdpTransforms = merge({}, sdpTransformDefaults, sdpTransformOptions);
  8201. const shouldFilterCandidate = candidate => iceConfig.transportPolicy === 'relay' && candidate != null && candidate.candidate.indexOf('typ relay') === -1;
  8202. const config = omit(options, ['isPublisher', 'logAnalyticsEvent', 'offerOverrides', 'answerOverrides', 'sendMessage', 'sdpTransformOptions']);
  8203. let _peerConnection, _channels, _offer, _answer;
  8204. let _peerConnectionCompletionHandlers = [];
  8205. const _simulcastEnabled = (() => {
  8206. let value = config.overrideSimulcastEnabled || false;
  8207. return {
  8208. get() {
  8209. return value;
  8210. },
  8211. set(newValueParam) {
  8212. const newValue = Boolean(newValueParam) && config.capableSimulcastStreams > 1;
  8213. if (newValue !== value && config.overrideSimulcastEnabled === undefined) {
  8214. value = newValue;
  8215. api.generateOffer();
  8216. }
  8217. }
  8218. };
  8219. })();
  8220. const _iceRestartNeeded = (() => {
  8221. let value = false;
  8222. return {
  8223. get() {
  8224. return value;
  8225. },
  8226. set(newValueParam) {
  8227. const newValue = Boolean(newValueParam);
  8228. if (newValue !== value) {
  8229. value = newValue;
  8230. if (value && !api.iceConnectionStateIsConnected()) {
  8231. api.generateOffer();
  8232. } else {
  8233. logging.debug('iceRestart is going to wait until we disconnect and then restart ice');
  8234. }
  8235. }
  8236. }
  8237. };
  8238. })();
  8239. const _getStatsAdapter = getStatsAdapter(); // OPENTOK-27106: This _readyToSendOffer mechanism is a workaround for a P2P IE->FF issue where
  8240. // ice candidates sometimes take an excessive amount of time (~10 seconds) to be generated by the
  8241. // IE plugin. FF will time out if there is a delay like this between receiving the offer and
  8242. // receiving ice candidates, so the workaround holds back sending the offer until an ice candidate
  8243. // appears.
  8244. const _readyToSendOffer = {
  8245. clean() {
  8246. delete this.promise;
  8247. delete this.resolve;
  8248. delete this.reject;
  8249. }
  8250. };
  8251. _readyToSendOffer.promise = new Promise((resolve, reject) => {
  8252. _readyToSendOffer.resolve = resolve;
  8253. _readyToSendOffer.reject = reject;
  8254. });
  8255. let _iceProcessor = new IceCandidateProcessor();
  8256. let _state = 'new';
  8257. Object.defineProperty(api, 'signalingState', {
  8258. get() {
  8259. return _peerConnection.signalingState;
  8260. },
  8261. set(val) {
  8262. // obviously they should not be doing this, but we'll mimic what the browser does.
  8263. _peerConnection.signalingState = val;
  8264. return val;
  8265. }
  8266. });
  8267. eventing(api);
  8268. api.once('iceConnected', () => {
  8269. const proxyInfo = '';
  8270. const payload = {
  8271. pcc: parseInt(now() - startConnectingTime, 10),
  8272. hasRelayCandidates,
  8273. proxyInfo
  8274. };
  8275. if (_peerConnection && _peerConnection.proxyInfo) payload.proxyInfo = _peerConnection.proxyInfo;
  8276. logAnalyticsEvent('createPeerConnection', 'Success', payload);
  8277. });
  8278. _readyToSendOffer.resolve(); // Create and initialise the PeerConnection object. This deals with
  8279. // any differences between the various browser implementations and
  8280. // our own OTPlugin version.
  8281. //
  8282. // +completion+ is the function is call once we've either successfully
  8283. // created the PeerConnection or on failure.
  8284. //
  8285. const internalCreatePeerConnection = completion => {
  8286. logging.debug('internalCreatePeerConnection: called');
  8287. if (_peerConnection) {
  8288. logging.debug('internalCreatePeerConnection: resolving synchronously');
  8289. completion.call(null, null, _peerConnection);
  8290. return;
  8291. }
  8292. _peerConnectionCompletionHandlers.push(completion);
  8293. if (_peerConnectionCompletionHandlers.length > 1) {
  8294. // The PeerConnection is already being setup, just wait for
  8295. // it to be ready.
  8296. return;
  8297. }
  8298. const pcConstraints = {
  8299. optional: [// This should be unnecessary, but the plugin has issues if we remove it. This needs
  8300. // to be investigated.
  8301. // @todo now plugin is gone, can we remove it?
  8302. {
  8303. DtlsSrtpKeyAgreement: true
  8304. }]
  8305. };
  8306. logging.debug("Creating peer connection config \"" + JSON.stringify(config) + "\".");
  8307. if (iceConfig.servers.length === 0) {
  8308. // This should never happen unless something is misconfigured
  8309. logging.error('No ice servers present');
  8310. logAnalyticsEvent('Error', 'noIceServers');
  8311. }
  8312. if (iceConfig.transportPolicy === 'relay') {
  8313. const isTurnUrl = url => url && url.indexOf('turn') === 0;
  8314. iceConfig.servers = iceConfig.servers.map(providedServer => {
  8315. const server = cloneDeep(providedServer);
  8316. if (!Array.isArray(server.urls)) {
  8317. server.urls = [server.urls];
  8318. }
  8319. server.urls = server.urls.filter(isTurnUrl);
  8320. return server.urls.length === 0 ? undefined : server;
  8321. }).filter(server => server !== undefined);
  8322. }
  8323. config.iceTransportPolicy = iceConfig.transportPolicy;
  8324. config.iceServers = iceConfig.servers;
  8325. futureIsPeerConnectionValid.then(isValid => {
  8326. if (!isValid) {
  8327. logging.error('createPeerConnection: Invalid RTCPeerConnection object');
  8328. throw new Error('Failed to create valid RTCPeerConnection object');
  8329. }
  8330. return createPeerConnection({
  8331. window: windowMock,
  8332. config,
  8333. constraints: pcConstraints
  8334. });
  8335. }).then(pc => attachEventsToPeerConnection(null, pc), err => attachEventsToPeerConnection(err));
  8336. }; // An auxiliary function to internalCreatePeerConnection. This binds the various event
  8337. // callbacks once the peer connection is created.
  8338. //
  8339. // +err+ will be non-null if an err occured while creating the PeerConnection
  8340. // +pc+ will be the PeerConnection object itself.
  8341. //
  8342. // @todo if anything called in attachEventsToPeerConnection throws it will be
  8343. // silent
  8344. const attachEventsToPeerConnection = (err, pc) => {
  8345. if (err) {
  8346. triggerError({
  8347. reason: "Failed to create PeerConnection, exception: " + err,
  8348. prefix: 'NewPeerConnection'
  8349. });
  8350. _peerConnectionCompletionHandlers = [];
  8351. return;
  8352. }
  8353. logging.debug('OT attachEventsToPeerConnection');
  8354. _peerConnection = pc;
  8355. if (_iceProcessor) {
  8356. _iceProcessor.setPeerConnection(pc);
  8357. }
  8358. _channels = new PeerConnectionChannels(_peerConnection);
  8359. if (config.channels) {
  8360. _channels.addMany(config.channels);
  8361. }
  8362. const forwarder = iceCandidateForwarder({
  8363. sendMessage,
  8364. logging
  8365. });
  8366. const onIceCandidate = event => {
  8367. _readyToSendOffer.resolve();
  8368. if (shouldFilterCandidate(event.candidate)) {
  8369. logging.debug('Ignore candidate', event.candidate.candidate);
  8370. return;
  8371. }
  8372. forwarder(event);
  8373. };
  8374. let _previousIceState = _peerConnection.iceConnectionState;
  8375. const onIceConnectionStateChanged = event => {
  8376. if (_peerConnection) {
  8377. logging.debug('iceconnectionstatechange', _peerConnection.iceConnectionState);
  8378. if (_peerConnection.iceConnectionState === 'connected') {
  8379. api.emit('iceConnected');
  8380. } else if (_peerConnection.iceConnectionState === 'completed' && env.isLegacyEdge) {
  8381. // Start collecting stats later in Edge because it fails if you call it sooner
  8382. // This can probably be fixed better in Adapter.js
  8383. setTimeout(() => qos.startCollecting(_peerConnection), 1000);
  8384. }
  8385. } else {
  8386. logging.debug('iceconnectionstatechange on peerConnection that no longer exists', api);
  8387. }
  8388. const newIceState = event.target.iceConnectionState;
  8389. api.trigger('iceConnectionStateChange', newIceState);
  8390. if (_previousIceState !== 'disconnected' && newIceState === 'failed') {
  8391. // the sequence disconnected => failure would indicate an abrupt disconnection (e.g. remote
  8392. // peer closed the browser) or a network problem. We don't want to log that has a connection
  8393. // establishment failure. This behavior is seen only in Chrome 47+
  8394. triggerError({
  8395. reason: 'The stream was unable to connect due to a network error.' + ' Make sure your connection isn\'t blocked by a firewall.',
  8396. prefix: 'ICEWorkflow'
  8397. });
  8398. } else {
  8399. logAnalyticsEvent('attachEventsToPeerConnection', 'iceconnectionstatechange', newIceState);
  8400. }
  8401. if (newIceState === 'disconnected' && _iceRestartNeeded.get()) {
  8402. logging.debug('Restarting ice!');
  8403. api.generateOffer();
  8404. }
  8405. _previousIceState = newIceState;
  8406. };
  8407. const onNegotiationNeeded = () => {
  8408. logAnalyticsEvent('peerConnection:negotiationNeeded', 'Event');
  8409. if (isPublisher) {
  8410. api.generateOffer();
  8411. }
  8412. }; // Work around the fact that the safari adapter shim only
  8413. // fires 'addstream' event if onaddstream has been set
  8414. // https://github.com/opentok/webrtc-js/pull/2266#issuecomment-305647862
  8415. _peerConnection.onaddstream = noop;
  8416. _peerConnection.addEventListener('icecandidate', onIceCandidate);
  8417. _peerConnection.addEventListener('addstream', onRemoteStreamAdded);
  8418. _peerConnection.addEventListener('removestream', onRemoteStreamRemoved);
  8419. _peerConnection.addEventListener('signalingstatechange', routeStateChanged);
  8420. _peerConnection.addEventListener('negotiationneeded', onNegotiationNeeded);
  8421. _peerConnection.addEventListener('iceconnectionstatechange', onIceConnectionStateChanged);
  8422. cleanupJobs.add(() => {
  8423. if (!_peerConnection) {
  8424. return;
  8425. }
  8426. _peerConnection.onaddstream = null;
  8427. _peerConnection.removeEventListener('icecandidate', onIceCandidate);
  8428. _peerConnection.removeEventListener('addstream', onRemoteStreamAdded);
  8429. _peerConnection.removeEventListener('removestream', onRemoteStreamRemoved);
  8430. _peerConnection.removeEventListener('signalingstatechange', routeStateChanged);
  8431. _peerConnection.removeEventListener('negotiationneeded', onNegotiationNeeded);
  8432. _peerConnection.removeEventListener('iceconnectionstatechange', onIceConnectionStateChanged);
  8433. });
  8434. triggerPeerConnectionCompletion(null);
  8435. };
  8436. const triggerPeerConnectionCompletion = () => {
  8437. while (_peerConnectionCompletionHandlers.length) {
  8438. _peerConnectionCompletionHandlers.shift().call(null);
  8439. }
  8440. }; // Clean up the Peer Connection and trigger the close event.
  8441. // This function can be called safely multiple times, it will
  8442. // only trigger the close event once (per PeerConnection object)
  8443. const tearDownPeerConnection = () => {
  8444. // Our connection is dead, stop processing ICE candidates
  8445. if (_iceProcessor) {
  8446. _iceProcessor.destroy();
  8447. _iceProcessor = null;
  8448. }
  8449. _peerConnectionCompletionHandlers = [];
  8450. qos.stopCollecting();
  8451. cleanupJobs.releaseAll();
  8452. _readyToSendOffer.clean();
  8453. if (_peerConnection !== null) {
  8454. if (_peerConnection.destroy) {
  8455. // OTPlugin defines a destroy method on PCs. This allows
  8456. // the plugin to release any resources that it's holding.
  8457. _peerConnection.destroy();
  8458. }
  8459. _peerConnection = null;
  8460. api.trigger('close');
  8461. }
  8462. api.off();
  8463. };
  8464. const routeStateChanged = event => {
  8465. const newState = event.target.signalingState;
  8466. api.emit('signalingStateChange', newState);
  8467. if (newState === 'stable') {
  8468. api.emit('signalingStateStable');
  8469. }
  8470. if (newState && newState !== _state) {
  8471. _state = newState;
  8472. logging.debug("stateChange: " + _state);
  8473. switch (_state) {
  8474. case 'closed':
  8475. tearDownPeerConnection();
  8476. break;
  8477. default:
  8478. }
  8479. }
  8480. };
  8481. const qosCallback = parsedStats => {
  8482. parsedStats.dataChannels = _channels.sampleQos();
  8483. api.trigger('qos', {
  8484. parsedStats,
  8485. simulcastEnabled: _simulcastEnabled.get()
  8486. });
  8487. };
  8488. const getRemoteStreams = () => {
  8489. let streams;
  8490. if (_peerConnection.getRemoteStreams) {
  8491. streams = _peerConnection.getRemoteStreams();
  8492. } else if (_peerConnection.remoteStreams) {
  8493. streams = _peerConnection.remoteStreams;
  8494. } else {
  8495. throw new Error('Invalid Peer Connection object implements no ' + 'method for retrieving remote streams');
  8496. } // Force streams to be an Array, rather than a 'Sequence' object,
  8497. // which is browser dependent and does not behaviour like an Array
  8498. // in every case.
  8499. return Array.prototype.slice.call(streams);
  8500. }; // / PeerConnection signaling
  8501. const onRemoteStreamAdded = event => {
  8502. logAnalyticsEvent('createPeerConnection', 'StreamAdded');
  8503. api.trigger('streamAdded', event.stream);
  8504. };
  8505. const onRemoteStreamRemoved = event => {
  8506. logAnalyticsEvent('peerConnection:streamRemoved', 'Event');
  8507. api.trigger('streamRemoved', event.stream);
  8508. }; // ICE Negotiation messages
  8509. const reportError = (message, reason, prefix) => {
  8510. processingOffer = false;
  8511. triggerError({
  8512. reason: "PeerConnection.offerProcessor " + message + ": " + reason,
  8513. prefix
  8514. });
  8515. }; // Process an offer that
  8516. const processOffer = message => {
  8517. if (processingOffer) {
  8518. // If we get multiple pending offer messages we just handle the most recent one
  8519. pendingOfferMessage = message;
  8520. return;
  8521. }
  8522. processingOffer = true;
  8523. logAnalyticsEvent('peerConnection:processOffer', 'Event');
  8524. const offer = new NativeRTCSessionDescription({
  8525. type: 'offer',
  8526. sdp: message.content.sdp
  8527. }); // Relays +answer+ Answer
  8528. const relayAnswer = answer => {
  8529. processingOffer = false;
  8530. if (_iceProcessor) {
  8531. _iceProcessor.process();
  8532. }
  8533. sendMessage('answer', answer);
  8534. if (!env.isLegacyEdge) {
  8535. qos.startCollecting(_peerConnection, isPublisher);
  8536. }
  8537. if (pendingOfferMessage) {
  8538. processOffer(pendingOfferMessage);
  8539. pendingOfferMessage = null;
  8540. }
  8541. };
  8542. const onRemoteVideoSupported = supported => api.trigger('remoteVideoSupported', supported);
  8543. internalCreatePeerConnection(() => {
  8544. offerProcessor(_peerConnection, windowMock.RTCPeerConnection, windowMock.RTCSessionDescription, NativeRTCSessionDescription, sdpTransforms, offer, codecFlags, p2p, relayAnswer, reportError, onRemoteVideoSupported, replaceBaselineProfile);
  8545. });
  8546. };
  8547. const processAnswer = message => {
  8548. logAnalyticsEvent('peerConnection:processAnswer', 'Event');
  8549. const failure = errorReason => {
  8550. triggerError({
  8551. reason: "Error while setting RemoteDescription " + errorReason,
  8552. prefix: 'SetRemoteDescription'
  8553. });
  8554. };
  8555. if (!message.content.sdp) {
  8556. failure('Weird answer message, no SDP.');
  8557. return;
  8558. }
  8559. _answer = new NativeRTCSessionDescription({
  8560. type: 'answer',
  8561. sdp: applySdpTransform(sdpTransforms, 'remote', 'answer', assign({
  8562. replaceBaselineProfile
  8563. }, answerOverrides), message.content.sdp).local
  8564. });
  8565. (() => {
  8566. const success = () => {
  8567. logging.debug('processAnswer: setRemoteDescription Success');
  8568. if (_iceProcessor) {
  8569. _iceProcessor.process();
  8570. }
  8571. };
  8572. _peerConnection.setRemoteDescription(_answer).then(success).catch(failure);
  8573. offerAnswerPending = false;
  8574. if (regenerateOffer) {
  8575. regenerateOffer = false;
  8576. api.generateOffer();
  8577. }
  8578. })();
  8579. if (!env.isLegacyEdge) {
  8580. qos.startCollecting(_peerConnection, isPublisher);
  8581. }
  8582. };
  8583. const processSubscribe = () => {
  8584. offerAnswerPending = true;
  8585. logAnalyticsEvent('peerConnection:processSubscribe', 'Event');
  8586. logging.debug('processSubscribe: Sending offer to subscriber.');
  8587. const simulcastStreams = _simulcastEnabled.get() ? config.capableSimulcastStreams : 1;
  8588. internalCreatePeerConnection(() => {
  8589. subscribeProcessor({
  8590. peerConnection: _peerConnection,
  8591. NativeRTCSessionDescription,
  8592. sdpTransforms,
  8593. simulcastStreams,
  8594. offerOverrides,
  8595. offerConstraints: {
  8596. iceRestart: _iceRestartNeeded.get()
  8597. },
  8598. replaceBaselineProfile
  8599. }).then(offer => {
  8600. logging.debug('processSubscribe: got offer, waiting for ' + '_readyToSendOffer');
  8601. _offer = offer;
  8602. _readyToSendOffer.promise.then(() => {
  8603. logging.debug('processSubscribe: sending offer');
  8604. sendMessage('offer', _offer);
  8605. });
  8606. }, error => {
  8607. triggerError({
  8608. reason: "subscribeProcessor " + error.message + ": " + error.reason,
  8609. prefix: error.prefix
  8610. });
  8611. });
  8612. _iceRestartNeeded.set(false);
  8613. });
  8614. };
  8615. api.generateOffer = debounce(() => {
  8616. if (!offerAnswerPending) {
  8617. processSubscribe();
  8618. } else {
  8619. regenerateOffer = true;
  8620. }
  8621. }, 100);
  8622. const triggerError = (_ref2) => {
  8623. let reason = _ref2.reason,
  8624. prefix = _ref2.prefix;
  8625. logging.error(reason, 'in state', !_peerConnection ? '(none)' : {
  8626. connectionState: _peerConnection.connectionState,
  8627. iceConnectionState: _peerConnection.iceConnectionState,
  8628. iceGatheringState: _peerConnection.iceGatheringState,
  8629. signalingState: _peerConnection.signalingState
  8630. });
  8631. api.trigger('error', {
  8632. reason,
  8633. prefix
  8634. });
  8635. };
  8636. /*
  8637. * Add a track to the underlying PeerConnection
  8638. *
  8639. * @param {object} track - the track to add
  8640. * @param {object} stream - the stream to add it to
  8641. * @return {RTCRtpSender}
  8642. */
  8643. api.addTrack = (track, stream) => {
  8644. const promise = new Promise((resolve, reject) => {
  8645. internalCreatePeerConnection(err => {
  8646. if (err) {
  8647. return reject(err);
  8648. }
  8649. resolve();
  8650. return undefined;
  8651. });
  8652. }).then(() => {
  8653. if (_peerConnection.addTrack) {
  8654. return _peerConnection.addTrack(track, stream);
  8655. }
  8656. const pcStream = _peerConnection.getLocalStreams()[0];
  8657. if (pcStream === undefined) {
  8658. throw new Error('PeerConnection has no existing streams, cannot addTrack');
  8659. }
  8660. pcStream.addTrack(track);
  8661. api.generateOffer();
  8662. return undefined;
  8663. }).then(() => new Promise(resolve => {
  8664. api.once('signalingStateStable', () => {
  8665. resolve();
  8666. });
  8667. }));
  8668. return promiseTimeout(promise, 15000, 'Renegotiation timed out');
  8669. };
  8670. function FakeRTCRtpSender(track) {
  8671. this.track = track;
  8672. }
  8673. /**
  8674. * Remove a track from the underlying PeerConnection
  8675. *
  8676. * @param {RTCRtpSender} RTCRtpSender - the RTCRtpSender to remove
  8677. */
  8678. api.removeTrack = RTCRtpSender => {
  8679. const promise = Promise.resolve().then(() => {
  8680. if (RTCRtpSender instanceof FakeRTCRtpSender) {
  8681. _peerConnection.getLocalStreams()[0].removeTrack(RTCRtpSender.track);
  8682. api.generateOffer();
  8683. return undefined;
  8684. }
  8685. return _peerConnection.removeTrack(RTCRtpSender);
  8686. }).then(() => new Promise(resolve => {
  8687. api.once('signalingStateStable', () => {
  8688. resolve();
  8689. });
  8690. }));
  8691. return promiseTimeout(promise, 15000, 'Renegotiation timed out');
  8692. };
  8693. api.addLocalStream = webRTCStream => new Promise((resolve, reject) => {
  8694. internalCreatePeerConnection(err => {
  8695. if (err) {
  8696. reject(err);
  8697. return;
  8698. }
  8699. try {
  8700. _peerConnection.addStream(webRTCStream);
  8701. } catch (addStreamErr) {
  8702. reject(addStreamErr);
  8703. return;
  8704. }
  8705. resolve();
  8706. }, webRTCStream);
  8707. });
  8708. api.getLocalStreams = () => _peerConnection.getLocalStreams();
  8709. api.getSenders = () => {
  8710. if (_peerConnection.getSenders) {
  8711. return _peerConnection.getSenders();
  8712. }
  8713. return _peerConnection.getLocalStreams()[0].getTracks().map(track => new FakeRTCRtpSender(track));
  8714. };
  8715. api.disconnect = () => {
  8716. if (_iceProcessor) {
  8717. _iceProcessor.destroy();
  8718. _iceProcessor = null;
  8719. }
  8720. if (_peerConnection && _peerConnection.signalingState && _peerConnection.signalingState.toLowerCase() !== 'closed') {
  8721. _peerConnection.close();
  8722. if (env.name === 'Firefox') {
  8723. // FF seems to never go into the closed signalingState when the close
  8724. // method is called on a PeerConnection. This means that we need to call
  8725. // our cleanup code manually.
  8726. //
  8727. // * https://bugzilla.mozilla.org/show_bug.cgi?id=989936
  8728. //
  8729. setTimeout(tearDownPeerConnection);
  8730. }
  8731. }
  8732. };
  8733. api.iceRestart = () => _iceRestartNeeded.set(true);
  8734. api.processMessage = (type, message) => {
  8735. logging.debug("processMessage: Received " + type + " from " + message.fromAddress, message);
  8736. logging.debug(message);
  8737. switch (type) {
  8738. case 'generateoffer':
  8739. if (message.content && message.content.simulcastEnabled !== undefined) {
  8740. _simulcastEnabled.set(message.content.simulcastEnabled);
  8741. }
  8742. api.generateOffer();
  8743. trackRenegotiationAttempts();
  8744. break;
  8745. case 'offer':
  8746. processOffer(message);
  8747. trackRenegotiationAttempts();
  8748. break;
  8749. case 'answer':
  8750. case 'pranswer':
  8751. processAnswer(message);
  8752. break;
  8753. case 'candidate':
  8754. var iceCandidate = new NativeRTCIceCandidate(message.content);
  8755. if (shouldFilterCandidate(iceCandidate)) {
  8756. logging.debug('Ignore candidate', iceCandidate.candidate);
  8757. return api;
  8758. }
  8759. if (_iceProcessor) {
  8760. _iceProcessor.addIceCandidate(iceCandidate).catch(err => {
  8761. // Sometimes you might get an error adding an iceCandidate
  8762. // this does not mean we should fail, if we get a working candidate
  8763. // later then we should let it work
  8764. logging.warn("Error while adding ICE candidate: " + JSON.stringify(iceCandidate) + ": " + err.toString());
  8765. });
  8766. }
  8767. break;
  8768. default:
  8769. logging.debug("processMessage: Received an unexpected message of type " + type + " from " + message.fromAddress + ": " + JSON.stringify(message));
  8770. }
  8771. function trackRenegotiationAttempts() {
  8772. offerMessagesReceived += 1;
  8773. qos.handleOfferMessageReceived();
  8774. if (offerMessagesReceived > 1) {
  8775. logAnalyticsEvent('Renegotiation', 'Attempt');
  8776. renegotiationInProgress = true;
  8777. }
  8778. }
  8779. return api;
  8780. };
  8781. api.remoteStreams = () => _peerConnection ? getRemoteStreams() : [];
  8782. api.remoteTracks = () => {
  8783. if (!_peerConnection) {
  8784. return [];
  8785. }
  8786. if (_peerConnection.getReceivers) {
  8787. return Array.prototype.slice.apply(_peerConnection.getReceivers()).map(receiver => receiver.track);
  8788. }
  8789. return Array.prototype.concat.apply([], getRemoteStreams().map(stream => stream.getTracks()));
  8790. };
  8791. api.remoteDescription = () => _peerConnection.remoteDescription;
  8792. /*
  8793. * @param {function(DOMError, Array<RTCStats>)} callback
  8794. */
  8795. api.getStats = callback => {
  8796. if (!_peerConnection) {
  8797. callback(new OTHelpersError('Cannot call getStats before there is a connection.', 'NotConnectedError', {
  8798. code: 1015
  8799. }));
  8800. return;
  8801. }
  8802. _getStatsAdapter(_peerConnection, callback);
  8803. };
  8804. const waitForChannel = function waitForChannel(timesToWait, label, channelOptions, completion) {
  8805. let err;
  8806. const channel = _channels.get(label, channelOptions);
  8807. if (!channel) {
  8808. if (timesToWait > 0) {
  8809. setTimeout(waitForChannel.bind(null, timesToWait - 1, label, channelOptions, completion), 200);
  8810. return;
  8811. }
  8812. err = new OTHelpersError("" + ('A channel with that label and options could not be found. ' + 'Label:') + label + ". Options: " + JSON.stringify(channelOptions));
  8813. }
  8814. completion(err, channel);
  8815. };
  8816. api.getDataChannel = (label, channelOptions, completion) => {
  8817. if (!_peerConnection) {
  8818. completion(new OTHelpersError('Cannot create a DataChannel before there is a connection.'));
  8819. return;
  8820. } // Wait up to 20 sec for the channel to appear, then fail
  8821. waitForChannel(100, label, channelOptions, completion);
  8822. };
  8823. api.iceConnectionStateIsConnected = () => _peerConnection && ['connected', 'completed'].indexOf(_peerConnection.iceConnectionState) > -1;
  8824. api.findAndReplaceTrack = (oldTrack, newTrack) => Promise.resolve().then(() => {
  8825. const sender = _peerConnection.getSenders().filter(s => s.track === oldTrack)[0];
  8826. if (!sender) {
  8827. // There is no video track to replace but this is OK
  8828. // they probably called cycleVideo on an audio only Publisher
  8829. // or on a Publisher that does not support the videoCodec
  8830. return Promise.resolve();
  8831. }
  8832. if (typeof sender.replaceTrack !== 'function') {
  8833. throw new Error('Sender does not support replaceTrack');
  8834. }
  8835. return sender.replaceTrack(newTrack);
  8836. });
  8837. api.hasRelayCandidates = () => hasRelayCandidates;
  8838. api.getNegotiatedCodecs = () => {
  8839. if (!_peerConnection.localDescription || !_peerConnection.remoteDescription) {
  8840. return null;
  8841. }
  8842. const getForMediaType = mediaType => intersection(SDPHelpers.getCodecs(_peerConnection.localDescription.sdp, mediaType), SDPHelpers.getCodecs(_peerConnection.remoteDescription.sdp, mediaType));
  8843. return {
  8844. audio: getForMediaType('audio'),
  8845. video: getForMediaType('video')
  8846. };
  8847. };
  8848. api.on('signalingStateStable', () => {
  8849. if (renegotiationInProgress) {
  8850. renegotiationInProgress = false;
  8851. logAnalyticsEvent('Renegotiation', 'Success', api.getNegotiatedCodecs());
  8852. }
  8853. });
  8854. api.on('error', (_ref3) => {
  8855. let prefix = _ref3.prefix;
  8856. if (renegotiationInProgress && ['CreateOffer', 'SetRemoteDescription'].indexOf(prefix) !== -1) {
  8857. renegotiationInProgress = false;
  8858. logAnalyticsEvent('Renegotiation', 'Failure');
  8859. }
  8860. });
  8861. api.on('close', () => {
  8862. if (renegotiationInProgress) {
  8863. renegotiationInProgress = false;
  8864. logAnalyticsEvent('Renegotiation', 'Cancel');
  8865. }
  8866. });
  8867. const qos = new Qos();
  8868. qos.on('stats', qosCallback);
  8869. return api;
  8870. };
  8871. };
  8872. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  8873. /***/ }),
  8874. /* 100 */
  8875. /***/ (function(module, exports, __webpack_require__) {
  8876. "use strict";
  8877. const env = __webpack_require__(3);
  8878. module.exports = () => env.name === 'Chrome' && env.version > 71 || env.isChromiumEdge || env.name === 'Opera' && env.version > 58;
  8879. /***/ }),
  8880. /* 101 */
  8881. /***/ (function(module, exports, __webpack_require__) {
  8882. "use strict";
  8883. /*
  8884. * Executes the provided callback before each paint (frequency is usually the monitors refresh
  8885. * rate which is typically 60 times per second)
  8886. *
  8887. * @param {function()} callback
  8888. * @constructor
  8889. */
  8890. module.exports = function RafRunner(callback) {
  8891. let cancelId = null;
  8892. let running = false;
  8893. const loop = () => {
  8894. if (!running) {
  8895. return;
  8896. }
  8897. callback();
  8898. cancelId = window.requestAnimationFrame(loop);
  8899. };
  8900. this.start = () => {
  8901. if (running) {
  8902. return;
  8903. }
  8904. running = true;
  8905. window.requestAnimationFrame(loop);
  8906. };
  8907. this.stop = () => {
  8908. window.cancelAnimationFrame(cancelId);
  8909. running = false;
  8910. };
  8911. };
  8912. /***/ }),
  8913. /* 102 */
  8914. /***/ (function(module, exports, __webpack_require__) {
  8915. "use strict";
  8916. const assign = __webpack_require__(6);
  8917. const generatePropertyFunction = (object, getter, setter) => {
  8918. if (getter && !setter) {
  8919. return () => getter.call(object);
  8920. }
  8921. if (getter && setter) {
  8922. return value => {
  8923. if (value !== undefined) {
  8924. setter.call(object, value);
  8925. }
  8926. return getter.call(object);
  8927. };
  8928. }
  8929. return value => {
  8930. if (value !== undefined) {
  8931. setter.call(object, value);
  8932. }
  8933. };
  8934. };
  8935. /**
  8936. * @typedef getterSetterDefinition
  8937. * @property {function(): any} get the function called when accessing the value
  8938. * @property {function(any): void} set the function called when setting the value
  8939. */
  8940. /**
  8941. * Creates primitive getters/ setters on objects
  8942. *
  8943. * For every key in gettersSetters, a method will be added to object.
  8944. *
  8945. * When the method is called with no value, it will call the getter
  8946. * When the method is called with a value, it will call the setter with the value
  8947. *
  8948. * @deprecated Prefer using real getters and setters
  8949. *
  8950. * @param {any} object
  8951. * @param {Object.<string, getterSetterDefinition>} getterSetters
  8952. */
  8953. module.exports = (object, getterSetters) => {
  8954. const mixin = {};
  8955. Object.keys(getterSetters).forEach(key => {
  8956. mixin[key] = generatePropertyFunction(object, getterSetters[key].get, getterSetters[key].set);
  8957. });
  8958. assign(object, mixin);
  8959. };
  8960. /***/ }),
  8961. /* 103 */
  8962. /***/ (function(module, exports, __webpack_require__) {
  8963. "use strict";
  8964. /* WEBPACK VAR INJECTION */(function(Promise) {
  8965. /* eslint-disable func-names */
  8966. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  8967. /* eslint-disable no-param-reassign, global-require */
  8968. module.exports = function deviceHelpersFactory(deps) {
  8969. if (deps === void 0) {
  8970. deps = {};
  8971. }
  8972. const getNativeEnumerateDevices = deps.getNativeEnumerateDevices || __webpack_require__(276)();
  8973. const env = deps.env || __webpack_require__(3);
  8974. const deviceHelpers = {}; // /
  8975. // Device Helpers
  8976. //
  8977. // Support functions to enumerating and guerying device info
  8978. //
  8979. const deviceKindsMap = {
  8980. audio: 'audioInput',
  8981. video: 'videoInput',
  8982. audioinput: 'audioInput',
  8983. videoinput: 'videoInput',
  8984. audioInput: 'audioInput',
  8985. videoInput: 'videoInput'
  8986. };
  8987. const enumerateDevices = function enumerateDevices() {
  8988. // Our mocking currently requires that this be re-evaluated each time.
  8989. const fn = getNativeEnumerateDevices();
  8990. return fn();
  8991. }; // Indicates whether this browser supports the enumerateDevices (getSources) API.
  8992. //
  8993. deviceHelpers.hasEnumerateDevicesCapability = function () {
  8994. return typeof getNativeEnumerateDevices() === 'function';
  8995. }; // OPENTOK-40733, see https://bugs.webkit.org/show_bug.cgi?id=209739#c2
  8996. // multiple calls to enumerateDevices fail to return video devices
  8997. // note that this causes any devices without a camera (mac minis) to make a video gum call
  8998. // we believe this is worth it to prevent safari video breaking
  8999. deviceHelpers.hasEnumerateDevicesBug = () => env.isSafari && env.version === 13.1;
  9000. deviceHelpers.getMediaDevices = function () {
  9001. if (!deviceHelpers.hasEnumerateDevicesCapability()) {
  9002. return Promise.reject(new Error('This browser does not support enumerateDevices APIs'));
  9003. }
  9004. return enumerateDevices().then(devices => // Normalise the device kinds
  9005. devices.map(device => ({
  9006. deviceId: device.deviceId || device.id,
  9007. label: device.label,
  9008. kind: deviceKindsMap[device.kind]
  9009. })).filter(device => device.kind === 'audioInput' || device.kind === 'videoInput'));
  9010. };
  9011. deviceHelpers.shouldAskForDevices = function () {
  9012. if (!deviceHelpers.hasEnumerateDevicesCapability()) {
  9013. // Assume video and audio exists if enumerateDevices is not available
  9014. return Promise.resolve({
  9015. video: true,
  9016. audio: true
  9017. });
  9018. }
  9019. return deviceHelpers.getMediaDevices().then(devices => {
  9020. if (devices.length === 0) {
  9021. // If no devices reported, might as well try anyway, maybe it was just an issue with
  9022. // device enumeration.
  9023. return {
  9024. video: true,
  9025. audio: true
  9026. };
  9027. }
  9028. const audioDevices = devices.filter(device => device.kind === 'audioInput');
  9029. const videoDevices = devices.filter(device => device.kind === 'videoInput');
  9030. if (deviceHelpers.hasEnumerateDevicesBug() && videoDevices.length === 0) {
  9031. return {
  9032. audio: true,
  9033. video: true
  9034. };
  9035. }
  9036. return {
  9037. video: videoDevices.length > 0,
  9038. audio: audioDevices.length > 0,
  9039. videoDevices,
  9040. audioDevices
  9041. };
  9042. }).catch(() => ( // There was an error. It may be temporally. Just assume
  9043. // all devices exist for now.
  9044. {
  9045. video: true,
  9046. audio: true
  9047. }));
  9048. };
  9049. return deviceHelpers;
  9050. };
  9051. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  9052. /***/ }),
  9053. /* 104 */
  9054. /***/ (function(module, exports, __webpack_require__) {
  9055. "use strict";
  9056. const DefaultNativeVideoElementWrapperFactory = __webpack_require__(283);
  9057. /**
  9058. * VideoElementFacadeFactory DI Container for VideoElementFacade
  9059. *
  9060. * @package
  9061. * @param {Object} [dependencies]
  9062. * @param {typeof NativeVideoElementWrapper} [dependencies.NativeVideoElementWrapper]
  9063. * @return {typeof VideoElementFacade}
  9064. */
  9065. function VideoElementFacadeFactory(_temp) {
  9066. let _ref = _temp === void 0 ? {} : _temp,
  9067. _ref$NativeVideoEleme = _ref.NativeVideoElementWrapper,
  9068. NativeVideoElementWrapper = _ref$NativeVideoEleme === void 0 ? DefaultNativeVideoElementWrapperFactory() : _ref$NativeVideoEleme;
  9069. const VideoElementWrapper = NativeVideoElementWrapper;
  9070. const defaultAudioVolume = 50;
  9071. /**
  9072. * Create a new VideoElementFacade
  9073. *
  9074. * Was used to simplify the strategy between Plugin and Native.
  9075. *
  9076. * @todo This needs to go.
  9077. *
  9078. * Note: Could VideoElementFacade not exist? Could it just be an expected interface
  9079. * for VideoElementWrapper which could be either PluginVideoElementWrapper or
  9080. * NativeVideoElementWrapper
  9081. *
  9082. * @package
  9083. * @class
  9084. * @param {Object} [config]
  9085. * @param {String} [config.fallbackText] displayed when WebRTC is not supported
  9086. * @param {Boolean} [config.muted] initial mute setting
  9087. * @param {String} [config.fitMode] fitMode a parameter passed to VideoElementWrapper
  9088. * @param {Object} [config._inject] @todo use the DI system
  9089. * @param {Function} [errorHandler=() => {}] error callback function
  9090. */
  9091. function VideoElementFacade(_temp2) {
  9092. let _ref2 = _temp2 === void 0 ? {} : _temp2,
  9093. _ref2$fallbackText = _ref2.fallbackText,
  9094. fallbackText = _ref2$fallbackText === void 0 ? 'Sorry, Web RTC is not available in your browser' : _ref2$fallbackText,
  9095. fitMode = _ref2.fitMode,
  9096. muted = _ref2.muted,
  9097. _inject = _ref2._inject,
  9098. widgetType = _ref2.widgetType;
  9099. return new VideoElementWrapper({
  9100. fallbackText,
  9101. fitMode,
  9102. muted,
  9103. defaultAudioVolume,
  9104. _inject,
  9105. widgetType
  9106. });
  9107. }
  9108. return VideoElementFacade;
  9109. }
  9110. module.exports = VideoElementFacadeFactory;
  9111. /***/ }),
  9112. /* 105 */
  9113. /***/ (function(module, exports) {
  9114. function _interopRequireWildcard(obj) {
  9115. if (obj && obj.__esModule) {
  9116. return obj;
  9117. } else {
  9118. var newObj = {};
  9119. if (obj != null) {
  9120. for (var key in obj) {
  9121. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  9122. var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
  9123. if (desc.get || desc.set) {
  9124. Object.defineProperty(newObj, key, desc);
  9125. } else {
  9126. newObj[key] = obj[key];
  9127. }
  9128. }
  9129. }
  9130. }
  9131. newObj.default = obj;
  9132. return newObj;
  9133. }
  9134. }
  9135. module.exports = _interopRequireWildcard;
  9136. /***/ }),
  9137. /* 106 */
  9138. /***/ (function(module, exports, __webpack_require__) {
  9139. var getNative = __webpack_require__(36),
  9140. root = __webpack_require__(10);
  9141. /* Built-in method references that are verified to be native. */
  9142. var Map = getNative(root, 'Map');
  9143. module.exports = Map;
  9144. /***/ }),
  9145. /* 107 */
  9146. /***/ (function(module, exports, __webpack_require__) {
  9147. var mapCacheClear = __webpack_require__(343),
  9148. mapCacheDelete = __webpack_require__(350),
  9149. mapCacheGet = __webpack_require__(352),
  9150. mapCacheHas = __webpack_require__(353),
  9151. mapCacheSet = __webpack_require__(354);
  9152. /**
  9153. * Creates a map cache object to store key-value pairs.
  9154. *
  9155. * @private
  9156. * @constructor
  9157. * @param {Array} [entries] The key-value pairs to cache.
  9158. */
  9159. function MapCache(entries) {
  9160. var index = -1,
  9161. length = entries == null ? 0 : entries.length;
  9162. this.clear();
  9163. while (++index < length) {
  9164. var entry = entries[index];
  9165. this.set(entry[0], entry[1]);
  9166. }
  9167. }
  9168. // Add methods to `MapCache`.
  9169. MapCache.prototype.clear = mapCacheClear;
  9170. MapCache.prototype['delete'] = mapCacheDelete;
  9171. MapCache.prototype.get = mapCacheGet;
  9172. MapCache.prototype.has = mapCacheHas;
  9173. MapCache.prototype.set = mapCacheSet;
  9174. module.exports = MapCache;
  9175. /***/ }),
  9176. /* 108 */
  9177. /***/ (function(module, exports) {
  9178. /**
  9179. * A specialized version of `_.forEach` for arrays without support for
  9180. * iteratee shorthands.
  9181. *
  9182. * @private
  9183. * @param {Array} [array] The array to iterate over.
  9184. * @param {Function} iteratee The function invoked per iteration.
  9185. * @returns {Array} Returns `array`.
  9186. */
  9187. function arrayEach(array, iteratee) {
  9188. var index = -1,
  9189. length = array == null ? 0 : array.length;
  9190. while (++index < length) {
  9191. if (iteratee(array[index], index, array) === false) {
  9192. break;
  9193. }
  9194. }
  9195. return array;
  9196. }
  9197. module.exports = arrayEach;
  9198. /***/ }),
  9199. /* 109 */
  9200. /***/ (function(module, exports) {
  9201. /** Used as references for various `Number` constants. */
  9202. var MAX_SAFE_INTEGER = 9007199254740991;
  9203. /**
  9204. * Checks if `value` is a valid array-like length.
  9205. *
  9206. * **Note:** This method is loosely based on
  9207. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  9208. *
  9209. * @static
  9210. * @memberOf _
  9211. * @since 4.0.0
  9212. * @category Lang
  9213. * @param {*} value The value to check.
  9214. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  9215. * @example
  9216. *
  9217. * _.isLength(3);
  9218. * // => true
  9219. *
  9220. * _.isLength(Number.MIN_VALUE);
  9221. * // => false
  9222. *
  9223. * _.isLength(Infinity);
  9224. * // => false
  9225. *
  9226. * _.isLength('3');
  9227. * // => false
  9228. */
  9229. function isLength(value) {
  9230. return typeof value == 'number' &&
  9231. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  9232. }
  9233. module.exports = isLength;
  9234. /***/ }),
  9235. /* 110 */
  9236. /***/ (function(module, exports, __webpack_require__) {
  9237. /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(168);
  9238. /** Detect free variable `exports`. */
  9239. var freeExports = true && exports && !exports.nodeType && exports;
  9240. /** Detect free variable `module`. */
  9241. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  9242. /** Detect the popular CommonJS extension `module.exports`. */
  9243. var moduleExports = freeModule && freeModule.exports === freeExports;
  9244. /** Detect free variable `process` from Node.js. */
  9245. var freeProcess = moduleExports && freeGlobal.process;
  9246. /** Used to access faster Node.js helpers. */
  9247. var nodeUtil = (function() {
  9248. try {
  9249. // Use `util.types` for Node.js 10+.
  9250. var types = freeModule && freeModule.require && freeModule.require('util').types;
  9251. if (types) {
  9252. return types;
  9253. }
  9254. // Legacy `process.binding('util')` for Node.js < 10.
  9255. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  9256. } catch (e) {}
  9257. }());
  9258. module.exports = nodeUtil;
  9259. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(81)(module)))
  9260. /***/ }),
  9261. /* 111 */
  9262. /***/ (function(module, exports, __webpack_require__) {
  9263. var isPrototype = __webpack_require__(65),
  9264. nativeKeys = __webpack_require__(359);
  9265. /** Used for built-in method references. */
  9266. var objectProto = Object.prototype;
  9267. /** Used to check objects for own properties. */
  9268. var hasOwnProperty = objectProto.hasOwnProperty;
  9269. /**
  9270. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  9271. *
  9272. * @private
  9273. * @param {Object} object The object to query.
  9274. * @returns {Array} Returns the array of property names.
  9275. */
  9276. function baseKeys(object) {
  9277. if (!isPrototype(object)) {
  9278. return nativeKeys(object);
  9279. }
  9280. var result = [];
  9281. for (var key in Object(object)) {
  9282. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  9283. result.push(key);
  9284. }
  9285. }
  9286. return result;
  9287. }
  9288. module.exports = baseKeys;
  9289. /***/ }),
  9290. /* 112 */
  9291. /***/ (function(module, exports, __webpack_require__) {
  9292. var arrayFilter = __webpack_require__(364),
  9293. stubArray = __webpack_require__(175);
  9294. /** Used for built-in method references. */
  9295. var objectProto = Object.prototype;
  9296. /** Built-in value references. */
  9297. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  9298. /* Built-in method references for those with the same name as other `lodash` methods. */
  9299. var nativeGetSymbols = Object.getOwnPropertySymbols;
  9300. /**
  9301. * Creates an array of the own enumerable symbols of `object`.
  9302. *
  9303. * @private
  9304. * @param {Object} object The object to query.
  9305. * @returns {Array} Returns the array of symbols.
  9306. */
  9307. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  9308. if (object == null) {
  9309. return [];
  9310. }
  9311. object = Object(object);
  9312. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  9313. return propertyIsEnumerable.call(object, symbol);
  9314. });
  9315. };
  9316. module.exports = getSymbols;
  9317. /***/ }),
  9318. /* 113 */
  9319. /***/ (function(module, exports) {
  9320. /**
  9321. * Appends the elements of `values` to `array`.
  9322. *
  9323. * @private
  9324. * @param {Array} array The array to modify.
  9325. * @param {Array} values The values to append.
  9326. * @returns {Array} Returns `array`.
  9327. */
  9328. function arrayPush(array, values) {
  9329. var index = -1,
  9330. length = values.length,
  9331. offset = array.length;
  9332. while (++index < length) {
  9333. array[offset + index] = values[index];
  9334. }
  9335. return array;
  9336. }
  9337. module.exports = arrayPush;
  9338. /***/ }),
  9339. /* 114 */
  9340. /***/ (function(module, exports, __webpack_require__) {
  9341. var overArg = __webpack_require__(173);
  9342. /** Built-in value references. */
  9343. var getPrototype = overArg(Object.getPrototypeOf, Object);
  9344. module.exports = getPrototype;
  9345. /***/ }),
  9346. /* 115 */
  9347. /***/ (function(module, exports, __webpack_require__) {
  9348. var Uint8Array = __webpack_require__(182);
  9349. /**
  9350. * Creates a clone of `arrayBuffer`.
  9351. *
  9352. * @private
  9353. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  9354. * @returns {ArrayBuffer} Returns the cloned array buffer.
  9355. */
  9356. function cloneArrayBuffer(arrayBuffer) {
  9357. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  9358. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  9359. return result;
  9360. }
  9361. module.exports = cloneArrayBuffer;
  9362. /***/ }),
  9363. /* 116 */
  9364. /***/ (function(module, exports, __webpack_require__) {
  9365. "use strict";
  9366. /* WEBPACK VAR INJECTION */(function(process) {
  9367. var utils = __webpack_require__(16);
  9368. var normalizeHeaderName = __webpack_require__(380);
  9369. var DEFAULT_CONTENT_TYPE = {
  9370. 'Content-Type': 'application/x-www-form-urlencoded'
  9371. };
  9372. function setContentTypeIfUnset(headers, value) {
  9373. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  9374. headers['Content-Type'] = value;
  9375. }
  9376. }
  9377. function getDefaultAdapter() {
  9378. var adapter;
  9379. if (typeof XMLHttpRequest !== 'undefined') {
  9380. // For browsers use XHR adapter
  9381. adapter = __webpack_require__(188);
  9382. } else if (typeof process !== 'undefined') {
  9383. // For node use HTTP adapter
  9384. adapter = __webpack_require__(188);
  9385. }
  9386. return adapter;
  9387. }
  9388. var defaults = {
  9389. adapter: getDefaultAdapter(),
  9390. transformRequest: [function transformRequest(data, headers) {
  9391. normalizeHeaderName(headers, 'Content-Type');
  9392. if (utils.isFormData(data) ||
  9393. utils.isArrayBuffer(data) ||
  9394. utils.isBuffer(data) ||
  9395. utils.isStream(data) ||
  9396. utils.isFile(data) ||
  9397. utils.isBlob(data)
  9398. ) {
  9399. return data;
  9400. }
  9401. if (utils.isArrayBufferView(data)) {
  9402. return data.buffer;
  9403. }
  9404. if (utils.isURLSearchParams(data)) {
  9405. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  9406. return data.toString();
  9407. }
  9408. if (utils.isObject(data)) {
  9409. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  9410. return JSON.stringify(data);
  9411. }
  9412. return data;
  9413. }],
  9414. transformResponse: [function transformResponse(data) {
  9415. /*eslint no-param-reassign:0*/
  9416. if (typeof data === 'string') {
  9417. try {
  9418. data = JSON.parse(data);
  9419. } catch (e) { /* Ignore */ }
  9420. }
  9421. return data;
  9422. }],
  9423. /**
  9424. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  9425. * timeout is not created.
  9426. */
  9427. timeout: 0,
  9428. xsrfCookieName: 'XSRF-TOKEN',
  9429. xsrfHeaderName: 'X-XSRF-TOKEN',
  9430. maxContentLength: -1,
  9431. validateStatus: function validateStatus(status) {
  9432. return status >= 200 && status < 300;
  9433. }
  9434. };
  9435. defaults.headers = {
  9436. common: {
  9437. 'Accept': 'application/json, text/plain, */*'
  9438. }
  9439. };
  9440. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  9441. defaults.headers[method] = {};
  9442. });
  9443. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  9444. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  9445. });
  9446. module.exports = defaults;
  9447. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(67)))
  9448. /***/ }),
  9449. /* 117 */
  9450. /***/ (function(module, exports) {
  9451. /**
  9452. * The default argument placeholder value for methods.
  9453. *
  9454. * @type {Object}
  9455. */
  9456. module.exports = {};
  9457. /***/ }),
  9458. /* 118 */
  9459. /***/ (function(module, exports, __webpack_require__) {
  9460. var baseSetData = __webpack_require__(193),
  9461. createBind = __webpack_require__(399),
  9462. createCurry = __webpack_require__(400),
  9463. createHybrid = __webpack_require__(195),
  9464. createPartial = __webpack_require__(416),
  9465. getData = __webpack_require__(199),
  9466. mergeData = __webpack_require__(417),
  9467. setData = __webpack_require__(202),
  9468. setWrapToString = __webpack_require__(204),
  9469. toInteger = __webpack_require__(87);
  9470. /** Error message constants. */
  9471. var FUNC_ERROR_TEXT = 'Expected a function';
  9472. /** Used to compose bitmasks for function metadata. */
  9473. var WRAP_BIND_FLAG = 1,
  9474. WRAP_BIND_KEY_FLAG = 2,
  9475. WRAP_CURRY_FLAG = 8,
  9476. WRAP_CURRY_RIGHT_FLAG = 16,
  9477. WRAP_PARTIAL_FLAG = 32,
  9478. WRAP_PARTIAL_RIGHT_FLAG = 64;
  9479. /* Built-in method references for those with the same name as other `lodash` methods. */
  9480. var nativeMax = Math.max;
  9481. /**
  9482. * Creates a function that either curries or invokes `func` with optional
  9483. * `this` binding and partially applied arguments.
  9484. *
  9485. * @private
  9486. * @param {Function|string} func The function or method name to wrap.
  9487. * @param {number} bitmask The bitmask flags.
  9488. * 1 - `_.bind`
  9489. * 2 - `_.bindKey`
  9490. * 4 - `_.curry` or `_.curryRight` of a bound function
  9491. * 8 - `_.curry`
  9492. * 16 - `_.curryRight`
  9493. * 32 - `_.partial`
  9494. * 64 - `_.partialRight`
  9495. * 128 - `_.rearg`
  9496. * 256 - `_.ary`
  9497. * 512 - `_.flip`
  9498. * @param {*} [thisArg] The `this` binding of `func`.
  9499. * @param {Array} [partials] The arguments to be partially applied.
  9500. * @param {Array} [holders] The `partials` placeholder indexes.
  9501. * @param {Array} [argPos] The argument positions of the new function.
  9502. * @param {number} [ary] The arity cap of `func`.
  9503. * @param {number} [arity] The arity of `func`.
  9504. * @returns {Function} Returns the new wrapped function.
  9505. */
  9506. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  9507. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  9508. if (!isBindKey && typeof func != 'function') {
  9509. throw new TypeError(FUNC_ERROR_TEXT);
  9510. }
  9511. var length = partials ? partials.length : 0;
  9512. if (!length) {
  9513. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  9514. partials = holders = undefined;
  9515. }
  9516. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  9517. arity = arity === undefined ? arity : toInteger(arity);
  9518. length -= holders ? holders.length : 0;
  9519. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  9520. var partialsRight = partials,
  9521. holdersRight = holders;
  9522. partials = holders = undefined;
  9523. }
  9524. var data = isBindKey ? undefined : getData(func);
  9525. var newData = [
  9526. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  9527. argPos, ary, arity
  9528. ];
  9529. if (data) {
  9530. mergeData(newData, data);
  9531. }
  9532. func = newData[0];
  9533. bitmask = newData[1];
  9534. thisArg = newData[2];
  9535. partials = newData[3];
  9536. holders = newData[4];
  9537. arity = newData[9] = newData[9] === undefined
  9538. ? (isBindKey ? 0 : func.length)
  9539. : nativeMax(newData[9] - length, 0);
  9540. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  9541. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  9542. }
  9543. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  9544. var result = createBind(func, bitmask, thisArg);
  9545. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  9546. result = createCurry(func, bitmask, arity);
  9547. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  9548. result = createPartial(func, bitmask, thisArg, partials);
  9549. } else {
  9550. result = createHybrid.apply(undefined, newData);
  9551. }
  9552. var setter = data ? baseSetData : setData;
  9553. return setWrapToString(setter(result, newData), func, bitmask);
  9554. }
  9555. module.exports = createWrap;
  9556. /***/ }),
  9557. /* 119 */
  9558. /***/ (function(module, exports) {
  9559. /**
  9560. * A faster alternative to `Function#apply`, this function invokes `func`
  9561. * with the `this` binding of `thisArg` and the arguments of `args`.
  9562. *
  9563. * @private
  9564. * @param {Function} func The function to invoke.
  9565. * @param {*} thisArg The `this` binding of `func`.
  9566. * @param {Array} args The arguments to invoke `func` with.
  9567. * @returns {*} Returns the result of `func`.
  9568. */
  9569. function apply(func, thisArg, args) {
  9570. switch (args.length) {
  9571. case 0: return func.call(thisArg);
  9572. case 1: return func.call(thisArg, args[0]);
  9573. case 2: return func.call(thisArg, args[0], args[1]);
  9574. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  9575. }
  9576. return func.apply(thisArg, args);
  9577. }
  9578. module.exports = apply;
  9579. /***/ }),
  9580. /* 120 */
  9581. /***/ (function(module, exports, __webpack_require__) {
  9582. var baseCreate = __webpack_require__(83),
  9583. baseLodash = __webpack_require__(121);
  9584. /** Used as references for the maximum length and index of an array. */
  9585. var MAX_ARRAY_LENGTH = 4294967295;
  9586. /**
  9587. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  9588. *
  9589. * @private
  9590. * @constructor
  9591. * @param {*} value The value to wrap.
  9592. */
  9593. function LazyWrapper(value) {
  9594. this.__wrapped__ = value;
  9595. this.__actions__ = [];
  9596. this.__dir__ = 1;
  9597. this.__filtered__ = false;
  9598. this.__iteratees__ = [];
  9599. this.__takeCount__ = MAX_ARRAY_LENGTH;
  9600. this.__views__ = [];
  9601. }
  9602. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  9603. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  9604. LazyWrapper.prototype.constructor = LazyWrapper;
  9605. module.exports = LazyWrapper;
  9606. /***/ }),
  9607. /* 121 */
  9608. /***/ (function(module, exports) {
  9609. /**
  9610. * The function whose prototype chain sequence wrappers inherit from.
  9611. *
  9612. * @private
  9613. */
  9614. function baseLodash() {
  9615. // No operation performed.
  9616. }
  9617. module.exports = baseLodash;
  9618. /***/ }),
  9619. /* 122 */
  9620. /***/ (function(module, exports, __webpack_require__) {
  9621. var baseSetToString = __webpack_require__(409),
  9622. shortOut = __webpack_require__(203);
  9623. /**
  9624. * Sets the `toString` method of `func` to return `string`.
  9625. *
  9626. * @private
  9627. * @param {Function} func The function to modify.
  9628. * @param {Function} string The `toString` result.
  9629. * @returns {Function} Returns `func`.
  9630. */
  9631. var setToString = shortOut(baseSetToString);
  9632. module.exports = setToString;
  9633. /***/ }),
  9634. /* 123 */
  9635. /***/ (function(module, exports) {
  9636. /** Used as the internal argument placeholder. */
  9637. var PLACEHOLDER = '__lodash_placeholder__';
  9638. /**
  9639. * Replaces all `placeholder` elements in `array` with an internal placeholder
  9640. * and returns an array of their indexes.
  9641. *
  9642. * @private
  9643. * @param {Array} array The array to modify.
  9644. * @param {*} placeholder The placeholder to replace.
  9645. * @returns {Array} Returns the new array of placeholder indexes.
  9646. */
  9647. function replaceHolders(array, placeholder) {
  9648. var index = -1,
  9649. length = array.length,
  9650. resIndex = 0,
  9651. result = [];
  9652. while (++index < length) {
  9653. var value = array[index];
  9654. if (value === placeholder || value === PLACEHOLDER) {
  9655. array[index] = PLACEHOLDER;
  9656. result[resIndex++] = index;
  9657. }
  9658. }
  9659. return result;
  9660. }
  9661. module.exports = replaceHolders;
  9662. /***/ }),
  9663. /* 124 */
  9664. /***/ (function(module, exports, __webpack_require__) {
  9665. var baseGetTag = __webpack_require__(26),
  9666. getPrototype = __webpack_require__(114),
  9667. isObjectLike = __webpack_require__(14);
  9668. /** `Object#toString` result references. */
  9669. var objectTag = '[object Object]';
  9670. /** Used for built-in method references. */
  9671. var funcProto = Function.prototype,
  9672. objectProto = Object.prototype;
  9673. /** Used to resolve the decompiled source of functions. */
  9674. var funcToString = funcProto.toString;
  9675. /** Used to check objects for own properties. */
  9676. var hasOwnProperty = objectProto.hasOwnProperty;
  9677. /** Used to infer the `Object` constructor. */
  9678. var objectCtorString = funcToString.call(Object);
  9679. /**
  9680. * Checks if `value` is a plain object, that is, an object created by the
  9681. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  9682. *
  9683. * @static
  9684. * @memberOf _
  9685. * @since 0.8.0
  9686. * @category Lang
  9687. * @param {*} value The value to check.
  9688. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  9689. * @example
  9690. *
  9691. * function Foo() {
  9692. * this.a = 1;
  9693. * }
  9694. *
  9695. * _.isPlainObject(new Foo);
  9696. * // => false
  9697. *
  9698. * _.isPlainObject([1, 2, 3]);
  9699. * // => false
  9700. *
  9701. * _.isPlainObject({ 'x': 0, 'y': 0 });
  9702. * // => true
  9703. *
  9704. * _.isPlainObject(Object.create(null));
  9705. * // => true
  9706. */
  9707. function isPlainObject(value) {
  9708. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  9709. return false;
  9710. }
  9711. var proto = getPrototype(value);
  9712. if (proto === null) {
  9713. return true;
  9714. }
  9715. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  9716. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  9717. funcToString.call(Ctor) == objectCtorString;
  9718. }
  9719. module.exports = isPlainObject;
  9720. /***/ }),
  9721. /* 125 */
  9722. /***/ (function(module, exports, __webpack_require__) {
  9723. var isArray = __webpack_require__(9),
  9724. isSymbol = __webpack_require__(68);
  9725. /** Used to match property names within property paths. */
  9726. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  9727. reIsPlainProp = /^\w*$/;
  9728. /**
  9729. * Checks if `value` is a property name and not a property path.
  9730. *
  9731. * @private
  9732. * @param {*} value The value to check.
  9733. * @param {Object} [object] The object to query keys on.
  9734. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  9735. */
  9736. function isKey(value, object) {
  9737. if (isArray(value)) {
  9738. return false;
  9739. }
  9740. var type = typeof value;
  9741. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  9742. value == null || isSymbol(value)) {
  9743. return true;
  9744. }
  9745. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  9746. (object != null && value in Object(object));
  9747. }
  9748. module.exports = isKey;
  9749. /***/ }),
  9750. /* 126 */
  9751. /***/ (function(module, exports, __webpack_require__) {
  9752. var flatten = __webpack_require__(440),
  9753. overRest = __webpack_require__(218),
  9754. setToString = __webpack_require__(122);
  9755. /**
  9756. * A specialized version of `baseRest` which flattens the rest array.
  9757. *
  9758. * @private
  9759. * @param {Function} func The function to apply a rest parameter to.
  9760. * @returns {Function} Returns the new function.
  9761. */
  9762. function flatRest(func) {
  9763. return setToString(overRest(func, undefined, flatten), func + '');
  9764. }
  9765. module.exports = flatRest;
  9766. /***/ }),
  9767. /* 127 */
  9768. /***/ (function(module, exports, __webpack_require__) {
  9769. "use strict";
  9770. module.exports = {
  9771. error: {
  9772. priority: 1,
  9773. method: 'error'
  9774. },
  9775. warn: {
  9776. priority: 2,
  9777. method: 'warn'
  9778. },
  9779. info: {
  9780. priority: 3,
  9781. method: 'info'
  9782. },
  9783. log: {
  9784. priority: 4,
  9785. method: 'log'
  9786. },
  9787. debug: {
  9788. priority: 5,
  9789. method: 'debug'
  9790. },
  9791. spam: {
  9792. priority: 6,
  9793. method: 'log'
  9794. }
  9795. };
  9796. /***/ }),
  9797. /* 128 */
  9798. /***/ (function(module, exports, __webpack_require__) {
  9799. "use strict";
  9800. const urlUtil = __webpack_require__(220);
  9801. const stripTrailingSlash = urlObj => ("" + urlObj.host + urlObj.pathname).replace(/\/$/, '');
  9802. const prependProxyToUrlIfNeeded = (url, proxyUrl) => {
  9803. if (!proxyUrl) return url;
  9804. const proxyUrlParsed = urlUtil.parse(proxyUrl);
  9805. const urlParsed = urlUtil.parse(url);
  9806. if (!proxyUrlParsed.protocol || !urlParsed.protocol) return url;
  9807. const isSsl = proxyUrlParsed.protocol.match(/^https/);
  9808. const isWs = urlParsed.protocol.match(/^ws/i);
  9809. const protocol = (isWs ? 'ws' : 'http') + (isSsl ? 's' : '');
  9810. const targetUrl = protocol + "://" + stripTrailingSlash(proxyUrlParsed);
  9811. const targetPath = "" + urlParsed.host + urlParsed.pathname + (urlParsed.search || '');
  9812. return targetUrl + "/" + targetPath;
  9813. };
  9814. module.exports = {
  9815. prependProxyToUrlIfNeeded
  9816. };
  9817. /***/ }),
  9818. /* 129 */
  9819. /***/ (function(module, exports, __webpack_require__) {
  9820. var eq = __webpack_require__(48),
  9821. isArrayLike = __webpack_require__(21),
  9822. isIndex = __webpack_require__(63),
  9823. isObject = __webpack_require__(7);
  9824. /**
  9825. * Checks if the given arguments are from an iteratee call.
  9826. *
  9827. * @private
  9828. * @param {*} value The potential iteratee value argument.
  9829. * @param {*} index The potential iteratee index or key argument.
  9830. * @param {*} object The potential iteratee object argument.
  9831. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  9832. * else `false`.
  9833. */
  9834. function isIterateeCall(value, index, object) {
  9835. if (!isObject(object)) {
  9836. return false;
  9837. }
  9838. var type = typeof index;
  9839. if (type == 'number'
  9840. ? (isArrayLike(object) && isIndex(index, object.length))
  9841. : (type == 'string' && index in object)
  9842. ) {
  9843. return eq(object[index], value);
  9844. }
  9845. return false;
  9846. }
  9847. module.exports = isIterateeCall;
  9848. /***/ }),
  9849. /* 130 */
  9850. /***/ (function(module, exports, __webpack_require__) {
  9851. "use strict";
  9852. module.exports = __webpack_require__(226)() ? Object.setPrototypeOf : __webpack_require__(227);
  9853. /***/ }),
  9854. /* 131 */
  9855. /***/ (function(module, exports, __webpack_require__) {
  9856. "use strict";
  9857. var isValue = __webpack_require__(53);
  9858. // prettier-ignore
  9859. var possibleTypes = { "object": true, "function": true, "undefined": true /* document.all */ };
  9860. module.exports = function (value) {
  9861. if (!isValue(value)) return false;
  9862. return hasOwnProperty.call(possibleTypes, typeof value);
  9863. };
  9864. /***/ }),
  9865. /* 132 */
  9866. /***/ (function(module, exports, __webpack_require__) {
  9867. "use strict";
  9868. module.exports = __webpack_require__(472)() ? Object.assign : __webpack_require__(473);
  9869. /***/ }),
  9870. /* 133 */
  9871. /***/ (function(module, exports, __webpack_require__) {
  9872. var baseRest = __webpack_require__(94),
  9873. eq = __webpack_require__(48),
  9874. isIterateeCall = __webpack_require__(129),
  9875. keysIn = __webpack_require__(66);
  9876. /** Used for built-in method references. */
  9877. var objectProto = Object.prototype;
  9878. /** Used to check objects for own properties. */
  9879. var hasOwnProperty = objectProto.hasOwnProperty;
  9880. /**
  9881. * Assigns own and inherited enumerable string keyed properties of source
  9882. * objects to the destination object for all destination properties that
  9883. * resolve to `undefined`. Source objects are applied from left to right.
  9884. * Once a property is set, additional values of the same property are ignored.
  9885. *
  9886. * **Note:** This method mutates `object`.
  9887. *
  9888. * @static
  9889. * @since 0.1.0
  9890. * @memberOf _
  9891. * @category Object
  9892. * @param {Object} object The destination object.
  9893. * @param {...Object} [sources] The source objects.
  9894. * @returns {Object} Returns `object`.
  9895. * @see _.defaultsDeep
  9896. * @example
  9897. *
  9898. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  9899. * // => { 'a': 1, 'b': 2 }
  9900. */
  9901. var defaults = baseRest(function(object, sources) {
  9902. object = Object(object);
  9903. var index = -1;
  9904. var length = sources.length;
  9905. var guard = length > 2 ? sources[2] : undefined;
  9906. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  9907. length = 1;
  9908. }
  9909. while (++index < length) {
  9910. var source = sources[index];
  9911. var props = keysIn(source);
  9912. var propsIndex = -1;
  9913. var propsLength = props.length;
  9914. while (++propsIndex < propsLength) {
  9915. var key = props[propsIndex];
  9916. var value = object[key];
  9917. if (value === undefined ||
  9918. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  9919. object[key] = source[key];
  9920. }
  9921. }
  9922. }
  9923. return object;
  9924. });
  9925. module.exports = defaults;
  9926. /***/ }),
  9927. /* 134 */
  9928. /***/ (function(module, exports, __webpack_require__) {
  9929. var stringify = __webpack_require__(243);
  9930. var _window =
  9931. typeof window !== 'undefined'
  9932. ? window
  9933. : typeof (typeof window !== undefined ? window : global) !== 'undefined'
  9934. ? (typeof window !== undefined ? window : global)
  9935. : typeof self !== 'undefined'
  9936. ? self
  9937. : {};
  9938. function isObject(what) {
  9939. return typeof what === 'object' && what !== null;
  9940. }
  9941. // Yanked from https://git.io/vS8DV re-used under CC0
  9942. // with some tiny modifications
  9943. function isError(value) {
  9944. switch (Object.prototype.toString.call(value)) {
  9945. case '[object Error]':
  9946. return true;
  9947. case '[object Exception]':
  9948. return true;
  9949. case '[object DOMException]':
  9950. return true;
  9951. default:
  9952. return value instanceof Error;
  9953. }
  9954. }
  9955. function isErrorEvent(value) {
  9956. return Object.prototype.toString.call(value) === '[object ErrorEvent]';
  9957. }
  9958. function isDOMError(value) {
  9959. return Object.prototype.toString.call(value) === '[object DOMError]';
  9960. }
  9961. function isDOMException(value) {
  9962. return Object.prototype.toString.call(value) === '[object DOMException]';
  9963. }
  9964. function isUndefined(what) {
  9965. return what === void 0;
  9966. }
  9967. function isFunction(what) {
  9968. return typeof what === 'function';
  9969. }
  9970. function isPlainObject(what) {
  9971. return Object.prototype.toString.call(what) === '[object Object]';
  9972. }
  9973. function isString(what) {
  9974. return Object.prototype.toString.call(what) === '[object String]';
  9975. }
  9976. function isArray(what) {
  9977. return Object.prototype.toString.call(what) === '[object Array]';
  9978. }
  9979. function isEmptyObject(what) {
  9980. if (!isPlainObject(what)) return false;
  9981. for (var _ in what) {
  9982. if (what.hasOwnProperty(_)) {
  9983. return false;
  9984. }
  9985. }
  9986. return true;
  9987. }
  9988. function supportsErrorEvent() {
  9989. try {
  9990. new ErrorEvent(''); // eslint-disable-line no-new
  9991. return true;
  9992. } catch (e) {
  9993. return false;
  9994. }
  9995. }
  9996. function supportsDOMError() {
  9997. try {
  9998. new DOMError(''); // eslint-disable-line no-new
  9999. return true;
  10000. } catch (e) {
  10001. return false;
  10002. }
  10003. }
  10004. function supportsDOMException() {
  10005. try {
  10006. new DOMException(''); // eslint-disable-line no-new
  10007. return true;
  10008. } catch (e) {
  10009. return false;
  10010. }
  10011. }
  10012. function supportsFetch() {
  10013. if (!('fetch' in _window)) return false;
  10014. try {
  10015. new Headers(); // eslint-disable-line no-new
  10016. new Request(''); // eslint-disable-line no-new
  10017. new Response(); // eslint-disable-line no-new
  10018. return true;
  10019. } catch (e) {
  10020. return false;
  10021. }
  10022. }
  10023. // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default
  10024. // https://caniuse.com/#feat=referrer-policy
  10025. // It doesn't. And it throw exception instead of ignoring this parameter...
  10026. // REF: https://github.com/getsentry/raven-js/issues/1233
  10027. function supportsReferrerPolicy() {
  10028. if (!supportsFetch()) return false;
  10029. try {
  10030. // eslint-disable-next-line no-new
  10031. new Request('pickleRick', {
  10032. referrerPolicy: 'origin'
  10033. });
  10034. return true;
  10035. } catch (e) {
  10036. return false;
  10037. }
  10038. }
  10039. function supportsPromiseRejectionEvent() {
  10040. return typeof PromiseRejectionEvent === 'function';
  10041. }
  10042. function wrappedCallback(callback) {
  10043. function dataCallback(data, original) {
  10044. var normalizedData = callback(data) || data;
  10045. if (original) {
  10046. return original(normalizedData) || normalizedData;
  10047. }
  10048. return normalizedData;
  10049. }
  10050. return dataCallback;
  10051. }
  10052. function each(obj, callback) {
  10053. var i, j;
  10054. if (isUndefined(obj.length)) {
  10055. for (i in obj) {
  10056. if (hasKey(obj, i)) {
  10057. callback.call(null, i, obj[i]);
  10058. }
  10059. }
  10060. } else {
  10061. j = obj.length;
  10062. if (j) {
  10063. for (i = 0; i < j; i++) {
  10064. callback.call(null, i, obj[i]);
  10065. }
  10066. }
  10067. }
  10068. }
  10069. function objectMerge(obj1, obj2) {
  10070. if (!obj2) {
  10071. return obj1;
  10072. }
  10073. each(obj2, function(key, value) {
  10074. obj1[key] = value;
  10075. });
  10076. return obj1;
  10077. }
  10078. /**
  10079. * This function is only used for react-native.
  10080. * react-native freezes object that have already been sent over the
  10081. * js bridge. We need this function in order to check if the object is frozen.
  10082. * So it's ok that objectFrozen returns false if Object.isFrozen is not
  10083. * supported because it's not relevant for other "platforms". See related issue:
  10084. * https://github.com/getsentry/react-native-sentry/issues/57
  10085. */
  10086. function objectFrozen(obj) {
  10087. if (!Object.isFrozen) {
  10088. return false;
  10089. }
  10090. return Object.isFrozen(obj);
  10091. }
  10092. function truncate(str, max) {
  10093. if (typeof max !== 'number') {
  10094. throw new Error('2nd argument to `truncate` function should be a number');
  10095. }
  10096. if (typeof str !== 'string' || max === 0) {
  10097. return str;
  10098. }
  10099. return str.length <= max ? str : str.substr(0, max) + '\u2026';
  10100. }
  10101. /**
  10102. * hasKey, a better form of hasOwnProperty
  10103. * Example: hasKey(MainHostObject, property) === true/false
  10104. *
  10105. * @param {Object} host object to check property
  10106. * @param {string} key to check
  10107. */
  10108. function hasKey(object, key) {
  10109. return Object.prototype.hasOwnProperty.call(object, key);
  10110. }
  10111. function joinRegExp(patterns) {
  10112. // Combine an array of regular expressions and strings into one large regexp
  10113. // Be mad.
  10114. var sources = [],
  10115. i = 0,
  10116. len = patterns.length,
  10117. pattern;
  10118. for (; i < len; i++) {
  10119. pattern = patterns[i];
  10120. if (isString(pattern)) {
  10121. // If it's a string, we need to escape it
  10122. // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
  10123. sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'));
  10124. } else if (pattern && pattern.source) {
  10125. // If it's a regexp already, we want to extract the source
  10126. sources.push(pattern.source);
  10127. }
  10128. // Intentionally skip other cases
  10129. }
  10130. return new RegExp(sources.join('|'), 'i');
  10131. }
  10132. function urlencode(o) {
  10133. var pairs = [];
  10134. each(o, function(key, value) {
  10135. pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
  10136. });
  10137. return pairs.join('&');
  10138. }
  10139. // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
  10140. // intentionally using regex and not <a/> href parsing trick because React Native and other
  10141. // environments where DOM might not be available
  10142. function parseUrl(url) {
  10143. if (typeof url !== 'string') return {};
  10144. var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
  10145. // coerce to undefined values to empty string so we don't get 'undefined'
  10146. var query = match[6] || '';
  10147. var fragment = match[8] || '';
  10148. return {
  10149. protocol: match[2],
  10150. host: match[4],
  10151. path: match[5],
  10152. relative: match[5] + query + fragment // everything minus origin
  10153. };
  10154. }
  10155. function uuid4() {
  10156. var crypto = _window.crypto || _window.msCrypto;
  10157. if (!isUndefined(crypto) && crypto.getRandomValues) {
  10158. // Use window.crypto API if available
  10159. // eslint-disable-next-line no-undef
  10160. var arr = new Uint16Array(8);
  10161. crypto.getRandomValues(arr);
  10162. // set 4 in byte 7
  10163. arr[3] = (arr[3] & 0xfff) | 0x4000;
  10164. // set 2 most significant bits of byte 9 to '10'
  10165. arr[4] = (arr[4] & 0x3fff) | 0x8000;
  10166. var pad = function(num) {
  10167. var v = num.toString(16);
  10168. while (v.length < 4) {
  10169. v = '0' + v;
  10170. }
  10171. return v;
  10172. };
  10173. return (
  10174. pad(arr[0]) +
  10175. pad(arr[1]) +
  10176. pad(arr[2]) +
  10177. pad(arr[3]) +
  10178. pad(arr[4]) +
  10179. pad(arr[5]) +
  10180. pad(arr[6]) +
  10181. pad(arr[7])
  10182. );
  10183. } else {
  10184. // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
  10185. return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  10186. var r = (Math.random() * 16) | 0,
  10187. v = c === 'x' ? r : (r & 0x3) | 0x8;
  10188. return v.toString(16);
  10189. });
  10190. }
  10191. }
  10192. /**
  10193. * Given a child DOM element, returns a query-selector statement describing that
  10194. * and its ancestors
  10195. * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
  10196. * @param elem
  10197. * @returns {string}
  10198. */
  10199. function htmlTreeAsString(elem) {
  10200. /* eslint no-extra-parens:0*/
  10201. var MAX_TRAVERSE_HEIGHT = 5,
  10202. MAX_OUTPUT_LEN = 80,
  10203. out = [],
  10204. height = 0,
  10205. len = 0,
  10206. separator = ' > ',
  10207. sepLength = separator.length,
  10208. nextStr;
  10209. while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
  10210. nextStr = htmlElementAsString(elem);
  10211. // bail out if
  10212. // - nextStr is the 'html' element
  10213. // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
  10214. // (ignore this limit if we are on the first iteration)
  10215. if (
  10216. nextStr === 'html' ||
  10217. (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)
  10218. ) {
  10219. break;
  10220. }
  10221. out.push(nextStr);
  10222. len += nextStr.length;
  10223. elem = elem.parentNode;
  10224. }
  10225. return out.reverse().join(separator);
  10226. }
  10227. /**
  10228. * Returns a simple, query-selector representation of a DOM element
  10229. * e.g. [HTMLElement] => input#foo.btn[name=baz]
  10230. * @param HTMLElement
  10231. * @returns {string}
  10232. */
  10233. function htmlElementAsString(elem) {
  10234. var out = [],
  10235. className,
  10236. classes,
  10237. key,
  10238. attr,
  10239. i;
  10240. if (!elem || !elem.tagName) {
  10241. return '';
  10242. }
  10243. out.push(elem.tagName.toLowerCase());
  10244. if (elem.id) {
  10245. out.push('#' + elem.id);
  10246. }
  10247. className = elem.className;
  10248. if (className && isString(className)) {
  10249. classes = className.split(/\s+/);
  10250. for (i = 0; i < classes.length; i++) {
  10251. out.push('.' + classes[i]);
  10252. }
  10253. }
  10254. var attrWhitelist = ['type', 'name', 'title', 'alt'];
  10255. for (i = 0; i < attrWhitelist.length; i++) {
  10256. key = attrWhitelist[i];
  10257. attr = elem.getAttribute(key);
  10258. if (attr) {
  10259. out.push('[' + key + '="' + attr + '"]');
  10260. }
  10261. }
  10262. return out.join('');
  10263. }
  10264. /**
  10265. * Returns true if either a OR b is truthy, but not both
  10266. */
  10267. function isOnlyOneTruthy(a, b) {
  10268. return !!(!!a ^ !!b);
  10269. }
  10270. /**
  10271. * Returns true if both parameters are undefined
  10272. */
  10273. function isBothUndefined(a, b) {
  10274. return isUndefined(a) && isUndefined(b);
  10275. }
  10276. /**
  10277. * Returns true if the two input exception interfaces have the same content
  10278. */
  10279. function isSameException(ex1, ex2) {
  10280. if (isOnlyOneTruthy(ex1, ex2)) return false;
  10281. ex1 = ex1.values[0];
  10282. ex2 = ex2.values[0];
  10283. if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
  10284. // in case both stacktraces are undefined, we can't decide so default to false
  10285. if (isBothUndefined(ex1.stacktrace, ex2.stacktrace)) return false;
  10286. return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
  10287. }
  10288. /**
  10289. * Returns true if the two input stack trace interfaces have the same content
  10290. */
  10291. function isSameStacktrace(stack1, stack2) {
  10292. if (isOnlyOneTruthy(stack1, stack2)) return false;
  10293. var frames1 = stack1.frames;
  10294. var frames2 = stack2.frames;
  10295. // Exit early if stacktrace is malformed
  10296. if (frames1 === undefined || frames2 === undefined) return false;
  10297. // Exit early if frame count differs
  10298. if (frames1.length !== frames2.length) return false;
  10299. // Iterate through every frame; bail out if anything differs
  10300. var a, b;
  10301. for (var i = 0; i < frames1.length; i++) {
  10302. a = frames1[i];
  10303. b = frames2[i];
  10304. if (
  10305. a.filename !== b.filename ||
  10306. a.lineno !== b.lineno ||
  10307. a.colno !== b.colno ||
  10308. a['function'] !== b['function']
  10309. )
  10310. return false;
  10311. }
  10312. return true;
  10313. }
  10314. /**
  10315. * Polyfill a method
  10316. * @param obj object e.g. `document`
  10317. * @param name method name present on object e.g. `addEventListener`
  10318. * @param replacement replacement function
  10319. * @param track {optional} record instrumentation to an array
  10320. */
  10321. function fill(obj, name, replacement, track) {
  10322. if (obj == null) return;
  10323. var orig = obj[name];
  10324. obj[name] = replacement(orig);
  10325. obj[name].__raven__ = true;
  10326. obj[name].__orig__ = orig;
  10327. if (track) {
  10328. track.push([obj, name, orig]);
  10329. }
  10330. }
  10331. /**
  10332. * Join values in array
  10333. * @param input array of values to be joined together
  10334. * @param delimiter string to be placed in-between values
  10335. * @returns {string}
  10336. */
  10337. function safeJoin(input, delimiter) {
  10338. if (!isArray(input)) return '';
  10339. var output = [];
  10340. for (var i = 0; i < input.length; i++) {
  10341. try {
  10342. output.push(String(input[i]));
  10343. } catch (e) {
  10344. output.push('[value cannot be serialized]');
  10345. }
  10346. }
  10347. return output.join(delimiter);
  10348. }
  10349. // Default Node.js REPL depth
  10350. var MAX_SERIALIZE_EXCEPTION_DEPTH = 3;
  10351. // 50kB, as 100kB is max payload size, so half sounds reasonable
  10352. var MAX_SERIALIZE_EXCEPTION_SIZE = 50 * 1024;
  10353. var MAX_SERIALIZE_KEYS_LENGTH = 40;
  10354. function utf8Length(value) {
  10355. return ~-encodeURI(value).split(/%..|./).length;
  10356. }
  10357. function jsonSize(value) {
  10358. return utf8Length(JSON.stringify(value));
  10359. }
  10360. function serializeValue(value) {
  10361. if (typeof value === 'string') {
  10362. var maxLength = 40;
  10363. return truncate(value, maxLength);
  10364. } else if (
  10365. typeof value === 'number' ||
  10366. typeof value === 'boolean' ||
  10367. typeof value === 'undefined'
  10368. ) {
  10369. return value;
  10370. }
  10371. var type = Object.prototype.toString.call(value);
  10372. // Node.js REPL notation
  10373. if (type === '[object Object]') return '[Object]';
  10374. if (type === '[object Array]') return '[Array]';
  10375. if (type === '[object Function]')
  10376. return value.name ? '[Function: ' + value.name + ']' : '[Function]';
  10377. return value;
  10378. }
  10379. function serializeObject(value, depth) {
  10380. if (depth === 0) return serializeValue(value);
  10381. if (isPlainObject(value)) {
  10382. return Object.keys(value).reduce(function(acc, key) {
  10383. acc[key] = serializeObject(value[key], depth - 1);
  10384. return acc;
  10385. }, {});
  10386. } else if (Array.isArray(value)) {
  10387. return value.map(function(val) {
  10388. return serializeObject(val, depth - 1);
  10389. });
  10390. }
  10391. return serializeValue(value);
  10392. }
  10393. function serializeException(ex, depth, maxSize) {
  10394. if (!isPlainObject(ex)) return ex;
  10395. depth = typeof depth !== 'number' ? MAX_SERIALIZE_EXCEPTION_DEPTH : depth;
  10396. maxSize = typeof depth !== 'number' ? MAX_SERIALIZE_EXCEPTION_SIZE : maxSize;
  10397. var serialized = serializeObject(ex, depth);
  10398. if (jsonSize(stringify(serialized)) > maxSize) {
  10399. return serializeException(ex, depth - 1);
  10400. }
  10401. return serialized;
  10402. }
  10403. function serializeKeysForMessage(keys, maxLength) {
  10404. if (typeof keys === 'number' || typeof keys === 'string') return keys.toString();
  10405. if (!Array.isArray(keys)) return '';
  10406. keys = keys.filter(function(key) {
  10407. return typeof key === 'string';
  10408. });
  10409. if (keys.length === 0) return '[object has no keys]';
  10410. maxLength = typeof maxLength !== 'number' ? MAX_SERIALIZE_KEYS_LENGTH : maxLength;
  10411. if (keys[0].length >= maxLength) return keys[0];
  10412. for (var usedKeys = keys.length; usedKeys > 0; usedKeys--) {
  10413. var serialized = keys.slice(0, usedKeys).join(', ');
  10414. if (serialized.length > maxLength) continue;
  10415. if (usedKeys === keys.length) return serialized;
  10416. return serialized + '\u2026';
  10417. }
  10418. return '';
  10419. }
  10420. function sanitize(input, sanitizeKeys) {
  10421. if (!isArray(sanitizeKeys) || (isArray(sanitizeKeys) && sanitizeKeys.length === 0))
  10422. return input;
  10423. var sanitizeRegExp = joinRegExp(sanitizeKeys);
  10424. var sanitizeMask = '********';
  10425. var safeInput;
  10426. try {
  10427. safeInput = JSON.parse(stringify(input));
  10428. } catch (o_O) {
  10429. return input;
  10430. }
  10431. function sanitizeWorker(workerInput) {
  10432. if (isArray(workerInput)) {
  10433. return workerInput.map(function(val) {
  10434. return sanitizeWorker(val);
  10435. });
  10436. }
  10437. if (isPlainObject(workerInput)) {
  10438. return Object.keys(workerInput).reduce(function(acc, k) {
  10439. if (sanitizeRegExp.test(k)) {
  10440. acc[k] = sanitizeMask;
  10441. } else {
  10442. acc[k] = sanitizeWorker(workerInput[k]);
  10443. }
  10444. return acc;
  10445. }, {});
  10446. }
  10447. return workerInput;
  10448. }
  10449. return sanitizeWorker(safeInput);
  10450. }
  10451. module.exports = {
  10452. isObject: isObject,
  10453. isError: isError,
  10454. isErrorEvent: isErrorEvent,
  10455. isDOMError: isDOMError,
  10456. isDOMException: isDOMException,
  10457. isUndefined: isUndefined,
  10458. isFunction: isFunction,
  10459. isPlainObject: isPlainObject,
  10460. isString: isString,
  10461. isArray: isArray,
  10462. isEmptyObject: isEmptyObject,
  10463. supportsErrorEvent: supportsErrorEvent,
  10464. supportsDOMError: supportsDOMError,
  10465. supportsDOMException: supportsDOMException,
  10466. supportsFetch: supportsFetch,
  10467. supportsReferrerPolicy: supportsReferrerPolicy,
  10468. supportsPromiseRejectionEvent: supportsPromiseRejectionEvent,
  10469. wrappedCallback: wrappedCallback,
  10470. each: each,
  10471. objectMerge: objectMerge,
  10472. truncate: truncate,
  10473. objectFrozen: objectFrozen,
  10474. hasKey: hasKey,
  10475. joinRegExp: joinRegExp,
  10476. urlencode: urlencode,
  10477. uuid4: uuid4,
  10478. htmlTreeAsString: htmlTreeAsString,
  10479. htmlElementAsString: htmlElementAsString,
  10480. isSameException: isSameException,
  10481. isSameStacktrace: isSameStacktrace,
  10482. parseUrl: parseUrl,
  10483. fill: fill,
  10484. safeJoin: safeJoin,
  10485. serializeException: serializeException,
  10486. serializeKeysForMessage: serializeKeysForMessage,
  10487. sanitize: sanitize
  10488. };
  10489. /***/ }),
  10490. /* 135 */
  10491. /***/ (function(module, exports, __webpack_require__) {
  10492. "use strict";
  10493. /* eslint-disable no-underscore-dangle */
  10494. const logging = __webpack_require__(1)('Event');
  10495. const assign = __webpack_require__(6);
  10496. const intersection = __webpack_require__(244);
  10497. module.exports = /*#__PURE__*/function () {
  10498. function Event(type, cancelable, props) {
  10499. if (cancelable === void 0) {
  10500. cancelable = true;
  10501. }
  10502. if (props === void 0) {
  10503. props = {};
  10504. }
  10505. this.type = type;
  10506. this.cancelable = cancelable;
  10507. this._defaultPrevented = false;
  10508. const reservedKeys = intersection(Object.keys(this), Object.keys(props));
  10509. if (reservedKeys.length > 0) {
  10510. throw new Error("Cannot used reserved property names: " + reservedKeys.join(','));
  10511. }
  10512. assign(this, props);
  10513. }
  10514. var _proto = Event.prototype;
  10515. _proto.preventDefault = function preventDefault() {
  10516. if (this.cancelable) {
  10517. this._defaultPrevented = true;
  10518. } else {
  10519. logging.warn('Event.preventDefault :: Trying to preventDefault on an ' + 'event that isn\'t cancelable');
  10520. }
  10521. };
  10522. _proto.isDefaultPrevented = function isDefaultPrevented() {
  10523. return this._defaultPrevented;
  10524. };
  10525. return Event;
  10526. }();
  10527. /***/ }),
  10528. /* 136 */
  10529. /***/ (function(module, exports) {
  10530. /**
  10531. * This function is like `arrayIncludes` except that it accepts a comparator.
  10532. *
  10533. * @private
  10534. * @param {Array} [array] The array to inspect.
  10535. * @param {*} target The value to search for.
  10536. * @param {Function} comparator The comparator invoked per element.
  10537. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  10538. */
  10539. function arrayIncludesWith(array, value, comparator) {
  10540. var index = -1,
  10541. length = array == null ? 0 : array.length;
  10542. while (++index < length) {
  10543. if (comparator(value, array[index])) {
  10544. return true;
  10545. }
  10546. }
  10547. return false;
  10548. }
  10549. module.exports = arrayIncludesWith;
  10550. /***/ }),
  10551. /* 137 */
  10552. /***/ (function(module, exports, __webpack_require__) {
  10553. var isArrayLike = __webpack_require__(21),
  10554. isObjectLike = __webpack_require__(14);
  10555. /**
  10556. * This method is like `_.isArrayLike` except that it also checks if `value`
  10557. * is an object.
  10558. *
  10559. * @static
  10560. * @memberOf _
  10561. * @since 4.0.0
  10562. * @category Lang
  10563. * @param {*} value The value to check.
  10564. * @returns {boolean} Returns `true` if `value` is an array-like object,
  10565. * else `false`.
  10566. * @example
  10567. *
  10568. * _.isArrayLikeObject([1, 2, 3]);
  10569. * // => true
  10570. *
  10571. * _.isArrayLikeObject(document.body.children);
  10572. * // => true
  10573. *
  10574. * _.isArrayLikeObject('abc');
  10575. * // => false
  10576. *
  10577. * _.isArrayLikeObject(_.noop);
  10578. * // => false
  10579. */
  10580. function isArrayLikeObject(value) {
  10581. return isObjectLike(value) && isArrayLike(value);
  10582. }
  10583. module.exports = isArrayLikeObject;
  10584. /***/ }),
  10585. /* 138 */
  10586. /***/ (function(module, exports, __webpack_require__) {
  10587. "use strict";
  10588. const extendES5Native = __webpack_require__(532);
  10589. const webrtcAdapter = __webpack_require__(533);
  10590. const logging = __webpack_require__(1)('createWindowMock');
  10591. const env = __webpack_require__(3);
  10592. const windowKeys = [{
  10593. key: 'location',
  10594. type: 'object'
  10595. }, {
  10596. key: 'setTimeout',
  10597. type: 'function'
  10598. }, {
  10599. key: 'requestAnimationFrame',
  10600. type: 'function'
  10601. }, {
  10602. key: 'URL',
  10603. type: 'function'
  10604. }, {
  10605. key: 'MediaStream',
  10606. type: 'class'
  10607. }, {
  10608. key: 'webkitMediaStream',
  10609. type: 'class'
  10610. }, {
  10611. key: 'RTCIceCandidate',
  10612. type: 'class'
  10613. }, {
  10614. key: 'mozRTCIceCandidate',
  10615. type: 'class'
  10616. }, {
  10617. key: 'RTCSessionDescription',
  10618. type: 'class'
  10619. }, {
  10620. key: 'mozRTCSessionDescription',
  10621. type: 'class'
  10622. }, {
  10623. key: 'RTCIceGatherer',
  10624. type: 'class'
  10625. }, {
  10626. key: 'RTCIceTransport',
  10627. type: 'class'
  10628. }, {
  10629. key: 'RTCDtlsTransport',
  10630. type: 'class'
  10631. }, {
  10632. key: 'RTCSctpTransport',
  10633. type: 'class'
  10634. }, {
  10635. key: 'RTCRtpReceiver',
  10636. type: 'class'
  10637. }, {
  10638. key: 'HTMLMediaElement',
  10639. type: 'class'
  10640. }, {
  10641. key: 'RTCPeerConnection',
  10642. type: 'class'
  10643. }, {
  10644. key: 'webkitRTCPeerConnection',
  10645. type: 'class'
  10646. }, {
  10647. key: 'mozRTCPeerConnection',
  10648. type: 'class'
  10649. }, {
  10650. key: 'MediaStreamTrack',
  10651. type: 'class'
  10652. }, {
  10653. key: 'RTCRtpSender',
  10654. type: 'class'
  10655. }, {
  10656. key: 'RTCTrackEvent',
  10657. type: 'class'
  10658. }, {
  10659. key: 'RTCTransceiver',
  10660. type: 'class'
  10661. }, {
  10662. key: 'RTCDtmfSender',
  10663. type: 'class'
  10664. }, {
  10665. key: 'RTCDTMFSender',
  10666. type: 'class'
  10667. }, {
  10668. key: 'MediaStreamTrackEvent',
  10669. type: 'class'
  10670. }];
  10671. const navigatorKeys = [{
  10672. key: 'userAgent',
  10673. type: 'string'
  10674. }, {
  10675. key: 'getUserMedia',
  10676. type: 'function'
  10677. }, {
  10678. key: 'getDisplayMedia',
  10679. type: 'function'
  10680. }, {
  10681. key: 'webkitGetUserMedia',
  10682. type: 'function'
  10683. }, {
  10684. key: 'mozGetUserMedia',
  10685. type: 'function'
  10686. }];
  10687. const mediaDevicesKeys = [{
  10688. key: 'getUserMedia',
  10689. type: 'function'
  10690. }, {
  10691. key: 'getDisplayMedia',
  10692. type: 'function'
  10693. }, {
  10694. key: 'enumerateDevices',
  10695. type: 'function'
  10696. }, {
  10697. key: 'getSupportedConstraints',
  10698. type: 'function'
  10699. }, {
  10700. key: 'addEventListener',
  10701. type: 'function'
  10702. }, {
  10703. key: 'removeEventListener',
  10704. type: 'function'
  10705. }];
  10706. const bindWithStaticProperties = (context, func) => {
  10707. if (typeof func !== 'function') {
  10708. logging.warn('Non-function passed into bindWithStaticProperties()');
  10709. return func;
  10710. }
  10711. const bound = func.bind(context);
  10712. Object.keys(func).forEach(key => {
  10713. bound[key] = func[key];
  10714. });
  10715. return bound;
  10716. };
  10717. const extendParentClass = ParentClass => {
  10718. try {
  10719. // The below __proto__ hack is so we can extend RTCPeerConnection in Firefox and Safari
  10720. // See: https://bugs.webkit.org/show_bug.cgi?id=172867#c6
  10721. // eslint-disable-next-line no-eval
  10722. const ChildClass = eval("\n \"use strict\"; // Chrome<49 requires strict mode\n\n const getOwnProperties = (target) => {\n const properties = {};\n Object.getOwnPropertyNames(target).forEach((key) => {\n properties[key] = Object.getOwnPropertyDescriptor(target, key);\n });\n return properties;\n };\n\n class ChildClass extends ParentClass {\n constructor(...args) {\n super(...args);\n try {\n this.__proto__ = ChildClass.prototype;\n } catch (e) {}\n }\n };\n\n Object.defineProperties(ChildClass.prototype, getOwnProperties(ParentClass.prototype));\n Object.keys(ParentClass)\n .forEach((staticKey) => {\n ChildClass[staticKey] = ParentClass[staticKey];\n });\n\n ChildClass; // Ensure the final statement is returned in FF\n ");
  10723. if (ChildClass && ChildClass.prototype instanceof ParentClass) {
  10724. return ChildClass;
  10725. }
  10726. } catch (e) {// Failed to use ES6 class or eval under CSP
  10727. }
  10728. return null;
  10729. };
  10730. const canUseES6Class = window => {
  10731. const RTCPeerConnection = window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection;
  10732. const PC = extendParentClass(RTCPeerConnection);
  10733. if (PC) {
  10734. try {
  10735. PC.prototype.foo = 'bar';
  10736. const instance = new PC({
  10737. iceServers: []
  10738. });
  10739. const result = instance.foo === 'bar';
  10740. try {
  10741. instance.close();
  10742. } catch (e) {} // eslint-disable-line no-empty
  10743. return result;
  10744. } catch (e) {// Failed to instantiate the subclass
  10745. }
  10746. }
  10747. return false;
  10748. };
  10749. const extendClass = (ParentClass, label, canUseClass) => {
  10750. if (typeof ParentClass !== 'function') {
  10751. logging.warn('Non-function passed into extendClass()');
  10752. return ParentClass;
  10753. }
  10754. let result = canUseClass && extendParentClass(ParentClass);
  10755. if (!result) {
  10756. result = extendES5Native(ParentClass);
  10757. }
  10758. return result;
  10759. };
  10760. const getCopyProperties = canUseClass => (target, source, keys) => {
  10761. keys.forEach((_ref) => {
  10762. let key = _ref.key,
  10763. type = _ref.type;
  10764. let value = source[key];
  10765. if (value !== undefined) {
  10766. switch (type) {
  10767. case 'function':
  10768. value = bindWithStaticProperties(source, value);
  10769. break;
  10770. case 'class':
  10771. value = extendClass(value, key, canUseClass);
  10772. break;
  10773. case 'string':
  10774. case 'object':
  10775. break;
  10776. default:
  10777. throw new Error("Invalid type of window key: " + type);
  10778. }
  10779. target[key] = value; // eslint-disable-line no-param-reassign
  10780. }
  10781. });
  10782. };
  10783. const cloneWindow = window => {
  10784. const windowMock = {};
  10785. const copyProperties = getCopyProperties(canUseES6Class(window));
  10786. copyProperties(windowMock, window, windowKeys);
  10787. if (window.navigator !== undefined) {
  10788. windowMock.navigator = {};
  10789. copyProperties(windowMock.navigator, window.navigator, navigatorKeys);
  10790. if (window.navigator.mediaDevices !== undefined) {
  10791. windowMock.navigator.mediaDevices = {};
  10792. copyProperties(windowMock.navigator.mediaDevices, window.navigator.mediaDevices, mediaDevicesKeys);
  10793. }
  10794. }
  10795. return windowMock;
  10796. };
  10797. module.exports = function createWindowMock(window) {
  10798. // We avoid shimming twice because adapter is not idempotent.
  10799. // Unfortunately checking for window.adapter can be used to detect
  10800. // adapter.js but not adapter_no_global.js, there is no reliable
  10801. // way of detecting it.
  10802. if (window.adapter !== undefined || env.isLegacyEdge) {
  10803. return window;
  10804. }
  10805. const windowMock = cloneWindow(window);
  10806. webrtcAdapter({
  10807. window: windowMock
  10808. });
  10809. return windowMock;
  10810. };
  10811. /***/ }),
  10812. /* 139 */
  10813. /***/ (function(module, exports, __webpack_require__) {
  10814. "use strict";
  10815. /*
  10816. * Transforms a raw audio level to produce a "smoother" animation when using displaying the
  10817. * audio level. This transformer is state-full because it needs to keep the previous average
  10818. * value of the signal for filtering.
  10819. *
  10820. * It applies a low pass filter to get rid of level jumps and apply a log scale.
  10821. *
  10822. * @constructor
  10823. */
  10824. module.exports = function AudioLevelTransformer() {
  10825. let averageAudioLevel = null;
  10826. /*
  10827. *
  10828. * @param {number} audioLevel a level in the [0,1] range
  10829. * @returns {number} a level in the [0,1] range transformed
  10830. */
  10831. this.transform = audioLevel => {
  10832. if (averageAudioLevel === null || audioLevel >= averageAudioLevel) {
  10833. averageAudioLevel = audioLevel;
  10834. } else {
  10835. // a simple low pass filter with a smoothing of 70
  10836. averageAudioLevel = audioLevel * 0.3 + averageAudioLevel * 0.7;
  10837. } // 1.5 scaling to map -30-0 dBm range to [0,1]
  10838. const logScaled = Math.log(averageAudioLevel) / Math.LN10 / 1.5 + 1;
  10839. return Math.min(Math.max(logScaled, 0), 1);
  10840. };
  10841. };
  10842. /***/ }),
  10843. /* 140 */
  10844. /***/ (function(module, exports, __webpack_require__) {
  10845. "use strict";
  10846. /* eslint-disable no-underscore-dangle */
  10847. const eventing = __webpack_require__(5);
  10848. const values = obj => Object.keys(obj).map(key => obj[key]);
  10849. const assign = __webpack_require__(6); // Manages N Chrome elements
  10850. module.exports = function Chrome(properties) {
  10851. const _widgets = {}; // Private helper function
  10852. const _set = (name, widget) => {
  10853. assign(widget, {
  10854. parent: this
  10855. });
  10856. widget.appendTo(properties.parent);
  10857. _widgets[name] = widget;
  10858. this[name] = widget;
  10859. };
  10860. if (!properties.parent) {
  10861. // @todo raise an exception
  10862. return;
  10863. }
  10864. eventing(this);
  10865. this.destroy = () => {
  10866. this.off();
  10867. this.hideWhileLoading();
  10868. values(_widgets).forEach(widget => widget.destroy());
  10869. };
  10870. this.showAfterLoading = () => {
  10871. values(_widgets).forEach(widget => widget.showAfterLoading());
  10872. };
  10873. this.hideWhileLoading = () => {
  10874. values(_widgets).forEach(widget => widget.hideWhileLoading());
  10875. }; // Adds the widget to the chrome and to the DOM. Also creates a accessor
  10876. // property for it on the chrome.
  10877. //
  10878. // @example
  10879. // chrome.set('foo', new FooWidget());
  10880. // chrome.foo.setDisplayMode('on');
  10881. //
  10882. // @example
  10883. // chrome.set({
  10884. // foo: new FooWidget(),
  10885. // bar: new BarWidget()
  10886. // });
  10887. // chrome.foo.setDisplayMode('on');
  10888. //
  10889. this.set = (widgetName, widget) => {
  10890. if (typeof widgetName === 'string' && widget) {
  10891. _set(widgetName, widget);
  10892. } else {
  10893. Object.keys(widgetName).forEach(name => {
  10894. _set(name, widgetName[name]);
  10895. });
  10896. }
  10897. return this;
  10898. };
  10899. };
  10900. /***/ }),
  10901. /* 141 */
  10902. /***/ (function(module, exports, __webpack_require__) {
  10903. "use strict";
  10904. var _interopRequireDefault = __webpack_require__(2);
  10905. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  10906. var _temp;
  10907. /* eslint-disable no-underscore-dangle */
  10908. /*
  10909. * An <code>AudioContext</code> based audio level sampler. It returns the maximum value in the
  10910. * last 1024 samples.
  10911. *
  10912. * It is worth noting that the remote <code>MediaStream</code> audio analysis is currently only
  10913. * available in FF.
  10914. *
  10915. * This implementation gracefully handles the case where the <code>MediaStream</code> has not
  10916. * been set yet by returning a <code>null</code> value until the stream is set. It is up to the
  10917. * call site to decide what to do with this value (most likely ignore it and retry later).
  10918. *
  10919. * @constructor
  10920. * @param {AudioContext} audioContext an audio context instance to get an analyser node
  10921. */
  10922. module.exports = (_temp = /*#__PURE__*/function () {
  10923. function WebAudioAudioLevelSampler(audioContext) {
  10924. (0, _defineProperty2.default)(this, "_analyser", null);
  10925. (0, _defineProperty2.default)(this, "_timeDomainData", null);
  10926. (0, _defineProperty2.default)(this, "_sourceNode", null);
  10927. this._audioContext = audioContext;
  10928. }
  10929. var _proto = WebAudioAudioLevelSampler.prototype;
  10930. _proto._initAudioAnalyser = function _initAudioAnalyser(mediaStream) {
  10931. this._analyser = this._audioContext.createAnalyser();
  10932. this._sourceNode = this._audioContext.createMediaStreamSource(mediaStream);
  10933. this._sourceNode.connect(this._analyser);
  10934. this._timeDomainData = new Uint8Array(this._analyser.frequencyBinCount);
  10935. };
  10936. _proto.webRTCStream = function webRTCStream(mediaStream) {
  10937. if (this._sourceNode) {
  10938. this._sourceNode.disconnect(this._analyser);
  10939. }
  10940. if (this._audioContext.state === 'suspended') {
  10941. this._audioContext.resume();
  10942. }
  10943. this._initAudioAnalyser(mediaStream);
  10944. };
  10945. _proto.destroy = function destroy() {
  10946. if (this._sourceNode) {
  10947. this._sourceNode.disconnect(this._analyser);
  10948. }
  10949. this._timeDomainData = null;
  10950. };
  10951. _proto.sample = function sample(done) {
  10952. if (typeof done === 'function') {
  10953. throw new Error('sample no longer takes a callback');
  10954. }
  10955. if (this._analyser && this._timeDomainData) {
  10956. this._analyser.getByteTimeDomainData(this._timeDomainData); // varies from 0 to 255
  10957. let max = 0;
  10958. for (let idx = this._timeDomainData.length - 1; idx >= 0; idx -= 1) {
  10959. max = Math.max(max, Math.abs(this._timeDomainData[idx] - 128));
  10960. } // normalize the collected level to match the range delivered by
  10961. // the getStats' audioOutputLevel
  10962. return max / 128;
  10963. }
  10964. return null;
  10965. };
  10966. return WebAudioAudioLevelSampler;
  10967. }(), _temp);
  10968. /***/ }),
  10969. /* 142 */
  10970. /***/ (function(module, exports, __webpack_require__) {
  10971. "use strict";
  10972. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  10973. /* eslint-disable no-underscore-dangle, no-use-before-define */
  10974. const domState = __webpack_require__(544);
  10975. const eventNames = __webpack_require__(24);
  10976. const eventing = __webpack_require__(5);
  10977. const Events = __webpack_require__(20)(); // Helper to synchronise several startup tasks and then dispatch a unified
  10978. // 'envLoaded' event.
  10979. function EnvironmentLoader() {
  10980. const environmentLoader = this;
  10981. eventing(environmentLoader);
  10982. function isReady() {
  10983. return domState.isDomLoaded() && !domState.isDomUnloaded();
  10984. }
  10985. function onLoaded() {
  10986. if (isReady()) {
  10987. environmentLoader.dispatchEvent(new Events.EnvLoadedEvent(eventNames.ENV_LOADED));
  10988. }
  10989. }
  10990. function onDomReady() {
  10991. domState.whenUnloaded.then(onDomUnload);
  10992. onLoaded();
  10993. }
  10994. function onDomUnload() {
  10995. environmentLoader.dispatchEvent(new Events.EnvLoadedEvent(eventNames.ENV_UNLOADED));
  10996. }
  10997. domState.whenLoaded.then(onDomReady);
  10998. this.onLoad = function (cb, context) {
  10999. if (isReady()) {
  11000. cb.call(context);
  11001. return;
  11002. }
  11003. environmentLoader.on(eventNames.ENV_LOADED, cb, context);
  11004. };
  11005. this.onUnload = function (cb, context) {
  11006. if (this.isUnloaded()) {
  11007. cb.call(context);
  11008. return;
  11009. }
  11010. environmentLoader.on(eventNames.ENV_UNLOADED, cb, context);
  11011. };
  11012. this.isUnloaded = function () {
  11013. return domState.isDomUnloaded();
  11014. };
  11015. }
  11016. module.exports = new EnvironmentLoader();
  11017. /***/ }),
  11018. /* 143 */
  11019. /***/ (function(module, exports, __webpack_require__) {
  11020. var baseMerge = __webpack_require__(545),
  11021. createAssigner = __webpack_require__(224);
  11022. /**
  11023. * This method is like `_.assign` except that it recursively merges own and
  11024. * inherited enumerable string keyed properties of source objects into the
  11025. * destination object. Source properties that resolve to `undefined` are
  11026. * skipped if a destination value exists. Array and plain object properties
  11027. * are merged recursively. Other objects and value types are overridden by
  11028. * assignment. Source objects are applied from left to right. Subsequent
  11029. * sources overwrite property assignments of previous sources.
  11030. *
  11031. * **Note:** This method mutates `object`.
  11032. *
  11033. * @static
  11034. * @memberOf _
  11035. * @since 0.5.0
  11036. * @category Object
  11037. * @param {Object} object The destination object.
  11038. * @param {...Object} [sources] The source objects.
  11039. * @returns {Object} Returns `object`.
  11040. * @example
  11041. *
  11042. * var object = {
  11043. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  11044. * };
  11045. *
  11046. * var other = {
  11047. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  11048. * };
  11049. *
  11050. * _.merge(object, other);
  11051. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  11052. */
  11053. var merge = createAssigner(function(object, source, srcIndex) {
  11054. baseMerge(object, source, srcIndex);
  11055. });
  11056. module.exports = merge;
  11057. /***/ }),
  11058. /* 144 */
  11059. /***/ (function(module, exports, __webpack_require__) {
  11060. "use strict";
  11061. var objectAssign = __webpack_require__(549);
  11062. // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
  11063. // original notice:
  11064. /*!
  11065. * The buffer module from node.js, for the browser.
  11066. *
  11067. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  11068. * @license MIT
  11069. */
  11070. function compare(a, b) {
  11071. if (a === b) {
  11072. return 0;
  11073. }
  11074. var x = a.length;
  11075. var y = b.length;
  11076. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  11077. if (a[i] !== b[i]) {
  11078. x = a[i];
  11079. y = b[i];
  11080. break;
  11081. }
  11082. }
  11083. if (x < y) {
  11084. return -1;
  11085. }
  11086. if (y < x) {
  11087. return 1;
  11088. }
  11089. return 0;
  11090. }
  11091. function isBuffer(b) {
  11092. if ((typeof window !== undefined ? window : global).Buffer && typeof (typeof window !== undefined ? window : global).Buffer.isBuffer === 'function') {
  11093. return (typeof window !== undefined ? window : global).Buffer.isBuffer(b);
  11094. }
  11095. return !!(b != null && b._isBuffer);
  11096. }
  11097. // based on node assert, original notice:
  11098. // NB: The URL to the CommonJS spec is kept just for tradition.
  11099. // node-assert has evolved a lot since then, both in API and behavior.
  11100. // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
  11101. //
  11102. // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
  11103. //
  11104. // Originally from narwhal.js (http://narwhaljs.org)
  11105. // Copyright (c) 2009 Thomas Robinson <280north.com>
  11106. //
  11107. // Permission is hereby granted, free of charge, to any person obtaining a copy
  11108. // of this software and associated documentation files (the 'Software'), to
  11109. // deal in the Software without restriction, including without limitation the
  11110. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  11111. // sell copies of the Software, and to permit persons to whom the Software is
  11112. // furnished to do so, subject to the following conditions:
  11113. //
  11114. // The above copyright notice and this permission notice shall be included in
  11115. // all copies or substantial portions of the Software.
  11116. //
  11117. // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11118. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11119. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11120. // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  11121. // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  11122. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  11123. var util = __webpack_require__(550);
  11124. var hasOwn = Object.prototype.hasOwnProperty;
  11125. var pSlice = Array.prototype.slice;
  11126. var functionsHaveNames = (function () {
  11127. return function foo() {}.name === 'foo';
  11128. }());
  11129. function pToString (obj) {
  11130. return Object.prototype.toString.call(obj);
  11131. }
  11132. function isView(arrbuf) {
  11133. if (isBuffer(arrbuf)) {
  11134. return false;
  11135. }
  11136. if (typeof (typeof window !== undefined ? window : global).ArrayBuffer !== 'function') {
  11137. return false;
  11138. }
  11139. if (typeof ArrayBuffer.isView === 'function') {
  11140. return ArrayBuffer.isView(arrbuf);
  11141. }
  11142. if (!arrbuf) {
  11143. return false;
  11144. }
  11145. if (arrbuf instanceof DataView) {
  11146. return true;
  11147. }
  11148. if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
  11149. return true;
  11150. }
  11151. return false;
  11152. }
  11153. // 1. The assert module provides functions that throw
  11154. // AssertionError's when particular conditions are not met. The
  11155. // assert module must conform to the following interface.
  11156. var assert = module.exports = ok;
  11157. // 2. The AssertionError is defined in assert.
  11158. // new assert.AssertionError({ message: message,
  11159. // actual: actual,
  11160. // expected: expected })
  11161. var regex = /\s*function\s+([^\(\s]*)\s*/;
  11162. // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
  11163. function getName(func) {
  11164. if (!util.isFunction(func)) {
  11165. return;
  11166. }
  11167. if (functionsHaveNames) {
  11168. return func.name;
  11169. }
  11170. var str = func.toString();
  11171. var match = str.match(regex);
  11172. return match && match[1];
  11173. }
  11174. assert.AssertionError = function AssertionError(options) {
  11175. this.name = 'AssertionError';
  11176. this.actual = options.actual;
  11177. this.expected = options.expected;
  11178. this.operator = options.operator;
  11179. if (options.message) {
  11180. this.message = options.message;
  11181. this.generatedMessage = false;
  11182. } else {
  11183. this.message = getMessage(this);
  11184. this.generatedMessage = true;
  11185. }
  11186. var stackStartFunction = options.stackStartFunction || fail;
  11187. if (Error.captureStackTrace) {
  11188. Error.captureStackTrace(this, stackStartFunction);
  11189. } else {
  11190. // non v8 browsers so we can have a stacktrace
  11191. var err = new Error();
  11192. if (err.stack) {
  11193. var out = err.stack;
  11194. // try to strip useless frames
  11195. var fn_name = getName(stackStartFunction);
  11196. var idx = out.indexOf('\n' + fn_name);
  11197. if (idx >= 0) {
  11198. // once we have located the function frame
  11199. // we need to strip out everything before it (and its line)
  11200. var next_line = out.indexOf('\n', idx + 1);
  11201. out = out.substring(next_line + 1);
  11202. }
  11203. this.stack = out;
  11204. }
  11205. }
  11206. };
  11207. // assert.AssertionError instanceof Error
  11208. util.inherits(assert.AssertionError, Error);
  11209. function truncate(s, n) {
  11210. if (typeof s === 'string') {
  11211. return s.length < n ? s : s.slice(0, n);
  11212. } else {
  11213. return s;
  11214. }
  11215. }
  11216. function inspect(something) {
  11217. if (functionsHaveNames || !util.isFunction(something)) {
  11218. return util.inspect(something);
  11219. }
  11220. var rawname = getName(something);
  11221. var name = rawname ? ': ' + rawname : '';
  11222. return '[Function' + name + ']';
  11223. }
  11224. function getMessage(self) {
  11225. return truncate(inspect(self.actual), 128) + ' ' +
  11226. self.operator + ' ' +
  11227. truncate(inspect(self.expected), 128);
  11228. }
  11229. // At present only the three keys mentioned above are used and
  11230. // understood by the spec. Implementations or sub modules can pass
  11231. // other keys to the AssertionError's constructor - they will be
  11232. // ignored.
  11233. // 3. All of the following functions must throw an AssertionError
  11234. // when a corresponding condition is not met, with a message that
  11235. // may be undefined if not provided. All assertion methods provide
  11236. // both the actual and expected values to the assertion error for
  11237. // display purposes.
  11238. function fail(actual, expected, message, operator, stackStartFunction) {
  11239. throw new assert.AssertionError({
  11240. message: message,
  11241. actual: actual,
  11242. expected: expected,
  11243. operator: operator,
  11244. stackStartFunction: stackStartFunction
  11245. });
  11246. }
  11247. // EXTENSION! allows for well behaved errors defined elsewhere.
  11248. assert.fail = fail;
  11249. // 4. Pure assertion tests whether a value is truthy, as determined
  11250. // by !!guard.
  11251. // assert.ok(guard, message_opt);
  11252. // This statement is equivalent to assert.equal(true, !!guard,
  11253. // message_opt);. To test strictly for the value true, use
  11254. // assert.strictEqual(true, guard, message_opt);.
  11255. function ok(value, message) {
  11256. if (!value) fail(value, true, message, '==', assert.ok);
  11257. }
  11258. assert.ok = ok;
  11259. // 5. The equality assertion tests shallow, coercive equality with
  11260. // ==.
  11261. // assert.equal(actual, expected, message_opt);
  11262. assert.equal = function equal(actual, expected, message) {
  11263. if (actual != expected) fail(actual, expected, message, '==', assert.equal);
  11264. };
  11265. // 6. The non-equality assertion tests for whether two objects are not equal
  11266. // with != assert.notEqual(actual, expected, message_opt);
  11267. assert.notEqual = function notEqual(actual, expected, message) {
  11268. if (actual == expected) {
  11269. fail(actual, expected, message, '!=', assert.notEqual);
  11270. }
  11271. };
  11272. // 7. The equivalence assertion tests a deep equality relation.
  11273. // assert.deepEqual(actual, expected, message_opt);
  11274. assert.deepEqual = function deepEqual(actual, expected, message) {
  11275. if (!_deepEqual(actual, expected, false)) {
  11276. fail(actual, expected, message, 'deepEqual', assert.deepEqual);
  11277. }
  11278. };
  11279. assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
  11280. if (!_deepEqual(actual, expected, true)) {
  11281. fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
  11282. }
  11283. };
  11284. function _deepEqual(actual, expected, strict, memos) {
  11285. // 7.1. All identical values are equivalent, as determined by ===.
  11286. if (actual === expected) {
  11287. return true;
  11288. } else if (isBuffer(actual) && isBuffer(expected)) {
  11289. return compare(actual, expected) === 0;
  11290. // 7.2. If the expected value is a Date object, the actual value is
  11291. // equivalent if it is also a Date object that refers to the same time.
  11292. } else if (util.isDate(actual) && util.isDate(expected)) {
  11293. return actual.getTime() === expected.getTime();
  11294. // 7.3 If the expected value is a RegExp object, the actual value is
  11295. // equivalent if it is also a RegExp object with the same source and
  11296. // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
  11297. } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
  11298. return actual.source === expected.source &&
  11299. actual.global === expected.global &&
  11300. actual.multiline === expected.multiline &&
  11301. actual.lastIndex === expected.lastIndex &&
  11302. actual.ignoreCase === expected.ignoreCase;
  11303. // 7.4. Other pairs that do not both pass typeof value == 'object',
  11304. // equivalence is determined by ==.
  11305. } else if ((actual === null || typeof actual !== 'object') &&
  11306. (expected === null || typeof expected !== 'object')) {
  11307. return strict ? actual === expected : actual == expected;
  11308. // If both values are instances of typed arrays, wrap their underlying
  11309. // ArrayBuffers in a Buffer each to increase performance
  11310. // This optimization requires the arrays to have the same type as checked by
  11311. // Object.prototype.toString (aka pToString). Never perform binary
  11312. // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
  11313. // bit patterns are not identical.
  11314. } else if (isView(actual) && isView(expected) &&
  11315. pToString(actual) === pToString(expected) &&
  11316. !(actual instanceof Float32Array ||
  11317. actual instanceof Float64Array)) {
  11318. return compare(new Uint8Array(actual.buffer),
  11319. new Uint8Array(expected.buffer)) === 0;
  11320. // 7.5 For all other Object pairs, including Array objects, equivalence is
  11321. // determined by having the same number of owned properties (as verified
  11322. // with Object.prototype.hasOwnProperty.call), the same set of keys
  11323. // (although not necessarily the same order), equivalent values for every
  11324. // corresponding key, and an identical 'prototype' property. Note: this
  11325. // accounts for both named and indexed properties on Arrays.
  11326. } else if (isBuffer(actual) !== isBuffer(expected)) {
  11327. return false;
  11328. } else {
  11329. memos = memos || {actual: [], expected: []};
  11330. var actualIndex = memos.actual.indexOf(actual);
  11331. if (actualIndex !== -1) {
  11332. if (actualIndex === memos.expected.indexOf(expected)) {
  11333. return true;
  11334. }
  11335. }
  11336. memos.actual.push(actual);
  11337. memos.expected.push(expected);
  11338. return objEquiv(actual, expected, strict, memos);
  11339. }
  11340. }
  11341. function isArguments(object) {
  11342. return Object.prototype.toString.call(object) == '[object Arguments]';
  11343. }
  11344. function objEquiv(a, b, strict, actualVisitedObjects) {
  11345. if (a === null || a === undefined || b === null || b === undefined)
  11346. return false;
  11347. // if one is a primitive, the other must be same
  11348. if (util.isPrimitive(a) || util.isPrimitive(b))
  11349. return a === b;
  11350. if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
  11351. return false;
  11352. var aIsArgs = isArguments(a);
  11353. var bIsArgs = isArguments(b);
  11354. if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
  11355. return false;
  11356. if (aIsArgs) {
  11357. a = pSlice.call(a);
  11358. b = pSlice.call(b);
  11359. return _deepEqual(a, b, strict);
  11360. }
  11361. var ka = objectKeys(a);
  11362. var kb = objectKeys(b);
  11363. var key, i;
  11364. // having the same number of owned properties (keys incorporates
  11365. // hasOwnProperty)
  11366. if (ka.length !== kb.length)
  11367. return false;
  11368. //the same set of keys (although not necessarily the same order),
  11369. ka.sort();
  11370. kb.sort();
  11371. //~~~cheap key test
  11372. for (i = ka.length - 1; i >= 0; i--) {
  11373. if (ka[i] !== kb[i])
  11374. return false;
  11375. }
  11376. //equivalent values for every corresponding key, and
  11377. //~~~possibly expensive deep test
  11378. for (i = ka.length - 1; i >= 0; i--) {
  11379. key = ka[i];
  11380. if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
  11381. return false;
  11382. }
  11383. return true;
  11384. }
  11385. // 8. The non-equivalence assertion tests for any deep inequality.
  11386. // assert.notDeepEqual(actual, expected, message_opt);
  11387. assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
  11388. if (_deepEqual(actual, expected, false)) {
  11389. fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
  11390. }
  11391. };
  11392. assert.notDeepStrictEqual = notDeepStrictEqual;
  11393. function notDeepStrictEqual(actual, expected, message) {
  11394. if (_deepEqual(actual, expected, true)) {
  11395. fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
  11396. }
  11397. }
  11398. // 9. The strict equality assertion tests strict equality, as determined by ===.
  11399. // assert.strictEqual(actual, expected, message_opt);
  11400. assert.strictEqual = function strictEqual(actual, expected, message) {
  11401. if (actual !== expected) {
  11402. fail(actual, expected, message, '===', assert.strictEqual);
  11403. }
  11404. };
  11405. // 10. The strict non-equality assertion tests for strict inequality, as
  11406. // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
  11407. assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
  11408. if (actual === expected) {
  11409. fail(actual, expected, message, '!==', assert.notStrictEqual);
  11410. }
  11411. };
  11412. function expectedException(actual, expected) {
  11413. if (!actual || !expected) {
  11414. return false;
  11415. }
  11416. if (Object.prototype.toString.call(expected) == '[object RegExp]') {
  11417. return expected.test(actual);
  11418. }
  11419. try {
  11420. if (actual instanceof expected) {
  11421. return true;
  11422. }
  11423. } catch (e) {
  11424. // Ignore. The instanceof check doesn't work for arrow functions.
  11425. }
  11426. if (Error.isPrototypeOf(expected)) {
  11427. return false;
  11428. }
  11429. return expected.call({}, actual) === true;
  11430. }
  11431. function _tryBlock(block) {
  11432. var error;
  11433. try {
  11434. block();
  11435. } catch (e) {
  11436. error = e;
  11437. }
  11438. return error;
  11439. }
  11440. function _throws(shouldThrow, block, expected, message) {
  11441. var actual;
  11442. if (typeof block !== 'function') {
  11443. throw new TypeError('"block" argument must be a function');
  11444. }
  11445. if (typeof expected === 'string') {
  11446. message = expected;
  11447. expected = null;
  11448. }
  11449. actual = _tryBlock(block);
  11450. message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
  11451. (message ? ' ' + message : '.');
  11452. if (shouldThrow && !actual) {
  11453. fail(actual, expected, 'Missing expected exception' + message);
  11454. }
  11455. var userProvidedMessage = typeof message === 'string';
  11456. var isUnwantedException = !shouldThrow && util.isError(actual);
  11457. var isUnexpectedException = !shouldThrow && actual && !expected;
  11458. if ((isUnwantedException &&
  11459. userProvidedMessage &&
  11460. expectedException(actual, expected)) ||
  11461. isUnexpectedException) {
  11462. fail(actual, expected, 'Got unwanted exception' + message);
  11463. }
  11464. if ((shouldThrow && actual && expected &&
  11465. !expectedException(actual, expected)) || (!shouldThrow && actual)) {
  11466. throw actual;
  11467. }
  11468. }
  11469. // 11. Expected to throw an error:
  11470. // assert.throws(block, Error_opt, message_opt);
  11471. assert.throws = function(block, /*optional*/error, /*optional*/message) {
  11472. _throws(true, block, error, message);
  11473. };
  11474. // EXTENSION! This is annoying to write outside this module.
  11475. assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
  11476. _throws(false, block, error, message);
  11477. };
  11478. assert.ifError = function(err) { if (err) throw err; };
  11479. // Expose a strict only variant of assert
  11480. function strict(value, message) {
  11481. if (!value) fail(value, true, message, '==', strict);
  11482. }
  11483. assert.strict = objectAssign(strict, assert, {
  11484. equal: assert.strictEqual,
  11485. deepEqual: assert.deepStrictEqual,
  11486. notEqual: assert.notStrictEqual,
  11487. notDeepEqual: assert.notDeepStrictEqual
  11488. });
  11489. assert.strict.strict = assert.strict;
  11490. var objectKeys = Object.keys || function (obj) {
  11491. var keys = [];
  11492. for (var key in obj) {
  11493. if (hasOwn.call(obj, key)) keys.push(key);
  11494. }
  11495. return keys;
  11496. };
  11497. /***/ }),
  11498. /* 145 */
  11499. /***/ (function(module, exports, __webpack_require__) {
  11500. "use strict";
  11501. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  11502. /* eslint-disable max-len, no-restricted-syntax, no-prototype-builtins, no-continue */
  11503. const castToBoolean = __webpack_require__(261);
  11504. const eventing = __webpack_require__(5);
  11505. const logging = __webpack_require__(1)('StreamChannel');
  11506. const VideoOrientation = __webpack_require__(146)(); // id: String | mandatory | immutable
  11507. // type: String {video/audio/data/...} | mandatory | immutable
  11508. // active: Boolean | mandatory | mutable
  11509. // orientation: Integer? | optional | mutable
  11510. // frameRate: Float | optional | mutable
  11511. // height: Integer | optional | mutable
  11512. // width: Integer | optional | mutable
  11513. // preferredFrameRate: Float | optional | mutable
  11514. // preferredHeight: Integer | optional | mutable
  11515. // preferredWidth: Integer | optional | mutable
  11516. //
  11517. module.exports = function StreamChannel(options) {
  11518. this.id = options.id;
  11519. this.type = options.type;
  11520. this.active = castToBoolean(options.active);
  11521. this.orientation = options.orientation || VideoOrientation.ROTATED_NORMAL;
  11522. if (options.frameRate) {
  11523. this.frameRate = parseFloat(options.frameRate);
  11524. }
  11525. if (options.preferredFrameRate) {
  11526. this.preferredFrameRate = parseFloat(options.preferredFrameRate);
  11527. }
  11528. if (options.preferredWidth) {
  11529. this.preferredWidth = parseInt(options.preferredWidth, 10);
  11530. }
  11531. if (options.preferredHeight) {
  11532. this.preferredHeight = parseInt(options.preferredHeight, 10);
  11533. }
  11534. this.width = parseInt(options.width, 10);
  11535. this.height = parseInt(options.height, 10); // The defaults are used for incoming streams from pre 2015Q1 release clients.
  11536. this.source = options.source || 'camera';
  11537. this.fitMode = options.fitMode || 'cover';
  11538. eventing(this); // Returns true if a property was updated.
  11539. this.update = function (attributes) {
  11540. const videoDimensions = {};
  11541. const oldVideoDimensions = {};
  11542. for (const key in attributes) {
  11543. if (!attributes.hasOwnProperty(key)) {
  11544. continue;
  11545. } // we shouldn't really read this before we know the key is valid
  11546. const oldValue = this[key];
  11547. switch (key) {
  11548. case 'active':
  11549. this.active = castToBoolean(attributes[key]);
  11550. break;
  11551. case 'disableWarning':
  11552. this.disableWarning = castToBoolean(attributes[key]);
  11553. break;
  11554. case 'frameRate':
  11555. this.frameRate = parseFloat(attributes[key], 10);
  11556. break;
  11557. case 'width':
  11558. case 'height':
  11559. this[key] = parseInt(attributes[key], 10);
  11560. videoDimensions[key] = this[key];
  11561. oldVideoDimensions[key] = oldValue;
  11562. break;
  11563. case 'orientation':
  11564. this[key] = attributes[key];
  11565. videoDimensions[key] = this[key];
  11566. oldVideoDimensions[key] = oldValue;
  11567. break;
  11568. case 'fitMode':
  11569. this[key] = attributes[key];
  11570. break;
  11571. case 'source':
  11572. this[key] = attributes[key];
  11573. break;
  11574. default:
  11575. logging.warn("Tried to update unknown key " + key + " on " + this.type + " channel " + this.id);
  11576. return false;
  11577. }
  11578. this.trigger('update', this, key, oldValue, this[key]);
  11579. }
  11580. if (Object.keys(videoDimensions).length) {
  11581. // To make things easier for the public API, we broadcast videoDimensions changes,
  11582. // which is an aggregate of width, height, and orientation changes.
  11583. this.trigger('update', this, 'videoDimensions', oldVideoDimensions, videoDimensions);
  11584. }
  11585. return true;
  11586. };
  11587. };
  11588. /***/ }),
  11589. /* 146 */
  11590. /***/ (function(module, exports, __webpack_require__) {
  11591. "use strict";
  11592. module.exports = function videoOrientationFactory() {
  11593. return {
  11594. ROTATED_NORMAL: 0,
  11595. ROTATED_LEFT: 270,
  11596. ROTATED_RIGHT: 90,
  11597. ROTATED_UPSIDE_DOWN: 180
  11598. };
  11599. };
  11600. /***/ }),
  11601. /* 147 */
  11602. /***/ (function(module, exports, __webpack_require__) {
  11603. "use strict";
  11604. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  11605. /* eslint-disable no-param-reassign, no-underscore-dangle */
  11606. const fixBackgroundImageURI = __webpack_require__(566);
  11607. const logging = __webpack_require__(1)('StylableComponent');
  11608. const Style = __webpack_require__(567);
  11609. const styleHashLogFilter = __webpack_require__(568);
  11610. /* Stylable Notes
  11611. * Some bits are controlled by multiple flags, i.e. buttonDisplayMode and nameDisplayMode.
  11612. * When there are multiple flags how is the final setting chosen?
  11613. * When some style bits are set updates will need to be pushed through to the Chrome
  11614. */
  11615. // Mixes the StylableComponent behaviour into the +self+ object. It will
  11616. // also set the default styles to +initialStyles+.
  11617. //
  11618. // @note This Mixin is dependent on OT.Eventing.
  11619. //
  11620. //
  11621. // @example
  11622. //
  11623. // function SomeObject {
  11624. // StylableComponent(this, {
  11625. // name: 'SomeObject',
  11626. // foo: 'bar'
  11627. // });
  11628. // }
  11629. //
  11630. // var obj = new SomeObject();
  11631. // obj.getStyle('foo'); // => 'bar'
  11632. // obj.setStyle('foo', 'baz')
  11633. // obj.getStyle('foo'); // => 'baz'
  11634. // obj.getStyle(); // => {name: 'SomeObject', foo: 'baz'}
  11635. //
  11636. module.exports = function StylableComponent(self, initialStyles, showControls, logSetStyleWithPayload) {
  11637. if (!self.trigger) {
  11638. throw new Error('OT.StylableComponent is dependent on the eventing mixin. ' + 'Ensure that this is included in the object before StylableComponent.');
  11639. }
  11640. logSetStyleWithPayload = logSetStyleWithPayload || function () {};
  11641. let _readOnly = false; // Broadcast style changes as the styleValueChanged event
  11642. const onStyleChange = function onStyleChange(key, value, oldValue) {
  11643. if (oldValue) {
  11644. self.trigger('styleValueChanged', key, value, oldValue);
  11645. } else {
  11646. self.trigger('styleValueChanged', key, value);
  11647. }
  11648. };
  11649. if (showControls === false) {
  11650. initialStyles = {
  11651. buttonDisplayMode: 'off',
  11652. nameDisplayMode: 'off',
  11653. audioLevelDisplayMode: 'off',
  11654. videoDisabledDisplayMode: 'off',
  11655. audioBlockedDisplayMode: 'off'
  11656. };
  11657. _readOnly = true;
  11658. logSetStyleWithPayload({
  11659. showControls: false
  11660. });
  11661. }
  11662. const _style = new Style(initialStyles, onStyleChange);
  11663. /**
  11664. * Returns an object that has the properties that define the current user interface controls of
  11665. * the Publisher. You can modify the properties of this object and pass the object to the
  11666. * <code>setStyle()</code> method of thePublisher object. (See the documentation for
  11667. * <a href="#setStyle">setStyle()</a> to see the styles that define this object.)
  11668. * @return {Object} The object that defines the styles of the Publisher.
  11669. * @see <a href="#setStyle">setStyle()</a>
  11670. * @method #getStyle
  11671. * @memberOf Publisher
  11672. */
  11673. /**
  11674. * Returns an object that has the properties that define the current user interface controls of
  11675. * the Subscriber. You can modify the properties of this object and pass the object to the
  11676. * <code>setStyle()</code> method of the Subscriber object. (See the documentation for
  11677. * <a href="#setStyle">setStyle()</a> to see the styles that define this object.)
  11678. * @return {Object} The object that defines the styles of the Subscriber.
  11679. * @see <a href="#setStyle">setStyle()</a>
  11680. * @method #getStyle
  11681. * @memberOf Subscriber
  11682. */
  11683. // If +key+ is falsly then all styles will be returned.
  11684. self.getStyle = function (key) {
  11685. return _style.get(key);
  11686. };
  11687. /**
  11688. * Sets properties that define the appearance of some user interface controls of the Publisher.
  11689. *
  11690. * <p>You can either pass one parameter or two parameters to this method.</p>
  11691. *
  11692. * <p>If you pass one parameter, <code>style</code>, it is an object that has the following
  11693. * properties:
  11694. *
  11695. * <ul>
  11696. * <li><code>audioLevelDisplayMode</code> (String) &mdash; How to display the audio level
  11697. * indicator. Possible values are: <code>"auto"</code> (the indicator is displayed when the
  11698. * video is disabled), <code>"off"</code> (the indicator is not displayed), and
  11699. * <code>"on"</code> (the indicator is always displayed).</li>
  11700. *
  11701. * <li><code>archiveStatusDisplayMode</code> (String) &mdash; How to display the archive
  11702. * status indicator. Possible values are: <code>"auto"</code> (the indicator is displayed
  11703. * when the session is being recorded), <code>"off"</code> (the indicator is not displayed).
  11704. * If you disable the archive status display indicator, you can display your own user
  11705. * interface notifications based on the <code>archiveStarted</code> and
  11706. * <code>archiveStopped</code> events dispatched by the Session object.</li>
  11707. *
  11708. * <li><code>backgroundImageURI</code> (String) &mdash; A URI for an image to display as
  11709. * the background image when a video is not displayed. (A video may not be displayed if
  11710. * you call <code>publishVideo(false)</code> on the Publisher object). You can pass an http
  11711. * or https URI to a PNG, JPEG, or non-animated GIF file location. You can also use the
  11712. * <code>data</code> URI scheme (instead of http or https) and pass in base-64-encrypted
  11713. * PNG data, such as that obtained from the <a href="Publisher.html#getImgData">
  11714. * Publisher.getImgData()</a> method (for example, you could call
  11715. * <code>myPublisher.setStyle("backgroundImageURI", myPublisher.getImgData())</code>).
  11716. * If the URL or the image data is invalid, the property is ignored (the attempt to set
  11717. * the image fails silently).</li>
  11718. *
  11719. * <li><code>buttonDisplayMode</code> (String) &mdash; How to display the microphone
  11720. * controls. Possible values are: <code>"auto"</code> (controls are displayed when the
  11721. * stream is first displayed and when the user mouses over the display), <code>"off"</code>
  11722. * (controls are not displayed), and <code>"on"</code> (controls are always displayed).</li>
  11723. *
  11724. * <li><code>nameDisplayMode</code> (String) &#151; Whether to display the stream name.
  11725. * Possible values are: <code>"auto"</code> (the name is displayed when the stream is first
  11726. * displayed and when the user mouses over the display), <code>"off"</code> (the name is not
  11727. * displayed), and <code>"on"</code> (the name is always displayed).</li>
  11728. * </ul>
  11729. * </p>
  11730. *
  11731. * <p>For example, the following code passes one parameter to the method:</p>
  11732. *
  11733. * <pre>myPublisher.setStyle({nameDisplayMode: "off"});</pre>
  11734. *
  11735. * <p>If you pass two parameters, <code>style</code> and <code>value</code>, they are
  11736. * key-value pair that define one property of the display style. For example, the following
  11737. * code passes two parameter values to the method:</p>
  11738. *
  11739. * <pre>myPublisher.setStyle("nameDisplayMode", "off");</pre>
  11740. *
  11741. * <p>You can set the initial settings when you call the <code>Session.publish()</code>
  11742. * or <code>OT.initPublisher()</code> method. Pass a <code>style</code> property as part of the
  11743. * <code>properties</code> parameter of the method.</p>
  11744. *
  11745. * <p>The OT object dispatches an <code>exception</code> event if you pass in an invalid style
  11746. * to the method. The <code>code</code> property of the ExceptionEvent object is set to 1011.</p>
  11747. *
  11748. * @param {Object} style Either an object containing properties that define the style, or a
  11749. * String defining this single style property to set.
  11750. * @param {String} value The value to set for the <code>style</code> passed in. Pass a value
  11751. * for this parameter only if the value of the <code>style</code> parameter is a String.</p>
  11752. *
  11753. * @see <a href="#getStyle">getStyle()</a>
  11754. * @return {Publisher} The Publisher object
  11755. * @see <a href="#setStyle">setStyle()</a>
  11756. *
  11757. * @see <a href="Session.html#subscribe">Session.publish()</a>
  11758. * @see <a href="OT.html#initPublisher">OT.initPublisher()</a>
  11759. * @method #setStyle
  11760. * @memberOf Publisher
  11761. */
  11762. /**
  11763. * Sets properties that define the appearance of some user interface controls of the Subscriber.
  11764. *
  11765. * <p>You can either pass one parameter or two parameters to this method.</p>
  11766. *
  11767. * <p>If you pass one parameter, <code>style</code>, it is an object that has the following
  11768. * properties:
  11769. *
  11770. * <ul>
  11771. * <li><code>audioBlockedDisplayMode</code> (String) &mdash; Whether to display
  11772. * the default audio blocked icon in Subscribers (in browsers where audio
  11773. * autoplay is blocked). Possible values are: <code>"auto"</code> (the default,
  11774. * icon is displayed when the audio is disabled) and <code>"off"</code> (the icon
  11775. * is not displayed). Set this to <code>"off"</code> if you want to display
  11776. * your own UI element showing that the audio is blocked. In response to an
  11777. * HTML element dispatching a <code>click</code> event, you can call the
  11778. * <a href="OT.html#unblockAudio">OT.unblockAudio()</a> method to start audio
  11779. * playback in this and all other blocked subscribers.</li>
  11780. *
  11781. * <li><code>audioLevelDisplayMode</code> (String) &mdash; How to display the audio level
  11782. * indicator. Possible values are: <code>"auto"</code> (the indicator is displayed when the
  11783. * video is disabled), <code>"off"</code> (the indicator is not displayed), and
  11784. * <code>"on"</code> (the indicator is always displayed).</li>
  11785. *
  11786. * <li><code>backgroundImageURI</code> (String) &mdash; A URI for an image to display as
  11787. * the background image when a video is not displayed. (A video may not be displayed if
  11788. * you call <code>subscribeToVideo(false)</code> on the Publisher object). You can pass an
  11789. * http or https URI to a PNG, JPEG, or non-animated GIF file location. You can also use the
  11790. * <code>data</code> URI scheme (instead of http or https) and pass in base-64-encrypted
  11791. * PNG data, such as that obtained from the <a href="Subscriber.html#getImgData">
  11792. * Subscriber.getImgData()</a> method (for example, you could call
  11793. * <code>mySubscriber.setStyle("backgroundImageURI", mySubscriber.getImgData())</code>).
  11794. * If the URL or the image data is invalid, the property is ignored (the attempt to set
  11795. * the image fails silently).</li>
  11796. *
  11797. * <li><code>buttonDisplayMode</code> (String) &mdash; How to display the speaker
  11798. * controls. Possible values are: <code>"auto"</code> (controls are displayed when the
  11799. * stream is first displayed and when the user mouses over the display), <code>"off"</code>
  11800. * (controls are not displayed), and <code>"on"</code> (controls are always displayed).</li>
  11801. *
  11802. * <li><code>nameDisplayMode</code> (String) &#151; Whether to display the stream name.
  11803. * Possible values are: <code>"auto"</code> (the name is displayed when the stream is first
  11804. * displayed and when the user mouses over the display), <code>"off"</code> (the name is not
  11805. * displayed), and <code>"on"</code> (the name is always displayed).</li>
  11806. *
  11807. * <li><code>videoDisabledDisplayMode</code> (String) &#151; Whether to display the video
  11808. * disabled indicator and video disabled warning icons for a Subscriber. These icons
  11809. * indicate that the video has been disabled (or is in risk of being disabled for
  11810. * the warning icon) due to poor stream quality. Possible values are: <code>"auto"</code>
  11811. * (the icons are automatically when the displayed video is disabled or in risk of being
  11812. * disabled due to poor stream quality), <code>"off"</code> (do not display the icons), and
  11813. * <code>"on"</code> (display the icons).</li>
  11814. * </ul>
  11815. * </p>
  11816. *
  11817. * <p>For example, the following code passes one parameter to the method:</p>
  11818. *
  11819. * <pre>mySubscriber.setStyle({nameDisplayMode: "off"});</pre>
  11820. *
  11821. * <p>If you pass two parameters, <code>style</code> and <code>value</code>, they are key-value
  11822. * pair that define one property of the display style. For example, the following code passes
  11823. * two parameter values to the method:</p>
  11824. *
  11825. * <pre>mySubscriber.setStyle("nameDisplayMode", "off");</pre>
  11826. *
  11827. * <p>You can set the initial settings when you call the <code>Session.subscribe()</code> method.
  11828. * Pass a <code>style</code> property as part of the <code>properties</code> parameter of the
  11829. * method.</p>
  11830. *
  11831. * <p>The OT object dispatches an <code>exception</code> event if you pass in an invalid style
  11832. * to the method. The <code>code</code> property of the ExceptionEvent object is set to 1011.</p>
  11833. *
  11834. * @param {Object} style Either an object containing properties that define the style, or a
  11835. * String defining this single style property to set.
  11836. * @param {String} value The value to set for the <code>style</code> passed in. Pass a value
  11837. * for this parameter only if the value of the <code>style</code> parameter is a String.</p>
  11838. *
  11839. * @returns {Subscriber} The Subscriber object.
  11840. *
  11841. * @see <a href="#getStyle">getStyle()</a>
  11842. * @see <a href="#setStyle">setStyle()</a>
  11843. *
  11844. * @see <a href="Session.html#subscribe">Session.subscribe()</a>
  11845. * @method #setStyle
  11846. * @memberOf Subscriber
  11847. */
  11848. self.setStyle = function (keyOrStyleHash, value, silent) {
  11849. if (_readOnly) {
  11850. logging.warn('Calling setStyle() has no effect because the' + 'showControls option was set to false');
  11851. return this;
  11852. }
  11853. let styleHash;
  11854. if (typeof keyOrStyleHash !== 'string') {
  11855. styleHash = keyOrStyleHash;
  11856. } else {
  11857. styleHash = {};
  11858. styleHash[keyOrStyleHash] = value;
  11859. }
  11860. if (styleHash.backgroundImageURI) {
  11861. styleHash.backgroundImageURI = fixBackgroundImageURI(styleHash.backgroundImageURI);
  11862. }
  11863. _style.setAll(styleHash, silent);
  11864. logSetStyleWithPayload(styleHashLogFilter(styleHash));
  11865. return this;
  11866. };
  11867. };
  11868. /***/ }),
  11869. /* 148 */
  11870. /***/ (function(module, exports, __webpack_require__) {
  11871. "use strict";
  11872. const once = __webpack_require__(47);
  11873. const StaticConfig = __webpack_require__(28)();
  11874. const Analytics = __webpack_require__(54);
  11875. const APIKEY = __webpack_require__(69);
  11876. const EnvironmentLoader = __webpack_require__(142);
  11877. const hasOpenTokSupport = __webpack_require__(56).once;
  11878. const isWebSocketSupported = __webpack_require__(570);
  11879. const OTHelpers = __webpack_require__(4);
  11880. const logging = __webpack_require__(1)('systemRequirements');
  11881. const upgradeHtml = __webpack_require__(571);
  11882. const Modal = __webpack_require__(572);
  11883. const staticConfig = StaticConfig.onlyLocal(); // This will be logged before we even get the correct loggingUrl from
  11884. // config.opentok.com.
  11885. const analytics = new Analytics();
  11886. const logOnce = once(() => {
  11887. analytics.logEvent({
  11888. action: 'checkSystemRequirements',
  11889. variation: 'notHasRequirements',
  11890. partnerId: APIKEY.value,
  11891. payload: {
  11892. userAgent: OTHelpers.env.userAgent
  11893. }
  11894. });
  11895. });
  11896. let isDialogOpen = false;
  11897. module.exports = {
  11898. /**
  11899. * Checks if the system supports OpenTok for WebRTC. Note that this method is called
  11900. * automatically when you call <code>OT.initPublisher()</code> or <code>OT.initSession()</code>,
  11901. * and if the system doesn't support OpenTok, the OpenTok.js library displays a message to
  11902. * the user. Call the <code>OT.checkSystemRequirements()</code> method before calling
  11903. * <code>OT.initPublisher()</code> or <code>OT.initSession()</code> if you do not want the
  11904. * library to display that message.
  11905. *
  11906. * @return {Number} Whether the system supports OpenTok for WebRTC (1) or not (0).
  11907. * @see <a href="#upgradeSystemRequirements">OT.upgradeSystemRequirements()</a>
  11908. * @method OT.checkSystemRequirements
  11909. * @memberof OT
  11910. */
  11911. check() {
  11912. logging.debug('OT.checkSystemRequirements()'); // We use Number here to coerce a Boolean to 1 or 0
  11913. const systemRequirementsMet = Number(isWebSocketSupported && hasOpenTokSupport());
  11914. if (!systemRequirementsMet) {
  11915. logOnce();
  11916. }
  11917. return systemRequirementsMet;
  11918. },
  11919. /**
  11920. * Displays information about system requirements for OpenTok for WebRTC. This
  11921. * information is displayed in an iframe element that fills the browser window.
  11922. * <p>
  11923. * <i>Note:</i> this information is displayed automatically when you call the
  11924. * <code>OT.initSession()</code> or the <code>OT.initPublisher()</code> method
  11925. * if the client does not support OpenTok for WebRTC.
  11926. * </p>
  11927. * @see <a href="#checkSystemRequirements">OT.checkSystemRequirements()</a>
  11928. * @method OT.upgradeSystemRequirements
  11929. * @memberof OT
  11930. */
  11931. upgrade(_temp) {
  11932. let _ref = _temp === void 0 ? {} : _temp,
  11933. _ref$isSupportedButOl = _ref.isSupportedButOld,
  11934. isSupportedButOld = _ref$isSupportedButOl === void 0 ? OTHelpers.env.name.toLowerCase() in staticConfig.minimumVersion : _ref$isSupportedButOl,
  11935. _ref$userAgent = _ref.userAgent,
  11936. userAgent = _ref$userAgent === void 0 ? navigator.userAgent : _ref$userAgent;
  11937. // trigger after the OT environment has loaded
  11938. EnvironmentLoader.onLoad(() => {
  11939. if (isDialogOpen) {
  11940. return;
  11941. }
  11942. const modal = new Modal(upgradeHtml);
  11943. isDialogOpen = true;
  11944. modal.on('close', () => {
  11945. isDialogOpen = false;
  11946. });
  11947. modal.open();
  11948. let section;
  11949. if (userAgent.match(/(iPad|iPhone|iPod|android|webOS)/i)) {
  11950. section = (isSupportedButOld ? 'supported-' : '') + "mobile-browser";
  11951. } else {
  11952. section = (isSupportedButOld ? 'upgrade' : 'normal') + "-install";
  11953. }
  11954. modal.el("#section-" + section).style.display = 'block';
  11955. });
  11956. }
  11957. };
  11958. /***/ }),
  11959. /* 149 */
  11960. /***/ (function(module, exports, __webpack_require__) {
  11961. "use strict";
  11962. /* WEBPACK VAR INJECTION */(function(Promise) {
  11963. var _interopRequireDefault = __webpack_require__(2);
  11964. var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(55));
  11965. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(573));
  11966. const pFinally = __webpack_require__(577);
  11967. let TimeoutError = /*#__PURE__*/function (_Error) {
  11968. (0, _inheritsLoose2.default)(TimeoutError, _Error);
  11969. function TimeoutError(message) {
  11970. var _this;
  11971. _this = _Error.call(this, message) || this;
  11972. _this.name = 'TimeoutError';
  11973. return _this;
  11974. }
  11975. return TimeoutError;
  11976. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  11977. module.exports = (promise, ms, fallback) => new Promise((resolve, reject) => {
  11978. if (typeof ms !== 'number' || ms < 0) {
  11979. throw new TypeError('Expected `ms` to be a positive number');
  11980. }
  11981. const timer = setTimeout(() => {
  11982. if (typeof fallback === 'function') {
  11983. try {
  11984. resolve(fallback());
  11985. } catch (err) {
  11986. reject(err);
  11987. }
  11988. return;
  11989. }
  11990. const message = typeof fallback === 'string' ? fallback : "Promise timed out after " + ms + " milliseconds";
  11991. const err = fallback instanceof Error ? fallback : new TimeoutError(message);
  11992. if (typeof promise.cancel === 'function') {
  11993. promise.cancel();
  11994. }
  11995. reject(err);
  11996. }, ms);
  11997. pFinally(promise.then(resolve, reject), () => {
  11998. clearTimeout(timer);
  11999. });
  12000. });
  12001. module.exports.TimeoutError = TimeoutError;
  12002. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  12003. /***/ }),
  12004. /* 150 */
  12005. /***/ (function(module, exports, __webpack_require__) {
  12006. "use strict";
  12007. function createCleanupJobs() {
  12008. const jobs = [];
  12009. return {
  12010. add(job) {
  12011. jobs.push(job);
  12012. },
  12013. remove(job) {
  12014. const index = jobs.indexOf(job);
  12015. if (index >= 0) {
  12016. jobs.splice(index, 1);
  12017. }
  12018. },
  12019. releaseAll() {
  12020. const errors = [];
  12021. while (jobs.length > 0) {
  12022. const job = jobs.pop();
  12023. try {
  12024. job();
  12025. } catch (err) {
  12026. errors.push(err);
  12027. }
  12028. }
  12029. const count = errors.length;
  12030. if (count > 0) {
  12031. throw new Error("Failed to complete " + count + " cleanup job" + (count === 1 ? '' : 's') + ": " + errors.map(err => "<" + err + ">").join(', '));
  12032. }
  12033. }
  12034. };
  12035. }
  12036. module.exports = createCleanupJobs;
  12037. /***/ }),
  12038. /* 151 */
  12039. /***/ (function(module, exports, __webpack_require__) {
  12040. "use strict";
  12041. const logging = __webpack_require__(1)('applySdpTransform');
  12042. module.exports = (transforms, localRemote, offerAnswer, transformOptions, sdp) => {
  12043. const transform = transforms[localRemote][offerAnswer];
  12044. const type = localRemote + " " + offerAnswer;
  12045. const pubSub = type === 'local offer' || type === 'remote answer' ? 'publisher' : 'subscriber';
  12046. const logPrefix = "sdpTransforms (" + pubSub + "): " + localRemote + " " + offerAnswer;
  12047. const createdReceived = localRemote === 'local' ? 'created' : 'received';
  12048. logging.debug(logPrefix + ": " + createdReceived + ":\n" + sdp);
  12049. const transformedSdps = transform(transformOptions, sdp);
  12050. if (transformedSdps.local === sdp) {
  12051. logging.debug(logPrefix + ": not modified");
  12052. } else {
  12053. logging.debug(logPrefix + ": modified to:\n" + transformedSdps.local);
  12054. }
  12055. return transformedSdps;
  12056. };
  12057. /***/ }),
  12058. /* 152 */
  12059. /***/ (function(module, exports) {
  12060. function _assertThisInitialized(self) {
  12061. if (self === void 0) {
  12062. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  12063. }
  12064. return self;
  12065. }
  12066. module.exports = _assertThisInitialized;
  12067. /***/ }),
  12068. /* 153 */
  12069. /***/ (function(module, exports, __webpack_require__) {
  12070. "use strict";
  12071. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  12072. /* eslint-disable no-param-reassign */
  12073. // TODO - Move this back within the factory once all modules have been
  12074. // converted to DI factories. This will ensure different unit tests are
  12075. // using distinct instances of AudioContext.
  12076. let context;
  12077. module.exports = function audioContextFactory(deps) {
  12078. if (deps === void 0) {
  12079. deps = {};
  12080. }
  12081. const AudioContext = deps.AudioContext || (typeof window !== undefined ? window : global).AudioContext || (typeof window !== undefined ? window : global).webkitAudioContext;
  12082. /*
  12083. * Lazy instantiates an audio context and always return the same instance on following calls
  12084. *
  12085. * @returns {AudioContext}
  12086. */
  12087. return function audioContext() {
  12088. context = context || AudioContext && new AudioContext(); // Safari does not throw, it simply returns null when it cannot create an
  12089. // audio context...
  12090. // @todo report this to Apple
  12091. if (context == null) {
  12092. throw new Error('AudioContext could not be created, hardware limit reached.');
  12093. }
  12094. return context;
  12095. };
  12096. };
  12097. /***/ }),
  12098. /* 154 */
  12099. /***/ (function(module, exports, __webpack_require__) {
  12100. "use strict";
  12101. var _interopRequireDefault = __webpack_require__(2);
  12102. exports.__esModule = true;
  12103. exports.default = void 0;
  12104. var _get = _interopRequireDefault(__webpack_require__(51));
  12105. const getDisplayMedia = (0, _get.default)((typeof window !== undefined ? window : global), 'navigator.getDisplayMedia', (0, _get.default)((typeof window !== undefined ? window : global), 'navigator.mediaDevices.getDisplayMedia'));
  12106. var _default = typeof getDisplayMedia === 'function';
  12107. exports.default = _default;
  12108. /***/ }),
  12109. /* 155 */
  12110. /***/ (function(module, exports, __webpack_require__) {
  12111. "use strict";
  12112. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  12113. /* eslint-disable no-param-reassign, global-require */
  12114. const clone = __webpack_require__(35);
  12115. module.exports = function generateSimpleStateMachineFactory() {
  12116. // A Factory method for generating simple state machine classes.
  12117. //
  12118. // @usage
  12119. // var StateMachine = generateSimpleStateMachine('start', ['start', 'middle', 'end', {
  12120. // start: ['middle'],
  12121. // middle: ['end'],
  12122. // end: ['start']
  12123. // }]);
  12124. //
  12125. // var states = new StateMachine();
  12126. // state.current; // <-- start
  12127. // state.set('middle');
  12128. //
  12129. return function generateSimpleStateMachine(initialState, states, transitions) {
  12130. const validStates = states.slice();
  12131. const validTransitions = clone(transitions);
  12132. const isValidState = function isValidState(state) {
  12133. return validStates.indexOf(state) !== -1;
  12134. };
  12135. const isValidTransition = function isValidTransition(fromState, toState) {
  12136. return validTransitions[fromState] && validTransitions[fromState].indexOf(toState) !== -1;
  12137. };
  12138. return function (stateChangeFailed) {
  12139. let currentState = initialState;
  12140. let previousState = null;
  12141. this.current = currentState;
  12142. function signalChangeFailed(message, newState) {
  12143. stateChangeFailed({
  12144. message,
  12145. newState,
  12146. currentState,
  12147. previousState
  12148. });
  12149. } // Validates +newState+. If it's invalid it triggers stateChangeFailed and returns false.
  12150. function handleInvalidStateChanges(newState) {
  12151. if (!isValidState(newState)) {
  12152. signalChangeFailed("'" + newState + "' is not a valid state", newState);
  12153. return false;
  12154. }
  12155. if (!isValidTransition(currentState, newState)) {
  12156. signalChangeFailed("'" + currentState + "' cannot transition to '" + newState + "'", newState);
  12157. return false;
  12158. }
  12159. return true;
  12160. }
  12161. this.set = function (newState) {
  12162. if (!handleInvalidStateChanges(newState)) {
  12163. return;
  12164. }
  12165. previousState = currentState;
  12166. this.current = newState;
  12167. currentState = newState;
  12168. };
  12169. };
  12170. };
  12171. };
  12172. /***/ }),
  12173. /* 156 */
  12174. /***/ (function(module, exports, __webpack_require__) {
  12175. "use strict";
  12176. /* WEBPACK VAR INJECTION */(function(Promise) {
  12177. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  12178. /* eslint-disable no-param-reassign, global-require */
  12179. const find = __webpack_require__(58);
  12180. module.exports = function screenSharingFactory(deps) {
  12181. if (deps === void 0) {
  12182. deps = {};
  12183. }
  12184. const chromeExtensionHelper = deps.chromeExtensionHelper || __webpack_require__(270)();
  12185. const electronExtensionHelper = deps.electronExtensionHelper || __webpack_require__(609)();
  12186. const Errors = deps.Errors || __webpack_require__(8);
  12187. const firefoxExtensionHelper = deps.firefoxExtensionHelper || __webpack_require__(611);
  12188. const getDisplayMediaExtensionHelper = deps.getDisplayMediaExtensionHelper || __webpack_require__(278);
  12189. const otError = deps.otError || __webpack_require__(12)();
  12190. const OTHelpers = deps.OTHelpers || __webpack_require__(4);
  12191. const screenSharing = {};
  12192. screenSharing.extensionByKind = {};
  12193. screenSharing.extensionClasses = {};
  12194. screenSharing.registerExtensionHelper = (kind, helper) => {
  12195. screenSharing.extensionClasses[kind] = helper;
  12196. if (helper.autoRegisters && helper.isSupportedInThisBrowser) {
  12197. screenSharing.registerExtension(kind);
  12198. }
  12199. };
  12200. /**
  12201. * Register an extension for screen-sharing support in an older version of Chrome or Opera.
  12202. * <p>
  12203. * <b>Note:</b> A screen-sharing extension is not required in Chrome 72+ or Opera 59+.
  12204. * The end user is prompted to grant access to the screen, just as they would be when granting
  12205. * access to a camera. You only need a screen-sharing extension for older versions
  12206. * of Opera and Chrome.
  12207. * <p>
  12208. * Use the <code>OT.checkScreenSharingCapability()</code> method to check if an extension is
  12209. * required, registered, and installed.
  12210. * <p>
  12211. * The OpenTok
  12212. * <a href="https://github.com/opentok/screensharing-extensions">screensharing-extensions</a>
  12213. * repo includes code for creating an extension for screen-sharing support.
  12214. *
  12215. * @param {String} kind Set this parameter to <code>"chrome"</code>. Currently, you can only
  12216. * register a screen-sharing extension for older versions of Chrome and Opera.
  12217. *
  12218. * @param {String} id The ID for your screen-sharing extension. You can find this ID at
  12219. * chrome://extensions.
  12220. *
  12221. * @param {Number} version The version of the screen-sharing extension from the
  12222. * <a href="https://github.com/opentok/screensharing-extensions">screensharing-extensions</a> repo.
  12223. * Set this if you are using version 2 or later. For example, if you are using version 2, set this
  12224. * to 2. With version 2, the client can use the extension immediately after installing it, without
  12225. * reloading the page.
  12226. *
  12227. * @see <a href="OT.html#initPublisher">OT.initPublisher()</a>
  12228. * @see <a href="OT.html#checkScreenSharingCapability">OT.checkScreenSharingCapability()</a>
  12229. * @method OT.registerScreenSharingExtension
  12230. * @memberof OT
  12231. */
  12232. screenSharing.registerExtension = function (kind) {
  12233. if (screenSharing.extensionClasses[kind] == null) {
  12234. throw new Error('Unsupported kind passed to OT.registerScreenSharingExtension');
  12235. }
  12236. for (var _len = arguments.length, initArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  12237. initArgs[_key - 1] = arguments[_key];
  12238. }
  12239. const x = screenSharing.extensionClasses[kind].register(...initArgs);
  12240. screenSharing.extensionByKind[kind] = x;
  12241. };
  12242. const screenSharingPickHelper = () => {
  12243. const foundClass = find(Object.keys(screenSharing.extensionClasses).sort( // Try "electron" first. Reason being, even though `getDisplayMedia`
  12244. // is exposed in electron, developers must use the electron's
  12245. // `desktopCapturer` instead.
  12246. cls => cls === 'electron' ? -1 : 1), cls => screenSharing.extensionClasses[cls].isSupportedInThisBrowser);
  12247. if (foundClass === undefined) {
  12248. return {};
  12249. }
  12250. return {
  12251. name: foundClass,
  12252. proto: screenSharing.extensionClasses[foundClass],
  12253. instance: screenSharing.extensionByKind[foundClass]
  12254. };
  12255. };
  12256. screenSharing.pickHelper = () => screenSharingPickHelper();
  12257. /**
  12258. * Checks for support for publishing screen-sharing streams on the client browser. The object
  12259. * passed to the callback function defines whether screen sharing is supported, as well as
  12260. * which screen-sharing sources (application, screen, or window) are supported. It also indicates
  12261. * whether an extension is required, installed, and registered (if needed).
  12262. * <p>
  12263. * <pre>
  12264. * OT.checkScreenSharingCapability(function(response) {
  12265. * if (!response.supported || response.extensionRegistered === false) {
  12266. * // This browser does not support screen sharing
  12267. * } else if (response.extensionInstalled === false) {
  12268. * // Prompt to install the extension
  12269. * } else {
  12270. * // Screen sharing is available.
  12271. * }
  12272. * });
  12273. * </pre>
  12274. * <p>
  12275. * Chrome 72+, Firefox 52+, Edge 79+, and Opera 59+ have screen-sharing support built-in, with
  12276. * no extension required. (Note that support for the OpenTok plugin for Internet Explorer is
  12277. * removed in OpenTok 2.17.) To publish a screen-sharing video in older versions or older
  12278. * versions of Chrome or Opera, the client adds an extension that enables publishing a
  12279. * screen-sharing video stream on your domain. The OpenTok
  12280. * <a href="https://github.com/opentok/screensharing-extensions">screensharing-extensions</a>
  12281. * sample includes code for creating an extension for screen-sharing support in
  12282. * older versions of Chrome and Opera.
  12283. * <p>
  12284. * For more information, see the <a href="https://tokbox.com/developer/guides/screen-sharing/js/">
  12285. * OpenTok Screen Sharing</a> developer guide.
  12286. *
  12287. * @param {function} callback The callback invoked with the support options object passed as
  12288. * the parameter. This object has the following properties that indicate support for publishing
  12289. * screen-sharing streams in the client:
  12290. * <p>
  12291. * <ul>
  12292. * <li>
  12293. * <code>extensionInstalled</code> (Boolean) &mdash; In older versions of Chrome and Opera,
  12294. * this is set to <code>true</code> if the extension is installed and registered.
  12295. * In Chrome 72+, Firefox 52+, Opera 59+, Edge 79+, and Internet Explorer,
  12296. * this property is undefined.
  12297. * </li>
  12298. * <li>
  12299. * <code>supported</code> (Boolean) &mdash; Set to <code>true</code> if screen sharing
  12300. * is supported in the browser. Check the <code>extensionRequired</code> property
  12301. * to see if the browser requires an extension for screen sharing.
  12302. * </li>
  12303. * <li>
  12304. * <code>supportedSources</code> (Object) &mdash; An object with the following properties:
  12305. * <code>application</code>, <code>browser</code>, <code>screen</code>, and
  12306. * <code>window</code>. Each property is a Boolean value indicating support.
  12307. * In Firefox, you can set a specify the type of screen-sharing source
  12308. * by setting the <code>videoSource</code> property of the options passed into the
  12309. * <a href="#initPublisher">OT.initPublisher()</a> method. Set the property to
  12310. * <code>"application"</code>, <code>"screen"</code>, or <code>"window"</code>.
  12311. * In other browsers, setting the <code>videoSource</code> property to any of these values
  12312. * results in a prompt that asks the user to determine the screen-sharing source.
  12313. * In Firefox, Chrome, and Opera, <code>browser</code>, <code>screen</code>, and
  12314. * <code>window</code> are set to <code>true</code>. In Chrome, only <code>screen</code> and
  12315. * <code>window</code> are set to <code>true</code>.
  12316. * </li>
  12317. * </ul>
  12318. * <p> The options parameter also includes the following properties, which apply to screen-sharing
  12319. * support in older versions of Chrome and Opera (in all other browsers these properties are
  12320. * undefined):
  12321. * <ul>
  12322. * <li>
  12323. * <code>extensionRequired</code> (String) &mdash; Set to <code>"chrome"</code>
  12324. * in older versions of Chrome and Opera, which require a screen-sharing extension
  12325. * to be installed. This property is undefined in other browsers.
  12326. * </li>
  12327. * <li>
  12328. * <code>extensionRegistered</code> (Boolean) &mdash; In older versions of Chrome and Opera,
  12329. * this property is set to <code>true</code> if a screen-sharing extension is registered;
  12330. * otherwise it is set to <code>false</code>. In other browsers (which do not require
  12331. * an extension), this property is undefined. Use the
  12332. * <code>OT.registerScreenSharingExtension()</code> method to register a screen-sharing
  12333. * extension in older versions of Chrome or Opera.
  12334. * </li>
  12335. * </ul>
  12336. *
  12337. * @see <a href="OT.html#initPublisher">OT.initPublisher()</a>
  12338. * @see <a href="OT.html#registerScreenSharingExtension">OT.registerScreenSharingExtension()</a>
  12339. * @method OT.checkScreenSharingCapability
  12340. * @memberof OT
  12341. */
  12342. screenSharing.checkCapability = callback => {
  12343. const response = {
  12344. supported: false,
  12345. extensionRequired: undefined,
  12346. extensionRegistered: undefined,
  12347. extensionInstalled: undefined,
  12348. supportedSources: {}
  12349. }; // find a supported browser
  12350. const helper = screenSharingPickHelper();
  12351. if (helper.name === undefined) {
  12352. setTimeout(callback.bind(null, response));
  12353. return;
  12354. }
  12355. response.supported = true;
  12356. response.extensionRequired = helper.proto.extensionRequired ? helper.name : undefined;
  12357. response.supportedSources = {
  12358. screen: helper.proto.sources.screen,
  12359. application: helper.proto.sources.application,
  12360. window: helper.proto.sources.window,
  12361. browser: helper.proto.sources.browser
  12362. };
  12363. if (!helper.instance) {
  12364. response.extensionRegistered = false;
  12365. if (response.extensionRequired) {
  12366. response.extensionInstalled = false;
  12367. }
  12368. setTimeout(callback.bind(null, response));
  12369. return;
  12370. }
  12371. response.extensionRegistered = response.extensionRequired ? true : undefined;
  12372. helper.instance.isInstalled(installed => {
  12373. response.extensionInstalled = response.extensionRequired || OTHelpers.env.name === 'Firefox' ? installed : undefined;
  12374. callback(response);
  12375. });
  12376. };
  12377. screenSharing.registerExtensionHelper('electron', electronExtensionHelper);
  12378. screenSharing.registerExtensionHelper('getDisplayMedia', getDisplayMediaExtensionHelper);
  12379. screenSharing.registerExtensionHelper('chrome', chromeExtensionHelper);
  12380. screenSharing.registerExtensionHelper('firefox', firefoxExtensionHelper);
  12381. const noop = () => {};
  12382. screenSharing.getConstraints = opt => {
  12383. const _opt$onAccessDialogOp = opt.onAccessDialogOpened,
  12384. onAccessDialogOpened = _opt$onAccessDialogOp === void 0 ? noop : _opt$onAccessDialogOp,
  12385. _opt$onAccessDialogCl = opt.onAccessDialogClosed,
  12386. onAccessDialogClosed = _opt$onAccessDialogCl === void 0 ? noop : _opt$onAccessDialogCl,
  12387. videoSource = opt.videoSource,
  12388. constraints = opt.constraints;
  12389. return new Promise((resolve, reject) => {
  12390. screenSharing.checkCapability(response => {
  12391. if (!response.supported) {
  12392. let errorMessage = 'Screen Sharing is not supported in this browser';
  12393. if (OTHelpers.env.name === 'Chrome' && OTHelpers.env.version > 73 && (typeof window !== undefined ? window : global).location.protocol !== 'https:') {
  12394. errorMessage = 'https:// is required for screen sharing';
  12395. }
  12396. reject(otError(Errors.SCREEN_SHARING_NOT_SUPPORTED, new Error(errorMessage)));
  12397. } else if (response.extensionRegistered === false) {
  12398. reject(otError(Errors.SCREEN_SHARING_EXTENSION_NOT_REGISTERED, new Error('Screen Sharing support in this browser requires an extension, but ' + 'one has not been registered.')));
  12399. } else if (response.extensionRequired && response.extensionInstalled === false) {
  12400. reject(otError(Errors.SCREEN_SHARING_EXTENSION_NOT_INSTALLED, new Error('Screen Sharing support in this browser requires an extension, but ' + 'the extension is not installed.')));
  12401. } else {
  12402. const helper = screenSharing.pickHelper();
  12403. if (helper.proto.getConstraintsShowsPermissionUI) {
  12404. onAccessDialogOpened();
  12405. }
  12406. helper.instance.getConstraints(videoSource, constraints, (err, helperConstraints) => {
  12407. if (helper.proto.getConstraintsShowsPermissionUI) {
  12408. onAccessDialogClosed();
  12409. }
  12410. if (err) {
  12411. reject(err);
  12412. } else {
  12413. resolve(helperConstraints);
  12414. }
  12415. });
  12416. }
  12417. });
  12418. });
  12419. };
  12420. return screenSharing;
  12421. };
  12422. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  12423. /***/ }),
  12424. /* 157 */
  12425. /***/ (function(module, exports, __webpack_require__) {
  12426. "use strict";
  12427. let userAgent = 'Node';
  12428. if (typeof navigator !== 'undefined') {
  12429. userAgent = navigator.userAgent;
  12430. }
  12431. module.exports = function isiOSFactory(deps) {
  12432. if (deps === void 0) {
  12433. deps = {
  12434. userAgent
  12435. };
  12436. }
  12437. return /iPhone|iPad/.test(deps.userAgent);
  12438. };
  12439. /***/ }),
  12440. /* 158 */
  12441. /***/ (function(module, exports, __webpack_require__) {
  12442. "use strict";
  12443. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  12444. /* eslint-disable global-require */
  12445. module.exports = function interpretPeerConnectionErrorFactory(deps) {
  12446. if (deps === void 0) {
  12447. deps = {};
  12448. }
  12449. const Errors = deps.Errors || __webpack_require__(8);
  12450. const ExceptionCodes = deps.ExceptionCodes || __webpack_require__(11);
  12451. const otError = deps.otError || __webpack_require__(12)();
  12452. const errorPrefixMap = {
  12453. ICEWorkflow: Errors.ICE_WORKFLOW_FAILED,
  12454. NewPeerConnection: Errors.CREATE_PEER_CONNECTION_FAILED,
  12455. SetRemoteDescription: Errors.SET_REMOTE_DESCRIPTION_FAILED,
  12456. Subscribe: {
  12457. 404: Errors.STREAM_NOT_FOUND,
  12458. [ExceptionCodes.STREAM_LIMIT_EXCEEDED]: Errors.STREAM_LIMIT_EXCEEDED
  12459. }
  12460. };
  12461. return function interpretPeerConnectionError(httpCode, reason, prefix, remoteConnectionId, className) {
  12462. const message = (prefix ? prefix + ": " : '') + className + " PeerConnection with connection " + remoteConnectionId + " failed: " + reason;
  12463. const nameOrCodeMap = errorPrefixMap[prefix] || {};
  12464. const name = typeof nameOrCodeMap === 'string' ? nameOrCodeMap : nameOrCodeMap[httpCode];
  12465. const defaultCode = className === 'Publisher' ? ExceptionCodes.UNABLE_TO_PUBLISH : ExceptionCodes.UNABLE_TO_SUBSCRIBE;
  12466. if (!name) {
  12467. const error = new Error(message);
  12468. error.code = defaultCode;
  12469. return error;
  12470. }
  12471. const code = (() => {
  12472. if (prefix === 'ICEWorkflow') {
  12473. return className === 'Publisher' ? ExceptionCodes.PUBLISHER_ICE_WORKFLOW_FAILED : ExceptionCodes.SUBSCRIBER_ICE_WORKFLOW_FAILED;
  12474. }
  12475. if (name === Errors.STREAM_LIMIT_EXCEEDED) {
  12476. return ExceptionCodes.STREAM_LIMIT_EXCEEDED;
  12477. }
  12478. return defaultCode;
  12479. })();
  12480. return otError(name, new Error(message), code);
  12481. };
  12482. };
  12483. /***/ }),
  12484. /* 159 */
  12485. /***/ (function(module, exports, __webpack_require__) {
  12486. "use strict";
  12487. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  12488. /* eslint-disable global-require, no-param-reassign */
  12489. module.exports = function setCertificatesFactory(deps) {
  12490. if (deps === void 0) {
  12491. deps = {};
  12492. }
  12493. const OTHelpers = deps.OTHelpers || __webpack_require__(4);
  12494. const windowMock = deps.global || (typeof window !== undefined ? window : global);
  12495. const RTCPeerConnection = windowMock.RTCPeerConnection;
  12496. return function setCertificates(pcConfig, completion) {
  12497. if (OTHelpers.env.name === 'Firefox' && RTCPeerConnection && RTCPeerConnection.generateCertificate) {
  12498. RTCPeerConnection.generateCertificate({
  12499. name: 'RSASSA-PKCS1-v1_5',
  12500. hash: 'SHA-256',
  12501. modulusLength: 2048,
  12502. publicExponent: new Uint8Array([1, 0, 1])
  12503. }).catch(err => {
  12504. completion(err);
  12505. }).then(cert => {
  12506. pcConfig.certificates = [cert];
  12507. completion(undefined, pcConfig);
  12508. });
  12509. } else {
  12510. setTimeout(() => {
  12511. completion(undefined, pcConfig);
  12512. });
  12513. }
  12514. };
  12515. };
  12516. /***/ }),
  12517. /* 160 */
  12518. /***/ (function(module, exports, __webpack_require__) {
  12519. "use strict";
  12520. var _interopRequireDefault = __webpack_require__(2);
  12521. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  12522. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  12523. var _createClass2 = _interopRequireDefault(__webpack_require__(40));
  12524. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  12525. /* eslint-disable no-underscore-dangle */
  12526. const eventing = __webpack_require__(5);
  12527. const hasPassiveCapability = __webpack_require__(623);
  12528. const defaultLogging = __webpack_require__(1)('WidgetView');
  12529. const DefaultOTHelpers = __webpack_require__(4);
  12530. const defaultIsiOS = __webpack_require__(157);
  12531. const defaultiOSVersion = __webpack_require__(624);
  12532. const defaultVersionGreaterThan = __webpack_require__(625);
  12533. const defaultEnv = __webpack_require__(3);
  12534. const _require = __webpack_require__(161),
  12535. Cancellation = _require.default,
  12536. CancellationError = _require.CancellationError;
  12537. const unblockAudio = __webpack_require__(162);
  12538. const waitForVideoResolution = __webpack_require__(627);
  12539. const waitForVideoToBePlaying = __webpack_require__(628);
  12540. const fixMini = __webpack_require__(629);
  12541. const getOrCreateContainer = __webpack_require__(630);
  12542. const ensureCSSUnit = __webpack_require__(631);
  12543. const eventHelper = __webpack_require__(59);
  12544. const DefaultVideoElementFacadeFactory = __webpack_require__(104); // eslint-disable-next-line no-unused-vars
  12545. const typeVideoElementFacade = DefaultVideoElementFacadeFactory();
  12546. /**
  12547. * WidgetViewFactory - DI factory for WidgetView
  12548. *
  12549. * @package
  12550. * @param {Object} deps
  12551. * @param {DefaultVideoElementFacadeFactory} deps.VideoElementFacade
  12552. * @return WidgetView
  12553. */
  12554. function WidgetViewFactory(_temp) {
  12555. let _ref = _temp === void 0 ? {} : _temp,
  12556. _ref$logging = _ref.logging,
  12557. logging = _ref$logging === void 0 ? defaultLogging : _ref$logging,
  12558. _ref$OTHelpers = _ref.OTHelpers,
  12559. OTHelpers = _ref$OTHelpers === void 0 ? DefaultOTHelpers : _ref$OTHelpers,
  12560. _ref$isiOS = _ref.isiOS,
  12561. isiOS = _ref$isiOS === void 0 ? defaultIsiOS : _ref$isiOS,
  12562. _ref$iOSVersion = _ref.iOSVersion,
  12563. iOSVersion = _ref$iOSVersion === void 0 ? defaultiOSVersion : _ref$iOSVersion,
  12564. _ref$versionGreaterTh = _ref.versionGreaterThan,
  12565. versionGreaterThan = _ref$versionGreaterTh === void 0 ? defaultVersionGreaterThan : _ref$versionGreaterTh,
  12566. _ref$VideoElementFaca = _ref.VideoElementFacade,
  12567. VideoElementFacade = _ref$VideoElementFaca === void 0 ? DefaultVideoElementFacadeFactory() : _ref$VideoElementFaca,
  12568. _ref$env = _ref.env,
  12569. env = _ref$env === void 0 ? defaultEnv : _ref$env;
  12570. // We pass in the real window rather than a mock because hasPassiveCapability
  12571. // needs to attach/remove real event listeners on the window which won't work
  12572. // using the mock window.
  12573. const supportsPassive = hasPassiveCapability({
  12574. window: (typeof window !== undefined ? window : global)
  12575. });
  12576. /**
  12577. * WidgetView - A standard abstraction used by Subscriber and Publisher for
  12578. * displaying the video and it's UI.
  12579. *
  12580. * @package
  12581. * @class
  12582. * @param {Element} targetElement the element to attach this WidgetView to
  12583. * @param {Object} properties
  12584. */
  12585. let WidgetView = /*#__PURE__*/function () {
  12586. /** @type {typeVideoElementFacade} */
  12587. /** @type {HTMLElement} */
  12588. function WidgetView(
  12589. /** @type {HTMLElement} */
  12590. targetElement, _temp2) {
  12591. let _ref2 = _temp2 === void 0 ? {} : _temp2,
  12592. _ref2$insertDefaultUI = _ref2.insertDefaultUI,
  12593. insertDefaultUI = _ref2$insertDefaultUI === void 0 ? true : _ref2$insertDefaultUI,
  12594. _ref2$width = _ref2.width,
  12595. width = _ref2$width === void 0 ? 264 : _ref2$width,
  12596. _ref2$height = _ref2.height,
  12597. height = _ref2$height === void 0 ? 198 : _ref2$height,
  12598. _ref2$fitMode = _ref2.fitMode,
  12599. fitMode = _ref2$fitMode === void 0 ? 'cover' : _ref2$fitMode,
  12600. _ref2$mirror = _ref2.mirror,
  12601. mirror = _ref2$mirror === void 0 ? false : _ref2$mirror,
  12602. insertMode = _ref2.insertMode,
  12603. classNames = _ref2.classNames,
  12604. style = _ref2.style,
  12605. widgetType = _ref2.widgetType;
  12606. (0, _defineProperty2.default)(this, "_videoElementFacade", void 0);
  12607. (0, _defineProperty2.default)(this, "_container", undefined);
  12608. (0, _defineProperty2.default)(this, "_posterContainer", document.createElement('div'));
  12609. (0, _defineProperty2.default)(this, "_widgetContainer", document.createElement('div'));
  12610. (0, _defineProperty2.default)(this, "_loading", true);
  12611. (0, _defineProperty2.default)(this, "_audioOnly", false);
  12612. (0, _defineProperty2.default)(this, "_showPoster", undefined);
  12613. (0, _defineProperty2.default)(this, "_poster", undefined);
  12614. (0, _defineProperty2.default)(this, "_cancelBind", undefined);
  12615. eventing(this);
  12616. if (/^(contain|cover)$/.test(fitMode) === false) {
  12617. logging.warn("Invalid fit value \"" + fitMode + "\" passed. Only \"contain\" and \"cover\" can be used.");
  12618. }
  12619. this._widgetType = widgetType;
  12620. this._fitMode = fitMode;
  12621. this._insertDefaultUI = insertDefaultUI;
  12622. const userInteractionEventHandlers = eventHelper(this._widgetContainer);
  12623. userInteractionEventHandlers.on('click', this.userGesture.bind(this));
  12624. userInteractionEventHandlers.on('touchstart', this.userGesture.bind(this), supportsPassive ? {
  12625. passive: true
  12626. } : false);
  12627. this.once('destroy', () => userInteractionEventHandlers.removeAll());
  12628. this._widgetContainer.classList.add('OT_widget-container');
  12629. this._widgetContainer.style.width = '100%'; // container.style.width;
  12630. this._widgetContainer.style.height = '100%'; // container.style.height;
  12631. if (insertDefaultUI !== false) {
  12632. this._container = getOrCreateContainer(targetElement, insertMode);
  12633. if (env.name === 'Safari' && isiOS() && iOSVersion() && versionGreaterThan('11.2', iOSVersion())) {
  12634. this._container.classList.add('OT_ForceContain');
  12635. }
  12636. this._container.style.width = ensureCSSUnit(width);
  12637. this._container.style.height = ensureCSSUnit(height);
  12638. this._container.style.overflow = 'hidden';
  12639. fixMini(this._container);
  12640. if (mirror) {
  12641. OTHelpers.addClass(this._container, 'OT_mirrored');
  12642. }
  12643. if (classNames) {
  12644. // @todo Refactor to avoid passing classNames to widgetView
  12645. classNames.trim().split(/\s+/).forEach(className => this._container.classList.add(className));
  12646. }
  12647. this._container.classList.add('OT_loading');
  12648. this._container.classList.add("OT_fit-mode-" + fitMode);
  12649. this._container.appendChild(this._widgetContainer); // Observe changes to the width and height and update the aspect ratio
  12650. const _OTHelpers$observeSiz = OTHelpers(this._container).observeSize(() => fixMini(this._container)),
  12651. sizeObserver = _OTHelpers$observeSiz[0]; // @todo observe if the video container or the video element get removed
  12652. // if they do we should do some cleanup
  12653. const videoObserver = OTHelpers.observeNodeOrChildNodeRemoval(this._container, removedNodes => {
  12654. if (!this._videoElementFacade) {
  12655. return;
  12656. } // check if our widget container / video element was removed
  12657. const videoRemoved = removedNodes.some(node => node === this._widgetContainer || node === this._videoElementFacade.domElement());
  12658. if (videoRemoved) {
  12659. this.destroyVideo();
  12660. }
  12661. });
  12662. this.once('destroy', () => {
  12663. logging.debug('disconnecting observers');
  12664. sizeObserver.disconnect();
  12665. videoObserver.disconnect();
  12666. });
  12667. }
  12668. this._posterContainer.classList.add('OT_video-poster');
  12669. this._widgetContainer.appendChild(this._posterContainer);
  12670. const loadingContainer = document.createElement('div');
  12671. loadingContainer.classList.add('OT_video-loading');
  12672. const loadingSpinner = document.createElement('div');
  12673. loadingSpinner.classList.add('OT_video-loading-spinner');
  12674. loadingContainer.appendChild(loadingSpinner);
  12675. this._widgetContainer.appendChild(loadingContainer);
  12676. if (style && style.backgroundImageURI) {
  12677. this.setBackgroundImageURI(style.backgroundImageURI);
  12678. }
  12679. }
  12680. var _proto = WidgetView.prototype;
  12681. _proto.addError = function addError(errorMsg, helpMsg, classNames) {
  12682. if (this._container) {
  12683. this._container.innerHTML = "<p>" + errorMsg + (helpMsg ? " <span class=\"ot-help-message\">" + helpMsg + "</span>" : '') + "</p>";
  12684. OTHelpers.addClass(this._container, classNames || 'OT_subscriber_error');
  12685. if (this._container.querySelector('p').offsetHeight > this._container.offsetHeight) {
  12686. this._container.querySelector('span').style.display = 'none';
  12687. }
  12688. }
  12689. }
  12690. /**
  12691. * Destroy the video
  12692. */
  12693. ;
  12694. _proto.destroy = function destroy() {
  12695. this.emit('destroy');
  12696. this.destroyVideo();
  12697. if (this._container) {
  12698. OTHelpers.removeElement(this._container);
  12699. this._container = null;
  12700. }
  12701. };
  12702. _proto.setBackgroundImageURI = function setBackgroundImageURI(bgImgURI) {
  12703. OTHelpers.css(this._posterContainer, 'backgroundImage', "url(" + bgImgURI + ")");
  12704. OTHelpers.css(this._posterContainer, 'backgroundSize', 'contain');
  12705. OTHelpers.css(this._posterContainer, 'opacity', '1.0');
  12706. };
  12707. _proto.isAudioBlocked = function isAudioBlocked() {
  12708. return Boolean(this._videoElementFacade && this._videoElementFacade.isAudioBlocked());
  12709. };
  12710. _proto.unblockAudio = function unblockAudio() {
  12711. return this._videoElementFacade.unblockAudio();
  12712. };
  12713. _proto.userGesture = function userGesture() {
  12714. if (this.isAudioBlocked()) {
  12715. unblockAudio().then(() => logging.debug('Successfully unblocked audio'), err => logging.error('Error retrying audio on user interaction:', err));
  12716. }
  12717. };
  12718. _proto.setAudioBlockedUi = function setAudioBlockedUi(audioBlocked) {
  12719. if (!this._container) {
  12720. return;
  12721. }
  12722. if (audioBlocked) {
  12723. this._container.classList.add('OT_container-audio-blocked');
  12724. } else {
  12725. this._container.classList.remove('OT_container-audio-blocked');
  12726. }
  12727. }
  12728. /**
  12729. * Bind a video to a VideoElementFacade
  12730. *
  12731. * @param {MediaStream} webRTCStream the MediaStream to bind
  12732. * @param {Object} options
  12733. * @param {Function} options.error Error callback
  12734. * @param {Float} options.audioVolume The initial audioVolume
  12735. * @param {Boolean} options.muted The initial mute state
  12736. * @param {String} [options.fallbackText] The default fallbackText
  12737. *
  12738. * @return {Promise<undefined>}
  12739. */
  12740. ;
  12741. _proto.bindVideo =
  12742. /*#__PURE__*/
  12743. function () {
  12744. var _bindVideo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(webRTCStream, _ref3) {
  12745. var audioVolume, muted, fallbackText, _inject, oldVideoFacade, tempContainer, cancellation, videoFacadeEvents, whenVideoPlaying;
  12746. return _regenerator.default.wrap(function _callee$(_context) {
  12747. while (1) switch (_context.prev = _context.next) {
  12748. case 0:
  12749. audioVolume = _ref3.audioVolume, muted = _ref3.muted, fallbackText = _ref3.fallbackText, _inject = _ref3._inject;
  12750. logging.debug('bindVideo ', {
  12751. webRTCStream
  12752. });
  12753. oldVideoFacade = this._videoElementFacade;
  12754. tempContainer = document.createElement('div');
  12755. if (this._cancelBind) {
  12756. logging.debug('Cancelling last bindVideo request');
  12757. this._cancelBind.cancel();
  12758. }
  12759. this._cancelBind = new Cancellation();
  12760. cancellation = this._cancelBind;
  12761. this.once('destroy', () => cancellation.cancel());
  12762. this._videoElementFacade = new WidgetView.VideoElementFacade({
  12763. defaultAudioVolume: parseFloat(audioVolume, 100),
  12764. fallbackText,
  12765. fitMode: this._fitMode,
  12766. _inject,
  12767. muted,
  12768. widgetType: this._widgetType
  12769. });
  12770. videoFacadeEvents = eventHelper(this._videoElementFacade);
  12771. if (this._videoFacadeEvents) {
  12772. logging.debug('Remove event listeners from old video facade');
  12773. this._videoFacadeEvents.removeAll();
  12774. }
  12775. this._videoFacadeEvents = videoFacadeEvents;
  12776. videoFacadeEvents.on('error', () => {
  12777. this.trigger('error');
  12778. });
  12779. videoFacadeEvents.on('videoDimensionsChanged', (oldValue, newValue) => {
  12780. this.trigger('videoDimensionsChanged', oldValue, newValue);
  12781. });
  12782. videoFacadeEvents.on('mediaStopped', track => {
  12783. this.trigger('mediaStopped', track);
  12784. });
  12785. videoFacadeEvents.on('audioBlocked', () => this.trigger('audioBlocked'));
  12786. videoFacadeEvents.on('audioUnblocked', () => this.trigger('audioUnblocked')); // Initialize the audio volume
  12787. if (typeof audioVolume !== 'undefined') {
  12788. try {
  12789. this._videoElementFacade.setAudioVolume(audioVolume);
  12790. } catch (e) {
  12791. logging.warn("bindVideo " + e);
  12792. }
  12793. } // makes the incoming audio streams take priority (will impact only FF OS for now)
  12794. this._videoElementFacade.audioChannelType('telephony');
  12795. if (!oldVideoFacade) {
  12796. logging.debug('Appending the video facade');
  12797. this._videoElementFacade.appendTo(this._widgetContainer);
  12798. } else {
  12799. this._videoElementFacade.appendTo(tempContainer);
  12800. }
  12801. _context.prev = 20;
  12802. _context.next = 23;
  12803. return this._videoElementFacade.bindToStream(webRTCStream);
  12804. case 23:
  12805. _context.next = 34;
  12806. break;
  12807. case 25:
  12808. _context.prev = 25;
  12809. _context.t0 = _context["catch"](20);
  12810. if (!cancellation.isCanceled()) {
  12811. _context.next = 32;
  12812. break;
  12813. }
  12814. logging.debug('Refusing to destroyVideo as bindVideo was cancelled');
  12815. throw new CancellationError('CANCEL');
  12816. case 32:
  12817. this.destroyVideo();
  12818. throw _context.t0;
  12819. case 34:
  12820. if (!oldVideoFacade) {
  12821. if (this._videoElementFacade.domElement()) {
  12822. this.trigger('videoElementCreated', this._videoElementFacade.domElement());
  12823. }
  12824. videoFacadeEvents.on('videoElementCreated', element => {
  12825. this.trigger('videoElementCreated', element);
  12826. });
  12827. }
  12828. if (!cancellation.isCanceled()) {
  12829. _context.next = 38;
  12830. break;
  12831. }
  12832. logging.debug('bindVideo bailing due to cancellation');
  12833. throw new CancellationError('CANCEL');
  12834. case 38:
  12835. whenVideoPlaying = waitForVideoToBePlaying(this._videoElementFacade, 5000);
  12836. if (!(webRTCStream.getVideoTracks().length > 0)) {
  12837. _context.next = 44;
  12838. break;
  12839. }
  12840. logging.debug('Waiting for correct resolution');
  12841. _context.next = 43;
  12842. return waitForVideoResolution(this._videoElementFacade, 5000);
  12843. case 43:
  12844. logging.debug("Resolution: " + this._videoElementFacade.videoWidth() + "x" + this._videoElementFacade.videoHeight());
  12845. case 44:
  12846. logging.debug('Waiting for video to be playing');
  12847. _context.next = 47;
  12848. return whenVideoPlaying;
  12849. case 47:
  12850. logging.debug('Video is playing');
  12851. if (!cancellation.isCanceled()) {
  12852. _context.next = 51;
  12853. break;
  12854. }
  12855. logging.debug('bindVideo bailing due to cancellation');
  12856. throw new CancellationError('CANCEL');
  12857. case 51:
  12858. if (oldVideoFacade) {
  12859. // overview of the transition
  12860. // add new one to dom, give it a second
  12861. // remove old one
  12862. if (this._videoElementFacade.domElement()) {
  12863. this.trigger('videoElementCreated', this._videoElementFacade.domElement());
  12864. }
  12865. videoFacadeEvents.on('videoElementCreated', element => {
  12866. this.trigger('videoElementCreated', element);
  12867. });
  12868. logging.debug('Destroy the old video facade');
  12869. oldVideoFacade.destroy();
  12870. logging.debug('Insert the new video facade');
  12871. this._videoElementFacade.appendTo(this._widgetContainer);
  12872. }
  12873. if (this._insertDefaultUI !== false) {
  12874. OTHelpers.addClass(this._videoElementFacade.domElement(), 'OT_video-element');
  12875. }
  12876. case 53:
  12877. case "end":
  12878. return _context.stop();
  12879. }
  12880. }, _callee, this, [[20, 25]]);
  12881. }));
  12882. function bindVideo(_x, _x2) {
  12883. return _bindVideo.apply(this, arguments);
  12884. }
  12885. return bindVideo;
  12886. }();
  12887. _proto.destroyVideo = function destroyVideo() {
  12888. if (this._videoElementFacade) {
  12889. this._videoElementFacade.destroy();
  12890. this._videoElementFacade = null;
  12891. }
  12892. };
  12893. _proto.video = function video() {
  12894. return this._videoElementFacade;
  12895. };
  12896. _proto.showPoster = function showPoster(_showPoster) {
  12897. if (_showPoster === undefined) {
  12898. return !OTHelpers.isDisplayNone(this._posterContainer);
  12899. }
  12900. this._showPoster = _showPoster;
  12901. OTHelpers[_showPoster ? 'show' : 'hide'](this._posterContainer);
  12902. return this.showPoster();
  12903. };
  12904. _proto.poster = function poster(src) {
  12905. if (src === undefined) {
  12906. return OTHelpers.css(this._posterContainer, 'backgroundImage');
  12907. }
  12908. this._poster = src;
  12909. OTHelpers.css(this._posterContainer, 'backgroundImage', "url(" + src + ")");
  12910. return this.poster();
  12911. };
  12912. _proto.loading = function loading(isLoading) {
  12913. if (isLoading === undefined) {
  12914. return this._loading;
  12915. }
  12916. this._loading = Boolean(isLoading);
  12917. if (this._container) {
  12918. this._container.classList[isLoading ? 'add' : 'remove']('OT_loading');
  12919. }
  12920. return this.loading();
  12921. };
  12922. _proto.audioOnly = function audioOnly(isAudioOnly) {
  12923. if (isAudioOnly === undefined) {
  12924. return this._audioOnly;
  12925. }
  12926. this._audioOnly = isAudioOnly;
  12927. if (this._container) {
  12928. this._container.classList[isAudioOnly ? 'add' : 'remove']('OT_audio-only');
  12929. }
  12930. return this.audioOnly();
  12931. };
  12932. _proto.domId = function domId() {
  12933. return this._container && this._container.getAttribute('id');
  12934. }
  12935. /** @return {HTMLVideoElement} */
  12936. ;
  12937. (0, _createClass2.default)(WidgetView, [{
  12938. key: "domElement",
  12939. get: function get() {
  12940. return this._container;
  12941. }
  12942. }, {
  12943. key: "videoElement",
  12944. get: function get() {
  12945. return this._videoElementFacade && this._videoElementFacade.domElement() || undefined;
  12946. }
  12947. /**
  12948. * The width of the video element in pixels
  12949. * @return {Number}
  12950. */
  12951. }, {
  12952. key: "width",
  12953. get: function get() {
  12954. return this.videoElement && this.videoElement.offsetWidth;
  12955. }
  12956. /**
  12957. * The height of the video element in pixels
  12958. * @return {Number}
  12959. */
  12960. }, {
  12961. key: "height",
  12962. get: function get() {
  12963. return this.videoElement && this.videoElement.offsetHeight;
  12964. }
  12965. }]);
  12966. return WidgetView;
  12967. }(); // This is bound here so that it can be mocked in testing. Feels like a smell that's a symptom of
  12968. // larger problems to me, but I'm just maintaining existing behaviour right now.
  12969. WidgetView.VideoElementFacade = VideoElementFacade;
  12970. return WidgetView;
  12971. }
  12972. module.exports = WidgetViewFactory;
  12973. /***/ }),
  12974. /* 161 */
  12975. /***/ (function(module, exports, __webpack_require__) {
  12976. "use strict";
  12977. Object.defineProperty(exports, "__esModule", {
  12978. value: true
  12979. });
  12980. exports.CancellationError = exports.default = undefined;
  12981. var _Cancellation = __webpack_require__(626);
  12982. var _Cancellation2 = _interopRequireDefault(_Cancellation);
  12983. var _CancellationError2 = __webpack_require__(287);
  12984. var _CancellationError3 = _interopRequireDefault(_CancellationError2);
  12985. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12986. exports.default = _Cancellation2.default;
  12987. exports.CancellationError = _CancellationError3.default;
  12988. /***/ }),
  12989. /* 162 */
  12990. /***/ (function(module, exports, __webpack_require__) {
  12991. "use strict";
  12992. /* WEBPACK VAR INJECTION */(function(Promise) {
  12993. const sessionObjects = __webpack_require__(22);
  12994. module.exports = () => Promise.all(sessionObjects.subscribers.where().map(sub => {
  12995. if (!sub.isAudioBlocked()) {
  12996. return undefined;
  12997. }
  12998. /**
  12999. * Causes subscribers' audio to play back in browsers where audio is blocked.
  13000. * You must call this method in response to an HTML element dispaching
  13001. * a <code>click</code> event.
  13002. * <p>
  13003. * You only need to call this method if you disable display of
  13004. * the Subscriber's default audio playback icon (by setting the
  13005. * <code>style.audioBlockedDisplayMode</code> property of the
  13006. * <code>options</code> parameter of the
  13007. * <a href="Session.html#subscribe">Session.subscribe()</a> method).
  13008. * You may call this method in response to the user clicking an HTML element
  13009. * that you display on the page.
  13010. * <p>
  13011. * The Subscriber dispatches an
  13012. * <a href="Subscriber.html#event:audioBlocked">audioBlocked</a> event
  13013. * if audio is blocked. In response to that event, you can display a UI
  13014. * element to notify the end user to respond to playback subscriber audio.
  13015. * Call the <code>OT.unblockAudio()</code> method in response to the user
  13016. * clicking a DOM element.
  13017. * <p>
  13018. * <i>Note:</i> Subscriber audio is also unblocked automatically if
  13019. * the local client gains access to the camera or microphone (for instance,
  13020. * in response to a successful call to <code>OT.initPublisher()</code>).
  13021. *
  13022. * @returns Promise The promise resolves if audio playback succeeds
  13023. * on all blocked subscribers. The promise is rejected if playback fails.
  13024. * See <a href="Error.html">Error</a> for details.
  13025. *
  13026. * @see <a href="Subscriber.html#isAudioBlocked">Subscriber.isAudioBlocked()</a>
  13027. * @see The <a href="Subscriber.html#event:audioBlocked">audioBlocked</a>
  13028. * and <a href="Subscriber.html#event:audioUnblocked">audioUnblocked</a>
  13029. * Subscriber events
  13030. *
  13031. * @method OT.unblockAudio
  13032. * @memberof OT
  13033. */
  13034. return sub._.unblockAudio();
  13035. }));
  13036. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  13037. /***/ }),
  13038. /* 163 */
  13039. /***/ (function(module, exports, __webpack_require__) {
  13040. "use strict";
  13041. /* WEBPACK VAR INJECTION */(function(Promise) {
  13042. var _interopRequireDefault = __webpack_require__(2);
  13043. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  13044. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  13045. var _extends2 = _interopRequireDefault(__webpack_require__(23));
  13046. var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__(644));
  13047. /* eslint-disable global-require, func-names */
  13048. /* eslint-disable no-use-before-define, no-prototype-builtins, no-underscore-dangle */
  13049. /* global MediaStreamTrack */
  13050. // @todo need to ensure logging for peer disconnected, and peer failures is intact
  13051. const get = __webpack_require__(51);
  13052. const assert = __webpack_require__(144);
  13053. const assign = __webpack_require__(6);
  13054. const cloneDeep = __webpack_require__(50);
  13055. const find = __webpack_require__(58);
  13056. const pick = __webpack_require__(42);
  13057. const once = __webpack_require__(47);
  13058. const uuid = __webpack_require__(15);
  13059. const capitalize = __webpack_require__(254);
  13060. const WeakMap = __webpack_require__(225);
  13061. const _require = __webpack_require__(161),
  13062. CancellationError = _require.CancellationError,
  13063. Cancellation = _require.default;
  13064. const env = __webpack_require__(3);
  13065. const setEncodersActiveStateDefault = __webpack_require__(645);
  13066. const promisify = __webpack_require__(293);
  13067. const getStatsHelpers = __webpack_require__(72);
  13068. const eventNames = __webpack_require__(24);
  13069. const eventing = __webpack_require__(5);
  13070. const Event = __webpack_require__(135);
  13071. const AnalyticsHelperDefault = __webpack_require__(54);
  13072. const IntervalRunnerDefault = __webpack_require__(71);
  13073. const createCleanupJobs = __webpack_require__(150);
  13074. const whitelistPublisherProperties = __webpack_require__(646);
  13075. const defaultWidgetView = __webpack_require__(160)();
  13076. const audioLevelBehaviour = __webpack_require__(647);
  13077. const blockCallsUntilComplete = __webpack_require__(648);
  13078. const unblockAudio = __webpack_require__(162);
  13079. const _require2 = __webpack_require__(103)(),
  13080. getMediaDevices = _require2.getMediaDevices;
  13081. const createCanvasVideoTrack = __webpack_require__(649);
  13082. const _require3 = __webpack_require__(164),
  13083. getProxyUrl = _require3.getProxyUrl;
  13084. module.exports = function PublisherFactory(_ref) {
  13085. if (_ref === void 0) {
  13086. _ref = {};
  13087. }
  13088. let _ref2 = _ref,
  13089. _ref2$FORCE_DISCONNEC = _ref2.FORCE_DISCONNECT_OLD_PEER_CONNECTIONS_DELAY,
  13090. FORCE_DISCONNECT_OLD_PEER_CONNECTIONS_DELAY = _ref2$FORCE_DISCONNEC === void 0 ? 30000 : _ref2$FORCE_DISCONNEC,
  13091. deps = (0, _objectWithoutPropertiesLoose2.default)(_ref2, ["FORCE_DISCONNECT_OLD_PEER_CONNECTIONS_DELAY"]);
  13092. ['processPubOptions'].forEach(key => {
  13093. assert(deps[key], key + " dependency must be injected into Publisher");
  13094. });
  13095. const AnalyticsHelper = deps.AnalyticsHelper || AnalyticsHelperDefault;
  13096. const calculateCapableSimulcastStreams = deps.calculateCapableSimulcastStreams || __webpack_require__(248);
  13097. const createChromeMixin = deps.createChromeMixin || __webpack_require__(271)();
  13098. const deviceHelpers = deps.deviceHelpers || __webpack_require__(103)();
  13099. const EnvironmentLoader = deps.EnvironmentLoader || __webpack_require__(142);
  13100. const Errors = deps.Errors || __webpack_require__(8);
  13101. const Events = deps.Events || __webpack_require__(20)();
  13102. const ExceptionCodes = deps.ExceptionCodes || __webpack_require__(11);
  13103. const interpretPeerConnectionError = deps.interpretPeerConnectionError || __webpack_require__(158)();
  13104. const IntervalRunner = deps.IntervalRunner || IntervalRunnerDefault;
  13105. const logging = deps.logging || __webpack_require__(1)('Publisher');
  13106. const Microphone = deps.Microphone || __webpack_require__(281)();
  13107. const otError = deps.otError || __webpack_require__(12)();
  13108. const OTErrorClass = deps.OTErrorClass || __webpack_require__(33);
  13109. const OTHelpers = deps.OTHelpers || __webpack_require__(4);
  13110. const parseIceServers = deps.parseIceServers || __webpack_require__(98).parseIceServers;
  13111. const PUBLISH_MAX_DELAY = deps.PUBLISH_MAX_DELAY || __webpack_require__(260);
  13112. const PublisherPeerConnection = deps.PublisherPeerConnection || __webpack_require__(284)();
  13113. const PublishingState = deps.PublishingState || __webpack_require__(286)();
  13114. const StreamChannel = deps.StreamChannel || __webpack_require__(145);
  13115. const systemRequirements = deps.systemRequirements || __webpack_require__(148);
  13116. const VideoOrientation = deps.VideoOrientation || __webpack_require__(146)();
  13117. const WidgetView = deps.WidgetView || defaultWidgetView;
  13118. const windowMock = deps.global || (typeof window !== undefined ? window : global);
  13119. const createSendMethod = deps.createSendMethod || __webpack_require__(291);
  13120. const setEncodersActiveState = deps.setEncodersActiveState || setEncodersActiveStateDefault;
  13121. const processPubOptions = deps.processPubOptions;
  13122. /**
  13123. * The Publisher object provides the mechanism through which control of the
  13124. * published stream is accomplished. Calling the <code>OT.initPublisher()</code> method
  13125. * creates a Publisher object. </p>
  13126. *
  13127. * <p>The following code instantiates a session, and publishes an audio-video stream
  13128. * upon connection to the session: </p>
  13129. *
  13130. * <pre>
  13131. * var apiKey = ''; // Replace with your API key. See https://tokbox.com/account
  13132. * var sessionID = ''; // Replace with your own session ID.
  13133. * // See https://tokbox.com/developer/guides/create-session/.
  13134. * var token = ''; // Replace with a generated token that has been assigned the moderator role.
  13135. * // See https://tokbox.com/developer/guides/create-token/.
  13136. *
  13137. * var session = OT.initSession(apiKey, sessionID);
  13138. * session.connect(token, function(error) {
  13139. * if (error) {
  13140. * console.log(error.message);
  13141. * } else {
  13142. * // This example assumes that a DOM element with the ID 'publisherElement' exists
  13143. * var publisherProperties = {width: 400, height:300, name:"Bob's stream"};
  13144. * publisher = OT.initPublisher('publisherElement', publisherProperties);
  13145. * session.publish(publisher);
  13146. * }
  13147. * });
  13148. * </pre>
  13149. *
  13150. * <p>This example creates a Publisher object and adds its video to a DOM element
  13151. * with the ID <code>publisherElement</code> by calling the <code>OT.initPublisher()</code>
  13152. * method. It then publishes a stream to the session by calling
  13153. * the <code>publish()</code> method of the Session object.</p>
  13154. *
  13155. * @property {Boolean} accessAllowed Whether the user has granted access to the camera
  13156. * and microphone. The Publisher object dispatches an <code>accessAllowed</code> event when
  13157. * the user grants access. The Publisher object dispatches an <code>accessDenied</code> event
  13158. * when the user denies access.
  13159. * @property {Element} element The HTML DOM element containing the Publisher. (<i>Note:</i>
  13160. * when you set the <code>insertDefaultUI</code> option to <code>false</code> in the call to
  13161. * <a href="OT.html#initPublisher">OT.initPublisher</a>, the <code>element</code> property
  13162. * is undefined.)
  13163. * @property {String} id The DOM ID of the Publisher.
  13164. * @property {Stream} stream The {@link Stream} object corresponding the stream of
  13165. * the Publisher.
  13166. * @property {Session} session The {@link Session} to which the Publisher belongs.
  13167. *
  13168. * @see <a href="OT.html#initPublisher">OT.initPublisher</a>
  13169. * @see <a href="Session.html#publish">Session.publish()</a>
  13170. *
  13171. * @class Publisher
  13172. * @augments EventDispatcher
  13173. */
  13174. const Publisher = function Publisher(options) {
  13175. var _this = this;
  13176. if (options === void 0) {
  13177. options = {};
  13178. }
  13179. let privateEvents = eventing({});
  13180. const peerConnectionMetaMap = new WeakMap();
  13181. /**
  13182. * @typedef {Object} peerConnectionMeta
  13183. * @property {String} remoteConnectionId The connection id of the remote side
  13184. * @property {String} remoteSubscriberId The subscriber id of the remote side
  13185. * @property {Number} peerPriority The priority for this peer connection
  13186. * @property {String} peerId The peerId of this peer connection
  13187. * @property {String} peerConnectionId Our local identifier for this peer connection
  13188. */
  13189. /**
  13190. * Retrieve meta information for this peer connection
  13191. * @param {PublisherPeerConnection} peerConnection
  13192. * @returns {peerConnectionMeta} meta data regarding this peer connection
  13193. */
  13194. const getPeerConnectionMeta = peerConnection => peerConnectionMetaMap.get(peerConnection);
  13195. const setPeerConnectionMeta = (peerConnection, value) => peerConnectionMetaMap.set(peerConnection, value);
  13196. eventing(this);
  13197. const streamCleanupJobs = createCleanupJobs();
  13198. const proxyUrl = getProxyUrl();
  13199. /** @type AnalyticsHelperDefault */
  13200. let analytics = new AnalyticsHelper({
  13201. proxyUrl
  13202. }); // Check that the client meets the minimum requirements, if they don't the upgrade
  13203. // flow will be triggered.
  13204. if (!systemRequirements.check()) {
  13205. systemRequirements.upgrade();
  13206. }
  13207. /** @type {WidgetView|null} */
  13208. let widgetView;
  13209. let lastRequestedStreamId;
  13210. let webRTCStream;
  13211. let publishStartTime;
  13212. let microphone;
  13213. let state;
  13214. let rumorIceServers;
  13215. let attemptStartTime;
  13216. let audioDevices;
  13217. let videoDevices;
  13218. let selectedVideoInputDeviceId;
  13219. let selectedAudioInputDeviceId;
  13220. let didPublishComplete = false;
  13221. let currentPeerPriority = 0;
  13222. /** @type IntervalRunnerDefault | undefined */
  13223. let connectivityAttemptPinger; // previousSession mimics the publisher.session variable except it's never set to null
  13224. // this allows analytics to refer to it in cases where we disconnect/destroy
  13225. // and go to log analytics and publisher.session has been set to null
  13226. let previousSession;
  13227. const getLastSession = () => this.session || previousSession || {
  13228. isConnected() {
  13229. return false;
  13230. }
  13231. };
  13232. this.once('publishComplete', err => {
  13233. if (!err) {
  13234. didPublishComplete = true;
  13235. }
  13236. });
  13237. this.on('audioAcquisitionProblem', (_ref3) => {
  13238. let method = _ref3.method;
  13239. logAnalyticsEvent('publisher:audioAcquisitionProblem', 'Event', {
  13240. didPublishComplete,
  13241. method
  13242. });
  13243. });
  13244. function getCommonAnalyticsFields() {
  13245. return {
  13246. connectionId: getLastSession().isConnected() ? getLastSession().connection.connectionId : null,
  13247. streamId: lastRequestedStreamId,
  13248. widgetType: 'Publisher'
  13249. };
  13250. }
  13251. const onStreamAvailableError = plainError => {
  13252. const names = Object.keys(Errors).map(shortName => Errors[shortName]);
  13253. const error = otError(names.indexOf(plainError.name) > -1 ? plainError.name : Errors.MEDIA_ERR_ABORTED, plainError, ExceptionCodes.UNABLE_TO_PUBLISH);
  13254. logging.error("onStreamAvailableError " + error.name + ": " + error.message);
  13255. state.set('Failed');
  13256. if (widgetView) {
  13257. widgetView.destroy();
  13258. widgetView = null;
  13259. }
  13260. const logOptions = {
  13261. failureReason: 'GetUserMedia',
  13262. failureCode: ExceptionCodes.UNABLE_TO_PUBLISH,
  13263. failureMessage: "OT.Publisher failed to access camera/mic: " + error.message
  13264. };
  13265. logConnectivityEvent('Failure', {}, logOptions);
  13266. OTErrorClass.handleJsException({
  13267. error,
  13268. errorMsg: logOptions.failureReason,
  13269. code: logOptions.failureCode,
  13270. target: this,
  13271. analytics
  13272. });
  13273. this.trigger('publishComplete', error);
  13274. };
  13275. const onScreenSharingError = errorParam => {
  13276. const error = cloneDeep(errorParam);
  13277. error.code = ExceptionCodes.UNABLE_TO_PUBLISH;
  13278. logging.error("OT.Publisher.onScreenSharingError " + error.message);
  13279. state.set('Failed');
  13280. error.message = "Screensharing: " + error.message;
  13281. this.trigger('publishComplete', error);
  13282. logConnectivityEvent('Failure', {}, {
  13283. failureReason: 'ScreenSharing',
  13284. failureMessage: error.message
  13285. });
  13286. if (widgetView) {
  13287. widgetView.destroy();
  13288. widgetView = null;
  13289. }
  13290. }; // The user has clicked the 'deny' button in the allow access dialog, or it's
  13291. // set to always deny, or the access was denied due to HTTP restrictions;
  13292. const onAccessDenied = errorParam => {
  13293. const error = cloneDeep(errorParam);
  13294. let isIframe;
  13295. try {
  13296. isIframe = window.self !== window.top;
  13297. } catch (err) {// ignore errors, (some browsers throw a security error when accessing cross domain)
  13298. }
  13299. if ((typeof window !== undefined ? window : global).location.protocol !== 'https:') {
  13300. if (isScreenSharing) {
  13301. /*
  13302. * in http:// the browser will deny permission without asking the
  13303. * user. There is also no way to tell if it was denied by the
  13304. * user, or prevented from the browser.
  13305. */
  13306. error.message += ' Note: https:// is required for screen sharing.';
  13307. } else if (OTHelpers.env.name === 'Chrome' && OTHelpers.env.hostName !== 'localhost') {
  13308. error.message += ' Note: Chrome requires HTTPS for camera and microphone access.';
  13309. }
  13310. }
  13311. if (isIframe && !isScreenSharing) {
  13312. error.message += ' Note: Check that the iframe has the allow attribute for camera and microphone';
  13313. }
  13314. logging.error(error.message);
  13315. state.set('Failed'); // Note: The substring 'Publisher Access Denied:' is part of our api contract for now.
  13316. // https://tokbox.com/developer/guides/publish-stream/js/#troubleshooting
  13317. error.message = "OT.Publisher Access Denied: Permission Denied: " + error.message;
  13318. error.code = ExceptionCodes.UNABLE_TO_PUBLISH;
  13319. if (widgetView) {
  13320. widgetView.destroy();
  13321. widgetView = null;
  13322. }
  13323. logConnectivityEvent('Cancel', {
  13324. reason: 'AccessDenied'
  13325. });
  13326. this.trigger('publishComplete', error);
  13327. this.dispatchEvent(new Event(eventNames.ACCESS_DENIED));
  13328. };
  13329. const userMediaError = error => {
  13330. const isPermissionError = error.name === Errors.USER_MEDIA_ACCESS_DENIED || error.name === Errors.NOT_SUPPORTED && error.originalMessage.match(/Only secure origins/);
  13331. if (isPermissionError) {
  13332. onAccessDenied(error);
  13333. } else if (processPubOptions.isScreenSharing) {
  13334. onScreenSharingError(error);
  13335. } else {
  13336. onStreamAvailableError(error);
  13337. }
  13338. throw error;
  13339. };
  13340. const onAccessDialogOpened = () => {
  13341. logAnalyticsEvent('accessDialog', 'Opened');
  13342. this.dispatchEvent(new Event(eventNames.ACCESS_DIALOG_OPENED, true));
  13343. };
  13344. const onAccessDialogClosed = () => {
  13345. logAnalyticsEvent('accessDialog', 'Closed');
  13346. this.dispatchEvent(new Event(eventNames.ACCESS_DIALOG_CLOSED, false));
  13347. };
  13348. const guid = uuid();
  13349. const peerConnectionsAsync = {};
  13350. let loaded = false;
  13351. let previousAnalyticsStats = {};
  13352. let audioAcquisitionProblemDetected = false;
  13353. let processedOptions = processPubOptions(options, 'OT.Publisher', () => state && state.isDestroyed());
  13354. processedOptions.on({
  13355. accessDialogOpened: onAccessDialogOpened,
  13356. accessDialogClosed: onAccessDialogClosed
  13357. });
  13358. const _processedOptions = processedOptions,
  13359. isScreenSharing = _processedOptions.isScreenSharing,
  13360. isCustomAudioTrack = _processedOptions.isCustomAudioTrack,
  13361. isCustomVideoTrack = _processedOptions.isCustomVideoTrack,
  13362. shouldAllowAudio = _processedOptions.shouldAllowAudio,
  13363. properties = _processedOptions.properties,
  13364. getUserMedia = _processedOptions.getUserMedia; // start with undefined
  13365. Object.defineProperty(this, 'loudness', {
  13366. writable: false,
  13367. value: undefined,
  13368. configurable: true
  13369. });
  13370. function removeTrackListeners(trackListeners) {
  13371. trackListeners.forEach(off => off());
  13372. }
  13373. const listenWithOff = (obj, event, listener) => {
  13374. if (!obj.addEventListener) {
  13375. // noop
  13376. return () => {};
  13377. }
  13378. obj.addEventListener(event, listener);
  13379. return () => obj.removeEventListener(event, listener);
  13380. };
  13381. (function handleAudioEnded() {
  13382. const trackListeners = [];
  13383. privateEvents.on('streamDestroy', () => removeTrackListeners(trackListeners));
  13384. privateEvents.on('streamChange', () => {
  13385. removeTrackListeners(trackListeners);
  13386. const newListeners = webRTCStream.getAudioTracks().map(track => listenWithOff(track, 'ended', () => {
  13387. // chrome audio acquisition issue
  13388. audioAcquisitionProblemDetected = true;
  13389. this.trigger('audioAcquisitionProblem', {
  13390. method: 'trackEndedEvent'
  13391. });
  13392. }));
  13393. trackListeners.splice(0, trackListeners.length, ...newListeners);
  13394. });
  13395. }).call(this);
  13396. (function handleMuteTrack() {
  13397. const trackListeners = [];
  13398. privateEvents.on('streamDestroy', () => removeTrackListeners(trackListeners));
  13399. privateEvents.on('streamChange', () => {
  13400. removeTrackListeners(trackListeners); // Screensharing in Chrome sometimes triggers 'mute' and 'unmute'
  13401. // repeatedly for now reason OPENTOK-37818
  13402. // https://bugs.chromium.org/p/chromium/issues/detail?id=931033
  13403. if (!isScreenSharing) {
  13404. webRTCStream.getTracks().forEach(track => {
  13405. if (track.addEventListener) {
  13406. trackListeners.push(listenWithOff(track, 'mute', refreshAudioVideoUI));
  13407. trackListeners.push(listenWithOff(track, 'unmute', refreshAudioVideoUI));
  13408. }
  13409. });
  13410. }
  13411. });
  13412. })(); // / Private Methods
  13413. const logAnalyticsEvent = options.logAnalyticsEvent || ((action, variation, payload, logOptions, throttle) => {
  13414. let stats = assign({
  13415. action,
  13416. variation,
  13417. payload
  13418. }, getCommonAnalyticsFields(), logOptions);
  13419. if (variation === 'Failure') {
  13420. stats = assign(previousAnalyticsStats, stats);
  13421. }
  13422. previousAnalyticsStats = pick(stats, 'sessionId', 'connectionId', 'partnerId');
  13423. analytics.logEvent(stats, throttle);
  13424. });
  13425. const logConnectivityEvent = function logConnectivityEvent(variation, payload, logOptions) {
  13426. if (payload === void 0) {
  13427. payload = {};
  13428. }
  13429. if (logOptions === void 0) {
  13430. logOptions = {};
  13431. }
  13432. if (logOptions.failureReason === 'Non-fatal') {
  13433. // we don't want to log because it was a non-fatal failure
  13434. return;
  13435. }
  13436. if (variation === 'Attempt') {
  13437. attemptStartTime = new Date().getTime();
  13438. if (connectivityAttemptPinger) {
  13439. connectivityAttemptPinger.stop();
  13440. logging.error('_connectivityAttemptPinger should have been cleaned up');
  13441. }
  13442. connectivityAttemptPinger = new IntervalRunner(() => {
  13443. logAnalyticsEvent('Publish', 'Attempting', payload, (0, _extends2.default)({}, getCommonAnalyticsFields(), {}, logOptions));
  13444. }, 1 / 5, 6);
  13445. }
  13446. if (variation === 'Failure' || variation === 'Success' || variation === 'Cancel') {
  13447. if (connectivityAttemptPinger) {
  13448. connectivityAttemptPinger.stop();
  13449. connectivityAttemptPinger = undefined;
  13450. } else {
  13451. logging.warn("Received connectivity event: \"" + variation + "\" without \"Attempt\"");
  13452. }
  13453. logAnalyticsEvent('Publish', variation, (0, _extends2.default)({
  13454. videoInputDevices: videoDevices,
  13455. audioInputDevices: audioDevices,
  13456. videoInputDeviceCount: videoDevices ? videoDevices.length : undefined,
  13457. audioInputDeviceCount: audioDevices ? audioDevices.length : undefined,
  13458. selectedVideoInputDeviceId,
  13459. selectedAudioInputDeviceId
  13460. }, payload), (0, _extends2.default)({
  13461. attemptDuration: new Date().getTime() - attemptStartTime
  13462. }, logOptions));
  13463. } else {
  13464. logAnalyticsEvent('Publish', variation, payload, logOptions);
  13465. }
  13466. };
  13467. const logRepublish = (variation, payload) => {
  13468. logAnalyticsEvent('ICERestart', variation, payload);
  13469. }; // logs an analytics event for getStats on the first call
  13470. const notifyGetStatsCalled = once(() => {
  13471. logAnalyticsEvent('GetStats', 'Called');
  13472. });
  13473. const recordQOS = (_ref4) => {
  13474. let parsedStats = _ref4.parsedStats,
  13475. simulcastEnabled = _ref4.simulcastEnabled,
  13476. remoteConnectionId = _ref4.remoteConnectionId,
  13477. peerPriority = _ref4.peerPriority,
  13478. peerId = _ref4.peerId;
  13479. const QoSBlob = {
  13480. peerPriority,
  13481. peerId,
  13482. widgetType: 'Publisher',
  13483. connectionId: this.session && this.session.isConnected() ? this.session.connection.connectionId : null,
  13484. streamId: lastRequestedStreamId,
  13485. width: widgetView.width,
  13486. height: widgetView.height,
  13487. audioTrack: webRTCStream && webRTCStream.getAudioTracks().length > 0,
  13488. hasAudio: hasAudio(),
  13489. publishAudio: properties.publishAudio,
  13490. videoTrack: webRTCStream && webRTCStream.getVideoTracks().length > 0,
  13491. hasVideo: hasVideo(),
  13492. publishVideo: properties.publishVideo,
  13493. audioSource: isCustomAudioTrack ? 'Custom' : undefined,
  13494. videoSource: isScreenSharing && options.videoSource || isCustomVideoTrack && 'Custom' || properties.constraints.video && 'Camera' || null,
  13495. duration: publishStartTime ? Math.round((new Date().getTime() - publishStartTime.getTime()) / 1000) : 0,
  13496. remoteConnectionId,
  13497. scalableVideo: simulcastEnabled
  13498. };
  13499. const videoDimensions = {
  13500. videoWidth: this.videoWidth(),
  13501. videoHeight: this.videoHeight()
  13502. };
  13503. const videoParsedStats = assign(parsedStats, videoDimensions);
  13504. analytics.logQOS(assign(QoSBlob, parsedStats));
  13505. this.trigger('qos', videoParsedStats);
  13506. }; // Returns the video dimensions. Which could either be the ones that
  13507. // the developer specific in the videoDimensions property, or just
  13508. // whatever the video element reports.
  13509. //
  13510. // If all else fails then we'll just default to 640x480
  13511. //
  13512. const getVideoDimensions = () => {
  13513. let streamWidth;
  13514. let streamHeight;
  13515. const video = widgetView && widgetView.video(); // We set the streamWidth and streamHeight to be the minimum of the requested
  13516. // resolution and the actual resolution.
  13517. if (properties.videoDimensions) {
  13518. streamWidth = Math.min(properties.videoDimensions.width, video && video.videoWidth() || 640);
  13519. streamHeight = Math.min(properties.videoDimensions.height, video && video.videoHeight() || 480);
  13520. } else {
  13521. streamWidth = video && video.videoWidth() || 640;
  13522. streamHeight = video && video.videoHeight() || 480;
  13523. }
  13524. return {
  13525. width: streamWidth,
  13526. height: streamHeight
  13527. };
  13528. }; // / Private Events
  13529. const stateChangeFailed = changeFailed => {
  13530. logging.error('OT.Publisher State Change Failed: ', changeFailed.message);
  13531. logging.debug(changeFailed);
  13532. };
  13533. const onLoaded = () => {
  13534. if (state.isDestroyed()) {
  13535. // The publisher was destroyed before loading finished
  13536. if (widgetView) {
  13537. widgetView.destroyVideo();
  13538. }
  13539. return;
  13540. }
  13541. logging.debug('OT.Publisher.onLoaded; resolution:', this.videoWidth() + "x" + this.videoHeight());
  13542. state.set('MediaBound'); // Try unblock audio on all subscribers
  13543. unblockAudio().catch(logging.error); // If we have a session and we haven't created the stream yet then
  13544. // wait until that is complete before hiding the loading spinner
  13545. widgetView.loading(this.session ? !this.stream : false);
  13546. loaded = true;
  13547. };
  13548. const onLoadFailure = plainError => {
  13549. // eslint-disable-next-line no-param-reassign
  13550. const err = otError(Errors.CONNECT_FAILED, plainError, ExceptionCodes.P2P_CONNECTION_FAILED);
  13551. err.message = "OT.Publisher PeerConnection Error: " + err.message;
  13552. logConnectivityEvent('Failure', {}, {
  13553. failureReason: 'PeerConnectionError',
  13554. failureCode: err.code,
  13555. failureMessage: err.message
  13556. });
  13557. state.set('Failed');
  13558. this.trigger('publishComplete', err);
  13559. OTErrorClass.handleJsException({
  13560. error: err,
  13561. target: this,
  13562. analytics
  13563. });
  13564. }; // Clean up our LocalMediaStream
  13565. const cleanupLocalStream = () => {
  13566. if (webRTCStream) {
  13567. privateEvents.emit('streamDestroy'); // Stop revokes our access cam and mic access for this instance
  13568. // of localMediaStream.
  13569. if (windowMock.MediaStreamTrack && windowMock.MediaStreamTrack.prototype.stop) {
  13570. // Newer spec
  13571. webRTCStream.getTracks().forEach(track => track.stop());
  13572. } else {
  13573. // Older spec
  13574. webRTCStream.stop();
  13575. }
  13576. }
  13577. };
  13578. const bindVideo = /*#__PURE__*/function () {
  13579. var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  13580. var videoContainerOptions;
  13581. return _regenerator.default.wrap(function _callee$(_context) {
  13582. while (1) switch (_context.prev = _context.next) {
  13583. case 0:
  13584. videoContainerOptions = {
  13585. muted: true
  13586. };
  13587. if (widgetView) {
  13588. _context.next = 3;
  13589. break;
  13590. }
  13591. throw new Error('Cannot bind video after widget view has been destroyed');
  13592. case 3:
  13593. return _context.abrupt("return", widgetView.bindVideo(webRTCStream, videoContainerOptions));
  13594. case 4:
  13595. case "end":
  13596. return _context.stop();
  13597. }
  13598. }, _callee);
  13599. }));
  13600. return function bindVideo() {
  13601. return _ref5.apply(this, arguments);
  13602. };
  13603. }();
  13604. const onStreamAvailable = webOTStream => {
  13605. logging.debug('OT.Publisher.onStreamAvailable');
  13606. state.set('BindingMedia');
  13607. cleanupLocalStream();
  13608. webRTCStream = webOTStream;
  13609. privateEvents.emit('streamChange');
  13610. const findSelectedDeviceId = (tracks, devices) => {
  13611. // Store the device labels to log later
  13612. let selectedDeviceId;
  13613. tracks.forEach(track => {
  13614. if (track.deviceId) {
  13615. selectedDeviceId = track.deviceId.toString();
  13616. } else if (track.label && devices) {
  13617. const selectedDevice = find(devices, el => el.label === track.label);
  13618. if (selectedDevice) {
  13619. selectedDeviceId = selectedDevice.deviceId;
  13620. }
  13621. }
  13622. });
  13623. return selectedDeviceId;
  13624. };
  13625. selectedVideoInputDeviceId = findSelectedDeviceId(webRTCStream.getVideoTracks(), videoDevices);
  13626. selectedAudioInputDeviceId = findSelectedDeviceId(webRTCStream.getAudioTracks(), audioDevices);
  13627. microphone = new Microphone(webRTCStream, !properties.publishAudio);
  13628. updateVideo();
  13629. updateAudio();
  13630. this.accessAllowed = true;
  13631. this.dispatchEvent(new Event(eventNames.ACCESS_ALLOWED, false));
  13632. };
  13633. const onPublishingTimeout = session => {
  13634. logging.error('OT.Publisher.onPublishingTimeout');
  13635. let errorName;
  13636. let errorMessage;
  13637. if (audioAcquisitionProblemDetected) {
  13638. errorName = Errors.CHROME_MICROPHONE_ACQUISITION_ERROR;
  13639. errorMessage = 'Unable to publish because your browser failed to get access to your ' + 'microphone. You may need to fully quit and restart your browser to get it to work. ' + 'See https://bugs.chromium.org/p/webrtc/issues/detail?id=4799 for more details.';
  13640. } else {
  13641. errorName = Errors.TIMEOUT;
  13642. errorMessage = 'Could not publish in a reasonable amount of time';
  13643. }
  13644. const logOptions = {
  13645. failureReason: 'ICEWorkflow',
  13646. failureCode: ExceptionCodes.UNABLE_TO_PUBLISH,
  13647. failureMessage: 'OT.Publisher failed to publish in a reasonable amount of time (timeout)'
  13648. };
  13649. logConnectivityEvent('Failure', {}, logOptions);
  13650. OTErrorClass.handleJsException({
  13651. errorMsg: logOptions.failureReason,
  13652. code: logOptions.failureCode,
  13653. target: this,
  13654. analytics
  13655. });
  13656. if (session.isConnected() && this.streamId) {
  13657. session._.streamDestroy(this.streamId);
  13658. } // Disconnect immediately, rather than wait for the WebSocket to
  13659. // reply to our destroyStream message.
  13660. this.disconnect();
  13661. this.session = null; // We're back to being a stand-alone publisher again.
  13662. if (!state.isDestroyed()) {
  13663. state.set('MediaBound');
  13664. }
  13665. this.trigger('publishComplete', otError(errorName, new Error(errorMessage), ExceptionCodes.UNABLE_TO_PUBLISH));
  13666. };
  13667. const onVideoError = plainErr => {
  13668. // eslint-disable-next-line no-param-reassign
  13669. const err = otError(Errors.MEDIA_ERR_DECODE, plainErr, ExceptionCodes.UNABLE_TO_PUBLISH);
  13670. err.message = "OT.Publisher while playing stream: " + err.message;
  13671. logging.error('OT.Publisher.onVideoError:', err);
  13672. logAnalyticsEvent('stream', null, {
  13673. reason: err.message
  13674. }); // Check if attempting to publish *before* overwriting the state
  13675. const isAttemptingToPublish = state.isAttemptingToPublish();
  13676. state.set('Failed');
  13677. if (isAttemptingToPublish) {
  13678. this.trigger('publishComplete', err);
  13679. } else {
  13680. // FIXME: This emits a string instead of an error here for backwards compatibility despite
  13681. // being undocumented. When possible we should remove access to this and other undocumented
  13682. // events, and restore emitting actual errors here.
  13683. this.trigger('error', err.message);
  13684. }
  13685. OTErrorClass.handleJsException({
  13686. error: err,
  13687. target: this,
  13688. analytics
  13689. });
  13690. };
  13691. this._removePeerConnection = peerConnection => {
  13692. const _getPeerConnectionMet = getPeerConnectionMeta(peerConnection),
  13693. peerConnectionId = _getPeerConnectionMet.peerConnectionId;
  13694. delete peerConnectionsAsync[peerConnectionId];
  13695. peerConnection.destroy();
  13696. };
  13697. this._removeSubscriber = subscriberId => {
  13698. getPeerConnectionsBySubscriber(subscriberId).then(peerConnections => {
  13699. peerConnections.forEach(pc => this._removePeerConnection(pc));
  13700. });
  13701. };
  13702. const onPeerDisconnected = peerConnection => {
  13703. logging.debug('Subscriber has been disconnected from the Publisher\'s PeerConnection');
  13704. const _getPeerConnectionMet2 = getPeerConnectionMeta(peerConnection),
  13705. peerPriority = _getPeerConnectionMet2.peerPriority,
  13706. remoteSubscriberId = _getPeerConnectionMet2.remoteSubscriberId;
  13707. const _getPeerConnectionMet3 = getPeerConnectionMeta(peerConnection),
  13708. peerConnectionId = _getPeerConnectionMet3.peerConnectionId;
  13709. logAnalyticsEvent('disconnect', 'PeerConnection', {
  13710. subscriberConnection: peerConnectionId
  13711. });
  13712. if (peerPriority < currentPeerPriority) {
  13713. // cleanup lower-priority peer connection that is expected to go away
  13714. this._removePeerConnection(peerConnection);
  13715. } else {
  13716. this._removeSubscriber(remoteSubscriberId);
  13717. }
  13718. }; // @todo find out if we get onPeerDisconnected when a failure occurs.
  13719. const onPeerConnectionFailure = /*#__PURE__*/function () {
  13720. var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(peerConnection, _ref6) {
  13721. var reason, prefix, sessionInfo, _ref8, _ref8$remoteConnectio, remoteConnectionId, peerConnectionId, error, payload, logOptions, pc;
  13722. return _regenerator.default.wrap(function _callee2$(_context2) {
  13723. while (1) switch (_context2.prev = _context2.next) {
  13724. case 0:
  13725. reason = _ref6.reason, prefix = _ref6.prefix;
  13726. sessionInfo = _this.session && _this.session.sessionInfo;
  13727. if (!(prefix === 'ICEWorkflow' && sessionInfo && sessionInfo.reconnection && loaded)) {
  13728. _context2.next = 5;
  13729. break;
  13730. }
  13731. // @todo not sure this is the right thing to do
  13732. logging.debug('Ignoring peer connection failure due to possibility of reconnection.');
  13733. return _context2.abrupt("return");
  13734. case 5:
  13735. _ref8 = getPeerConnectionMeta(peerConnection) || {}, _ref8$remoteConnectio = _ref8.remoteConnectionId, remoteConnectionId = _ref8$remoteConnectio === void 0 ? '(not found)' : _ref8$remoteConnectio, peerConnectionId = _ref8.peerConnectionId;
  13736. error = interpretPeerConnectionError(undefined, reason, prefix, remoteConnectionId, 'Publisher');
  13737. payload = {
  13738. hasRelayCandidates: peerConnection && peerConnection.hasRelayCandidates()
  13739. };
  13740. logOptions = {
  13741. failureReason: prefix || 'PeerConnectionError',
  13742. failureCode: error.code,
  13743. failureMessage: error.message
  13744. };
  13745. if (state.isPublishing()) {
  13746. // We're already publishing so this is a Non-fatal failure, must be p2p and one of our
  13747. // peerconnections failed
  13748. logOptions.reason = 'Non-fatal';
  13749. } else {
  13750. _this.trigger('publishComplete', error);
  13751. }
  13752. logConnectivityEvent('Failure', payload, logOptions);
  13753. OTErrorClass.handleJsException({
  13754. errorMsg: "OT.Publisher PeerConnection Error: " + reason,
  13755. code: error.code,
  13756. target: _this,
  13757. analytics
  13758. });
  13759. _context2.next = 14;
  13760. return peerConnectionsAsync[peerConnectionId];
  13761. case 14:
  13762. pc = _context2.sent;
  13763. pc.destroy();
  13764. delete peerConnectionsAsync[peerConnectionId];
  13765. case 17:
  13766. case "end":
  13767. return _context2.stop();
  13768. }
  13769. }, _callee2);
  13770. }));
  13771. return function onPeerConnectionFailure(_x, _x2) {
  13772. return _ref7.apply(this, arguments);
  13773. };
  13774. }();
  13775. const onIceRestartSuccess = peerConnection => {
  13776. const _getPeerConnectionMet4 = getPeerConnectionMeta(peerConnection),
  13777. remoteConnectionId = _getPeerConnectionMet4.remoteConnectionId;
  13778. logRepublish('Success', {
  13779. remoteConnectionId
  13780. });
  13781. };
  13782. const onIceRestartFailure = peerConnection => {
  13783. const _getPeerConnectionMet5 = getPeerConnectionMeta(peerConnection),
  13784. remoteConnectionId = _getPeerConnectionMet5.remoteConnectionId;
  13785. logRepublish('Failure', {
  13786. reason: 'ICEWorkflow',
  13787. message: 'OT.Publisher PeerConnection Error: ' + 'The stream was unable to connect due to a network error.' + ' Make sure your connection isn\'t blocked by a firewall.',
  13788. remoteConnectionId
  13789. });
  13790. }; // / Private Helpers
  13791. // Assigns +stream+ to this publisher. The publisher listens for a bunch of events on the stream
  13792. // so it can respond to changes.
  13793. const assignStream = stream => {
  13794. // the Publisher only expects a stream in the PublishingToSession state
  13795. if (state.current !== 'PublishingToSession') {
  13796. throw new Error('assignStream called when publisher is not successfully publishing');
  13797. }
  13798. streamCleanupJobs.releaseAll();
  13799. this.stream = stream;
  13800. this.stream.on('destroyed', this.disconnect, this);
  13801. streamCleanupJobs.add(() => {
  13802. if (this.stream) {
  13803. this.stream.off('destroyed', this.disconnect, this);
  13804. }
  13805. });
  13806. state.set('Publishing');
  13807. widgetView.loading(!loaded);
  13808. publishStartTime = new Date();
  13809. this.dispatchEvent(new Events.StreamEvent('streamCreated', stream, null, false));
  13810. logConnectivityEvent('Success');
  13811. this.trigger('publishComplete', null, this);
  13812. };
  13813. /**
  13814. * Provides the peer connection associated to the given peerConnectionId.
  13815. *
  13816. * It there is no PC associated it creates a new one and stores it so that the next call returns
  13817. * the same instance.
  13818. *
  13819. * @param {Object} configuration
  13820. * @param {string} configuration.peerConnectionId
  13821. * @returns {Promise<Error, PublisherPeerConnection>}
  13822. */
  13823. const createPeerConnection = (_ref9) => {
  13824. let peerConnectionId = _ref9.peerConnectionId,
  13825. send = _ref9.send,
  13826. log = _ref9.log,
  13827. logQoS = _ref9.logQoS;
  13828. if (getPeerConnectionById(peerConnectionId)) {
  13829. return Promise.reject(new Error('PeerConnection already exists'));
  13830. } // Calculate the number of streams to use. 1 for normal, >1 for Simulcast
  13831. const capableSimulcastStreams = calculateCapableSimulcastStreams({
  13832. browserName: OTHelpers.env.name,
  13833. isScreenSharing,
  13834. isCustomVideoTrack,
  13835. sessionInfo: this.session.sessionInfo,
  13836. constraints: properties.constraints,
  13837. videoDimensions: getVideoDimensions()
  13838. });
  13839. peerConnectionsAsync[peerConnectionId] = Promise.all([this.session._.getIceConfig(), this.session._.getVideoCodecsCompatible(webRTCStream)]).then((_ref10) => {
  13840. let iceConfig = _ref10[0],
  13841. videoCodecsCompatible = _ref10[1];
  13842. let pcStream = webRTCStream;
  13843. if (!videoCodecsCompatible) {
  13844. pcStream = webRTCStream.clone();
  13845. const _pcStream$getVideoTra = pcStream.getVideoTracks(),
  13846. videoTrack = _pcStream$getVideoTra[0];
  13847. if (videoTrack) {
  13848. videoTrack.stop();
  13849. pcStream.removeTrack(videoTrack);
  13850. }
  13851. }
  13852. const peerConnection = new PublisherPeerConnection({
  13853. iceConfig,
  13854. sendMessage: (type, content) => {
  13855. if (type === 'offer') {
  13856. this.trigger('connected');
  13857. }
  13858. send(type, content);
  13859. },
  13860. webRTCStream: pcStream,
  13861. channels: properties.channels,
  13862. capableSimulcastStreams,
  13863. overrideSimulcastEnabled: options._enableSimulcast,
  13864. logAnalyticsEvent: log,
  13865. offerOverrides: {
  13866. enableStereo: properties.enableStereo,
  13867. audioBitrate: properties.audioBitrate,
  13868. priorityVideoCodec: properties._priorityVideoCodec || this.session.sessionInfo.priorityVideoCodec,
  13869. codecFlags: properties._codecFlags || this.session._.getCodecFlags()
  13870. },
  13871. // FIXME - Remove answerOverrides once b=AS is supported by Mantis
  13872. answerOverrides: this.session.sessionInfo.p2pEnabled ? undefined : {
  13873. audioBitrate: properties.audioBitrate
  13874. }
  13875. });
  13876. peerConnection.on({
  13877. disconnected: () => onPeerDisconnected(peerConnection),
  13878. error: (_ref11) => {
  13879. let reason = _ref11.reason,
  13880. prefix = _ref11.prefix;
  13881. return onPeerConnectionFailure(peerConnection, {
  13882. reason,
  13883. prefix
  13884. });
  13885. },
  13886. qos: logQoS,
  13887. iceRestartSuccess: () => onIceRestartSuccess(peerConnection),
  13888. iceRestartFailure: () => onIceRestartFailure(peerConnection),
  13889. audioAcquisitionProblem: () => {
  13890. // will be only triggered in Chrome
  13891. audioAcquisitionProblemDetected = true;
  13892. this.trigger('audioAcquisitionProblem', {
  13893. method: 'getStats'
  13894. });
  13895. }
  13896. });
  13897. return new Promise((resolve, reject) => {
  13898. const rejectOnError = err => {
  13899. reject(err);
  13900. };
  13901. peerConnection.once('error', rejectOnError);
  13902. peerConnection.init(rumorIceServers, err => {
  13903. if (err) {
  13904. return reject(err);
  13905. }
  13906. peerConnection.off('error', rejectOnError);
  13907. resolve(peerConnection);
  13908. return undefined;
  13909. });
  13910. });
  13911. });
  13912. return getPeerConnectionById(peerConnectionId);
  13913. };
  13914. const getAllPeerConnections = () => Promise.all(Object.keys(peerConnectionsAsync).map(getPeerConnectionById));
  13915. const getPeerConnectionsBySubscriber = subscriberId => getAllPeerConnections().then(peerConnections => peerConnections.filter(peerConnection => getPeerConnectionMeta(peerConnection).remoteSubscriberId === subscriberId));
  13916. const getPeerConnectionsByPriority = priority => getAllPeerConnections().then(peerConnections => peerConnections.filter(peerConnection => getPeerConnectionMeta(peerConnection).peerPriority === priority));
  13917. const getPeerConnectionById = id => peerConnectionsAsync[id];
  13918. let chromeMixin = createChromeMixin(this, {
  13919. name: properties.name,
  13920. publishAudio: properties.publishAudio,
  13921. publishVideo: properties.publishVideo,
  13922. audioSource: properties.audioSource,
  13923. showControls: properties.showControls,
  13924. shouldAllowAudio,
  13925. logAnalyticsEvent
  13926. });
  13927. const reset = () => {
  13928. this.off('publishComplete', refreshAudioVideoUI);
  13929. if (chromeMixin) {
  13930. chromeMixin.reset();
  13931. }
  13932. streamCleanupJobs.releaseAll();
  13933. this.disconnect();
  13934. microphone = null;
  13935. cleanupLocalStream();
  13936. webRTCStream = null;
  13937. if (widgetView) {
  13938. widgetView.destroy();
  13939. widgetView = null;
  13940. }
  13941. if (this.session) {
  13942. this._.unpublishFromSession(this.session, 'reset');
  13943. }
  13944. this.id = null;
  13945. this.stream = null;
  13946. loaded = false;
  13947. this.session = null;
  13948. if (!state.isDestroyed()) {
  13949. state.set('NotPublishing');
  13950. }
  13951. };
  13952. const hasVideo = () => {
  13953. if (!webRTCStream || webRTCStream.getVideoTracks().length === 0) {
  13954. return false;
  13955. }
  13956. return webRTCStream.getVideoTracks().reduce((isEnabled, track) => isEnabled && !track.muted && track.enabled && track.readyState !== 'ended', properties.publishVideo);
  13957. };
  13958. const hasAudio = () => {
  13959. if (!webRTCStream || webRTCStream.getAudioTracks().length === 0) {
  13960. return false;
  13961. }
  13962. return webRTCStream.getAudioTracks().length > 0 && webRTCStream.getAudioTracks().reduce((isEnabled, track) => isEnabled && !track.muted && track.enabled && track.readyState !== 'ended', properties.publishAudio);
  13963. };
  13964. const refreshAudioVideoUI = () => {
  13965. if (widgetView) {
  13966. widgetView.audioOnly(!hasVideo());
  13967. widgetView.showPoster(!hasVideo());
  13968. }
  13969. if (chromeMixin) {
  13970. chromeMixin.setAudioOnly(!hasVideo() && hasAudio());
  13971. }
  13972. if (this.stream) {
  13973. this.stream.setChannelActiveState('audio', hasAudio());
  13974. this.stream.setChannelActiveState('video', hasVideo());
  13975. } else {
  13976. this.once('publishComplete', refreshAudioVideoUI);
  13977. }
  13978. };
  13979. this.publish = targetElement => {
  13980. logging.debug('OT.Publisher: publish');
  13981. if (state.isAttemptingToPublish() || state.isPublishing()) {
  13982. reset();
  13983. }
  13984. state.set('GetUserMedia');
  13985. if (properties.style) {
  13986. this.setStyle(properties.style, null, true);
  13987. }
  13988. properties.classNames = 'OT_root OT_publisher'; // Defer actually creating the publisher DOM nodes until we know
  13989. // the DOM is actually loaded.
  13990. EnvironmentLoader.onLoad(() => {
  13991. logging.debug('OT.Publisher: publish: environment loaded'); // @note If ever replacing the widgetView with a new one elsewhere, you'll need to be
  13992. // mindful that audioLevelBehaviour has a reference to this one, and it will need to be
  13993. // updated accordingly.
  13994. // widgetView = new WidgetView(targetElement, properties);
  13995. widgetView = new WidgetView(targetElement, (0, _extends2.default)({}, properties, {
  13996. widgetType: 'publisher'
  13997. }));
  13998. if (shouldAllowAudio) {
  13999. audioLevelBehaviour({
  14000. publisher: this,
  14001. widgetView
  14002. });
  14003. }
  14004. widgetView.on('error', onVideoError);
  14005. this.id = widgetView.domId();
  14006. this.element = widgetView.domElement;
  14007. if (this.element && chromeMixin) {
  14008. // Only create the chrome if we have an element to insert it into
  14009. // for insertDefautlUI:false we don't create the chrome
  14010. chromeMixin.init(widgetView);
  14011. }
  14012. widgetView.on('videoDimensionsChanged', (oldValue, newValue) => {
  14013. if (this.stream) {
  14014. this.stream.setVideoDimensions(newValue.width, newValue.height);
  14015. }
  14016. this.dispatchEvent(new Events.VideoDimensionsChangedEvent(this, oldValue, newValue));
  14017. });
  14018. widgetView.on('mediaStopped', track => {
  14019. const event = new Events.MediaStoppedEvent(this, track);
  14020. this.dispatchEvent(event);
  14021. if (event.isDefaultPrevented()) {
  14022. return;
  14023. }
  14024. if (track) {
  14025. const kind = String(track.kind).toLowerCase(); // If we are publishing this kind when the track stops then
  14026. // make sure we start publishing again if we switch to a new track
  14027. if (kind === 'audio') {
  14028. updateAudio();
  14029. } else if (kind === 'video') {
  14030. updateVideo();
  14031. } else {
  14032. logging.warn("Track with invalid kind has ended: " + track.kind);
  14033. }
  14034. return;
  14035. }
  14036. if (this.session) {
  14037. this._.unpublishFromSession(this.session, 'mediaStopped');
  14038. } else {
  14039. this.destroy('mediaStopped');
  14040. }
  14041. });
  14042. widgetView.on('videoElementCreated', element => {
  14043. const event = new Events.VideoElementCreatedEvent(element);
  14044. this.dispatchEvent(event);
  14045. });
  14046. getUserMedia().catch(userMediaError).then(stream => {
  14047. // this comes from deviceHelpers.shouldAskForDevices in a round-about way
  14048. audioDevices = processedOptions.audioDevices;
  14049. videoDevices = processedOptions.videoDevices;
  14050. onStreamAvailable(stream);
  14051. if (!properties.publishVideo) {
  14052. this._toggleVideo(properties.publishVideo);
  14053. }
  14054. return bindVideo().catch(error => {
  14055. if (error instanceof CancellationError) {
  14056. // If we get a CancellationError, it means something newer tried
  14057. // to bindVideo before the old one succeeded, perhaps they called
  14058. // switchTracks.. It should be rare, and they shouldn't be doing
  14059. // this before loaded, but we'll handle it anyway.
  14060. return undefined;
  14061. }
  14062. throw error;
  14063. }).then(() => {
  14064. onLoaded();
  14065. if (!state.isDestroyed()) {
  14066. this.trigger('initSuccess');
  14067. this.trigger('loaded', this);
  14068. }
  14069. }, err => {
  14070. logging.error("OT.Publisher.publish failed to bind video: " + err);
  14071. onLoadFailure(err);
  14072. });
  14073. });
  14074. });
  14075. return this;
  14076. };
  14077. const haveWorkingTracks = type => webRTCStream && webRTCStream["get" + capitalize(type) + "Tracks"]().length > 0 && webRTCStream["get" + capitalize(type) + "Tracks"]().every(track => track.readyState !== 'ended');
  14078. const updateAudio = () => {
  14079. const shouldSendAudio = haveWorkingTracks('audio') && properties.publishAudio;
  14080. if (chromeMixin) {
  14081. chromeMixin.setMuted(!shouldSendAudio);
  14082. }
  14083. if (microphone) {
  14084. microphone.muted(!shouldSendAudio);
  14085. }
  14086. refreshAudioVideoUI();
  14087. };
  14088. /**
  14089. * Starts publishing audio (if it is currently not being published)
  14090. * when the <code>value</code> is <code>true</code>; stops publishing audio
  14091. * (if it is currently being published) when the <code>value</code> is <code>false</code>.
  14092. *
  14093. * @param {Boolean} value Whether to start publishing audio (<code>true</code>)
  14094. * or not (<code>false</code>).
  14095. *
  14096. * @see <a href="OT.html#initPublisher">OT.initPublisher()</a>
  14097. * @see <a href="Stream.html#hasAudio">Stream.hasAudio</a>
  14098. * @see StreamPropertyChangedEvent
  14099. * @method #publishAudio
  14100. * @memberOf Publisher
  14101. */
  14102. this.publishAudio = value => {
  14103. logAnalyticsEvent('publishAudio', 'Attempt', {
  14104. publishAudio: value
  14105. });
  14106. properties.publishAudio = value;
  14107. try {
  14108. updateAudio();
  14109. logAnalyticsEvent('publishAudio', 'Success', {
  14110. publishAudio: value
  14111. });
  14112. } catch (e) {
  14113. logAnalyticsEvent('publishAudio', 'Failure', {
  14114. message: e.message
  14115. });
  14116. }
  14117. return this;
  14118. };
  14119. let updateVideoSenderParametersSentinel; // keeps track of if the client has called mediaStreamTrack.stop(), so that we don't restart
  14120. // the camera if they then call publishVideo(true)
  14121. let isTrackManuallyStopped = false;
  14122. const updateVideo = () => {
  14123. const shouldSendVideo = haveWorkingTracks('video') && properties.publishVideo;
  14124. if (env.name === 'Chrome' && env.version >= 69) {
  14125. (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  14126. var executionSentinel, peerConnections;
  14127. return _regenerator.default.wrap(function _callee3$(_context3) {
  14128. while (1) switch (_context3.prev = _context3.next) {
  14129. case 0:
  14130. if (updateVideoSenderParametersSentinel) {
  14131. updateVideoSenderParametersSentinel.cancel();
  14132. }
  14133. updateVideoSenderParametersSentinel = new Cancellation();
  14134. executionSentinel = updateVideoSenderParametersSentinel;
  14135. _context3.next = 5;
  14136. return getAllPeerConnections();
  14137. case 5:
  14138. peerConnections = _context3.sent;
  14139. if (!executionSentinel.isCanceled()) {
  14140. // only proceed if we weren't canceled during the async operation above
  14141. peerConnections.forEach(peerConnection => {
  14142. setEncodersActiveState(peerConnection, shouldSendVideo);
  14143. });
  14144. }
  14145. case 7:
  14146. case "end":
  14147. return _context3.stop();
  14148. }
  14149. }, _callee3);
  14150. }))();
  14151. }
  14152. if (webRTCStream) {
  14153. webRTCStream.getVideoTracks().forEach(track => {
  14154. track.enabled = shouldSendVideo; // eslint-disable-line no-param-reassign
  14155. if (track.isCreatedCanvas) {
  14156. // eslint-disable-next-line no-param-reassign
  14157. track.enabled = false;
  14158. }
  14159. });
  14160. }
  14161. refreshAudioVideoUI();
  14162. };
  14163. let currentDeviceId;
  14164. this._toggleVideo = blockCallsUntilComplete( /*#__PURE__*/function () {
  14165. var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(shouldHaveVideo) {
  14166. var oldTrack, _properties$videoDime, videoDimensions, canvasTrack, vidDevices, newTrack;
  14167. return _regenerator.default.wrap(function _callee4$(_context4) {
  14168. while (1) switch (_context4.prev = _context4.next) {
  14169. case 0:
  14170. if (!(isScreenSharing || isCustomVideoTrack || isTrackManuallyStopped)) {
  14171. _context4.next = 2;
  14172. break;
  14173. }
  14174. return _context4.abrupt("return");
  14175. case 2:
  14176. oldTrack = getCurrentTrack();
  14177. if (oldTrack) {
  14178. _context4.next = 5;
  14179. break;
  14180. }
  14181. throw otError(Errors.NOT_SUPPORTED, new Error('Publisher._toggleVideo cannot toggleVideo when you have no video source.'));
  14182. case 5:
  14183. if (!(oldTrack.readyState === 'ended')) {
  14184. _context4.next = 8;
  14185. break;
  14186. }
  14187. isTrackManuallyStopped = true;
  14188. return _context4.abrupt("return");
  14189. case 8:
  14190. // create a canvas and grab the track from it to pass into video
  14191. // resize the canvas so that we don't emit a 'streamPropertyChanged' event
  14192. _properties$videoDime = properties.videoDimensions, videoDimensions = _properties$videoDime === void 0 ? getVideoDimensions() : _properties$videoDime;
  14193. _context4.prev = 9;
  14194. canvasTrack = createCanvasVideoTrack(videoDimensions);
  14195. _context4.next = 16;
  14196. break;
  14197. case 13:
  14198. _context4.prev = 13;
  14199. _context4.t0 = _context4["catch"](9);
  14200. return _context4.abrupt("return");
  14201. case 16:
  14202. _context4.next = 18;
  14203. return getVideoDevices();
  14204. case 18:
  14205. vidDevices = _context4.sent;
  14206. if (OTHelpers.env.name === 'Chrome' && OTHelpers.env.userAgent.toLowerCase().indexOf('android') > -1) {
  14207. // On Chrome on Android you need to stop the previous video track OPENTOK-37206
  14208. if (oldTrack && oldTrack.stop) {
  14209. oldTrack.stop();
  14210. }
  14211. } // store the current deviceId to reaquire the video later
  14212. if (!shouldHaveVideo) {
  14213. currentDeviceId = vidDevices.find(device => device.label === oldTrack.label).deviceId;
  14214. }
  14215. if (!(currentDeviceId && vidDevices.findIndex(device => device.deviceId === currentDeviceId) === -1)) {
  14216. _context4.next = 23;
  14217. break;
  14218. }
  14219. throw otError(Errors.NO_DEVICES_FOUND, new Error('Previous device no longer available - deviceId not found'));
  14220. case 23:
  14221. privateEvents.emit('streamDestroy');
  14222. if (!shouldHaveVideo) {
  14223. _context4.next = 30;
  14224. break;
  14225. }
  14226. _context4.next = 27;
  14227. return getTrackFromDeviceId(currentDeviceId);
  14228. case 27:
  14229. _context4.t1 = _context4.sent;
  14230. _context4.next = 31;
  14231. break;
  14232. case 30:
  14233. _context4.t1 = canvasTrack;
  14234. case 31:
  14235. newTrack = _context4.t1;
  14236. _context4.next = 34;
  14237. return replaceTrackAndUpdate(oldTrack, newTrack);
  14238. case 34:
  14239. case "end":
  14240. return _context4.stop();
  14241. }
  14242. }, _callee4, null, [[9, 13]]);
  14243. }));
  14244. return function (_x3) {
  14245. return _ref13.apply(this, arguments);
  14246. };
  14247. }());
  14248. /**
  14249. * Starts publishing video (if it is currently not being published)
  14250. * when the <code>value</code> is <code>true</code>; stops publishing video
  14251. * (if it is currently being published) when the <code>value</code> is <code>false</code>.
  14252. *
  14253. * @param {Boolean} value Whether to start publishing video (<code>true</code>)
  14254. * or not (<code>false</code>).
  14255. *
  14256. * @see <a href="OT.html#initPublisher">OT.initPublisher()</a>
  14257. * @see <a href="Stream.html#hasVideo">Stream.hasVideo</a>
  14258. * @see StreamPropertyChangedEvent
  14259. * @method #publishVideo
  14260. * @memberOf Publisher
  14261. */
  14262. this.publishVideo = value => {
  14263. logAnalyticsEvent('publishVideo', 'Attempt', {
  14264. publishVideo: value
  14265. });
  14266. properties.publishVideo = value;
  14267. try {
  14268. this._toggleVideo(properties.publishVideo);
  14269. updateVideo();
  14270. logAnalyticsEvent('publishVideo', 'Success', {
  14271. publishVideo: value
  14272. });
  14273. } catch (e) {
  14274. logAnalyticsEvent('publishVideo', 'Failure', {
  14275. message: e.message
  14276. });
  14277. }
  14278. return this;
  14279. };
  14280. /**
  14281. * Deletes the Publisher object and removes it from the HTML DOM.
  14282. * <p>
  14283. * The Publisher object dispatches a <code>destroyed</code> event when the DOM
  14284. * element is removed.
  14285. * </p>
  14286. * @method #destroy
  14287. * @memberOf Publisher
  14288. * @return {Publisher} The Publisher.
  14289. */
  14290. this.destroy = function (
  14291. /* unused */
  14292. reason, quiet) {
  14293. // @todo OPENTOK-36652 this.session should not be needed here
  14294. if (state.isAttemptingToPublish() && this.session) {
  14295. logConnectivityEvent('Cancel', {
  14296. reason: 'destroy'
  14297. });
  14298. }
  14299. if (state.isDestroyed()) {
  14300. return this;
  14301. }
  14302. state.set('Destroyed');
  14303. reset();
  14304. if (processedOptions) {
  14305. processedOptions.off();
  14306. processedOptions = null;
  14307. }
  14308. if (chromeMixin) {
  14309. chromeMixin.destroy();
  14310. chromeMixin = null;
  14311. }
  14312. if (privateEvents) {
  14313. privateEvents.off();
  14314. privateEvents = null;
  14315. }
  14316. if (quiet !== true) {
  14317. this.dispatchEvent(new Events.DestroyedEvent(eventNames.PUBLISHER_DESTROYED, this, reason));
  14318. }
  14319. this.off();
  14320. return this;
  14321. };
  14322. /*
  14323. * @methodOf Publisher
  14324. * @private
  14325. */
  14326. this.disconnect = () => {
  14327. Object.keys(peerConnectionsAsync).forEach(peerConnectionId => {
  14328. const futurePeerConnection = getPeerConnectionById(peerConnectionId);
  14329. delete peerConnectionsAsync[peerConnectionId];
  14330. futurePeerConnection.then(peerConnection => this._removePeerConnection(peerConnection));
  14331. });
  14332. };
  14333. this.processMessage = (type, fromConnectionId, message) => {
  14334. const subscriberId = get(message, 'params.subscriber', fromConnectionId).replace(/^INVALID-STREAM$/, fromConnectionId);
  14335. const peerId = get(message, 'content.peerId');
  14336. const peerPriority = Number(get(message, 'content.peerPriority')); // Symphony will not have a subscriberId so we'll fallback to using the connectionId for it.
  14337. // Also fallback to the connectionId if it is equal to 'INVALID-STREAM' (See OPENTOK-30029).
  14338. const peerConnectionId = subscriberId + "~" + peerId + "~" + peerPriority;
  14339. logging.debug("OT.Publisher.processMessage: Received " + type + " from " + fromConnectionId + " for " + peerConnectionId);
  14340. logging.debug(message);
  14341. const futurePeerConnection = getPeerConnectionById(peerConnectionId);
  14342. const addPeerConnection = () => {
  14343. if (peerPriority > currentPeerPriority) {
  14344. logging.info("PeerConnection escalation to " + peerId + ":" + peerPriority);
  14345. getPeerConnectionsByPriority(currentPeerPriority).then(peerConnections => {
  14346. peerConnections.forEach(peerConnection => {
  14347. setTimeout(() => {
  14348. logging.info('PeerConnection escalation removing old peer connection with force');
  14349. this._removePeerConnection(peerConnection);
  14350. }, FORCE_DISCONNECT_OLD_PEER_CONNECTIONS_DELAY);
  14351. });
  14352. });
  14353. currentPeerPriority = peerPriority;
  14354. }
  14355. const send = createSendMethod({
  14356. socket: this.session._.getSocket(),
  14357. uri: message.uri,
  14358. content: {
  14359. peerPriority,
  14360. peerId
  14361. }
  14362. });
  14363. const log = function log(action, variation, payload, logOptions, throttle) {
  14364. if (logOptions === void 0) {
  14365. logOptions = {};
  14366. }
  14367. const transformedOptions = (0, _extends2.default)({
  14368. peerId,
  14369. peerPriority
  14370. }, logOptions);
  14371. return logAnalyticsEvent(action, variation, payload, transformedOptions, throttle);
  14372. };
  14373. const logQoS = qos => {
  14374. recordQOS((0, _extends2.default)({}, qos, {
  14375. peerId,
  14376. peerPriority,
  14377. remoteConnectionId: fromConnectionId
  14378. }));
  14379. };
  14380. createPeerConnection({
  14381. peerConnectionId,
  14382. send,
  14383. log,
  14384. logQoS
  14385. }).then(peerConnection => {
  14386. setPeerConnectionMeta(peerConnection, {
  14387. remoteConnectionId: fromConnectionId,
  14388. remoteSubscriberId: subscriberId,
  14389. peerPriority,
  14390. peerId,
  14391. peerConnectionId
  14392. });
  14393. peerConnection.processMessage(type, message); // Allow this runaway promise
  14394. // http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-was-not-returned-from-it
  14395. return null;
  14396. }).catch(err => {
  14397. logging.error('OT.Publisher failed to create a peerConnection', err);
  14398. });
  14399. };
  14400. if ((type === 'generateoffer' || type === 'offer') && peerPriority < currentPeerPriority) {
  14401. logging.debug('Ignore offer from lower priority peer connection');
  14402. }
  14403. switch (type) {
  14404. case 'unsubscribe':
  14405. this._removeSubscriber(subscriberId);
  14406. break;
  14407. default:
  14408. if (!futurePeerConnection) {
  14409. addPeerConnection();
  14410. } else {
  14411. futurePeerConnection.then(peerConnection => peerConnection.processMessage(type, message));
  14412. }
  14413. break;
  14414. }
  14415. };
  14416. /**
  14417. * Returns the base-64-encoded string of PNG data representing the Publisher video.
  14418. *
  14419. * <p>You can use the string as the value for a data URL scheme passed to the src parameter of
  14420. * an image file, as in the following:</p>
  14421. *
  14422. * <pre>
  14423. * var imgData = publisher.getImgData();
  14424. *
  14425. * var img = document.createElement("img");
  14426. * img.setAttribute("src", "data:image/png;base64," + imgData);
  14427. * var imgWin = window.open("about:blank", "Screenshot");
  14428. * imgWin.document.write("&lt;body&gt;&lt;/body&gt;");
  14429. * imgWin.document.body.appendChild(img);
  14430. * </pre>
  14431. *
  14432. * @method #getImgData
  14433. * @memberOf Publisher
  14434. * @return {String} The base-64 encoded string. Returns an empty string if there is no video.
  14435. */
  14436. this.getImgData = function () {
  14437. if (!loaded) {
  14438. logging.error('OT.Publisher.getImgData: Cannot getImgData before the Publisher is publishing.');
  14439. return null;
  14440. }
  14441. const video = widgetView && widgetView.video();
  14442. return video ? video.imgData() : null;
  14443. };
  14444. const setNewStream = newStream => {
  14445. cleanupLocalStream();
  14446. webRTCStream = newStream;
  14447. privateEvents.emit('streamChange');
  14448. microphone = new Microphone(webRTCStream, !properties.publishAudio);
  14449. };
  14450. const defaultReplaceTrackLogic = peerConnection => {
  14451. peerConnection.getSenders().forEach(sender => {
  14452. if (sender.track.kind === 'audio' && webRTCStream.getAudioTracks().length) {
  14453. return sender.replaceTrack(webRTCStream.getAudioTracks()[0]);
  14454. } else if (sender.track.kind === 'video' && webRTCStream.getVideoTracks().length) {
  14455. return sender.replaceTrack(webRTCStream.getVideoTracks()[0]);
  14456. }
  14457. return undefined;
  14458. });
  14459. };
  14460. const replaceTracks = function replaceTracks(replaceTrackLogic) {
  14461. if (replaceTrackLogic === void 0) {
  14462. replaceTrackLogic = defaultReplaceTrackLogic;
  14463. }
  14464. return getAllPeerConnections().then(peerConnections => {
  14465. const tasks = [];
  14466. peerConnections.map(replaceTrackLogic);
  14467. return Promise.all(tasks);
  14468. });
  14469. };
  14470. {
  14471. let videoIndex = 0;
  14472. /**
  14473. * Switches the video input source used by the publisher to the next one in the list
  14474. * of available devices.
  14475. * <p>
  14476. * This will result in an error (the Promise returned by the method is rejected) in the
  14477. * following conditions:
  14478. * <ul>
  14479. * <li>
  14480. * The user denied access to the video input device.
  14481. * </li>
  14482. * <li>
  14483. * The publisher is not using a camera video source. (The <code>videoSource</code>
  14484. * option of the <a href="OT.html#initPublisher">OT.initPublisher()</a> method was
  14485. * set to <code>null</code>, <code>false</code>, a MediaStreamTrack object, or
  14486. * <code>"screen"</code>).
  14487. * </li>
  14488. * <li>
  14489. * There are no video input devices (cameras) available.
  14490. * </li>
  14491. * <li>
  14492. * There was an error acquiring video from the video input device.
  14493. * </li>
  14494. * </ul>
  14495. * </p>
  14496. *
  14497. * @method #cycleVideo
  14498. * @memberOf Publisher
  14499. *
  14500. * @return {Promise} A promise that resolves when the operation completes
  14501. * successfully. The promise resolves with an object that has a
  14502. * <code>deviceId</code> property set to the device ID of the camera used:
  14503. *
  14504. * <pre>
  14505. * publisher.cycleVideo().then(console.log);
  14506. * // Output: {deviceId: "967a86e52..."}
  14507. * </pre>
  14508. *
  14509. * If there is an error, the promise is rejected.
  14510. */
  14511. this.cycleVideo = blockCallsUntilComplete( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
  14512. var oldTrack, vidDevices, hasOtherVideoDevices, newVideoDevice, deviceId, newTrack;
  14513. return _regenerator.default.wrap(function _callee5$(_context5) {
  14514. while (1) switch (_context5.prev = _context5.next) {
  14515. case 0:
  14516. if (!(OTHelpers.env.isLegacyEdge || !windowMock.RTCRtpSender || typeof windowMock.RTCRtpSender.prototype.replaceTrack !== 'function')) {
  14517. _context5.next = 2;
  14518. break;
  14519. }
  14520. throw otError(Errors.UNSUPPORTED_BROWSER, new Error('Publisher#cycleVideo is not supported in your browser.'), ExceptionCodes.UNABLE_TO_PUBLISH);
  14521. case 2:
  14522. if (!(isCustomVideoTrack || isScreenSharing)) {
  14523. _context5.next = 4;
  14524. break;
  14525. }
  14526. throw otError(Errors.NOT_SUPPORTED, new Error('Publisher#cycleVideo: The publisher is not using a camera video source'));
  14527. case 4:
  14528. oldTrack = getCurrentTrack();
  14529. if (oldTrack) {
  14530. _context5.next = 7;
  14531. break;
  14532. }
  14533. throw otError(Errors.NOT_SUPPORTED, new Error('Publisher#cycleVideo cannot cycleVideo when you have no video source.'));
  14534. case 7:
  14535. videoIndex += 1;
  14536. _context5.next = 10;
  14537. return getVideoDevices();
  14538. case 10:
  14539. vidDevices = _context5.sent;
  14540. // different devices return the cameras in different orders
  14541. hasOtherVideoDevices = vidDevices.filter(device => device.label !== oldTrack.label).length > 0;
  14542. if (hasOtherVideoDevices) {
  14543. while (vidDevices[videoIndex % vidDevices.length].label === oldTrack.label) {
  14544. videoIndex += 1;
  14545. }
  14546. }
  14547. if (OTHelpers.env.name === 'Chrome' && OTHelpers.env.userAgent.toLowerCase().indexOf('android') > -1) {
  14548. // On Chrome on Android you need to stop the previous video track OPENTOK-37206
  14549. if (oldTrack && oldTrack.stop) {
  14550. oldTrack.stop();
  14551. }
  14552. }
  14553. privateEvents.emit('streamDestroy');
  14554. newVideoDevice = vidDevices[videoIndex % vidDevices.length];
  14555. deviceId = newVideoDevice.deviceId; // ToggleVideo needs to be able to track the deviceId
  14556. currentDeviceId = deviceId; // we don't want to restart the camera if !publishVideo
  14557. if (properties.publishVideo) {
  14558. _context5.next = 20;
  14559. break;
  14560. }
  14561. return _context5.abrupt("return", {
  14562. deviceId
  14563. });
  14564. case 20:
  14565. _context5.next = 22;
  14566. return getTrackFromDeviceId(deviceId);
  14567. case 22:
  14568. newTrack = _context5.sent;
  14569. _context5.next = 25;
  14570. return replaceTrackAndUpdate(oldTrack, newTrack);
  14571. case 25:
  14572. isTrackManuallyStopped = false;
  14573. return _context5.abrupt("return", {
  14574. deviceId
  14575. });
  14576. case 27:
  14577. case "end":
  14578. return _context5.stop();
  14579. }
  14580. }, _callee5);
  14581. })));
  14582. }
  14583. const replaceTrackAndUpdate = /*#__PURE__*/function () {
  14584. var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(oldTrack, newTrack) {
  14585. var pcs, video;
  14586. return _regenerator.default.wrap(function _callee6$(_context6) {
  14587. while (1) switch (_context6.prev = _context6.next) {
  14588. case 0:
  14589. _context6.next = 2;
  14590. return getAllPeerConnections();
  14591. case 2:
  14592. pcs = _context6.sent;
  14593. _context6.next = 5;
  14594. return Promise.all(pcs.map(pc => pc.findAndReplaceTrack(oldTrack, newTrack)));
  14595. case 5:
  14596. webRTCStream.addTrack(newTrack);
  14597. webRTCStream.removeTrack(oldTrack);
  14598. if (oldTrack && oldTrack.stop) {
  14599. oldTrack.stop();
  14600. }
  14601. if (OTHelpers.env.name === 'Firefox' || OTHelpers.env.name === 'Safari') {
  14602. // Local video freezes on old stream without this for some reason
  14603. _this.videoElement().srcObject = null;
  14604. _this.videoElement().srcObject = webRTCStream;
  14605. }
  14606. video = widgetView && widgetView.video();
  14607. if (video) {
  14608. video.refreshTracks();
  14609. }
  14610. privateEvents.emit('streamChange');
  14611. updateVideo();
  14612. case 13:
  14613. case "end":
  14614. return _context6.stop();
  14615. }
  14616. }, _callee6);
  14617. }));
  14618. return function replaceTrackAndUpdate(_x4, _x5) {
  14619. return _ref15.apply(this, arguments);
  14620. };
  14621. }();
  14622. const getTrackFromDeviceId = /*#__PURE__*/function () {
  14623. var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(deviceId) {
  14624. var newOptions, _processedOptions2, getUserMediaHelper, newVideoStream;
  14625. return _regenerator.default.wrap(function _callee7$(_context7) {
  14626. while (1) switch (_context7.prev = _context7.next) {
  14627. case 0:
  14628. newOptions = cloneDeep(options);
  14629. newOptions.audioSource = null;
  14630. newOptions.videoSource = deviceId;
  14631. processedOptions = processPubOptions(newOptions, 'OT.Publisher.getTrackFromDeviceId', () => state && state.isDestroyed());
  14632. processedOptions.on({
  14633. accessDialogOpened: onAccessDialogOpened,
  14634. accessDialogClosed: onAccessDialogClosed
  14635. });
  14636. _processedOptions2 = processedOptions, getUserMediaHelper = _processedOptions2.getUserMedia;
  14637. _context7.next = 8;
  14638. return getUserMediaHelper().catch(userMediaError);
  14639. case 8:
  14640. newVideoStream = _context7.sent;
  14641. return _context7.abrupt("return", newVideoStream.getVideoTracks()[0]);
  14642. case 10:
  14643. case "end":
  14644. return _context7.stop();
  14645. }
  14646. }, _callee7);
  14647. }));
  14648. return function getTrackFromDeviceId(_x6) {
  14649. return _ref16.apply(this, arguments);
  14650. };
  14651. }();
  14652. const getCurrentTrack = () => {
  14653. const _webRTCStream$getVide = webRTCStream.getVideoTracks(),
  14654. currentTrack = _webRTCStream$getVide[0];
  14655. return currentTrack;
  14656. };
  14657. const getVideoDevices = /*#__PURE__*/function () {
  14658. var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  14659. var devices, vidDevices;
  14660. return _regenerator.default.wrap(function _callee8$(_context8) {
  14661. while (1) switch (_context8.prev = _context8.next) {
  14662. case 0:
  14663. _context8.next = 2;
  14664. return deviceHelpers.shouldAskForDevices();
  14665. case 2:
  14666. devices = _context8.sent;
  14667. vidDevices = devices.videoDevices;
  14668. if (!(!devices.video || !vidDevices || !vidDevices.length)) {
  14669. _context8.next = 6;
  14670. break;
  14671. }
  14672. throw otError(Errors.NO_DEVICES_FOUND, new Error('No video devices available'), ExceptionCodes.UNABLE_TO_PUBLISH);
  14673. case 6:
  14674. return _context8.abrupt("return", vidDevices);
  14675. case 7:
  14676. case "end":
  14677. return _context8.stop();
  14678. }
  14679. }, _callee8);
  14680. }));
  14681. return function getVideoDevices() {
  14682. return _ref17.apply(this, arguments);
  14683. };
  14684. }();
  14685. const replaceAudioTrack = (oldTrack, newTrack) => {
  14686. if (newTrack) {
  14687. webRTCStream.addTrack(newTrack);
  14688. }
  14689. if (oldTrack) {
  14690. webRTCStream.removeTrack(oldTrack);
  14691. }
  14692. const video = widgetView && widgetView.video();
  14693. if (video) {
  14694. video.refreshTracks();
  14695. }
  14696. if (chromeMixin) {
  14697. if (newTrack && !oldTrack) {
  14698. chromeMixin.addAudioTrack();
  14699. }
  14700. if (oldTrack && !newTrack) {
  14701. chromeMixin.removeAudioTrack();
  14702. }
  14703. }
  14704. if (oldTrack && oldTrack.stop) {
  14705. oldTrack.stop();
  14706. }
  14707. if (newTrack) {
  14708. // Turn the audio back on if the audio track stopped because it was disconnected
  14709. updateAudio();
  14710. microphone = new Microphone(webRTCStream, !properties.publishAudio);
  14711. }
  14712. privateEvents.emit('streamChange');
  14713. refreshAudioVideoUI();
  14714. };
  14715. /**
  14716. * Switches the audio input source used by the publisher. You can set the
  14717. * <code>audioSource</code> to a device ID (string) or audio MediaStreamTrack object.
  14718. * <p>
  14719. * This will result in an error (the Promise returned by the method is rejected) in the
  14720. * following conditions:
  14721. * <ul>
  14722. * <li>
  14723. * The browser does not support this method. This method is not supported in
  14724. * Internet Explorer or non-Chromium versions of Edge (older than version 79).
  14725. * </li>
  14726. * <li>
  14727. * The publisher was not initiated with an audio source. (The <code>audioSource</code>
  14728. * option of the <a href="OT.html#initPublisher">OT.initPublisher()</a> method was
  14729. * set to <code>null</code> or <code>false</code>).
  14730. * </li>
  14731. * <li>
  14732. * The user denied access to the audio input device.
  14733. * </li>
  14734. * <li>
  14735. * There was an error acquiring audio from the audio input device or MediaStreamTrack
  14736. * object.
  14737. * </li>
  14738. * <li>
  14739. * The <code>audioSource</code> value is not a string or MediaStreamTrack object.
  14740. * </li>
  14741. * <li>
  14742. * The <code>audioSource</code> string is not a valid audio input device available
  14743. * to the browser.
  14744. * </li>
  14745. * </ul>
  14746. * </p>
  14747. *
  14748. * @param {Object} audioSource The device ID (string) of an audio input device, or an audio
  14749. * MediaStreamTrack object.
  14750. *
  14751. * @method #setAudioSource
  14752. * @memberOf Publisher
  14753. *
  14754. * @see <a href="#getAudioSource">Publisher.getAudioSource()</a>
  14755. *
  14756. * @return {Promise} A promise that resolves when the operation completes successfully.
  14757. * If there is an error, the promise is rejected.
  14758. */
  14759. let cancelPreviousSetAudioSourceSentinel;
  14760. const setAudioSource = /*#__PURE__*/function () {
  14761. var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(audioSource) {
  14762. var CANCEL_ERR_MSG, currentCancelSentinel, setStreamIfNotCancelled, prevAudioSource, pcs, newOptions, prevLabel, prevDeviceId, _processedOptions3, getUserMediaHelper, prevOptions, previousDevice, stream;
  14763. return _regenerator.default.wrap(function _callee9$(_context9) {
  14764. while (1) switch (_context9.prev = _context9.next) {
  14765. case 0:
  14766. CANCEL_ERR_MSG = 'Operation did not succeed due to a new request.';
  14767. if (cancelPreviousSetAudioSourceSentinel) {
  14768. cancelPreviousSetAudioSourceSentinel.cancel();
  14769. }
  14770. cancelPreviousSetAudioSourceSentinel = new Cancellation();
  14771. currentCancelSentinel = cancelPreviousSetAudioSourceSentinel;
  14772. setStreamIfNotCancelled = stream => {
  14773. if (currentCancelSentinel.isCanceled()) {
  14774. stream.getTracks(track => track.stop());
  14775. throw otError(Errors.CANCEL, new Error(CANCEL_ERR_MSG));
  14776. }
  14777. return setAudioSource(stream.getAudioTracks()[0]);
  14778. };
  14779. if (!(OTHelpers.env.isLegacyEdge || !windowMock.RTCRtpSender || typeof windowMock.RTCRtpSender.prototype.replaceTrack !== 'function')) {
  14780. _context9.next = 7;
  14781. break;
  14782. }
  14783. throw otError(Errors.UNSUPPORTED_BROWSER, new Error('Publisher#setAudioSource is not supported in your browser.'));
  14784. case 7:
  14785. prevAudioSource = _this.getAudioSource();
  14786. if (prevAudioSource) {
  14787. _context9.next = 10;
  14788. break;
  14789. }
  14790. throw otError(Errors.NOT_SUPPORTED, new Error('Publisher#setAudioSource cannot add an audio source when you started without one.'));
  14791. case 10:
  14792. if (!(audioSource instanceof MediaStreamTrack)) {
  14793. _context9.next = 21;
  14794. break;
  14795. }
  14796. _context9.next = 13;
  14797. return getAllPeerConnections();
  14798. case 13:
  14799. pcs = _context9.sent;
  14800. if (!currentCancelSentinel.isCanceled()) {
  14801. _context9.next = 16;
  14802. break;
  14803. }
  14804. throw otError(Errors.CANCEL, new Error(CANCEL_ERR_MSG));
  14805. case 16:
  14806. _context9.next = 18;
  14807. return Promise.all(pcs.map(pc => pc.findAndReplaceTrack(prevAudioSource, audioSource)));
  14808. case 18:
  14809. return _context9.abrupt("return", replaceAudioTrack(prevAudioSource, audioSource));
  14810. case 21:
  14811. if (!(typeof audioSource === 'string')) {
  14812. _context9.next = 68;
  14813. break;
  14814. }
  14815. // Must be a deviceId, call getUserMedia and get the MediaStreamTrack
  14816. newOptions = cloneDeep(options);
  14817. newOptions.audioSource = audioSource;
  14818. newOptions.videoSource = null;
  14819. processedOptions = processPubOptions(newOptions, 'OT.Publisher.setAudioSource', () => currentCancelSentinel.isCanceled() || state && state.isDestroyed());
  14820. processedOptions.on({
  14821. accessDialogOpened: onAccessDialogOpened,
  14822. accessDialogClosed: onAccessDialogClosed
  14823. });
  14824. prevLabel = prevAudioSource.label;
  14825. prevDeviceId = prevAudioSource.getConstraints && prevAudioSource.getSettings().deviceId || undefined; // In firefox we have to stop the previous track before we get a new one
  14826. if (prevAudioSource) {
  14827. prevAudioSource.stop();
  14828. }
  14829. _processedOptions3 = processedOptions, getUserMediaHelper = _processedOptions3.getUserMedia;
  14830. _context9.prev = 31;
  14831. _context9.t0 = setStreamIfNotCancelled;
  14832. _context9.next = 35;
  14833. return getUserMediaHelper();
  14834. case 35:
  14835. _context9.t1 = _context9.sent;
  14836. _context9.next = 38;
  14837. return (0, _context9.t0)(_context9.t1);
  14838. case 38:
  14839. return _context9.abrupt("return", _context9.sent);
  14840. case 41:
  14841. _context9.prev = 41;
  14842. _context9.t2 = _context9["catch"](31);
  14843. if (!currentCancelSentinel.isCanceled()) {
  14844. _context9.next = 45;
  14845. break;
  14846. }
  14847. throw otError(Errors.CANCEL, new Error(CANCEL_ERR_MSG));
  14848. case 45:
  14849. prevOptions = cloneDeep(options);
  14850. prevOptions.videoSource = null;
  14851. prevOptions.audioSource = prevDeviceId;
  14852. if (!(!prevOptions.audioSource && prevLabel)) {
  14853. _context9.next = 55;
  14854. break;
  14855. }
  14856. _context9.next = 51;
  14857. return getMediaDevices();
  14858. case 51:
  14859. previousDevice = _context9.sent.filter(x => x.label === prevLabel)[0];
  14860. if (!currentCancelSentinel.isCanceled()) {
  14861. _context9.next = 54;
  14862. break;
  14863. }
  14864. throw otError(Errors.CANCEL, new Error(CANCEL_ERR_MSG));
  14865. case 54:
  14866. if (previousDevice) {
  14867. prevOptions.audioSource = previousDevice.deviceId;
  14868. }
  14869. case 55:
  14870. if (prevOptions.audioSource) {
  14871. _context9.next = 58;
  14872. break;
  14873. }
  14874. _context9.t2.message += ' (could not determine previous audio device)';
  14875. throw otError(Errors.NOT_FOUND, _context9.t2);
  14876. case 58:
  14877. processedOptions = processPubOptions(prevOptions, 'OT.Publisher.setAudioSource', () => currentCancelSentinel.isCanceled() || state && state.isDestroyed());
  14878. _context9.next = 61;
  14879. return processedOptions.getUserMedia().catch(error => {
  14880. // eslint-disable-next-line no-param-reassign
  14881. error.message += ' (could not obtain previous audio device)';
  14882. throw error;
  14883. });
  14884. case 61:
  14885. stream = _context9.sent;
  14886. _context9.next = 64;
  14887. return setStreamIfNotCancelled(stream);
  14888. case 64:
  14889. _context9.t2.message += ' (reverted to previous audio device)';
  14890. throw _context9.t2;
  14891. case 66:
  14892. _context9.next = 69;
  14893. break;
  14894. case 68:
  14895. throw otError(Errors.INVALID_PARAMETER, new Error('Invalid parameter passed to OT.Publisher.setAudioSource(). Expected string or MediaStreamTrack.'));
  14896. case 69:
  14897. case "end":
  14898. return _context9.stop();
  14899. }
  14900. }, _callee9, null, [[31, 41]]);
  14901. }));
  14902. return function setAudioSource(_x7) {
  14903. return _ref18.apply(this, arguments);
  14904. };
  14905. }();
  14906. this.setAudioSource = setAudioSource;
  14907. /**
  14908. * Returns the MediaStreamTrack object used as the audio input source for the publisher.
  14909. * If the publisher does not have an audio source, this method returns null.
  14910. *
  14911. * @method #getAudioSource
  14912. * @memberOf Publisher
  14913. * @see <a href="#setAudioSource">Publisher.setAudioSource()</a>
  14914. *
  14915. * @return {MediaStreamTrak} The audio source for the publisher (or null, if there is none).
  14916. */
  14917. this.getAudioSource = () => {
  14918. if (webRTCStream && webRTCStream.getAudioTracks().length > 0) {
  14919. return webRTCStream.getAudioTracks()[0];
  14920. }
  14921. return null;
  14922. }; // API Compatibility layer for Flash Publisher, this could do with some tidyup.
  14923. this._ = {
  14924. publishToSession: (session, analyticsReplacement) => {
  14925. if (analyticsReplacement) {
  14926. analytics = analyticsReplacement;
  14927. } // Add session property to Publisher
  14928. previousSession = session;
  14929. this.session = session;
  14930. const requestedStreamId = uuid();
  14931. lastRequestedStreamId = requestedStreamId;
  14932. this.streamId = requestedStreamId;
  14933. logConnectivityEvent('Attempt', {
  14934. dataChannels: properties.channels,
  14935. properties: whitelistPublisherProperties(properties)
  14936. });
  14937. const loadedPromise = new Promise((resolve, reject) => {
  14938. if (loaded) {
  14939. resolve();
  14940. return;
  14941. }
  14942. this.once('initSuccess', resolve);
  14943. this.once('destroyed', (_ref19) => {
  14944. let reason = _ref19.reason;
  14945. let reasonDescription = '';
  14946. if (reason) {
  14947. reasonDescription = " Reason: " + reason;
  14948. }
  14949. reject(new Error("Publisher destroyed before it finished loading." + reasonDescription));
  14950. });
  14951. });
  14952. logging.debug('publishToSession: waiting for publishComplete, which is triggered by ' + 'stream#created from rumor');
  14953. const completedPromise = new Promise((resolve, reject) => {
  14954. this.once('publishComplete', error => {
  14955. if (error) {
  14956. reject(error);
  14957. return;
  14958. }
  14959. logging.debug('publishToSession: got publishComplete');
  14960. resolve();
  14961. });
  14962. });
  14963. const processMessagingError = error => {
  14964. // @todo Can we provide more specific errors for these codes? Are these still the only
  14965. // codes that we expect?
  14966. const expectedErrorCodes = [403, 404, 409];
  14967. const publicError = expectedErrorCodes.indexOf(error.code) > -1 ? otError(Errors.STREAM_CREATE_FAILED, new Error("Failed to create stream in server model: " + error.message), ExceptionCodes.UNABLE_TO_PUBLISH) : otError(Errors.UNEXPECTED_SERVER_RESPONSE, new Error("Unexpected server response: " + error.message), ExceptionCodes.UNEXPECTED_SERVER_RESPONSE);
  14968. logConnectivityEvent('Failure', {}, {
  14969. failureReason: 'Publish',
  14970. failureCode: publicError.code,
  14971. failureMessage: publicError.message
  14972. });
  14973. if (state.isAttemptingToPublish()) {
  14974. this.trigger('publishComplete', publicError);
  14975. }
  14976. OTErrorClass.handleJsException({
  14977. errorMsg: error.message,
  14978. code: publicError.code,
  14979. target: this,
  14980. error,
  14981. analytics
  14982. });
  14983. throw publicError;
  14984. };
  14985. logging.debug('publishToSession: waiting for loaded');
  14986. const streamCreatedPromise = loadedPromise.then(() => session._.getVideoCodecsCompatible(webRTCStream)).then(videoCodecsCompatible => {
  14987. logging.debug('publishToSession: loaded'); // Bail if this.session is gone, it means we were unpublished
  14988. // before createStream could finish.
  14989. if (!this.session) {
  14990. return undefined;
  14991. } // make sure we trigger an error if we are not getting any "ack" after a reasonable
  14992. // amount of time
  14993. const publishGuardingTo = setTimeout(() => {
  14994. onPublishingTimeout(session);
  14995. }, PUBLISH_MAX_DELAY);
  14996. this.once('publishComplete', () => {
  14997. clearTimeout(publishGuardingTo);
  14998. });
  14999. state.set('PublishingToSession');
  15000. const streamChannels = [];
  15001. const video = videoCodecsCompatible && widgetView && widgetView.video();
  15002. const hasVideoTrack = webRTCStream.getVideoTracks().length > 0;
  15003. const didRequestVideo = properties.videoSource !== null && properties.videoSource !== false;
  15004. if (video && hasVideoTrack && didRequestVideo) {
  15005. streamChannels.push(new StreamChannel({
  15006. id: 'video1',
  15007. type: 'video',
  15008. active: properties.publishVideo,
  15009. orientation: VideoOrientation.ROTATED_NORMAL,
  15010. frameRate: properties.frameRate,
  15011. width: video.videoWidth(),
  15012. height: video.videoHeight(),
  15013. source: (() => {
  15014. if (isScreenSharing) {
  15015. return 'screen';
  15016. }
  15017. if (isCustomVideoTrack) {
  15018. return 'custom';
  15019. }
  15020. return 'camera';
  15021. })(),
  15022. fitMode: properties.fitMode
  15023. }));
  15024. }
  15025. const hasAudioTrack = webRTCStream.getAudioTracks().length > 0;
  15026. const didRequestAudio = properties.audioSource !== null && properties.audioSource !== false; // @todo should we just use hasAudioTrack here? if hasAudioTrack is true
  15027. // then does it matter if didRequestAudio is false? we still have an audio
  15028. // track for some reason!
  15029. if (didRequestAudio && hasAudioTrack) {
  15030. streamChannels.push(new StreamChannel({
  15031. id: 'audio1',
  15032. type: 'audio',
  15033. active: properties.publishAudio
  15034. }));
  15035. }
  15036. logging.debug('publishToSession: creating rumor stream id');
  15037. return new Promise((resolve, reject) => {
  15038. session._.streamCreate(properties.name || '', requestedStreamId, properties.audioFallbackEnabled, streamChannels, properties.minVideoBitrate, (messagingError, streamId, message) => {
  15039. if (messagingError) {
  15040. reject(processMessagingError(messagingError));
  15041. return;
  15042. }
  15043. resolve({
  15044. streamId,
  15045. message
  15046. });
  15047. });
  15048. });
  15049. }).then(maybeStream => {
  15050. if (maybeStream === undefined) {
  15051. return;
  15052. }
  15053. const streamId = maybeStream.streamId,
  15054. message = maybeStream.message;
  15055. logging.debug('publishToSession: rumor stream id created:', streamId, '(this is different from stream#created, which requires media to actually be ' + 'flowing for mantis sessions)');
  15056. if (streamId !== requestedStreamId) {
  15057. throw new Error('streamId response does not match request');
  15058. }
  15059. this.streamId = streamId;
  15060. rumorIceServers = parseIceServers(message);
  15061. }).catch(err => {
  15062. this.trigger('publishComplete', err);
  15063. throw err;
  15064. });
  15065. return Promise.all([streamCreatedPromise, completedPromise]);
  15066. },
  15067. unpublishFromSession: (session, reason) => {
  15068. if (!this.session || session.id !== this.session.id) {
  15069. if (reason === 'unpublished') {
  15070. const selfSessionText = this.session && this.session.id || 'no session';
  15071. logging.warn("The publisher " + guid + " is trying to unpublish from a session " + session.id + " it is not " + ("attached to (it is attached to " + selfSessionText + ")"));
  15072. }
  15073. return this;
  15074. }
  15075. if (session.isConnected() && (this.stream || state.isAttemptingToPublish())) {
  15076. session._.streamDestroy(this.streamId);
  15077. }
  15078. streamCleanupJobs.releaseAll(); // Disconnect immediately, rather than wait for the WebSocket to
  15079. // reply to our destroyStream message.
  15080. this.disconnect();
  15081. if (state.isAttemptingToPublish()) {
  15082. logConnectivityEvent('Cancel', {
  15083. reason: 'unpublish'
  15084. });
  15085. const createErrorFromReason = () => {
  15086. switch (reason) {
  15087. case 'mediaStopped':
  15088. return 'The video element fired the ended event, indicating there is an issue with the media';
  15089. case 'unpublished':
  15090. return 'The publisher was unpublished before it could be published';
  15091. case 'reset':
  15092. return 'The publisher was reset';
  15093. default:
  15094. return "The publisher was destroyed due to " + reason;
  15095. }
  15096. };
  15097. const err = new Error(createErrorFromReason());
  15098. this.trigger('publishComplete', otError(reason === 'mediaStopped' ? Errors.MEDIA_ENDED : Errors.CANCEL, err));
  15099. }
  15100. this.session = null;
  15101. logAnalyticsEvent('unpublish', 'Success');
  15102. this._.streamDestroyed(reason);
  15103. return this;
  15104. },
  15105. unpublishStreamFromSession: (stream, session, reason) => {
  15106. if (!lastRequestedStreamId || stream.id !== lastRequestedStreamId) {
  15107. logging.warn("The publisher " + guid + " is trying to destroy a stream " + stream.id + " that is not attached to it (it has " + (lastRequestedStreamId || 'no stream') + " attached to it)");
  15108. return this;
  15109. }
  15110. return this._.unpublishFromSession(session, reason);
  15111. },
  15112. streamDestroyed: reason => {
  15113. if (['reset'].indexOf(reason) < 0) {
  15114. // We're back to being a stand-alone publisher again.
  15115. if (!state.isDestroyed()) {
  15116. state.set('MediaBound');
  15117. }
  15118. }
  15119. const event = new Events.StreamEvent('streamDestroyed', this.stream, reason, true);
  15120. this.dispatchEvent(event);
  15121. if (!event.isDefaultPrevented()) {
  15122. this.destroy();
  15123. }
  15124. },
  15125. archivingStatus(status) {
  15126. if (chromeMixin) {
  15127. chromeMixin.setArchivingStatus(status);
  15128. }
  15129. return status;
  15130. },
  15131. webRtcStream() {
  15132. return webRTCStream;
  15133. },
  15134. switchTracks() {
  15135. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
  15136. var stream;
  15137. return _regenerator.default.wrap(function _callee10$(_context10) {
  15138. while (1) switch (_context10.prev = _context10.next) {
  15139. case 0:
  15140. _context10.prev = 0;
  15141. _context10.next = 3;
  15142. return getUserMedia().catch(userMediaError);
  15143. case 3:
  15144. stream = _context10.sent;
  15145. _context10.next = 10;
  15146. break;
  15147. case 6:
  15148. _context10.prev = 6;
  15149. _context10.t0 = _context10["catch"](0);
  15150. logging.error("OT.Publisher.switchTracks failed to getUserMedia: " + _context10.t0);
  15151. throw _context10.t0;
  15152. case 10:
  15153. setNewStream(stream);
  15154. _context10.prev = 11;
  15155. bindVideo();
  15156. _context10.next = 21;
  15157. break;
  15158. case 15:
  15159. _context10.prev = 15;
  15160. _context10.t1 = _context10["catch"](11);
  15161. if (!(_context10.t1 instanceof CancellationError)) {
  15162. _context10.next = 19;
  15163. break;
  15164. }
  15165. return _context10.abrupt("return");
  15166. case 19:
  15167. logging.error('Error while binding video', _context10.t1);
  15168. throw _context10.t1;
  15169. case 21:
  15170. _context10.prev = 21;
  15171. replaceTracks();
  15172. _context10.next = 29;
  15173. break;
  15174. case 25:
  15175. _context10.prev = 25;
  15176. _context10.t2 = _context10["catch"](21);
  15177. logging.error('Error replacing tracks', _context10.t2);
  15178. throw _context10.t2;
  15179. case 29:
  15180. case "end":
  15181. return _context10.stop();
  15182. }
  15183. }, _callee10, null, [[0, 6], [11, 15], [21, 25]]);
  15184. }))();
  15185. },
  15186. getDataChannel(label, getOptions, completion) {
  15187. const pc = getPeerConnectionById(Object.keys(peerConnectionsAsync)[0]); // @fixme this will fail if it's called before we have a PublisherPeerConnection.
  15188. // I.e. before we have a subscriber.
  15189. if (!pc) {
  15190. completion(new OTHelpers.Error('Cannot create a DataChannel before there is a subscriber.'));
  15191. return;
  15192. }
  15193. pc.then(peerConnection => {
  15194. peerConnection.getDataChannel(label, getOptions, completion);
  15195. });
  15196. },
  15197. iceRestart() {
  15198. getAllPeerConnections().then(peerConnections => {
  15199. peerConnections.forEach(peerConnection => {
  15200. const _getPeerConnectionMet6 = getPeerConnectionMeta(peerConnection),
  15201. remoteConnectionId = _getPeerConnectionMet6.remoteConnectionId;
  15202. logRepublish('Attempt', {
  15203. remoteConnectionId
  15204. });
  15205. logging.debug('Publisher: ice restart attempt');
  15206. peerConnection.iceRestart();
  15207. });
  15208. });
  15209. },
  15210. getState() {
  15211. return state;
  15212. },
  15213. demoOnlyCycleVideo: this.cycleVideo,
  15214. testOnlyGetFramesEncoded() {
  15215. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
  15216. var peerConnections;
  15217. return _regenerator.default.wrap(function _callee11$(_context11) {
  15218. while (1) switch (_context11.prev = _context11.next) {
  15219. case 0:
  15220. _context11.next = 2;
  15221. return getAllPeerConnections();
  15222. case 2:
  15223. peerConnections = _context11.sent;
  15224. if (peerConnections.length) {
  15225. _context11.next = 5;
  15226. break;
  15227. }
  15228. throw new Error('No established PeerConnections yet');
  15229. case 5:
  15230. return _context11.abrupt("return", peerConnections[0]._testOnlyGetFramesEncoded());
  15231. case 6:
  15232. case "end":
  15233. return _context11.stop();
  15234. }
  15235. }, _callee11);
  15236. }))();
  15237. },
  15238. onStreamAvailable
  15239. };
  15240. this.detectDevices = function () {
  15241. logging.warn('Publisher.detectDevices() is not implemented.');
  15242. };
  15243. this.detectMicActivity = function () {
  15244. logging.warn('Publisher.detectMicActivity() is not implemented.');
  15245. };
  15246. this.getEchoCancellationMode = function () {
  15247. logging.warn('Publisher.getEchoCancellationMode() is not implemented.');
  15248. return 'fullDuplex';
  15249. };
  15250. this.setMicrophoneGain = function () {
  15251. logging.warn('Publisher.setMicrophoneGain() is not implemented.');
  15252. };
  15253. this.getMicrophoneGain = function () {
  15254. logging.warn('Publisher.getMicrophoneGain() is not implemented.');
  15255. return 0.5;
  15256. };
  15257. this.setCamera = function () {
  15258. logging.warn('Publisher.setCamera() is not implemented.');
  15259. };
  15260. this.setMicrophone = function () {
  15261. logging.warn('Publisher.setMicrophone() is not implemented.');
  15262. }; // Platform methods:
  15263. this.guid = function () {
  15264. return guid;
  15265. };
  15266. this.videoElement = function () {
  15267. const video = widgetView && widgetView.video();
  15268. return video ? video.domElement() : null;
  15269. };
  15270. this.setStream = assignStream;
  15271. this.isWebRTC = true;
  15272. this.isLoading = function () {
  15273. return widgetView && widgetView.loading();
  15274. };
  15275. /**
  15276. * Returns the width, in pixels, of the Publisher video. This may differ from the
  15277. * <code>resolution</code> property passed in as the <code>properties</code> property
  15278. * the options passed into the <code>OT.initPublisher()</code> method, if the browser
  15279. * does not support the requested resolution.
  15280. *
  15281. * @method #videoWidth
  15282. * @memberOf Publisher
  15283. * @return {Number} the width, in pixels, of the Publisher video.
  15284. */
  15285. this.videoWidth = function () {
  15286. const video = widgetView && widgetView.video();
  15287. return video ? video.videoWidth() : undefined;
  15288. };
  15289. /**
  15290. * Returns the height, in pixels, of the Publisher video. This may differ from the
  15291. * <code>resolution</code> property passed in as the <code>properties</code> property
  15292. * the options passed into the <code>OT.initPublisher()</code> method, if the browser
  15293. * does not support the requested resolution.
  15294. *
  15295. * @method #videoHeight
  15296. * @memberOf Publisher
  15297. * @return {Number} the height, in pixels, of the Publisher video.
  15298. */
  15299. this.videoHeight = function () {
  15300. const video = widgetView && widgetView.video();
  15301. return video ? video.videoHeight() : undefined;
  15302. };
  15303. /**
  15304. * Returns the details on the publisher's stream quality, including the following:
  15305. *
  15306. * <ul>
  15307. *
  15308. * <li>The total number of audio and video packets lost</li>
  15309. * <li>The total number of audio and video packets sent</li>
  15310. * <li>The total number of audio and video bytes sent</li>
  15311. * <li>The current video frame rate</li>
  15312. *
  15313. * </ul>
  15314. *
  15315. * You can use these stats to assess the quality of the publisher's audio-video stream.
  15316. *
  15317. * @param {Function} completionHandler A function that takes the following
  15318. * parameters:
  15319. *
  15320. * <ul>
  15321. *
  15322. * <li><code>error</code> (<a href="Error.html">Error</a>) &mdash; Upon successful completion
  15323. * the method, this is undefined. An error results if the publisher is not connected to a
  15324. * session or if it is not publishing audio or video.</li>
  15325. *
  15326. * <li><code>statsArray</code> (Array) &mdash; An array of objects defining the current
  15327. * audio-video statistics for the publisher. For a publisher in a routed session (one that
  15328. * uses the <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">OpenTok
  15329. * Media Router</a>), this array includes one object, defining the statistics for the single
  15330. * audio-media stream that is sent to the OpenTok Media Router. In a relayed session, the
  15331. * array includes an object for each subscriber to the published stream. Each object in the
  15332. * array contains a <code>stats</code> property that includes the following properties:
  15333. *
  15334. * <p>
  15335. * <ul>
  15336. * <li><code>audio.bytesSent</code> (Number) &mdash; The total number of audio bytes
  15337. * sent to the subscriber (or to the OpenTok Media Router)</li>
  15338. *
  15339. * <li><code>audio.packetsLost</code> (Number) &mdash; The total number audio packets
  15340. * that did not reach the subscriber (or to the OpenTok Media Router)</li>
  15341. *
  15342. * <li><code>audio.packetsSent</code> (Number) &mdash; The total number of audio
  15343. * packets sent to the subscriber (or to the OpenTok Media Router)</li>
  15344. *
  15345. * <li><code>timestamp</code> (Number) &mdash; The timestamp, in milliseconds since
  15346. * the Unix epoch, for when these stats were gathered</li>
  15347. *
  15348. * <li><code>video.bytesSent</code> (Number) &mdash; The total video bytes sent to
  15349. * the subscriber (or to the OpenTok Media Router)</li>
  15350. *
  15351. * <li><code>video.packetsLost</code> (Number) &mdash; The total number of video packets
  15352. * that did not reach the subscriber (or to the OpenTok Media Router)</li>
  15353. *
  15354. * <li><code>video.packetsSent</code> (Number) &mdash; The total number of video
  15355. * packets sent to the subscriber</li>
  15356. *
  15357. * <li><code>video.frameRate</code> (Number) &mdash; The current video frame rate</li>
  15358. * </ul>
  15359. *
  15360. * <p>Additionally, for a publisher in a relayed session, each object in the array contains
  15361. * the following two properties:
  15362. *
  15363. * <ul>
  15364. * <li><code>connectionId</code> (String) &mdash; The unique ID of the client's
  15365. * connection, which matches the <code>id</code> property of the <code>connection</code>
  15366. * property of the <a href="Session.html##.event:connectionCreated">connectionCreated</a>
  15367. * event that the Session object dispatched for the remote client.</li>
  15368. *
  15369. * <li><code>subscriberId</code> (String) &mdash; The unique ID of the subscriber, which
  15370. * matches the <code>id</code> property of the Subscriber object in the subscribing
  15371. * client's app.</li>
  15372. * </ul>
  15373. *
  15374. * <p>These two properties are undefined for a publisher in a routed session.
  15375. *
  15376. * </li>
  15377. * </ul>
  15378. *
  15379. * @see <a href="Subscriber.html#getStats">Subscriber.getStats()</a>
  15380. *
  15381. * @method #getStats
  15382. * @memberOf Publisher
  15383. */
  15384. this.getStats = function getStats(callback) {
  15385. notifyGetStatsCalled();
  15386. getAllPeerConnections().then(peerConnections => Promise.all(peerConnections.map(peerConnection => promisify(peerConnection.getStats.bind(peerConnection))().then(stats => ({
  15387. pc: peerConnection,
  15388. stats
  15389. }))))).then(pcsAndStats => {
  15390. // @todo this publishStartTime is going to be so wrong in P2P
  15391. const startTimestamp = publishStartTime ? publishStartTime.getTime() : Date.now();
  15392. const ret = pcsAndStats.map((_ref20) => {
  15393. let pc = _ref20.pc,
  15394. stats = _ref20.stats;
  15395. const _getPeerConnectionMet7 = getPeerConnectionMeta(pc),
  15396. remoteConnectionId = _getPeerConnectionMet7.remoteConnectionId,
  15397. remoteSubscriberId = _getPeerConnectionMet7.remoteSubscriberId;
  15398. return assign(remoteConnectionId.match(/^symphony\./) ? {} : {
  15399. subscriberId: remoteSubscriberId,
  15400. connectionId: remoteConnectionId
  15401. }, {
  15402. stats: getStatsHelpers.normalizeStats(stats, false, startTimestamp)
  15403. });
  15404. });
  15405. callback(null, ret);
  15406. }).catch(callback);
  15407. }; // Make read-only: element, guid, _.webRtcStream
  15408. state = new PublishingState(stateChangeFailed);
  15409. this.accessAllowed = false;
  15410. };
  15411. /**
  15412. * Dispatched when the user has clicked the Allow button, granting the
  15413. * app access to the camera and microphone. The Publisher object has an
  15414. * <code>accessAllowed</code> property which indicates whether the user
  15415. * has granted access to the camera and microphone.
  15416. * @see Event
  15417. * @name accessAllowed
  15418. * @event
  15419. * @memberof Publisher
  15420. */
  15421. /**
  15422. * Dispatched when the user has clicked the Deny button, preventing the
  15423. * app from having access to the camera and microphone.
  15424. * <p>
  15425. * <i>Note:</i> On macOS 10.15+ (Catalina), to publish a screen-sharing stream
  15426. * the user must grant the browser access to the screen in macOS System Preferences &gt;
  15427. * Security &amp; Privacy &gt; Privacy &gt; Screen Recording. Otherwise,
  15428. * the Publisher will dispatch an <code>accessDenied</code> event.
  15429. *
  15430. * @see Event
  15431. * @name accessDenied
  15432. * @event
  15433. * @memberof Publisher
  15434. */
  15435. /**
  15436. * Dispatched when the Allow/Deny dialog box is opened. (This is the dialog box in which
  15437. * the user can grant the app access to the camera and microphone.)
  15438. * @see Event
  15439. * @name accessDialogOpened
  15440. * @event
  15441. * @memberof Publisher
  15442. */
  15443. /**
  15444. * Dispatched when the Allow/Deny box is closed. (This is the dialog box in which the
  15445. * user can grant the app access to the camera and microphone.)
  15446. * @see Event
  15447. * @name accessDialogClosed
  15448. * @event
  15449. * @memberof Publisher
  15450. */
  15451. /**
  15452. * Dispatched periodically to indicate the publisher's audio level. The event is dispatched
  15453. * up to 60 times per second, depending on the browser. The <code>audioLevel</code> property
  15454. * of the event is audio level, from 0 to 1.0. See {@link AudioLevelUpdatedEvent} for more
  15455. * information.
  15456. * <p>
  15457. * The following example adjusts the value of a meter element that shows volume of the
  15458. * publisher. Note that the audio level is adjusted logarithmically and a moving average
  15459. * is applied:
  15460. * <p>
  15461. * <pre>
  15462. * var movingAvg = null;
  15463. * publisher.on('audioLevelUpdated', function(event) {
  15464. * if (movingAvg === null || movingAvg &lt;= event.audioLevel) {
  15465. * movingAvg = event.audioLevel;
  15466. * } else {
  15467. * movingAvg = 0.7 * movingAvg + 0.3 * event.audioLevel;
  15468. * }
  15469. *
  15470. * // 1.5 scaling to map the -30 - 0 dBm range to [0,1]
  15471. * var logLevel = (Math.log(movingAvg) / Math.LN10) / 1.5 + 1;
  15472. * logLevel = Math.min(Math.max(logLevel, 0), 1);
  15473. * document.getElementById('publisherMeter').value = logLevel;
  15474. * });
  15475. * </pre>
  15476. * <p>This example shows the algorithm used by the default audio level indicator displayed
  15477. * in an audio-only Publisher.
  15478. *
  15479. * @name audioLevelUpdated
  15480. * @event
  15481. * @memberof Publisher
  15482. * @see AudioLevelUpdatedEvent
  15483. */
  15484. /**
  15485. * The publisher has started streaming to the session.
  15486. * @name streamCreated
  15487. * @event
  15488. * @memberof Publisher
  15489. * @see StreamEvent
  15490. * @see <a href="Session.html#publish">Session.publish()</a>
  15491. */
  15492. /**
  15493. * The publisher has stopped streaming to the session. The default behavior is that
  15494. * the Publisher object is removed from the HTML DOM. The Publisher object dispatches a
  15495. * <code>destroyed</code> event when the element is removed from the HTML DOM. If you call the
  15496. * <code>preventDefault()</code> method of the event object in the event listener, the default
  15497. * behavior is prevented, and you can, optionally, retain the Publisher for reuse or clean it up
  15498. * using your own code.
  15499. * @name streamDestroyed
  15500. * @event
  15501. * @memberof Publisher
  15502. * @see StreamEvent
  15503. */
  15504. /**
  15505. * Dispatched when the Publisher element is removed from the HTML DOM. When this event
  15506. * is dispatched, you may choose to adjust or remove HTML DOM elements related to the publisher.
  15507. * @name destroyed
  15508. * @event
  15509. * @memberof Publisher
  15510. */
  15511. /**
  15512. * Dispatched when the video dimensions of the video change. This can only occur in when the
  15513. * <code>stream.videoType</code> property is set to <code>"screen"</code> (for a screen-sharing
  15514. * video stream), when the user resizes the window being captured. This event object has a
  15515. * <code>newValue</code> property and an <code>oldValue</code> property, representing the new and
  15516. * old dimensions of the video. Each of these has a <code>height</code> property and a
  15517. * <code>width</code> property, representing the height and width, in pixels.
  15518. * @name videoDimensionsChanged
  15519. * @event
  15520. * @memberof Publisher
  15521. * @see VideoDimensionsChangedEvent
  15522. */
  15523. /**
  15524. * Dispatched when the Publisher's video element is created. Add a listener for this event when
  15525. * you set the <code>insertDefaultUI</code> option to <code>false</code> in the call to the
  15526. * <a href="OT.html#initPublisher">OT.initPublisher()</a> method. The <code>element</code>
  15527. * property of the event object is a reference to the Publisher's <code>video</code> element
  15528. * (or in Internet Explorer the <code>object</code> element containing the video). Add it to
  15529. * the HTML DOM to display the video. When you set the <code>insertDefaultUI</code> option to
  15530. * <code>false</code>, the <code>video</code> (or <code>object</code>) element is not
  15531. * automatically inserted into the DOM.
  15532. * <p>
  15533. * Add a listener for this event only if you have set the <code>insertDefaultUI</code> option to
  15534. * <code>false</code>. If you have not set <code>insertDefaultUI</code> option to
  15535. * <code>false</code>, do not move the <code>video</code> (or <code>object</code>) element in
  15536. * in the HTML DOM. Doing so causes the Publisher object to be destroyed.
  15537. *
  15538. * @name videoElementCreated
  15539. * @event
  15540. * @memberof Publisher
  15541. * @see VideoElementCreatedEvent
  15542. */
  15543. /**
  15544. * The user publishing the stream has stopped sharing one or all media
  15545. * types (video, audio and/or screen). This can occur when a user disconnects a camera or
  15546. * microphone used as a media source for the Publisher. Or it can occur when a user closes
  15547. * a when the video and audio sources of the stream are MediaStreamTrack elements and
  15548. * tracks are stopped or destroyed.
  15549. *
  15550. * @name mediaStopped
  15551. * @event
  15552. * @memberof Publisher
  15553. * @see MediaStoppedEvent
  15554. */
  15555. return Publisher;
  15556. };
  15557. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  15558. /***/ }),
  15559. /* 164 */
  15560. /***/ (function(module, exports, __webpack_require__) {
  15561. "use strict";
  15562. const sessionObjects = __webpack_require__(22);
  15563. const ProxyUrlWarnings = __webpack_require__(294);
  15564. let proxyUrl;
  15565. module.exports = {
  15566. setProxyUrl: url => {
  15567. const hasSessionInitalized = sessionObjects.sessions.length() > 0;
  15568. const hasPublisherInitalized = sessionObjects.publishers.length() > 0;
  15569. if (hasPublisherInitalized || hasSessionInitalized) {
  15570. // @TODO WILL NEED TO UPDATE THESE console.warns TO EXCEPTIONS IN 2.18.0
  15571. console.warn(ProxyUrlWarnings.TEARDOWN_REQUIRED);
  15572. } else if (proxyUrl) {
  15573. console.warn(ProxyUrlWarnings.ALREADY_SET);
  15574. } else {
  15575. // eslint-disable-next-line no-param-reassign
  15576. proxyUrl = url;
  15577. }
  15578. },
  15579. getProxyUrl: () => proxyUrl,
  15580. // this method should only be exposed to tests
  15581. clearProxyUrl: () => {
  15582. proxyUrl = undefined;
  15583. }
  15584. };
  15585. /***/ }),
  15586. /* 165 */
  15587. /***/ (function(module, exports, __webpack_require__) {
  15588. "use strict";
  15589. const hasOpenTokSupport = __webpack_require__(56).once;
  15590. /**
  15591. * A class defining properties of the <code>capabilities</code> property of a
  15592. * Session object. See <a href="Session.html#properties">Session.capabilities</a>.
  15593. * <p>
  15594. * All Capabilities properties are undefined until you have connected to a session
  15595. * and the Session object has dispatched the <code>sessionConnected</code> event.
  15596. * <p>
  15597. * For more information on token roles, see the
  15598. * <a href="https://tokbox.com/developer/guides/create-token/">Token Creation Overview</a>.
  15599. *
  15600. * @class Capabilities
  15601. *
  15602. * @property {Number} forceDisconnect Specifies whether you can call
  15603. * the <code>Session.forceDisconnect()</code> method (1) or not (0). To call the
  15604. * <code>Session.forceDisconnect()</code> method,
  15605. * the user must have a token that is assigned the role of moderator.
  15606. * @property {Number} forceUnpublish Specifies whether you can call
  15607. * the <code>Session.forceUnpublish()</code> method (1) or not (0). To call the
  15608. * <code>Session.forceUnpublish()</code> method, the user must have a token that
  15609. * is assigned the role of moderator.
  15610. * @property {Number} publish Specifies whether you can publish to the session (1) or not (0).
  15611. * The ability to publish is based on a few factors. To publish, the user must have a token that
  15612. * is assigned a role that supports publishing. There must be a connected camera and microphone.
  15613. * @property {Number} subscribe Specifies whether you can subscribe to streams
  15614. * in the session (1) or not (0). Currently, this capability is available for all users on all
  15615. * platforms.
  15616. */
  15617. module.exports = function Capabilities(permissions) {
  15618. this.publish = permissions.indexOf('publish') !== -1 ? 1 : 0;
  15619. this.subscribe = permissions.indexOf('subscribe') !== -1 ? 1 : 0;
  15620. this.forceUnpublish = permissions.indexOf('forceunpublish') !== -1 ? 1 : 0;
  15621. this.forceDisconnect = permissions.indexOf('forcedisconnect') !== -1 ? 1 : 0;
  15622. this.supportsWebRTC = hasOpenTokSupport() ? 1 : 0;
  15623. this.permittedTo = action => Object.prototype.hasOwnProperty.call(this, action) && this[action] === 1;
  15624. };
  15625. /***/ }),
  15626. /* 166 */
  15627. /***/ (function(module, exports, __webpack_require__) {
  15628. "use strict";
  15629. exports.__esModule = true;
  15630. exports.STATUS = exports.PONG = exports.PING = exports.DISCONNECT = exports.CONNECT = exports.MESSAGE = exports.UNSUBSCRIBE = exports.SUBSCRIBE = void 0;
  15631. // Rumor Messaging for JS
  15632. //
  15633. // https://tbwiki.tokbox.com/index.php/Rumor_:_Messaging_FrameWork
  15634. //
  15635. // @todo Rumor {
  15636. // Add error codes for all the error cases
  15637. // Add Dependability commands
  15638. // }
  15639. // This is used to subscribe to address/addresses. The address/addresses the
  15640. // client specifies here is registered on the server. Once any message is sent to
  15641. // that address/addresses, the client receives that message.
  15642. const SUBSCRIBE = 0; // This is used to unsubscribe to address / addresses. Once the client unsubscribe
  15643. // to an address, it will stop getting messages sent to that address.
  15644. exports.SUBSCRIBE = SUBSCRIBE;
  15645. const UNSUBSCRIBE = 1; // This is used to send messages to arbitrary address/ addresses. Messages can be
  15646. // anything and Rumor will not care about what is included.
  15647. exports.UNSUBSCRIBE = UNSUBSCRIBE;
  15648. const MESSAGE = 2; // This will be the first message that the client sends to the server. It includes
  15649. // the uniqueId for that client connection and a disconnect_notify address that will
  15650. // be notified once the client disconnects.
  15651. exports.MESSAGE = MESSAGE;
  15652. const CONNECT = 3; // This will be the message used by the server to notify an address that a
  15653. // client disconnected.
  15654. exports.CONNECT = CONNECT;
  15655. const DISCONNECT = 4; // Enhancements to support Keepalives
  15656. exports.DISCONNECT = DISCONNECT;
  15657. const PING = 7;
  15658. exports.PING = PING;
  15659. const PONG = 8;
  15660. exports.PONG = PONG;
  15661. const STATUS = 9;
  15662. exports.STATUS = STATUS;
  15663. /***/ }),
  15664. /* 167 */
  15665. /***/ (function(module, exports, __webpack_require__) {
  15666. "use strict";
  15667. const assign = __webpack_require__(6);
  15668. const Capabilities = __webpack_require__(165);
  15669. const eventing = __webpack_require__(5);
  15670. const Events = __webpack_require__(20)();
  15671. const connectionCapabilities = __webpack_require__(676);
  15672. /**
  15673. * The Connection object represents a connection to an OpenTok session. Each client that connects
  15674. * to a session has a unique connection, with a unique connection ID (represented by the
  15675. * <code>id</code> property of the Connection object for the client).
  15676. * <p>
  15677. * The Session object has a <code>connection</code> property that is a Connection object.
  15678. * It represents the local client's connection. (A client only has a connection once the
  15679. * client has successfully called the <code>connect()</code> method of the {@link Session}
  15680. * object.)
  15681. * <p>
  15682. * The Session object dispatches a <code>connectionCreated</code> event when each client (including
  15683. * your own) connects to a session (and for clients that are present in the session when you
  15684. * connect). The <code>connectionCreated</code> event object has a <code>connection</code>
  15685. * property, which is a Connection object corresponding to the client the event pertains to.
  15686. * <p>
  15687. * The Stream object has a <code>connection</code> property that is a Connection object.
  15688. * It represents the connection of the client that is publishing the stream.
  15689. *
  15690. * @class Connection
  15691. * @property {String} connectionId The ID of this connection.
  15692. * @property {Number} creationTime The timestamp for the creation of the connection. This
  15693. * value is calculated in milliseconds.
  15694. * You can convert this value to a Date object by calling <code>new Date(creationTime)</code>,
  15695. * where <code>creationTime</code>
  15696. * is the <code>creationTime</code> property of the Connection object.
  15697. * @property {String} data A string containing metadata describing the
  15698. * connection. When you generate a user token, you can define connection data (see the
  15699. * <a href="https://tokbox.com/developer/guides/create-token/">Token creation overview</a>).
  15700. */
  15701. function Connection(id, creationTime, data, capabilitiesHash, permissionsHash) {
  15702. let destroyedReason;
  15703. this.id = id;
  15704. this.connectionId = id;
  15705. this.creationTime = creationTime ? Number(creationTime) : null;
  15706. this.data = data;
  15707. this.capabilities = connectionCapabilities(capabilitiesHash);
  15708. this.permissions = new Capabilities(permissionsHash);
  15709. this.quality = null;
  15710. eventing(this);
  15711. this.destroy = (reason, quiet) => {
  15712. destroyedReason = reason || 'clientDisconnected';
  15713. if (quiet !== true) {
  15714. this.dispatchEvent(new Events.DestroyedEvent( // This should be eventNames.CONNECTION_DESTROYED, but
  15715. // the value of that is currently shared with Session
  15716. 'destroyed', this, destroyedReason));
  15717. }
  15718. };
  15719. this.destroyed = () => destroyedReason !== undefined;
  15720. this.destroyedReason = () => destroyedReason;
  15721. }
  15722. Connection.fromHash = (_ref) => {
  15723. let id = _ref.id,
  15724. creationTime = _ref.creationTime,
  15725. data = _ref.data,
  15726. capablities = _ref.capablities,
  15727. permissions = _ref.permissions;
  15728. return new Connection(id, creationTime, data, assign(capablities || {}, {
  15729. supportsWebRTC: true
  15730. }), permissions || []);
  15731. };
  15732. module.exports = Connection;
  15733. /***/ }),
  15734. /* 168 */
  15735. /***/ (function(module, exports) {
  15736. /** Detect free variable `global` from Node.js. */
  15737. var freeGlobal = typeof (typeof window !== undefined ? window : global) == 'object' && (typeof window !== undefined ? window : global) && (typeof window !== undefined ? window : global).Object === Object && (typeof window !== undefined ? window : global);
  15738. module.exports = freeGlobal;
  15739. /***/ }),
  15740. /* 169 */
  15741. /***/ (function(module, exports) {
  15742. /** Used for built-in method references. */
  15743. var funcProto = Function.prototype;
  15744. /** Used to resolve the decompiled source of functions. */
  15745. var funcToString = funcProto.toString;
  15746. /**
  15747. * Converts `func` to its source code.
  15748. *
  15749. * @private
  15750. * @param {Function} func The function to convert.
  15751. * @returns {string} Returns the source code.
  15752. */
  15753. function toSource(func) {
  15754. if (func != null) {
  15755. try {
  15756. return funcToString.call(func);
  15757. } catch (e) {}
  15758. try {
  15759. return (func + '');
  15760. } catch (e) {}
  15761. }
  15762. return '';
  15763. }
  15764. module.exports = toSource;
  15765. /***/ }),
  15766. /* 170 */
  15767. /***/ (function(module, exports, __webpack_require__) {
  15768. var getNative = __webpack_require__(36);
  15769. var defineProperty = (function() {
  15770. try {
  15771. var func = getNative(Object, 'defineProperty');
  15772. func({}, '', {});
  15773. return func;
  15774. } catch (e) {}
  15775. }());
  15776. module.exports = defineProperty;
  15777. /***/ }),
  15778. /* 171 */
  15779. /***/ (function(module, exports, __webpack_require__) {
  15780. var copyObject = __webpack_require__(38),
  15781. keys = __webpack_require__(27);
  15782. /**
  15783. * The base implementation of `_.assign` without support for multiple sources
  15784. * or `customizer` functions.
  15785. *
  15786. * @private
  15787. * @param {Object} object The destination object.
  15788. * @param {Object} source The source object.
  15789. * @returns {Object} Returns `object`.
  15790. */
  15791. function baseAssign(object, source) {
  15792. return object && copyObject(source, keys(source), object);
  15793. }
  15794. module.exports = baseAssign;
  15795. /***/ }),
  15796. /* 172 */
  15797. /***/ (function(module, exports, __webpack_require__) {
  15798. var baseTimes = __webpack_require__(355),
  15799. isArguments = __webpack_require__(61),
  15800. isArray = __webpack_require__(9),
  15801. isBuffer = __webpack_require__(62),
  15802. isIndex = __webpack_require__(63),
  15803. isTypedArray = __webpack_require__(82);
  15804. /** Used for built-in method references. */
  15805. var objectProto = Object.prototype;
  15806. /** Used to check objects for own properties. */
  15807. var hasOwnProperty = objectProto.hasOwnProperty;
  15808. /**
  15809. * Creates an array of the enumerable property names of the array-like `value`.
  15810. *
  15811. * @private
  15812. * @param {*} value The value to query.
  15813. * @param {boolean} inherited Specify returning inherited property names.
  15814. * @returns {Array} Returns the array of property names.
  15815. */
  15816. function arrayLikeKeys(value, inherited) {
  15817. var isArr = isArray(value),
  15818. isArg = !isArr && isArguments(value),
  15819. isBuff = !isArr && !isArg && isBuffer(value),
  15820. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  15821. skipIndexes = isArr || isArg || isBuff || isType,
  15822. result = skipIndexes ? baseTimes(value.length, String) : [],
  15823. length = result.length;
  15824. for (var key in value) {
  15825. if ((inherited || hasOwnProperty.call(value, key)) &&
  15826. !(skipIndexes && (
  15827. // Safari 9 has enumerable `arguments.length` in strict mode.
  15828. key == 'length' ||
  15829. // Node.js 0.10 has enumerable non-index properties on buffers.
  15830. (isBuff && (key == 'offset' || key == 'parent')) ||
  15831. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  15832. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  15833. // Skip index properties.
  15834. isIndex(key, length)
  15835. ))) {
  15836. result.push(key);
  15837. }
  15838. }
  15839. return result;
  15840. }
  15841. module.exports = arrayLikeKeys;
  15842. /***/ }),
  15843. /* 173 */
  15844. /***/ (function(module, exports) {
  15845. /**
  15846. * Creates a unary function that invokes `func` with its argument transformed.
  15847. *
  15848. * @private
  15849. * @param {Function} func The function to wrap.
  15850. * @param {Function} transform The argument transform.
  15851. * @returns {Function} Returns the new function.
  15852. */
  15853. function overArg(func, transform) {
  15854. return function(arg) {
  15855. return func(transform(arg));
  15856. };
  15857. }
  15858. module.exports = overArg;
  15859. /***/ }),
  15860. /* 174 */
  15861. /***/ (function(module, exports, __webpack_require__) {
  15862. /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(10);
  15863. /** Detect free variable `exports`. */
  15864. var freeExports = true && exports && !exports.nodeType && exports;
  15865. /** Detect free variable `module`. */
  15866. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  15867. /** Detect the popular CommonJS extension `module.exports`. */
  15868. var moduleExports = freeModule && freeModule.exports === freeExports;
  15869. /** Built-in value references. */
  15870. var Buffer = moduleExports ? root.Buffer : undefined,
  15871. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
  15872. /**
  15873. * Creates a clone of `buffer`.
  15874. *
  15875. * @private
  15876. * @param {Buffer} buffer The buffer to clone.
  15877. * @param {boolean} [isDeep] Specify a deep clone.
  15878. * @returns {Buffer} Returns the cloned buffer.
  15879. */
  15880. function cloneBuffer(buffer, isDeep) {
  15881. if (isDeep) {
  15882. return buffer.slice();
  15883. }
  15884. var length = buffer.length,
  15885. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  15886. buffer.copy(result);
  15887. return result;
  15888. }
  15889. module.exports = cloneBuffer;
  15890. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(81)(module)))
  15891. /***/ }),
  15892. /* 175 */
  15893. /***/ (function(module, exports) {
  15894. /**
  15895. * This method returns a new empty array.
  15896. *
  15897. * @static
  15898. * @memberOf _
  15899. * @since 4.13.0
  15900. * @category Util
  15901. * @returns {Array} Returns the new empty array.
  15902. * @example
  15903. *
  15904. * var arrays = _.times(2, _.stubArray);
  15905. *
  15906. * console.log(arrays);
  15907. * // => [[], []]
  15908. *
  15909. * console.log(arrays[0] === arrays[1]);
  15910. * // => false
  15911. */
  15912. function stubArray() {
  15913. return [];
  15914. }
  15915. module.exports = stubArray;
  15916. /***/ }),
  15917. /* 176 */
  15918. /***/ (function(module, exports, __webpack_require__) {
  15919. var arrayPush = __webpack_require__(113),
  15920. getPrototype = __webpack_require__(114),
  15921. getSymbols = __webpack_require__(112),
  15922. stubArray = __webpack_require__(175);
  15923. /* Built-in method references for those with the same name as other `lodash` methods. */
  15924. var nativeGetSymbols = Object.getOwnPropertySymbols;
  15925. /**
  15926. * Creates an array of the own and inherited enumerable symbols of `object`.
  15927. *
  15928. * @private
  15929. * @param {Object} object The object to query.
  15930. * @returns {Array} Returns the array of symbols.
  15931. */
  15932. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  15933. var result = [];
  15934. while (object) {
  15935. arrayPush(result, getSymbols(object));
  15936. object = getPrototype(object);
  15937. }
  15938. return result;
  15939. };
  15940. module.exports = getSymbolsIn;
  15941. /***/ }),
  15942. /* 177 */
  15943. /***/ (function(module, exports, __webpack_require__) {
  15944. var baseGetAllKeys = __webpack_require__(178),
  15945. getSymbols = __webpack_require__(112),
  15946. keys = __webpack_require__(27);
  15947. /**
  15948. * Creates an array of own enumerable property names and symbols of `object`.
  15949. *
  15950. * @private
  15951. * @param {Object} object The object to query.
  15952. * @returns {Array} Returns the array of property names and symbols.
  15953. */
  15954. function getAllKeys(object) {
  15955. return baseGetAllKeys(object, keys, getSymbols);
  15956. }
  15957. module.exports = getAllKeys;
  15958. /***/ }),
  15959. /* 178 */
  15960. /***/ (function(module, exports, __webpack_require__) {
  15961. var arrayPush = __webpack_require__(113),
  15962. isArray = __webpack_require__(9);
  15963. /**
  15964. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  15965. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  15966. * symbols of `object`.
  15967. *
  15968. * @private
  15969. * @param {Object} object The object to query.
  15970. * @param {Function} keysFunc The function to get the keys of `object`.
  15971. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  15972. * @returns {Array} Returns the array of property names and symbols.
  15973. */
  15974. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  15975. var result = keysFunc(object);
  15976. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  15977. }
  15978. module.exports = baseGetAllKeys;
  15979. /***/ }),
  15980. /* 179 */
  15981. /***/ (function(module, exports, __webpack_require__) {
  15982. var baseGetAllKeys = __webpack_require__(178),
  15983. getSymbolsIn = __webpack_require__(176),
  15984. keysIn = __webpack_require__(66);
  15985. /**
  15986. * Creates an array of own and inherited enumerable property names and
  15987. * symbols of `object`.
  15988. *
  15989. * @private
  15990. * @param {Object} object The object to query.
  15991. * @returns {Array} Returns the array of property names and symbols.
  15992. */
  15993. function getAllKeysIn(object) {
  15994. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  15995. }
  15996. module.exports = getAllKeysIn;
  15997. /***/ }),
  15998. /* 180 */
  15999. /***/ (function(module, exports, __webpack_require__) {
  16000. var getNative = __webpack_require__(36),
  16001. root = __webpack_require__(10);
  16002. /* Built-in method references that are verified to be native. */
  16003. var Set = getNative(root, 'Set');
  16004. module.exports = Set;
  16005. /***/ }),
  16006. /* 181 */
  16007. /***/ (function(module, exports, __webpack_require__) {
  16008. var getNative = __webpack_require__(36),
  16009. root = __webpack_require__(10);
  16010. /* Built-in method references that are verified to be native. */
  16011. var WeakMap = getNative(root, 'WeakMap');
  16012. module.exports = WeakMap;
  16013. /***/ }),
  16014. /* 182 */
  16015. /***/ (function(module, exports, __webpack_require__) {
  16016. var root = __webpack_require__(10);
  16017. /** Built-in value references. */
  16018. var Uint8Array = root.Uint8Array;
  16019. module.exports = Uint8Array;
  16020. /***/ }),
  16021. /* 183 */
  16022. /***/ (function(module, exports, __webpack_require__) {
  16023. var cloneArrayBuffer = __webpack_require__(115);
  16024. /**
  16025. * Creates a clone of `typedArray`.
  16026. *
  16027. * @private
  16028. * @param {Object} typedArray The typed array to clone.
  16029. * @param {boolean} [isDeep] Specify a deep clone.
  16030. * @returns {Object} Returns the cloned typed array.
  16031. */
  16032. function cloneTypedArray(typedArray, isDeep) {
  16033. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  16034. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  16035. }
  16036. module.exports = cloneTypedArray;
  16037. /***/ }),
  16038. /* 184 */
  16039. /***/ (function(module, exports, __webpack_require__) {
  16040. var baseCreate = __webpack_require__(83),
  16041. getPrototype = __webpack_require__(114),
  16042. isPrototype = __webpack_require__(65);
  16043. /**
  16044. * Initializes an object clone.
  16045. *
  16046. * @private
  16047. * @param {Object} object The object to clone.
  16048. * @returns {Object} Returns the initialized clone.
  16049. */
  16050. function initCloneObject(object) {
  16051. return (typeof object.constructor == 'function' && !isPrototype(object))
  16052. ? baseCreate(getPrototype(object))
  16053. : {};
  16054. }
  16055. module.exports = initCloneObject;
  16056. /***/ }),
  16057. /* 185 */
  16058. /***/ (function(module, exports, __webpack_require__) {
  16059. "use strict";
  16060. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  16061. /* eslint-disable global-require */
  16062. const staticConfigFactory = __webpack_require__(28);
  16063. const StaticConfig = staticConfigFactory();
  16064. /**
  16065. * @typedef errorReportingFactoryDeps
  16066. * @property {StaticConfig} staticConfig
  16067. */
  16068. module.exports = function errorReportingFactory(
  16069. /** @type errorReportingFactoryDeps */
  16070. deps) {
  16071. if (deps === void 0) {
  16072. deps = {};
  16073. }
  16074. const APIKEY = deps.APIKEY || __webpack_require__(69);
  16075. const logging = deps.logging || __webpack_require__(1)('errorReporting');
  16076. const staticConfig = deps.staticConfig || StaticConfig.onlyLocal();
  16077. const isEnabled = staticConfig.enableErrorReporting;
  16078. let context = deps.global;
  16079. if (!context && typeof window !== 'undefined') {
  16080. context = window;
  16081. }
  16082. let Raven = deps.Raven;
  16083. if (!Raven && context) {
  16084. Raven = __webpack_require__(518);
  16085. }
  16086. const whitelistUrlPattern = /(opentok|ot|tb|tokbox)(?:\.min)?\.js/;
  16087. /*
  16088. * Blocks error reporting until it has been explicitly enabled.
  16089. *
  16090. * The otError tag workaround is necessary because raven-js will
  16091. * automatically wrap global error listeners. We prevent this by
  16092. * only accepting errors that have the otError tag set by our
  16093. * generateTags() function. It is deleted because it's not used
  16094. * after this point.
  16095. */
  16096. const shouldSendCallback = errorData => {
  16097. if (!isEnabled) {
  16098. return false;
  16099. }
  16100. if (errorData && errorData.tags && errorData.tags.otError) {
  16101. delete errorData.tags.otError; // eslint-disable-line no-param-reassign
  16102. return true;
  16103. }
  16104. return false;
  16105. };
  16106. const installRaven = () => {
  16107. if (Raven) {
  16108. Raven.config(staticConfig.sentryDSN, {
  16109. whitelistUrls: [whitelistUrlPattern],
  16110. logger: 'webrtc-js',
  16111. release: staticConfig.version,
  16112. autoBreadcrumbs: false,
  16113. shouldSendCallback
  16114. }).install().noConflict();
  16115. }
  16116. };
  16117. /*
  16118. * The rawError object must be normalised to an instance of Error because
  16119. * raven-js will cast anything else to a string. This prevents objects
  16120. * like ExceptionEvent from being reported as "[object Object]".
  16121. *
  16122. * @param {Error|Object|String} rawError
  16123. * @return {Error|String}
  16124. */
  16125. const normaliseError = rawError => {
  16126. let error;
  16127. if (rawError instanceof Error || typeof rawError === 'string') {
  16128. error = rawError;
  16129. } else if (rawError == null) {
  16130. error = new Error('Undefined or null error was reported!');
  16131. } else {
  16132. error = new Error(rawError.message);
  16133. ['name', 'title', 'code', 'stack'].forEach(key => {
  16134. if (rawError[key]) {
  16135. error[key] = rawError[key];
  16136. }
  16137. });
  16138. }
  16139. if (error instanceof Error && !error.stack) {
  16140. try {
  16141. throw error;
  16142. } catch (e) {// IE populates the error's .stack when it is thrown, nothing to do here
  16143. }
  16144. }
  16145. return error;
  16146. };
  16147. /*
  16148. * We generate a fingerprint because some unrelated errors can end up
  16149. * being grouped together as the same issue, particularly normalised
  16150. * errors that end up with identical stacktraces.
  16151. * https://docs.sentry.io/learn/rollups/#customize-grouping-with-fingerprints
  16152. */
  16153. const generateFingerprint = error => {
  16154. const fingerprint = ['{{ default }}'];
  16155. if (typeof error === 'string') {
  16156. fingerprint.push("message::" + error);
  16157. } else if (error != null) {
  16158. ['message', 'name', 'title', 'code'].forEach(key => {
  16159. if (error[key]) {
  16160. fingerprint.push(key + "::" + error[key]);
  16161. }
  16162. });
  16163. }
  16164. return fingerprint;
  16165. };
  16166. const generateTags = error => {
  16167. const tags = {
  16168. otError: true,
  16169. partnerId: APIKEY.value,
  16170. buildHash: staticConfig.buildHash
  16171. };
  16172. if (error instanceof Error) {
  16173. ['name', 'title', 'code'].forEach(key => {
  16174. if (error[key]) {
  16175. tags["error." + key] = error[key];
  16176. }
  16177. });
  16178. }
  16179. return tags;
  16180. };
  16181. const errorReporting = {
  16182. /*
  16183. * Reports an error to Sentry.io if error reporting has been enabled.
  16184. *
  16185. * @param {Error|Object|String} rawError
  16186. * @return {String} Report event ID
  16187. */
  16188. send(rawError) {
  16189. if (!isEnabled || !Raven) {
  16190. return null;
  16191. }
  16192. const error = normaliseError(rawError);
  16193. const options = {
  16194. fingerprint: generateFingerprint(error),
  16195. tags: generateTags(error)
  16196. };
  16197. Raven.captureException(error, options);
  16198. const lastId = Raven.lastEventId();
  16199. logging.debug("Reported error with ID: " + lastId, error, options);
  16200. return lastId;
  16201. }
  16202. };
  16203. const attachGlobalListener = () => {
  16204. context.addEventListener('error', e => {
  16205. if (e.error == null) {
  16206. // unfortunately we can't do much about errors we know nothing about
  16207. return;
  16208. }
  16209. errorReporting.send(e.error);
  16210. });
  16211. };
  16212. if (isEnabled) {
  16213. attachGlobalListener();
  16214. installRaven();
  16215. }
  16216. return errorReporting;
  16217. };
  16218. /***/ }),
  16219. /* 186 */
  16220. /***/ (function(module, exports, __webpack_require__) {
  16221. module.exports = __webpack_require__(377);
  16222. /***/ }),
  16223. /* 187 */
  16224. /***/ (function(module, exports, __webpack_require__) {
  16225. "use strict";
  16226. module.exports = function bind(fn, thisArg) {
  16227. return function wrap() {
  16228. var args = new Array(arguments.length);
  16229. for (var i = 0; i < args.length; i++) {
  16230. args[i] = arguments[i];
  16231. }
  16232. return fn.apply(thisArg, args);
  16233. };
  16234. };
  16235. /***/ }),
  16236. /* 188 */
  16237. /***/ (function(module, exports, __webpack_require__) {
  16238. "use strict";
  16239. /* WEBPACK VAR INJECTION */(function(Promise) {
  16240. var utils = __webpack_require__(16);
  16241. var settle = __webpack_require__(381);
  16242. var buildURL = __webpack_require__(383);
  16243. var parseHeaders = __webpack_require__(384);
  16244. var isURLSameOrigin = __webpack_require__(385);
  16245. var createError = __webpack_require__(189);
  16246. module.exports = function xhrAdapter(config) {
  16247. return new Promise(function dispatchXhrRequest(resolve, reject) {
  16248. var requestData = config.data;
  16249. var requestHeaders = config.headers;
  16250. if (utils.isFormData(requestData)) {
  16251. delete requestHeaders['Content-Type']; // Let the browser set it
  16252. }
  16253. var request = new XMLHttpRequest();
  16254. // HTTP basic authentication
  16255. if (config.auth) {
  16256. var username = config.auth.username || '';
  16257. var password = config.auth.password || '';
  16258. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  16259. }
  16260. request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
  16261. // Set the request timeout in MS
  16262. request.timeout = config.timeout;
  16263. // Listen for ready state
  16264. request.onreadystatechange = function handleLoad() {
  16265. if (!request || request.readyState !== 4) {
  16266. return;
  16267. }
  16268. // The request errored out and we didn't get a response, this will be
  16269. // handled by onerror instead
  16270. // With one exception: request that using file: protocol, most browsers
  16271. // will return status as 0 even though it's a successful request
  16272. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  16273. return;
  16274. }
  16275. // Prepare the response
  16276. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  16277. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  16278. var response = {
  16279. data: responseData,
  16280. status: request.status,
  16281. statusText: request.statusText,
  16282. headers: responseHeaders,
  16283. config: config,
  16284. request: request
  16285. };
  16286. settle(resolve, reject, response);
  16287. // Clean up request
  16288. request = null;
  16289. };
  16290. // Handle low level network errors
  16291. request.onerror = function handleError() {
  16292. // Real errors are hidden from us by the browser
  16293. // onerror should only fire if it's a network error
  16294. reject(createError('Network Error', config, null, request));
  16295. // Clean up request
  16296. request = null;
  16297. };
  16298. // Handle timeout
  16299. request.ontimeout = function handleTimeout() {
  16300. reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
  16301. request));
  16302. // Clean up request
  16303. request = null;
  16304. };
  16305. // Add xsrf header
  16306. // This is only done if running in a standard browser environment.
  16307. // Specifically not if we're in a web worker, or react-native.
  16308. if (utils.isStandardBrowserEnv()) {
  16309. var cookies = __webpack_require__(386);
  16310. // Add xsrf header
  16311. var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
  16312. cookies.read(config.xsrfCookieName) :
  16313. undefined;
  16314. if (xsrfValue) {
  16315. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  16316. }
  16317. }
  16318. // Add headers to the request
  16319. if ('setRequestHeader' in request) {
  16320. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  16321. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  16322. // Remove Content-Type if data is undefined
  16323. delete requestHeaders[key];
  16324. } else {
  16325. // Otherwise add header to the request
  16326. request.setRequestHeader(key, val);
  16327. }
  16328. });
  16329. }
  16330. // Add withCredentials to request if needed
  16331. if (config.withCredentials) {
  16332. request.withCredentials = true;
  16333. }
  16334. // Add responseType to request if needed
  16335. if (config.responseType) {
  16336. try {
  16337. request.responseType = config.responseType;
  16338. } catch (e) {
  16339. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  16340. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  16341. if (config.responseType !== 'json') {
  16342. throw e;
  16343. }
  16344. }
  16345. }
  16346. // Handle progress if needed
  16347. if (typeof config.onDownloadProgress === 'function') {
  16348. request.addEventListener('progress', config.onDownloadProgress);
  16349. }
  16350. // Not all browsers support upload events
  16351. if (typeof config.onUploadProgress === 'function' && request.upload) {
  16352. request.upload.addEventListener('progress', config.onUploadProgress);
  16353. }
  16354. if (config.cancelToken) {
  16355. // Handle cancellation
  16356. config.cancelToken.promise.then(function onCanceled(cancel) {
  16357. if (!request) {
  16358. return;
  16359. }
  16360. request.abort();
  16361. reject(cancel);
  16362. // Clean up request
  16363. request = null;
  16364. });
  16365. }
  16366. if (requestData === undefined) {
  16367. requestData = null;
  16368. }
  16369. // Send the request
  16370. request.send(requestData);
  16371. });
  16372. };
  16373. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  16374. /***/ }),
  16375. /* 189 */
  16376. /***/ (function(module, exports, __webpack_require__) {
  16377. "use strict";
  16378. var enhanceError = __webpack_require__(382);
  16379. /**
  16380. * Create an Error with the specified message, config, error code, request and response.
  16381. *
  16382. * @param {string} message The error message.
  16383. * @param {Object} config The config.
  16384. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  16385. * @param {Object} [request] The request.
  16386. * @param {Object} [response] The response.
  16387. * @returns {Error} The created error.
  16388. */
  16389. module.exports = function createError(message, config, code, request, response) {
  16390. var error = new Error(message);
  16391. return enhanceError(error, config, code, request, response);
  16392. };
  16393. /***/ }),
  16394. /* 190 */
  16395. /***/ (function(module, exports, __webpack_require__) {
  16396. "use strict";
  16397. module.exports = function isCancel(value) {
  16398. return !!(value && value.__CANCEL__);
  16399. };
  16400. /***/ }),
  16401. /* 191 */
  16402. /***/ (function(module, exports, __webpack_require__) {
  16403. "use strict";
  16404. /**
  16405. * A `Cancel` is an object that is thrown when an operation is canceled.
  16406. *
  16407. * @class
  16408. * @param {string=} message The message.
  16409. */
  16410. function Cancel(message) {
  16411. this.message = message;
  16412. }
  16413. Cancel.prototype.toString = function toString() {
  16414. return 'Cancel' + (this.message ? ': ' + this.message : '');
  16415. };
  16416. Cancel.prototype.__CANCEL__ = true;
  16417. module.exports = Cancel;
  16418. /***/ }),
  16419. /* 192 */
  16420. /***/ (function(module, exports, __webpack_require__) {
  16421. var baseConvert = __webpack_require__(395),
  16422. util = __webpack_require__(397);
  16423. /**
  16424. * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
  16425. * version with conversion `options` applied. If `name` is an object its methods
  16426. * will be converted.
  16427. *
  16428. * @param {string} name The name of the function to wrap.
  16429. * @param {Function} [func] The function to wrap.
  16430. * @param {Object} [options] The options object. See `baseConvert` for more details.
  16431. * @returns {Function|Object} Returns the converted function or object.
  16432. */
  16433. function convert(name, func, options) {
  16434. return baseConvert(util, name, func, options);
  16435. }
  16436. module.exports = convert;
  16437. /***/ }),
  16438. /* 193 */
  16439. /***/ (function(module, exports, __webpack_require__) {
  16440. var identity = __webpack_require__(84),
  16441. metaMap = __webpack_require__(194);
  16442. /**
  16443. * The base implementation of `setData` without support for hot loop shorting.
  16444. *
  16445. * @private
  16446. * @param {Function} func The function to associate metadata with.
  16447. * @param {*} data The metadata.
  16448. * @returns {Function} Returns `func`.
  16449. */
  16450. var baseSetData = !metaMap ? identity : function(func, data) {
  16451. metaMap.set(func, data);
  16452. return func;
  16453. };
  16454. module.exports = baseSetData;
  16455. /***/ }),
  16456. /* 194 */
  16457. /***/ (function(module, exports, __webpack_require__) {
  16458. var WeakMap = __webpack_require__(181);
  16459. /** Used to store function metadata. */
  16460. var metaMap = WeakMap && new WeakMap;
  16461. module.exports = metaMap;
  16462. /***/ }),
  16463. /* 195 */
  16464. /***/ (function(module, exports, __webpack_require__) {
  16465. var composeArgs = __webpack_require__(196),
  16466. composeArgsRight = __webpack_require__(197),
  16467. countHolders = __webpack_require__(401),
  16468. createCtor = __webpack_require__(85),
  16469. createRecurry = __webpack_require__(198),
  16470. getHolder = __webpack_require__(206),
  16471. reorder = __webpack_require__(415),
  16472. replaceHolders = __webpack_require__(123),
  16473. root = __webpack_require__(10);
  16474. /** Used to compose bitmasks for function metadata. */
  16475. var WRAP_BIND_FLAG = 1,
  16476. WRAP_BIND_KEY_FLAG = 2,
  16477. WRAP_CURRY_FLAG = 8,
  16478. WRAP_CURRY_RIGHT_FLAG = 16,
  16479. WRAP_ARY_FLAG = 128,
  16480. WRAP_FLIP_FLAG = 512;
  16481. /**
  16482. * Creates a function that wraps `func` to invoke it with optional `this`
  16483. * binding of `thisArg`, partial application, and currying.
  16484. *
  16485. * @private
  16486. * @param {Function|string} func The function or method name to wrap.
  16487. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  16488. * @param {*} [thisArg] The `this` binding of `func`.
  16489. * @param {Array} [partials] The arguments to prepend to those provided to
  16490. * the new function.
  16491. * @param {Array} [holders] The `partials` placeholder indexes.
  16492. * @param {Array} [partialsRight] The arguments to append to those provided
  16493. * to the new function.
  16494. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  16495. * @param {Array} [argPos] The argument positions of the new function.
  16496. * @param {number} [ary] The arity cap of `func`.
  16497. * @param {number} [arity] The arity of `func`.
  16498. * @returns {Function} Returns the new wrapped function.
  16499. */
  16500. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  16501. var isAry = bitmask & WRAP_ARY_FLAG,
  16502. isBind = bitmask & WRAP_BIND_FLAG,
  16503. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  16504. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  16505. isFlip = bitmask & WRAP_FLIP_FLAG,
  16506. Ctor = isBindKey ? undefined : createCtor(func);
  16507. function wrapper() {
  16508. var length = arguments.length,
  16509. args = Array(length),
  16510. index = length;
  16511. while (index--) {
  16512. args[index] = arguments[index];
  16513. }
  16514. if (isCurried) {
  16515. var placeholder = getHolder(wrapper),
  16516. holdersCount = countHolders(args, placeholder);
  16517. }
  16518. if (partials) {
  16519. args = composeArgs(args, partials, holders, isCurried);
  16520. }
  16521. if (partialsRight) {
  16522. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  16523. }
  16524. length -= holdersCount;
  16525. if (isCurried && length < arity) {
  16526. var newHolders = replaceHolders(args, placeholder);
  16527. return createRecurry(
  16528. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  16529. args, newHolders, argPos, ary, arity - length
  16530. );
  16531. }
  16532. var thisBinding = isBind ? thisArg : this,
  16533. fn = isBindKey ? thisBinding[func] : func;
  16534. length = args.length;
  16535. if (argPos) {
  16536. args = reorder(args, argPos);
  16537. } else if (isFlip && length > 1) {
  16538. args.reverse();
  16539. }
  16540. if (isAry && ary < length) {
  16541. args.length = ary;
  16542. }
  16543. if (this && this !== root && this instanceof wrapper) {
  16544. fn = Ctor || createCtor(fn);
  16545. }
  16546. return fn.apply(thisBinding, args);
  16547. }
  16548. return wrapper;
  16549. }
  16550. module.exports = createHybrid;
  16551. /***/ }),
  16552. /* 196 */
  16553. /***/ (function(module, exports) {
  16554. /* Built-in method references for those with the same name as other `lodash` methods. */
  16555. var nativeMax = Math.max;
  16556. /**
  16557. * Creates an array that is the composition of partially applied arguments,
  16558. * placeholders, and provided arguments into a single array of arguments.
  16559. *
  16560. * @private
  16561. * @param {Array} args The provided arguments.
  16562. * @param {Array} partials The arguments to prepend to those provided.
  16563. * @param {Array} holders The `partials` placeholder indexes.
  16564. * @params {boolean} [isCurried] Specify composing for a curried function.
  16565. * @returns {Array} Returns the new array of composed arguments.
  16566. */
  16567. function composeArgs(args, partials, holders, isCurried) {
  16568. var argsIndex = -1,
  16569. argsLength = args.length,
  16570. holdersLength = holders.length,
  16571. leftIndex = -1,
  16572. leftLength = partials.length,
  16573. rangeLength = nativeMax(argsLength - holdersLength, 0),
  16574. result = Array(leftLength + rangeLength),
  16575. isUncurried = !isCurried;
  16576. while (++leftIndex < leftLength) {
  16577. result[leftIndex] = partials[leftIndex];
  16578. }
  16579. while (++argsIndex < holdersLength) {
  16580. if (isUncurried || argsIndex < argsLength) {
  16581. result[holders[argsIndex]] = args[argsIndex];
  16582. }
  16583. }
  16584. while (rangeLength--) {
  16585. result[leftIndex++] = args[argsIndex++];
  16586. }
  16587. return result;
  16588. }
  16589. module.exports = composeArgs;
  16590. /***/ }),
  16591. /* 197 */
  16592. /***/ (function(module, exports) {
  16593. /* Built-in method references for those with the same name as other `lodash` methods. */
  16594. var nativeMax = Math.max;
  16595. /**
  16596. * This function is like `composeArgs` except that the arguments composition
  16597. * is tailored for `_.partialRight`.
  16598. *
  16599. * @private
  16600. * @param {Array} args The provided arguments.
  16601. * @param {Array} partials The arguments to append to those provided.
  16602. * @param {Array} holders The `partials` placeholder indexes.
  16603. * @params {boolean} [isCurried] Specify composing for a curried function.
  16604. * @returns {Array} Returns the new array of composed arguments.
  16605. */
  16606. function composeArgsRight(args, partials, holders, isCurried) {
  16607. var argsIndex = -1,
  16608. argsLength = args.length,
  16609. holdersIndex = -1,
  16610. holdersLength = holders.length,
  16611. rightIndex = -1,
  16612. rightLength = partials.length,
  16613. rangeLength = nativeMax(argsLength - holdersLength, 0),
  16614. result = Array(rangeLength + rightLength),
  16615. isUncurried = !isCurried;
  16616. while (++argsIndex < rangeLength) {
  16617. result[argsIndex] = args[argsIndex];
  16618. }
  16619. var offset = argsIndex;
  16620. while (++rightIndex < rightLength) {
  16621. result[offset + rightIndex] = partials[rightIndex];
  16622. }
  16623. while (++holdersIndex < holdersLength) {
  16624. if (isUncurried || argsIndex < argsLength) {
  16625. result[offset + holders[holdersIndex]] = args[argsIndex++];
  16626. }
  16627. }
  16628. return result;
  16629. }
  16630. module.exports = composeArgsRight;
  16631. /***/ }),
  16632. /* 198 */
  16633. /***/ (function(module, exports, __webpack_require__) {
  16634. var isLaziable = __webpack_require__(402),
  16635. setData = __webpack_require__(202),
  16636. setWrapToString = __webpack_require__(204);
  16637. /** Used to compose bitmasks for function metadata. */
  16638. var WRAP_BIND_FLAG = 1,
  16639. WRAP_BIND_KEY_FLAG = 2,
  16640. WRAP_CURRY_BOUND_FLAG = 4,
  16641. WRAP_CURRY_FLAG = 8,
  16642. WRAP_PARTIAL_FLAG = 32,
  16643. WRAP_PARTIAL_RIGHT_FLAG = 64;
  16644. /**
  16645. * Creates a function that wraps `func` to continue currying.
  16646. *
  16647. * @private
  16648. * @param {Function} func The function to wrap.
  16649. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  16650. * @param {Function} wrapFunc The function to create the `func` wrapper.
  16651. * @param {*} placeholder The placeholder value.
  16652. * @param {*} [thisArg] The `this` binding of `func`.
  16653. * @param {Array} [partials] The arguments to prepend to those provided to
  16654. * the new function.
  16655. * @param {Array} [holders] The `partials` placeholder indexes.
  16656. * @param {Array} [argPos] The argument positions of the new function.
  16657. * @param {number} [ary] The arity cap of `func`.
  16658. * @param {number} [arity] The arity of `func`.
  16659. * @returns {Function} Returns the new wrapped function.
  16660. */
  16661. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  16662. var isCurry = bitmask & WRAP_CURRY_FLAG,
  16663. newHolders = isCurry ? holders : undefined,
  16664. newHoldersRight = isCurry ? undefined : holders,
  16665. newPartials = isCurry ? partials : undefined,
  16666. newPartialsRight = isCurry ? undefined : partials;
  16667. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  16668. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  16669. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  16670. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  16671. }
  16672. var newData = [
  16673. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  16674. newHoldersRight, argPos, ary, arity
  16675. ];
  16676. var result = wrapFunc.apply(undefined, newData);
  16677. if (isLaziable(func)) {
  16678. setData(result, newData);
  16679. }
  16680. result.placeholder = placeholder;
  16681. return setWrapToString(result, func, bitmask);
  16682. }
  16683. module.exports = createRecurry;
  16684. /***/ }),
  16685. /* 199 */
  16686. /***/ (function(module, exports, __webpack_require__) {
  16687. var metaMap = __webpack_require__(194),
  16688. noop = __webpack_require__(200);
  16689. /**
  16690. * Gets metadata for `func`.
  16691. *
  16692. * @private
  16693. * @param {Function} func The function to query.
  16694. * @returns {*} Returns the metadata for `func`.
  16695. */
  16696. var getData = !metaMap ? noop : function(func) {
  16697. return metaMap.get(func);
  16698. };
  16699. module.exports = getData;
  16700. /***/ }),
  16701. /* 200 */
  16702. /***/ (function(module, exports) {
  16703. /**
  16704. * This method returns `undefined`.
  16705. *
  16706. * @static
  16707. * @memberOf _
  16708. * @since 2.3.0
  16709. * @category Util
  16710. * @example
  16711. *
  16712. * _.times(2, _.noop);
  16713. * // => [undefined, undefined]
  16714. */
  16715. function noop() {
  16716. // No operation performed.
  16717. }
  16718. module.exports = noop;
  16719. /***/ }),
  16720. /* 201 */
  16721. /***/ (function(module, exports, __webpack_require__) {
  16722. var baseCreate = __webpack_require__(83),
  16723. baseLodash = __webpack_require__(121);
  16724. /**
  16725. * The base constructor for creating `lodash` wrapper objects.
  16726. *
  16727. * @private
  16728. * @param {*} value The value to wrap.
  16729. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  16730. */
  16731. function LodashWrapper(value, chainAll) {
  16732. this.__wrapped__ = value;
  16733. this.__actions__ = [];
  16734. this.__chain__ = !!chainAll;
  16735. this.__index__ = 0;
  16736. this.__values__ = undefined;
  16737. }
  16738. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  16739. LodashWrapper.prototype.constructor = LodashWrapper;
  16740. module.exports = LodashWrapper;
  16741. /***/ }),
  16742. /* 202 */
  16743. /***/ (function(module, exports, __webpack_require__) {
  16744. var baseSetData = __webpack_require__(193),
  16745. shortOut = __webpack_require__(203);
  16746. /**
  16747. * Sets metadata for `func`.
  16748. *
  16749. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  16750. * period of time, it will trip its breaker and transition to an identity
  16751. * function to avoid garbage collection pauses in V8. See
  16752. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  16753. * for more details.
  16754. *
  16755. * @private
  16756. * @param {Function} func The function to associate metadata with.
  16757. * @param {*} data The metadata.
  16758. * @returns {Function} Returns `func`.
  16759. */
  16760. var setData = shortOut(baseSetData);
  16761. module.exports = setData;
  16762. /***/ }),
  16763. /* 203 */
  16764. /***/ (function(module, exports) {
  16765. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  16766. var HOT_COUNT = 800,
  16767. HOT_SPAN = 16;
  16768. /* Built-in method references for those with the same name as other `lodash` methods. */
  16769. var nativeNow = Date.now;
  16770. /**
  16771. * Creates a function that'll short out and invoke `identity` instead
  16772. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  16773. * milliseconds.
  16774. *
  16775. * @private
  16776. * @param {Function} func The function to restrict.
  16777. * @returns {Function} Returns the new shortable function.
  16778. */
  16779. function shortOut(func) {
  16780. var count = 0,
  16781. lastCalled = 0;
  16782. return function() {
  16783. var stamp = nativeNow(),
  16784. remaining = HOT_SPAN - (stamp - lastCalled);
  16785. lastCalled = stamp;
  16786. if (remaining > 0) {
  16787. if (++count >= HOT_COUNT) {
  16788. return arguments[0];
  16789. }
  16790. } else {
  16791. count = 0;
  16792. }
  16793. return func.apply(undefined, arguments);
  16794. };
  16795. }
  16796. module.exports = shortOut;
  16797. /***/ }),
  16798. /* 204 */
  16799. /***/ (function(module, exports, __webpack_require__) {
  16800. var getWrapDetails = __webpack_require__(407),
  16801. insertWrapDetails = __webpack_require__(408),
  16802. setToString = __webpack_require__(122),
  16803. updateWrapDetails = __webpack_require__(411);
  16804. /**
  16805. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  16806. * with wrapper details in a comment at the top of the source body.
  16807. *
  16808. * @private
  16809. * @param {Function} wrapper The function to modify.
  16810. * @param {Function} reference The reference function.
  16811. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  16812. * @returns {Function} Returns `wrapper`.
  16813. */
  16814. function setWrapToString(wrapper, reference, bitmask) {
  16815. var source = (reference + '');
  16816. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  16817. }
  16818. module.exports = setWrapToString;
  16819. /***/ }),
  16820. /* 205 */
  16821. /***/ (function(module, exports) {
  16822. /**
  16823. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  16824. * support for iteratee shorthands.
  16825. *
  16826. * @private
  16827. * @param {Array} array The array to inspect.
  16828. * @param {Function} predicate The function invoked per iteration.
  16829. * @param {number} fromIndex The index to search from.
  16830. * @param {boolean} [fromRight] Specify iterating from right to left.
  16831. * @returns {number} Returns the index of the matched value, else `-1`.
  16832. */
  16833. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  16834. var length = array.length,
  16835. index = fromIndex + (fromRight ? 1 : -1);
  16836. while ((fromRight ? index-- : ++index < length)) {
  16837. if (predicate(array[index], index, array)) {
  16838. return index;
  16839. }
  16840. }
  16841. return -1;
  16842. }
  16843. module.exports = baseFindIndex;
  16844. /***/ }),
  16845. /* 206 */
  16846. /***/ (function(module, exports) {
  16847. /**
  16848. * Gets the argument placeholder value for `func`.
  16849. *
  16850. * @private
  16851. * @param {Function} func The function to inspect.
  16852. * @returns {*} Returns the placeholder value.
  16853. */
  16854. function getHolder(func) {
  16855. var object = func;
  16856. return object.placeholder;
  16857. }
  16858. module.exports = getHolder;
  16859. /***/ }),
  16860. /* 207 */
  16861. /***/ (function(module, exports, __webpack_require__) {
  16862. var isObject = __webpack_require__(7),
  16863. isSymbol = __webpack_require__(68);
  16864. /** Used as references for various `Number` constants. */
  16865. var NAN = 0 / 0;
  16866. /** Used to match leading and trailing whitespace. */
  16867. var reTrim = /^\s+|\s+$/g;
  16868. /** Used to detect bad signed hexadecimal string values. */
  16869. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  16870. /** Used to detect binary string values. */
  16871. var reIsBinary = /^0b[01]+$/i;
  16872. /** Used to detect octal string values. */
  16873. var reIsOctal = /^0o[0-7]+$/i;
  16874. /** Built-in method references without a dependency on `root`. */
  16875. var freeParseInt = parseInt;
  16876. /**
  16877. * Converts `value` to a number.
  16878. *
  16879. * @static
  16880. * @memberOf _
  16881. * @since 4.0.0
  16882. * @category Lang
  16883. * @param {*} value The value to process.
  16884. * @returns {number} Returns the number.
  16885. * @example
  16886. *
  16887. * _.toNumber(3.2);
  16888. * // => 3.2
  16889. *
  16890. * _.toNumber(Number.MIN_VALUE);
  16891. * // => 5e-324
  16892. *
  16893. * _.toNumber(Infinity);
  16894. * // => Infinity
  16895. *
  16896. * _.toNumber('3.2');
  16897. * // => 3.2
  16898. */
  16899. function toNumber(value) {
  16900. if (typeof value == 'number') {
  16901. return value;
  16902. }
  16903. if (isSymbol(value)) {
  16904. return NAN;
  16905. }
  16906. if (isObject(value)) {
  16907. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  16908. value = isObject(other) ? (other + '') : other;
  16909. }
  16910. if (typeof value != 'string') {
  16911. return value === 0 ? value : +value;
  16912. }
  16913. value = value.replace(reTrim, '');
  16914. var isBinary = reIsBinary.test(value);
  16915. return (isBinary || reIsOctal.test(value))
  16916. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  16917. : (reIsBadHex.test(value) ? NAN : +value);
  16918. }
  16919. module.exports = toNumber;
  16920. /***/ }),
  16921. /* 208 */
  16922. /***/ (function(module, exports, __webpack_require__) {
  16923. var baseIsEqualDeep = __webpack_require__(425),
  16924. isObjectLike = __webpack_require__(14);
  16925. /**
  16926. * The base implementation of `_.isEqual` which supports partial comparisons
  16927. * and tracks traversed objects.
  16928. *
  16929. * @private
  16930. * @param {*} value The value to compare.
  16931. * @param {*} other The other value to compare.
  16932. * @param {boolean} bitmask The bitmask flags.
  16933. * 1 - Unordered comparison
  16934. * 2 - Partial comparison
  16935. * @param {Function} [customizer] The function to customize comparisons.
  16936. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  16937. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  16938. */
  16939. function baseIsEqual(value, other, bitmask, customizer, stack) {
  16940. if (value === other) {
  16941. return true;
  16942. }
  16943. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  16944. return value !== value && other !== other;
  16945. }
  16946. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  16947. }
  16948. module.exports = baseIsEqual;
  16949. /***/ }),
  16950. /* 209 */
  16951. /***/ (function(module, exports, __webpack_require__) {
  16952. var SetCache = __webpack_require__(88),
  16953. arraySome = __webpack_require__(210),
  16954. cacheHas = __webpack_require__(89);
  16955. /** Used to compose bitmasks for value comparisons. */
  16956. var COMPARE_PARTIAL_FLAG = 1,
  16957. COMPARE_UNORDERED_FLAG = 2;
  16958. /**
  16959. * A specialized version of `baseIsEqualDeep` for arrays with support for
  16960. * partial deep comparisons.
  16961. *
  16962. * @private
  16963. * @param {Array} array The array to compare.
  16964. * @param {Array} other The other array to compare.
  16965. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  16966. * @param {Function} customizer The function to customize comparisons.
  16967. * @param {Function} equalFunc The function to determine equivalents of values.
  16968. * @param {Object} stack Tracks traversed `array` and `other` objects.
  16969. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  16970. */
  16971. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  16972. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  16973. arrLength = array.length,
  16974. othLength = other.length;
  16975. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  16976. return false;
  16977. }
  16978. // Assume cyclic values are equal.
  16979. var stacked = stack.get(array);
  16980. if (stacked && stack.get(other)) {
  16981. return stacked == other;
  16982. }
  16983. var index = -1,
  16984. result = true,
  16985. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  16986. stack.set(array, other);
  16987. stack.set(other, array);
  16988. // Ignore non-index properties.
  16989. while (++index < arrLength) {
  16990. var arrValue = array[index],
  16991. othValue = other[index];
  16992. if (customizer) {
  16993. var compared = isPartial
  16994. ? customizer(othValue, arrValue, index, other, array, stack)
  16995. : customizer(arrValue, othValue, index, array, other, stack);
  16996. }
  16997. if (compared !== undefined) {
  16998. if (compared) {
  16999. continue;
  17000. }
  17001. result = false;
  17002. break;
  17003. }
  17004. // Recursively compare arrays (susceptible to call stack limits).
  17005. if (seen) {
  17006. if (!arraySome(other, function(othValue, othIndex) {
  17007. if (!cacheHas(seen, othIndex) &&
  17008. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  17009. return seen.push(othIndex);
  17010. }
  17011. })) {
  17012. result = false;
  17013. break;
  17014. }
  17015. } else if (!(
  17016. arrValue === othValue ||
  17017. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  17018. )) {
  17019. result = false;
  17020. break;
  17021. }
  17022. }
  17023. stack['delete'](array);
  17024. stack['delete'](other);
  17025. return result;
  17026. }
  17027. module.exports = equalArrays;
  17028. /***/ }),
  17029. /* 210 */
  17030. /***/ (function(module, exports) {
  17031. /**
  17032. * A specialized version of `_.some` for arrays without support for iteratee
  17033. * shorthands.
  17034. *
  17035. * @private
  17036. * @param {Array} [array] The array to iterate over.
  17037. * @param {Function} predicate The function invoked per iteration.
  17038. * @returns {boolean} Returns `true` if any element passes the predicate check,
  17039. * else `false`.
  17040. */
  17041. function arraySome(array, predicate) {
  17042. var index = -1,
  17043. length = array == null ? 0 : array.length;
  17044. while (++index < length) {
  17045. if (predicate(array[index], index, array)) {
  17046. return true;
  17047. }
  17048. }
  17049. return false;
  17050. }
  17051. module.exports = arraySome;
  17052. /***/ }),
  17053. /* 211 */
  17054. /***/ (function(module, exports) {
  17055. /**
  17056. * Converts `map` to its key-value pairs.
  17057. *
  17058. * @private
  17059. * @param {Object} map The map to convert.
  17060. * @returns {Array} Returns the key-value pairs.
  17061. */
  17062. function mapToArray(map) {
  17063. var index = -1,
  17064. result = Array(map.size);
  17065. map.forEach(function(value, key) {
  17066. result[++index] = [key, value];
  17067. });
  17068. return result;
  17069. }
  17070. module.exports = mapToArray;
  17071. /***/ }),
  17072. /* 212 */
  17073. /***/ (function(module, exports, __webpack_require__) {
  17074. var isObject = __webpack_require__(7);
  17075. /**
  17076. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  17077. *
  17078. * @private
  17079. * @param {*} value The value to check.
  17080. * @returns {boolean} Returns `true` if `value` if suitable for strict
  17081. * equality comparisons, else `false`.
  17082. */
  17083. function isStrictComparable(value) {
  17084. return value === value && !isObject(value);
  17085. }
  17086. module.exports = isStrictComparable;
  17087. /***/ }),
  17088. /* 213 */
  17089. /***/ (function(module, exports) {
  17090. /**
  17091. * A specialized version of `matchesProperty` for source values suitable
  17092. * for strict equality comparisons, i.e. `===`.
  17093. *
  17094. * @private
  17095. * @param {string} key The key of the property to get.
  17096. * @param {*} srcValue The value to match.
  17097. * @returns {Function} Returns the new spec function.
  17098. */
  17099. function matchesStrictComparable(key, srcValue) {
  17100. return function(object) {
  17101. if (object == null) {
  17102. return false;
  17103. }
  17104. return object[key] === srcValue &&
  17105. (srcValue !== undefined || (key in Object(object)));
  17106. };
  17107. }
  17108. module.exports = matchesStrictComparable;
  17109. /***/ }),
  17110. /* 214 */
  17111. /***/ (function(module, exports, __webpack_require__) {
  17112. var memoizeCapped = __webpack_require__(432);
  17113. /** Used to match property names within property paths. */
  17114. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  17115. /** Used to match backslashes in property paths. */
  17116. var reEscapeChar = /\\(\\)?/g;
  17117. /**
  17118. * Converts `string` to a property path array.
  17119. *
  17120. * @private
  17121. * @param {string} string The string to convert.
  17122. * @returns {Array} Returns the property path array.
  17123. */
  17124. var stringToPath = memoizeCapped(function(string) {
  17125. var result = [];
  17126. if (string.charCodeAt(0) === 46 /* . */) {
  17127. result.push('');
  17128. }
  17129. string.replace(rePropName, function(match, number, quote, subString) {
  17130. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  17131. });
  17132. return result;
  17133. });
  17134. module.exports = stringToPath;
  17135. /***/ }),
  17136. /* 215 */
  17137. /***/ (function(module, exports, __webpack_require__) {
  17138. var MapCache = __webpack_require__(107);
  17139. /** Error message constants. */
  17140. var FUNC_ERROR_TEXT = 'Expected a function';
  17141. /**
  17142. * Creates a function that memoizes the result of `func`. If `resolver` is
  17143. * provided, it determines the cache key for storing the result based on the
  17144. * arguments provided to the memoized function. By default, the first argument
  17145. * provided to the memoized function is used as the map cache key. The `func`
  17146. * is invoked with the `this` binding of the memoized function.
  17147. *
  17148. * **Note:** The cache is exposed as the `cache` property on the memoized
  17149. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  17150. * constructor with one whose instances implement the
  17151. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  17152. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  17153. *
  17154. * @static
  17155. * @memberOf _
  17156. * @since 0.1.0
  17157. * @category Function
  17158. * @param {Function} func The function to have its output memoized.
  17159. * @param {Function} [resolver] The function to resolve the cache key.
  17160. * @returns {Function} Returns the new memoized function.
  17161. * @example
  17162. *
  17163. * var object = { 'a': 1, 'b': 2 };
  17164. * var other = { 'c': 3, 'd': 4 };
  17165. *
  17166. * var values = _.memoize(_.values);
  17167. * values(object);
  17168. * // => [1, 2]
  17169. *
  17170. * values(other);
  17171. * // => [3, 4]
  17172. *
  17173. * object.a = 2;
  17174. * values(object);
  17175. * // => [1, 2]
  17176. *
  17177. * // Modify the result cache.
  17178. * values.cache.set(object, ['a', 'b']);
  17179. * values(object);
  17180. * // => ['a', 'b']
  17181. *
  17182. * // Replace `_.memoize.Cache`.
  17183. * _.memoize.Cache = WeakMap;
  17184. */
  17185. function memoize(func, resolver) {
  17186. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  17187. throw new TypeError(FUNC_ERROR_TEXT);
  17188. }
  17189. var memoized = function() {
  17190. var args = arguments,
  17191. key = resolver ? resolver.apply(this, args) : args[0],
  17192. cache = memoized.cache;
  17193. if (cache.has(key)) {
  17194. return cache.get(key);
  17195. }
  17196. var result = func.apply(this, args);
  17197. memoized.cache = cache.set(key, result) || cache;
  17198. return result;
  17199. };
  17200. memoized.cache = new (memoize.Cache || MapCache);
  17201. return memoized;
  17202. }
  17203. // Expose `MapCache`.
  17204. memoize.Cache = MapCache;
  17205. module.exports = memoize;
  17206. /***/ }),
  17207. /* 216 */
  17208. /***/ (function(module, exports, __webpack_require__) {
  17209. var baseHasIn = __webpack_require__(434),
  17210. hasPath = __webpack_require__(435);
  17211. /**
  17212. * Checks if `path` is a direct or inherited property of `object`.
  17213. *
  17214. * @static
  17215. * @memberOf _
  17216. * @since 4.0.0
  17217. * @category Object
  17218. * @param {Object} object The object to query.
  17219. * @param {Array|string} path The path to check.
  17220. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  17221. * @example
  17222. *
  17223. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  17224. *
  17225. * _.hasIn(object, 'a');
  17226. * // => true
  17227. *
  17228. * _.hasIn(object, 'a.b');
  17229. * // => true
  17230. *
  17231. * _.hasIn(object, ['a', 'b']);
  17232. * // => true
  17233. *
  17234. * _.hasIn(object, 'b');
  17235. * // => false
  17236. */
  17237. function hasIn(object, path) {
  17238. return object != null && hasPath(object, path, baseHasIn);
  17239. }
  17240. module.exports = hasIn;
  17241. /***/ }),
  17242. /* 217 */
  17243. /***/ (function(module, exports, __webpack_require__) {
  17244. var arrayPush = __webpack_require__(113),
  17245. isFlattenable = __webpack_require__(441);
  17246. /**
  17247. * The base implementation of `_.flatten` with support for restricting flattening.
  17248. *
  17249. * @private
  17250. * @param {Array} array The array to flatten.
  17251. * @param {number} depth The maximum recursion depth.
  17252. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  17253. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  17254. * @param {Array} [result=[]] The initial result value.
  17255. * @returns {Array} Returns the new flattened array.
  17256. */
  17257. function baseFlatten(array, depth, predicate, isStrict, result) {
  17258. var index = -1,
  17259. length = array.length;
  17260. predicate || (predicate = isFlattenable);
  17261. result || (result = []);
  17262. while (++index < length) {
  17263. var value = array[index];
  17264. if (depth > 0 && predicate(value)) {
  17265. if (depth > 1) {
  17266. // Recursively flatten arrays (susceptible to call stack limits).
  17267. baseFlatten(value, depth - 1, predicate, isStrict, result);
  17268. } else {
  17269. arrayPush(result, value);
  17270. }
  17271. } else if (!isStrict) {
  17272. result[result.length] = value;
  17273. }
  17274. }
  17275. return result;
  17276. }
  17277. module.exports = baseFlatten;
  17278. /***/ }),
  17279. /* 218 */
  17280. /***/ (function(module, exports, __webpack_require__) {
  17281. var apply = __webpack_require__(119);
  17282. /* Built-in method references for those with the same name as other `lodash` methods. */
  17283. var nativeMax = Math.max;
  17284. /**
  17285. * A specialized version of `baseRest` which transforms the rest array.
  17286. *
  17287. * @private
  17288. * @param {Function} func The function to apply a rest parameter to.
  17289. * @param {number} [start=func.length-1] The start position of the rest parameter.
  17290. * @param {Function} transform The rest array transform.
  17291. * @returns {Function} Returns the new function.
  17292. */
  17293. function overRest(func, start, transform) {
  17294. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  17295. return function() {
  17296. var args = arguments,
  17297. index = -1,
  17298. length = nativeMax(args.length - start, 0),
  17299. array = Array(length);
  17300. while (++index < length) {
  17301. array[index] = args[start + index];
  17302. }
  17303. index = -1;
  17304. var otherArgs = Array(start + 1);
  17305. while (++index < start) {
  17306. otherArgs[index] = args[index];
  17307. }
  17308. otherArgs[start] = transform(array);
  17309. return apply(func, this, otherArgs);
  17310. };
  17311. }
  17312. module.exports = overRest;
  17313. /***/ }),
  17314. /* 219 */
  17315. /***/ (function(module, exports, __webpack_require__) {
  17316. var createBaseFor = __webpack_require__(448);
  17317. /**
  17318. * The base implementation of `baseForOwn` which iterates over `object`
  17319. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  17320. * Iteratee functions may exit iteration early by explicitly returning `false`.
  17321. *
  17322. * @private
  17323. * @param {Object} object The object to iterate over.
  17324. * @param {Function} iteratee The function invoked per iteration.
  17325. * @param {Function} keysFunc The function to get the keys of `object`.
  17326. * @returns {Object} Returns `object`.
  17327. */
  17328. var baseFor = createBaseFor();
  17329. module.exports = baseFor;
  17330. /***/ }),
  17331. /* 220 */
  17332. /***/ (function(module, exports, __webpack_require__) {
  17333. "use strict";
  17334. // Copyright Joyent, Inc. and other Node contributors.
  17335. //
  17336. // Permission is hereby granted, free of charge, to any person obtaining a
  17337. // copy of this software and associated documentation files (the
  17338. // "Software"), to deal in the Software without restriction, including
  17339. // without limitation the rights to use, copy, modify, merge, publish,
  17340. // distribute, sublicense, and/or sell copies of the Software, and to permit
  17341. // persons to whom the Software is furnished to do so, subject to the
  17342. // following conditions:
  17343. //
  17344. // The above copyright notice and this permission notice shall be included
  17345. // in all copies or substantial portions of the Software.
  17346. //
  17347. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17348. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17349. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17350. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  17351. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  17352. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  17353. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  17354. var punycode = __webpack_require__(452);
  17355. var util = __webpack_require__(453);
  17356. exports.parse = urlParse;
  17357. exports.resolve = urlResolve;
  17358. exports.resolveObject = urlResolveObject;
  17359. exports.format = urlFormat;
  17360. exports.Url = Url;
  17361. function Url() {
  17362. this.protocol = null;
  17363. this.slashes = null;
  17364. this.auth = null;
  17365. this.host = null;
  17366. this.port = null;
  17367. this.hostname = null;
  17368. this.hash = null;
  17369. this.search = null;
  17370. this.query = null;
  17371. this.pathname = null;
  17372. this.path = null;
  17373. this.href = null;
  17374. }
  17375. // Reference: RFC 3986, RFC 1808, RFC 2396
  17376. // define these here so at least they only have to be
  17377. // compiled once on the first module load.
  17378. var protocolPattern = /^([a-z0-9.+-]+:)/i,
  17379. portPattern = /:[0-9]*$/,
  17380. // Special case for a simple path URL
  17381. simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  17382. // RFC 2396: characters reserved for delimiting URLs.
  17383. // We actually just auto-escape these.
  17384. delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
  17385. // RFC 2396: characters not allowed for various reasons.
  17386. unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
  17387. // Allowed by RFCs, but cause of XSS attacks. Always escape these.
  17388. autoEscape = ['\''].concat(unwise),
  17389. // Characters that are never ever allowed in a hostname.
  17390. // Note that any invalid chars are also handled, but these
  17391. // are the ones that are *expected* to be seen, so we fast-path
  17392. // them.
  17393. nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
  17394. hostEndingChars = ['/', '?', '#'],
  17395. hostnameMaxLen = 255,
  17396. hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
  17397. hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  17398. // protocols that can allow "unsafe" and "unwise" chars.
  17399. unsafeProtocol = {
  17400. 'javascript': true,
  17401. 'javascript:': true
  17402. },
  17403. // protocols that never have a hostname.
  17404. hostlessProtocol = {
  17405. 'javascript': true,
  17406. 'javascript:': true
  17407. },
  17408. // protocols that always contain a // bit.
  17409. slashedProtocol = {
  17410. 'http': true,
  17411. 'https': true,
  17412. 'ftp': true,
  17413. 'gopher': true,
  17414. 'file': true,
  17415. 'http:': true,
  17416. 'https:': true,
  17417. 'ftp:': true,
  17418. 'gopher:': true,
  17419. 'file:': true
  17420. },
  17421. querystring = __webpack_require__(454);
  17422. function urlParse(url, parseQueryString, slashesDenoteHost) {
  17423. if (url && util.isObject(url) && url instanceof Url) return url;
  17424. var u = new Url;
  17425. u.parse(url, parseQueryString, slashesDenoteHost);
  17426. return u;
  17427. }
  17428. Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
  17429. if (!util.isString(url)) {
  17430. throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
  17431. }
  17432. // Copy chrome, IE, opera backslash-handling behavior.
  17433. // Back slashes before the query string get converted to forward slashes
  17434. // See: https://code.google.com/p/chromium/issues/detail?id=25916
  17435. var queryIndex = url.indexOf('?'),
  17436. splitter =
  17437. (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',
  17438. uSplit = url.split(splitter),
  17439. slashRegex = /\\/g;
  17440. uSplit[0] = uSplit[0].replace(slashRegex, '/');
  17441. url = uSplit.join(splitter);
  17442. var rest = url;
  17443. // trim before proceeding.
  17444. // This is to support parse stuff like " http://foo.com \n"
  17445. rest = rest.trim();
  17446. if (!slashesDenoteHost && url.split('#').length === 1) {
  17447. // Try fast path regexp
  17448. var simplePath = simplePathPattern.exec(rest);
  17449. if (simplePath) {
  17450. this.path = rest;
  17451. this.href = rest;
  17452. this.pathname = simplePath[1];
  17453. if (simplePath[2]) {
  17454. this.search = simplePath[2];
  17455. if (parseQueryString) {
  17456. this.query = querystring.parse(this.search.substr(1));
  17457. } else {
  17458. this.query = this.search.substr(1);
  17459. }
  17460. } else if (parseQueryString) {
  17461. this.search = '';
  17462. this.query = {};
  17463. }
  17464. return this;
  17465. }
  17466. }
  17467. var proto = protocolPattern.exec(rest);
  17468. if (proto) {
  17469. proto = proto[0];
  17470. var lowerProto = proto.toLowerCase();
  17471. this.protocol = lowerProto;
  17472. rest = rest.substr(proto.length);
  17473. }
  17474. // figure out if it's got a host
  17475. // user@server is *always* interpreted as a hostname, and url
  17476. // resolution will treat //foo/bar as host=foo,path=bar because that's
  17477. // how the browser resolves relative URLs.
  17478. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  17479. var slashes = rest.substr(0, 2) === '//';
  17480. if (slashes && !(proto && hostlessProtocol[proto])) {
  17481. rest = rest.substr(2);
  17482. this.slashes = true;
  17483. }
  17484. }
  17485. if (!hostlessProtocol[proto] &&
  17486. (slashes || (proto && !slashedProtocol[proto]))) {
  17487. // there's a hostname.
  17488. // the first instance of /, ?, ;, or # ends the host.
  17489. //
  17490. // If there is an @ in the hostname, then non-host chars *are* allowed
  17491. // to the left of the last @ sign, unless some host-ending character
  17492. // comes *before* the @-sign.
  17493. // URLs are obnoxious.
  17494. //
  17495. // ex:
  17496. // http://a@b@c/ => user:a@b host:c
  17497. // http://a@b?@c => user:a host:c path:/?@c
  17498. // v0.12 TODO(isaacs): This is not quite how Chrome does things.
  17499. // Review our test case against browsers more comprehensively.
  17500. // find the first instance of any hostEndingChars
  17501. var hostEnd = -1;
  17502. for (var i = 0; i < hostEndingChars.length; i++) {
  17503. var hec = rest.indexOf(hostEndingChars[i]);
  17504. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
  17505. hostEnd = hec;
  17506. }
  17507. // at this point, either we have an explicit point where the
  17508. // auth portion cannot go past, or the last @ char is the decider.
  17509. var auth, atSign;
  17510. if (hostEnd === -1) {
  17511. // atSign can be anywhere.
  17512. atSign = rest.lastIndexOf('@');
  17513. } else {
  17514. // atSign must be in auth portion.
  17515. // http://a@b/c@d => host:b auth:a path:/c@d
  17516. atSign = rest.lastIndexOf('@', hostEnd);
  17517. }
  17518. // Now we have a portion which is definitely the auth.
  17519. // Pull that off.
  17520. if (atSign !== -1) {
  17521. auth = rest.slice(0, atSign);
  17522. rest = rest.slice(atSign + 1);
  17523. this.auth = decodeURIComponent(auth);
  17524. }
  17525. // the host is the remaining to the left of the first non-host char
  17526. hostEnd = -1;
  17527. for (var i = 0; i < nonHostChars.length; i++) {
  17528. var hec = rest.indexOf(nonHostChars[i]);
  17529. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
  17530. hostEnd = hec;
  17531. }
  17532. // if we still have not hit it, then the entire thing is a host.
  17533. if (hostEnd === -1)
  17534. hostEnd = rest.length;
  17535. this.host = rest.slice(0, hostEnd);
  17536. rest = rest.slice(hostEnd);
  17537. // pull out port.
  17538. this.parseHost();
  17539. // we've indicated that there is a hostname,
  17540. // so even if it's empty, it has to be present.
  17541. this.hostname = this.hostname || '';
  17542. // if hostname begins with [ and ends with ]
  17543. // assume that it's an IPv6 address.
  17544. var ipv6Hostname = this.hostname[0] === '[' &&
  17545. this.hostname[this.hostname.length - 1] === ']';
  17546. // validate a little.
  17547. if (!ipv6Hostname) {
  17548. var hostparts = this.hostname.split(/\./);
  17549. for (var i = 0, l = hostparts.length; i < l; i++) {
  17550. var part = hostparts[i];
  17551. if (!part) continue;
  17552. if (!part.match(hostnamePartPattern)) {
  17553. var newpart = '';
  17554. for (var j = 0, k = part.length; j < k; j++) {
  17555. if (part.charCodeAt(j) > 127) {
  17556. // we replace non-ASCII char with a temporary placeholder
  17557. // we need this to make sure size of hostname is not
  17558. // broken by replacing non-ASCII by nothing
  17559. newpart += 'x';
  17560. } else {
  17561. newpart += part[j];
  17562. }
  17563. }
  17564. // we test again with ASCII char only
  17565. if (!newpart.match(hostnamePartPattern)) {
  17566. var validParts = hostparts.slice(0, i);
  17567. var notHost = hostparts.slice(i + 1);
  17568. var bit = part.match(hostnamePartStart);
  17569. if (bit) {
  17570. validParts.push(bit[1]);
  17571. notHost.unshift(bit[2]);
  17572. }
  17573. if (notHost.length) {
  17574. rest = '/' + notHost.join('.') + rest;
  17575. }
  17576. this.hostname = validParts.join('.');
  17577. break;
  17578. }
  17579. }
  17580. }
  17581. }
  17582. if (this.hostname.length > hostnameMaxLen) {
  17583. this.hostname = '';
  17584. } else {
  17585. // hostnames are always lower case.
  17586. this.hostname = this.hostname.toLowerCase();
  17587. }
  17588. if (!ipv6Hostname) {
  17589. // IDNA Support: Returns a punycoded representation of "domain".
  17590. // It only converts parts of the domain name that
  17591. // have non-ASCII characters, i.e. it doesn't matter if
  17592. // you call it with a domain that already is ASCII-only.
  17593. this.hostname = punycode.toASCII(this.hostname);
  17594. }
  17595. var p = this.port ? ':' + this.port : '';
  17596. var h = this.hostname || '';
  17597. this.host = h + p;
  17598. this.href += this.host;
  17599. // strip [ and ] from the hostname
  17600. // the host field still retains them, though
  17601. if (ipv6Hostname) {
  17602. this.hostname = this.hostname.substr(1, this.hostname.length - 2);
  17603. if (rest[0] !== '/') {
  17604. rest = '/' + rest;
  17605. }
  17606. }
  17607. }
  17608. // now rest is set to the post-host stuff.
  17609. // chop off any delim chars.
  17610. if (!unsafeProtocol[lowerProto]) {
  17611. // First, make 100% sure that any "autoEscape" chars get
  17612. // escaped, even if encodeURIComponent doesn't think they
  17613. // need to be.
  17614. for (var i = 0, l = autoEscape.length; i < l; i++) {
  17615. var ae = autoEscape[i];
  17616. if (rest.indexOf(ae) === -1)
  17617. continue;
  17618. var esc = encodeURIComponent(ae);
  17619. if (esc === ae) {
  17620. esc = escape(ae);
  17621. }
  17622. rest = rest.split(ae).join(esc);
  17623. }
  17624. }
  17625. // chop off from the tail first.
  17626. var hash = rest.indexOf('#');
  17627. if (hash !== -1) {
  17628. // got a fragment string.
  17629. this.hash = rest.substr(hash);
  17630. rest = rest.slice(0, hash);
  17631. }
  17632. var qm = rest.indexOf('?');
  17633. if (qm !== -1) {
  17634. this.search = rest.substr(qm);
  17635. this.query = rest.substr(qm + 1);
  17636. if (parseQueryString) {
  17637. this.query = querystring.parse(this.query);
  17638. }
  17639. rest = rest.slice(0, qm);
  17640. } else if (parseQueryString) {
  17641. // no query string, but parseQueryString still requested
  17642. this.search = '';
  17643. this.query = {};
  17644. }
  17645. if (rest) this.pathname = rest;
  17646. if (slashedProtocol[lowerProto] &&
  17647. this.hostname && !this.pathname) {
  17648. this.pathname = '/';
  17649. }
  17650. //to support http.request
  17651. if (this.pathname || this.search) {
  17652. var p = this.pathname || '';
  17653. var s = this.search || '';
  17654. this.path = p + s;
  17655. }
  17656. // finally, reconstruct the href based on what has been validated.
  17657. this.href = this.format();
  17658. return this;
  17659. };
  17660. // format a parsed object into a url string
  17661. function urlFormat(obj) {
  17662. // ensure it's an object, and not a string url.
  17663. // If it's an obj, this is a no-op.
  17664. // this way, you can call url_format() on strings
  17665. // to clean up potentially wonky urls.
  17666. if (util.isString(obj)) obj = urlParse(obj);
  17667. if (!(obj instanceof Url)) return Url.prototype.format.call(obj);
  17668. return obj.format();
  17669. }
  17670. Url.prototype.format = function() {
  17671. var auth = this.auth || '';
  17672. if (auth) {
  17673. auth = encodeURIComponent(auth);
  17674. auth = auth.replace(/%3A/i, ':');
  17675. auth += '@';
  17676. }
  17677. var protocol = this.protocol || '',
  17678. pathname = this.pathname || '',
  17679. hash = this.hash || '',
  17680. host = false,
  17681. query = '';
  17682. if (this.host) {
  17683. host = auth + this.host;
  17684. } else if (this.hostname) {
  17685. host = auth + (this.hostname.indexOf(':') === -1 ?
  17686. this.hostname :
  17687. '[' + this.hostname + ']');
  17688. if (this.port) {
  17689. host += ':' + this.port;
  17690. }
  17691. }
  17692. if (this.query &&
  17693. util.isObject(this.query) &&
  17694. Object.keys(this.query).length) {
  17695. query = querystring.stringify(this.query);
  17696. }
  17697. var search = this.search || (query && ('?' + query)) || '';
  17698. if (protocol && protocol.substr(-1) !== ':') protocol += ':';
  17699. // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.
  17700. // unless they had them to begin with.
  17701. if (this.slashes ||
  17702. (!protocol || slashedProtocol[protocol]) && host !== false) {
  17703. host = '//' + (host || '');
  17704. if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
  17705. } else if (!host) {
  17706. host = '';
  17707. }
  17708. if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
  17709. if (search && search.charAt(0) !== '?') search = '?' + search;
  17710. pathname = pathname.replace(/[?#]/g, function(match) {
  17711. return encodeURIComponent(match);
  17712. });
  17713. search = search.replace('#', '%23');
  17714. return protocol + host + pathname + search + hash;
  17715. };
  17716. function urlResolve(source, relative) {
  17717. return urlParse(source, false, true).resolve(relative);
  17718. }
  17719. Url.prototype.resolve = function(relative) {
  17720. return this.resolveObject(urlParse(relative, false, true)).format();
  17721. };
  17722. function urlResolveObject(source, relative) {
  17723. if (!source) return relative;
  17724. return urlParse(source, false, true).resolveObject(relative);
  17725. }
  17726. Url.prototype.resolveObject = function(relative) {
  17727. if (util.isString(relative)) {
  17728. var rel = new Url();
  17729. rel.parse(relative, false, true);
  17730. relative = rel;
  17731. }
  17732. var result = new Url();
  17733. var tkeys = Object.keys(this);
  17734. for (var tk = 0; tk < tkeys.length; tk++) {
  17735. var tkey = tkeys[tk];
  17736. result[tkey] = this[tkey];
  17737. }
  17738. // hash is always overridden, no matter what.
  17739. // even href="" will remove it.
  17740. result.hash = relative.hash;
  17741. // if the relative url is empty, then there's nothing left to do here.
  17742. if (relative.href === '') {
  17743. result.href = result.format();
  17744. return result;
  17745. }
  17746. // hrefs like //foo/bar always cut to the protocol.
  17747. if (relative.slashes && !relative.protocol) {
  17748. // take everything except the protocol from relative
  17749. var rkeys = Object.keys(relative);
  17750. for (var rk = 0; rk < rkeys.length; rk++) {
  17751. var rkey = rkeys[rk];
  17752. if (rkey !== 'protocol')
  17753. result[rkey] = relative[rkey];
  17754. }
  17755. //urlParse appends trailing / to urls like http://www.example.com
  17756. if (slashedProtocol[result.protocol] &&
  17757. result.hostname && !result.pathname) {
  17758. result.path = result.pathname = '/';
  17759. }
  17760. result.href = result.format();
  17761. return result;
  17762. }
  17763. if (relative.protocol && relative.protocol !== result.protocol) {
  17764. // if it's a known url protocol, then changing
  17765. // the protocol does weird things
  17766. // first, if it's not file:, then we MUST have a host,
  17767. // and if there was a path
  17768. // to begin with, then we MUST have a path.
  17769. // if it is file:, then the host is dropped,
  17770. // because that's known to be hostless.
  17771. // anything else is assumed to be absolute.
  17772. if (!slashedProtocol[relative.protocol]) {
  17773. var keys = Object.keys(relative);
  17774. for (var v = 0; v < keys.length; v++) {
  17775. var k = keys[v];
  17776. result[k] = relative[k];
  17777. }
  17778. result.href = result.format();
  17779. return result;
  17780. }
  17781. result.protocol = relative.protocol;
  17782. if (!relative.host && !hostlessProtocol[relative.protocol]) {
  17783. var relPath = (relative.pathname || '').split('/');
  17784. while (relPath.length && !(relative.host = relPath.shift()));
  17785. if (!relative.host) relative.host = '';
  17786. if (!relative.hostname) relative.hostname = '';
  17787. if (relPath[0] !== '') relPath.unshift('');
  17788. if (relPath.length < 2) relPath.unshift('');
  17789. result.pathname = relPath.join('/');
  17790. } else {
  17791. result.pathname = relative.pathname;
  17792. }
  17793. result.search = relative.search;
  17794. result.query = relative.query;
  17795. result.host = relative.host || '';
  17796. result.auth = relative.auth;
  17797. result.hostname = relative.hostname || relative.host;
  17798. result.port = relative.port;
  17799. // to support http.request
  17800. if (result.pathname || result.search) {
  17801. var p = result.pathname || '';
  17802. var s = result.search || '';
  17803. result.path = p + s;
  17804. }
  17805. result.slashes = result.slashes || relative.slashes;
  17806. result.href = result.format();
  17807. return result;
  17808. }
  17809. var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),
  17810. isRelAbs = (
  17811. relative.host ||
  17812. relative.pathname && relative.pathname.charAt(0) === '/'
  17813. ),
  17814. mustEndAbs = (isRelAbs || isSourceAbs ||
  17815. (result.host && relative.pathname)),
  17816. removeAllDots = mustEndAbs,
  17817. srcPath = result.pathname && result.pathname.split('/') || [],
  17818. relPath = relative.pathname && relative.pathname.split('/') || [],
  17819. psychotic = result.protocol && !slashedProtocol[result.protocol];
  17820. // if the url is a non-slashed url, then relative
  17821. // links like ../.. should be able
  17822. // to crawl up to the hostname, as well. This is strange.
  17823. // result.protocol has already been set by now.
  17824. // Later on, put the first path part into the host field.
  17825. if (psychotic) {
  17826. result.hostname = '';
  17827. result.port = null;
  17828. if (result.host) {
  17829. if (srcPath[0] === '') srcPath[0] = result.host;
  17830. else srcPath.unshift(result.host);
  17831. }
  17832. result.host = '';
  17833. if (relative.protocol) {
  17834. relative.hostname = null;
  17835. relative.port = null;
  17836. if (relative.host) {
  17837. if (relPath[0] === '') relPath[0] = relative.host;
  17838. else relPath.unshift(relative.host);
  17839. }
  17840. relative.host = null;
  17841. }
  17842. mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
  17843. }
  17844. if (isRelAbs) {
  17845. // it's absolute.
  17846. result.host = (relative.host || relative.host === '') ?
  17847. relative.host : result.host;
  17848. result.hostname = (relative.hostname || relative.hostname === '') ?
  17849. relative.hostname : result.hostname;
  17850. result.search = relative.search;
  17851. result.query = relative.query;
  17852. srcPath = relPath;
  17853. // fall through to the dot-handling below.
  17854. } else if (relPath.length) {
  17855. // it's relative
  17856. // throw away the existing file, and take the new path instead.
  17857. if (!srcPath) srcPath = [];
  17858. srcPath.pop();
  17859. srcPath = srcPath.concat(relPath);
  17860. result.search = relative.search;
  17861. result.query = relative.query;
  17862. } else if (!util.isNullOrUndefined(relative.search)) {
  17863. // just pull out the search.
  17864. // like href='?foo'.
  17865. // Put this after the other two cases because it simplifies the booleans
  17866. if (psychotic) {
  17867. result.hostname = result.host = srcPath.shift();
  17868. //occationaly the auth can get stuck only in host
  17869. //this especially happens in cases like
  17870. //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
  17871. var authInHost = result.host && result.host.indexOf('@') > 0 ?
  17872. result.host.split('@') : false;
  17873. if (authInHost) {
  17874. result.auth = authInHost.shift();
  17875. result.host = result.hostname = authInHost.shift();
  17876. }
  17877. }
  17878. result.search = relative.search;
  17879. result.query = relative.query;
  17880. //to support http.request
  17881. if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
  17882. result.path = (result.pathname ? result.pathname : '') +
  17883. (result.search ? result.search : '');
  17884. }
  17885. result.href = result.format();
  17886. return result;
  17887. }
  17888. if (!srcPath.length) {
  17889. // no path at all. easy.
  17890. // we've already handled the other stuff above.
  17891. result.pathname = null;
  17892. //to support http.request
  17893. if (result.search) {
  17894. result.path = '/' + result.search;
  17895. } else {
  17896. result.path = null;
  17897. }
  17898. result.href = result.format();
  17899. return result;
  17900. }
  17901. // if a url ENDs in . or .., then it must get a trailing slash.
  17902. // however, if it ends in anything else non-slashy,
  17903. // then it must NOT get a trailing slash.
  17904. var last = srcPath.slice(-1)[0];
  17905. var hasTrailingSlash = (
  17906. (result.host || relative.host || srcPath.length > 1) &&
  17907. (last === '.' || last === '..') || last === '');
  17908. // strip single dots, resolve double dots to parent dir
  17909. // if the path tries to go above the root, `up` ends up > 0
  17910. var up = 0;
  17911. for (var i = srcPath.length; i >= 0; i--) {
  17912. last = srcPath[i];
  17913. if (last === '.') {
  17914. srcPath.splice(i, 1);
  17915. } else if (last === '..') {
  17916. srcPath.splice(i, 1);
  17917. up++;
  17918. } else if (up) {
  17919. srcPath.splice(i, 1);
  17920. up--;
  17921. }
  17922. }
  17923. // if the path is allowed to go above the root, restore leading ..s
  17924. if (!mustEndAbs && !removeAllDots) {
  17925. for (; up--; up) {
  17926. srcPath.unshift('..');
  17927. }
  17928. }
  17929. if (mustEndAbs && srcPath[0] !== '' &&
  17930. (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
  17931. srcPath.unshift('');
  17932. }
  17933. if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
  17934. srcPath.push('');
  17935. }
  17936. var isAbsolute = srcPath[0] === '' ||
  17937. (srcPath[0] && srcPath[0].charAt(0) === '/');
  17938. // put the host back
  17939. if (psychotic) {
  17940. result.hostname = result.host = isAbsolute ? '' :
  17941. srcPath.length ? srcPath.shift() : '';
  17942. //occationaly the auth can get stuck only in host
  17943. //this especially happens in cases like
  17944. //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
  17945. var authInHost = result.host && result.host.indexOf('@') > 0 ?
  17946. result.host.split('@') : false;
  17947. if (authInHost) {
  17948. result.auth = authInHost.shift();
  17949. result.host = result.hostname = authInHost.shift();
  17950. }
  17951. }
  17952. mustEndAbs = mustEndAbs || (result.host && srcPath.length);
  17953. if (mustEndAbs && !isAbsolute) {
  17954. srcPath.unshift('');
  17955. }
  17956. if (!srcPath.length) {
  17957. result.pathname = null;
  17958. result.path = null;
  17959. } else {
  17960. result.pathname = srcPath.join('/');
  17961. }
  17962. //to support request.http
  17963. if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
  17964. result.path = (result.pathname ? result.pathname : '') +
  17965. (result.search ? result.search : '');
  17966. }
  17967. result.auth = relative.auth || result.auth;
  17968. result.slashes = result.slashes || relative.slashes;
  17969. result.href = result.format();
  17970. return result;
  17971. };
  17972. Url.prototype.parseHost = function() {
  17973. var host = this.host;
  17974. var port = portPattern.exec(host);
  17975. if (port) {
  17976. port = port[0];
  17977. if (port !== ':') {
  17978. this.port = port.substr(1);
  17979. }
  17980. host = host.substr(0, host.length - port.length);
  17981. }
  17982. if (host) this.hostname = host;
  17983. };
  17984. /***/ }),
  17985. /* 221 */
  17986. /***/ (function(module, exports, __webpack_require__) {
  17987. "use strict";
  17988. const ElementCollection = __webpack_require__(222);
  17989. module.exports = function (selector, context) {
  17990. return new ElementCollection(selector, context);
  17991. };
  17992. /***/ }),
  17993. /* 222 */
  17994. /***/ (function(module, exports, __webpack_require__) {
  17995. "use strict";
  17996. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  17997. /* eslint-disable global-require, no-param-reassign, no-void */
  17998. /* eslint-disable no-underscore-dangle, prefer-rest-params, prefer-const */
  17999. const isFunction = __webpack_require__(13);
  18000. const extensions = {
  18001. attributes: __webpack_require__(457),
  18002. css: __webpack_require__(458),
  18003. classNames: __webpack_require__(459),
  18004. observers: __webpack_require__(461)
  18005. };
  18006. const idRegex = /^#([\w-]*)$/; // A helper for converting a NodeList to a JS Array
  18007. const nodeListToArray = function nodeListToArray(nodes) {
  18008. return Array.prototype.slice.call(nodes);
  18009. };
  18010. const selectorToElementArray = function selectorToElementArray(selector, context) {
  18011. let elements;
  18012. if (typeof selector === 'undefined') {
  18013. return [];
  18014. }
  18015. if (typeof selector === 'string') {
  18016. elements = [];
  18017. const idSelector = idRegex.exec(selector);
  18018. context = context || document;
  18019. if (idSelector && idSelector[1]) {
  18020. const element = context.getElementById(idSelector[1]);
  18021. if (element) {
  18022. elements.push(element);
  18023. }
  18024. } else {
  18025. elements = context.querySelectorAll(selector);
  18026. }
  18027. } else if (selector && (selector.nodeType || (typeof window !== undefined ? window : global).XMLHttpRequest && selector instanceof (typeof window !== undefined ? window : global).XMLHttpRequest || selector === (typeof window !== undefined ? window : global))) {
  18028. // allow OTHelpers(DOMNode) and OTHelpers(xmlHttpRequest)
  18029. elements = [selector];
  18030. context = selector;
  18031. } else if (Array.isArray(selector)) {
  18032. elements = selector.slice();
  18033. context = null;
  18034. } else {
  18035. elements = nodeListToArray(elements);
  18036. }
  18037. return elements;
  18038. }; // ElementCollection contains the result of calling OTHelpers.
  18039. //
  18040. // It has the following properties:
  18041. // length
  18042. // first
  18043. // last
  18044. //
  18045. // It also has a get method that can be used to access elements in the collection
  18046. //
  18047. // var videos = OTHelpers('video');
  18048. // var firstElement = videos.get(0); // identical to videos.first
  18049. // var lastElement = videos.get(videos.length-1); // identical to videos.last
  18050. // var allVideos = videos.get();
  18051. //
  18052. //
  18053. // The collection also implements the following helper methods:
  18054. // some, forEach, map, filter, find,
  18055. // appendTo, after, before, remove, empty,
  18056. // attr, center, width, height,
  18057. // addClass, removeClass, hasClass, toggleClass,
  18058. // on, off, once,
  18059. // observeStyleChanges, observeNodeOrChildNodeRemoval
  18060. //
  18061. // Mostly the usage should be obvious. When in doubt, assume it functions like
  18062. // the jQuery equivalent.
  18063. //
  18064. const ElementCollection = function ElementCollection(selector, context) {
  18065. const elements = selectorToElementArray(selector, context);
  18066. this.context = context;
  18067. this.toArray = function () {
  18068. return elements;
  18069. };
  18070. this.length = elements.length;
  18071. this.first = elements[0];
  18072. this.last = elements[elements.length - 1];
  18073. this.get = function (index) {
  18074. if (index === void 0) {
  18075. return elements;
  18076. }
  18077. return elements[index];
  18078. };
  18079. };
  18080. module.exports = ElementCollection;
  18081. ElementCollection._attachToOTHelpers = {}; // @remove
  18082. ElementCollection._attachToOTHelpers.removeElement = function (element) {
  18083. return new ElementCollection(element).remove();
  18084. };
  18085. ElementCollection.prototype.getAsArray = function () {
  18086. let _collection = this.get();
  18087. if (!isFunction(_collection.forEach)) {
  18088. // It's possibly something Array-ish that isn't quite an
  18089. // Array. Something like arguments or a NodeList
  18090. _collection = nodeListToArray(_collection);
  18091. }
  18092. return _collection;
  18093. };
  18094. ElementCollection.prototype.some = function (iter, context) {
  18095. return this.getAsArray().some(iter, context);
  18096. };
  18097. ElementCollection.prototype.forEach = function (fn, context) {
  18098. this.getAsArray().forEach(fn, context);
  18099. return this;
  18100. };
  18101. ElementCollection.prototype.map = function (fn, context) {
  18102. return new ElementCollection(this.getAsArray().map(fn, context), this.context);
  18103. };
  18104. ElementCollection.prototype.filter = function (fn, context) {
  18105. return new ElementCollection(this.getAsArray().filter(fn, context), this.context);
  18106. };
  18107. ElementCollection.prototype.find = function (selector) {
  18108. return new ElementCollection(selector, this.first);
  18109. }; // Helper function for adding event listeners to dom elements.
  18110. // WARNING: This doesn't preserve event types, your handler could
  18111. // be getting all kinds of different parameters depending on the browser.
  18112. // You also may have different scopes depending on the browser and bubbling
  18113. // and cancelable are not supported.
  18114. ElementCollection.prototype.on = function (eventName, handler) {
  18115. return this.forEach(element => {
  18116. element.addEventListener(eventName, handler, false);
  18117. });
  18118. }; // Helper function for removing event listeners from dom elements.
  18119. ElementCollection.prototype.off = function (eventName, handler) {
  18120. return this.forEach(element => {
  18121. element.removeEventListener(eventName, handler, false);
  18122. });
  18123. };
  18124. ElementCollection.prototype.once = function (eventName, handler) {
  18125. const removeAfterTrigger = function () {
  18126. this.off(eventName, removeAfterTrigger);
  18127. handler(...arguments);
  18128. }.bind(this);
  18129. return this.on(eventName, removeAfterTrigger);
  18130. };
  18131. ElementCollection.prototype.appendTo = function (parentElement) {
  18132. if (!parentElement) {
  18133. throw new Error('appendTo requires a DOMElement to append to.');
  18134. }
  18135. return this.forEach(child => {
  18136. parentElement.appendChild(child);
  18137. });
  18138. };
  18139. ElementCollection.prototype.append = function () {
  18140. const parentElement = this.first;
  18141. if (!parentElement) {
  18142. return this;
  18143. }
  18144. Array.prototype.forEach.call(arguments, child => {
  18145. parentElement.appendChild(child);
  18146. });
  18147. return this;
  18148. };
  18149. ElementCollection.prototype.prepend = function () {
  18150. if (arguments.length === 0) {
  18151. return this;
  18152. }
  18153. const parentElement = this.first;
  18154. let elementsToPrepend;
  18155. if (!parentElement) {
  18156. return this;
  18157. }
  18158. elementsToPrepend = Array.prototype.slice.call(arguments);
  18159. if (!parentElement.firstElementChild) {
  18160. parentElement.appendChild(elementsToPrepend.shift());
  18161. }
  18162. elementsToPrepend.forEach(element => {
  18163. parentElement.insertBefore(element, parentElement.firstElementChild);
  18164. });
  18165. return this;
  18166. };
  18167. ElementCollection.prototype.after = function (prevElement) {
  18168. if (!prevElement) {
  18169. throw new Error('after requires a DOMElement to insert after');
  18170. }
  18171. return this.forEach(element => {
  18172. if (element.parentElement) {
  18173. if (prevElement !== element.parentNode.lastChild) {
  18174. element.parentElement.insertBefore(element, prevElement);
  18175. } else {
  18176. element.parentElement.appendChild(element);
  18177. }
  18178. }
  18179. });
  18180. };
  18181. ElementCollection.prototype.before = function (nextElement) {
  18182. if (!nextElement) {
  18183. throw new Error('before requires a DOMElement to insert before');
  18184. }
  18185. return this.forEach(element => {
  18186. if (element.parentElement) {
  18187. element.parentElement.insertBefore(element, nextElement);
  18188. }
  18189. });
  18190. };
  18191. ElementCollection.prototype.remove = function () {
  18192. return this.forEach(element => {
  18193. if (element.parentNode) {
  18194. element.parentNode.removeChild(element);
  18195. }
  18196. });
  18197. };
  18198. ElementCollection.prototype.empty = function () {
  18199. return this.forEach(element => {
  18200. // elements is a "live" NodesList collection. Meaning that the collection
  18201. // itself will be mutated as we remove elements from the DOM. This means
  18202. // that "while there are still elements" is safer than "iterate over each
  18203. // element" as the collection length and the elements indices will be modified
  18204. // with each iteration.
  18205. while (element.firstChild) {
  18206. element.removeChild(element.firstChild);
  18207. }
  18208. });
  18209. }; // Detects when an element is not part of the document flow because
  18210. // it or one of it's ancesters has display:none.
  18211. ElementCollection.prototype.isDisplayNone = function () {
  18212. return this.some(element => {
  18213. if ((element.offsetWidth === 0 || element.offsetHeight === 0) && new ElementCollection(element).css('display') === 'none') {
  18214. return true;
  18215. }
  18216. if (element.parentNode && element.parentNode.style) {
  18217. return new ElementCollection(element.parentNode).isDisplayNone();
  18218. }
  18219. return false;
  18220. });
  18221. };
  18222. const findElementWithDisplayNone = function findElementWithDisplayNone(element) {
  18223. if ((element.offsetWidth === 0 || element.offsetHeight === 0) && new ElementCollection(element).css('display') === 'none') {
  18224. return element;
  18225. }
  18226. if (element.parentNode && element.parentNode.style) {
  18227. return findElementWithDisplayNone(element.parentNode);
  18228. }
  18229. return null;
  18230. }; // @remove
  18231. ElementCollection._attachToOTHelpers.emptyElement = function (element) {
  18232. return new ElementCollection(element).empty();
  18233. };
  18234. ElementCollection._attachToOTHelpers._findElementWithDisplayNone = findElementWithDisplayNone;
  18235. extensions.css(ElementCollection, findElementWithDisplayNone);
  18236. extensions.attributes(ElementCollection);
  18237. extensions.classNames(ElementCollection);
  18238. extensions.observers(ElementCollection); // TODO: Deprecation logging?
  18239. // @remove
  18240. ['on', 'off', 'isDisplayNone', 'show', 'hide', 'css', 'makeVisibleAndYield', 'addClass', 'removeClass'].forEach(methodName => {
  18241. ElementCollection._attachToOTHelpers[methodName] = function ()
  18242. /* arguments */
  18243. {
  18244. const args = Array.prototype.slice.apply(arguments);
  18245. const element = args.shift();
  18246. const collection = new ElementCollection(element);
  18247. return ElementCollection.prototype[methodName].apply(collection, args);
  18248. };
  18249. });
  18250. /***/ }),
  18251. /* 223 */
  18252. /***/ (function(module, exports, __webpack_require__) {
  18253. "use strict";
  18254. const logging = __webpack_require__(1)('deprecation');
  18255. module.exports = function setDeprecatedProperty(object, key, _temp) {
  18256. let _ref = _temp === void 0 ? {} : _temp,
  18257. defaultValue = _ref.value,
  18258. _ref$name = _ref.name,
  18259. name = _ref$name === void 0 ? "" + key : _ref$name,
  18260. _ref$getWarning = _ref.getWarning,
  18261. getWarning = _ref$getWarning === void 0 ? '' : _ref$getWarning,
  18262. _ref$setWarning = _ref.setWarning,
  18263. setWarning = _ref$setWarning === void 0 ? '' : _ref$setWarning,
  18264. _ref$canSet = _ref.canSet,
  18265. canSet = _ref$canSet === void 0 ? false : _ref$canSet,
  18266. _ref$warnOnSet = _ref.warnOnSet,
  18267. warnOnSet = _ref$warnOnSet === void 0 ? false : _ref$warnOnSet;
  18268. let value = defaultValue;
  18269. let hasWarnedOnGet = false;
  18270. let hasWarnedOnSet = !warnOnSet;
  18271. const propertyDescriptor = {
  18272. get() {
  18273. if (!hasWarnedOnGet) {
  18274. hasWarnedOnGet = true;
  18275. logging.warn((name + " is deprecated, and will be removed in the future. " + getWarning).trim());
  18276. }
  18277. return value;
  18278. },
  18279. set(newValue) {
  18280. if (canSet) {
  18281. value = newValue;
  18282. }
  18283. if (!hasWarnedOnSet) {
  18284. hasWarnedOnSet = true;
  18285. if (canSet) {
  18286. logging.warn((name + " is deprecated. " + setWarning).trim());
  18287. } else {
  18288. logging.warn((name + " is deprecated, and will be removed in the future. " + setWarning).trim());
  18289. }
  18290. }
  18291. }
  18292. };
  18293. Object.defineProperty(object, key, propertyDescriptor);
  18294. };
  18295. /***/ }),
  18296. /* 224 */
  18297. /***/ (function(module, exports, __webpack_require__) {
  18298. var baseRest = __webpack_require__(94),
  18299. isIterateeCall = __webpack_require__(129);
  18300. /**
  18301. * Creates a function like `_.assign`.
  18302. *
  18303. * @private
  18304. * @param {Function} assigner The function to assign values.
  18305. * @returns {Function} Returns the new assigner function.
  18306. */
  18307. function createAssigner(assigner) {
  18308. return baseRest(function(object, sources) {
  18309. var index = -1,
  18310. length = sources.length,
  18311. customizer = length > 1 ? sources[length - 1] : undefined,
  18312. guard = length > 2 ? sources[2] : undefined;
  18313. customizer = (assigner.length > 3 && typeof customizer == 'function')
  18314. ? (length--, customizer)
  18315. : undefined;
  18316. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  18317. customizer = length < 3 ? undefined : customizer;
  18318. length = 1;
  18319. }
  18320. object = Object(object);
  18321. while (++index < length) {
  18322. var source = sources[index];
  18323. if (source) {
  18324. assigner(object, source, index, customizer);
  18325. }
  18326. }
  18327. return object;
  18328. });
  18329. }
  18330. module.exports = createAssigner;
  18331. /***/ }),
  18332. /* 225 */
  18333. /***/ (function(module, exports, __webpack_require__) {
  18334. "use strict";
  18335. module.exports = __webpack_require__(464)() ? WeakMap : __webpack_require__(465);
  18336. /***/ }),
  18337. /* 226 */
  18338. /***/ (function(module, exports, __webpack_require__) {
  18339. "use strict";
  18340. var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {};
  18341. module.exports = function (/* CustomCreate*/) {
  18342. var setPrototypeOf = Object.setPrototypeOf, customCreate = arguments[0] || create;
  18343. if (typeof setPrototypeOf !== "function") return false;
  18344. return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject;
  18345. };
  18346. /***/ }),
  18347. /* 227 */
  18348. /***/ (function(module, exports, __webpack_require__) {
  18349. "use strict";
  18350. /* eslint no-proto: "off" */
  18351. // Big thanks to @WebReflection for sorting this out
  18352. // https://gist.github.com/WebReflection/5593554
  18353. var isObject = __webpack_require__(228)
  18354. , value = __webpack_require__(31)
  18355. , objIsPrototypeOf = Object.prototype.isPrototypeOf
  18356. , defineProperty = Object.defineProperty
  18357. , nullDesc = { configurable: true, enumerable: false, writable: true, value: undefined }
  18358. , validate;
  18359. validate = function (obj, prototype) {
  18360. value(obj);
  18361. if (prototype === null || isObject(prototype)) return obj;
  18362. throw new TypeError("Prototype must be null or an object");
  18363. };
  18364. module.exports = (function (status) {
  18365. var fn, set;
  18366. if (!status) return null;
  18367. if (status.level === 2) {
  18368. if (status.set) {
  18369. set = status.set;
  18370. fn = function (obj, prototype) {
  18371. set.call(validate(obj, prototype), prototype);
  18372. return obj;
  18373. };
  18374. } else {
  18375. fn = function (obj, prototype) {
  18376. validate(obj, prototype).__proto__ = prototype;
  18377. return obj;
  18378. };
  18379. }
  18380. } else {
  18381. fn = function self(obj, prototype) {
  18382. var isNullBase;
  18383. validate(obj, prototype);
  18384. isNullBase = objIsPrototypeOf.call(self.nullPolyfill, obj);
  18385. if (isNullBase) delete self.nullPolyfill.__proto__;
  18386. if (prototype === null) prototype = self.nullPolyfill;
  18387. obj.__proto__ = prototype;
  18388. if (isNullBase) defineProperty(self.nullPolyfill, "__proto__", nullDesc);
  18389. return obj;
  18390. };
  18391. }
  18392. return Object.defineProperty(fn, "level", {
  18393. configurable: false,
  18394. enumerable: false,
  18395. writable: false,
  18396. value: status.level
  18397. });
  18398. })(
  18399. (function () {
  18400. var tmpObj1 = Object.create(null)
  18401. , tmpObj2 = {}
  18402. , set
  18403. , desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__");
  18404. if (desc) {
  18405. try {
  18406. set = desc.set; // Opera crashes at this point
  18407. set.call(tmpObj1, tmpObj2);
  18408. } catch (ignore) {}
  18409. if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { set: set, level: 2 };
  18410. }
  18411. tmpObj1.__proto__ = tmpObj2;
  18412. if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 2 };
  18413. tmpObj1 = {};
  18414. tmpObj1.__proto__ = tmpObj2;
  18415. if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 1 };
  18416. return false;
  18417. })()
  18418. );
  18419. __webpack_require__(467);
  18420. /***/ }),
  18421. /* 228 */
  18422. /***/ (function(module, exports, __webpack_require__) {
  18423. "use strict";
  18424. var isValue = __webpack_require__(44);
  18425. var map = { function: true, object: true };
  18426. module.exports = function (value) { return (isValue(value) && map[typeof value]) || false; };
  18427. /***/ }),
  18428. /* 229 */
  18429. /***/ (function(module, exports, __webpack_require__) {
  18430. "use strict";
  18431. var isFunction = __webpack_require__(470);
  18432. var classRe = /^\s*class[\s{/}]/, functionToString = Function.prototype.toString;
  18433. module.exports = function (value) {
  18434. if (!isFunction(value)) return false;
  18435. if (classRe.test(functionToString.call(value))) return false;
  18436. return true;
  18437. };
  18438. /***/ }),
  18439. /* 230 */
  18440. /***/ (function(module, exports, __webpack_require__) {
  18441. "use strict";
  18442. var isValue = __webpack_require__(44);
  18443. var forEach = Array.prototype.forEach, create = Object.create;
  18444. var process = function (src, obj) {
  18445. var key;
  18446. for (key in src) obj[key] = src[key];
  18447. };
  18448. // eslint-disable-next-line no-unused-vars
  18449. module.exports = function (opts1/*, …options*/) {
  18450. var result = create(null);
  18451. forEach.call(arguments, function (options) {
  18452. if (!isValue(options)) return;
  18453. process(Object(options), result);
  18454. });
  18455. return result;
  18456. };
  18457. /***/ }),
  18458. /* 231 */
  18459. /***/ (function(module, exports, __webpack_require__) {
  18460. "use strict";
  18461. module.exports = __webpack_require__(477)() ? String.prototype.contains : __webpack_require__(478);
  18462. /***/ }),
  18463. /* 232 */
  18464. /***/ (function(module, exports, __webpack_require__) {
  18465. "use strict";
  18466. var isArguments = __webpack_require__(95)
  18467. , isString = __webpack_require__(96)
  18468. , ArrayIterator = __webpack_require__(479)
  18469. , StringIterator = __webpack_require__(508)
  18470. , iterable = __webpack_require__(509)
  18471. , iteratorSymbol = __webpack_require__(45).iterator;
  18472. module.exports = function (obj) {
  18473. if (typeof iterable(obj)[iteratorSymbol] === "function") return obj[iteratorSymbol]();
  18474. if (isArguments(obj)) return new ArrayIterator(obj);
  18475. if (isString(obj)) return new StringIterator(obj);
  18476. return new ArrayIterator(obj);
  18477. };
  18478. /***/ }),
  18479. /* 233 */
  18480. /***/ (function(module, exports, __webpack_require__) {
  18481. "use strict";
  18482. var isSymbol = __webpack_require__(484);
  18483. module.exports = function (value) {
  18484. if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
  18485. return value;
  18486. };
  18487. /***/ }),
  18488. /* 234 */
  18489. /***/ (function(module, exports, __webpack_require__) {
  18490. "use strict";
  18491. var clear = __webpack_require__(488)
  18492. , assign = __webpack_require__(132)
  18493. , callable = __webpack_require__(70)
  18494. , value = __webpack_require__(31)
  18495. , d = __webpack_require__(32)
  18496. , autoBind = __webpack_require__(489)
  18497. , Symbol = __webpack_require__(45);
  18498. var defineProperty = Object.defineProperty, defineProperties = Object.defineProperties, Iterator;
  18499. module.exports = Iterator = function (list, context) {
  18500. if (!(this instanceof Iterator)) throw new TypeError("Constructor requires 'new'");
  18501. defineProperties(this, {
  18502. __list__: d("w", value(list)),
  18503. __context__: d("w", context),
  18504. __nextIndex__: d("w", 0)
  18505. });
  18506. if (!context) return;
  18507. callable(context.on);
  18508. context.on("_add", this._onAdd);
  18509. context.on("_delete", this._onDelete);
  18510. context.on("_clear", this._onClear);
  18511. };
  18512. // Internal %IteratorPrototype% doesn't expose its constructor
  18513. delete Iterator.prototype.constructor;
  18514. defineProperties(
  18515. Iterator.prototype,
  18516. assign(
  18517. {
  18518. _next: d(function () {
  18519. var i;
  18520. if (!this.__list__) return undefined;
  18521. if (this.__redo__) {
  18522. i = this.__redo__.shift();
  18523. if (i !== undefined) return i;
  18524. }
  18525. if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++;
  18526. this._unBind();
  18527. return undefined;
  18528. }),
  18529. next: d(function () {
  18530. return this._createResult(this._next());
  18531. }),
  18532. _createResult: d(function (i) {
  18533. if (i === undefined) return { done: true, value: undefined };
  18534. return { done: false, value: this._resolve(i) };
  18535. }),
  18536. _resolve: d(function (i) {
  18537. return this.__list__[i];
  18538. }),
  18539. _unBind: d(function () {
  18540. this.__list__ = null;
  18541. delete this.__redo__;
  18542. if (!this.__context__) return;
  18543. this.__context__.off("_add", this._onAdd);
  18544. this.__context__.off("_delete", this._onDelete);
  18545. this.__context__.off("_clear", this._onClear);
  18546. this.__context__ = null;
  18547. }),
  18548. toString: d(function () {
  18549. return "[object " + (this[Symbol.toStringTag] || "Object") + "]";
  18550. })
  18551. },
  18552. autoBind({
  18553. _onAdd: d(function (index) {
  18554. if (index >= this.__nextIndex__) return;
  18555. ++this.__nextIndex__;
  18556. if (!this.__redo__) {
  18557. defineProperty(this, "__redo__", d("c", [index]));
  18558. return;
  18559. }
  18560. this.__redo__.forEach(function (redo, i) {
  18561. if (redo >= index) this.__redo__[i] = ++redo;
  18562. }, this);
  18563. this.__redo__.push(index);
  18564. }),
  18565. _onDelete: d(function (index) {
  18566. var i;
  18567. if (index >= this.__nextIndex__) return;
  18568. --this.__nextIndex__;
  18569. if (!this.__redo__) return;
  18570. i = this.__redo__.indexOf(index);
  18571. if (i !== -1) this.__redo__.splice(i, 1);
  18572. this.__redo__.forEach(function (redo, j) {
  18573. if (redo > index) this.__redo__[j] = --redo;
  18574. }, this);
  18575. }),
  18576. _onClear: d(function () {
  18577. if (this.__redo__) clear.call(this.__redo__);
  18578. this.__nextIndex__ = 0;
  18579. })
  18580. })
  18581. )
  18582. );
  18583. defineProperty(
  18584. Iterator.prototype,
  18585. Symbol.iterator,
  18586. d(function () {
  18587. return this;
  18588. })
  18589. );
  18590. /***/ }),
  18591. /* 235 */
  18592. /***/ (function(module, exports, __webpack_require__) {
  18593. "use strict";
  18594. var isValue = __webpack_require__(53)
  18595. , isObject = __webpack_require__(131)
  18596. , stringCoerce = __webpack_require__(491)
  18597. , toShortString = __webpack_require__(492);
  18598. var resolveMessage = function (message, value) {
  18599. return message.replace("%v", toShortString(value));
  18600. };
  18601. module.exports = function (value, defaultMessage, inputOptions) {
  18602. if (!isObject(inputOptions)) throw new TypeError(resolveMessage(defaultMessage, value));
  18603. if (!isValue(value)) {
  18604. if ("default" in inputOptions) return inputOptions["default"];
  18605. if (inputOptions.isOptional) return null;
  18606. }
  18607. var errorMessage = stringCoerce(inputOptions.errorMessage);
  18608. if (!isValue(errorMessage)) errorMessage = defaultMessage;
  18609. throw new TypeError(resolveMessage(errorMessage, value));
  18610. };
  18611. /***/ }),
  18612. /* 236 */
  18613. /***/ (function(module, exports, __webpack_require__) {
  18614. "use strict";
  18615. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  18616. /* eslint-disable no-underscore-dangle, no-void, no-param-reassign */
  18617. /* eslint-disable no-restricted-syntax, no-continue */
  18618. const $ = __webpack_require__(221);
  18619. const env = __webpack_require__(3);
  18620. const makeEverythingAttachToOTHelpers = __webpack_require__(237);
  18621. const assign = __webpack_require__(6);
  18622. const browserAjax = {};
  18623. module.exports = browserAjax;
  18624. function formatPostData(data) {
  18625. // , contentType
  18626. // If it's a string, we assume it's properly encoded
  18627. if (typeof data === 'string') {
  18628. return data;
  18629. }
  18630. const queryString = [];
  18631. Object.keys(data).forEach(key => {
  18632. queryString.push(encodeURIComponent(key) + "=" + encodeURIComponent(data[key]));
  18633. });
  18634. return queryString.join('&').replace(/\+/g, '%20');
  18635. }
  18636. if (env.name !== 'Node') {
  18637. browserAjax.request = function (url, options, callback) {
  18638. const request = new (typeof window !== undefined ? window : global).XMLHttpRequest();
  18639. const _options = options || {};
  18640. const _method = _options.method;
  18641. if (!_method) {
  18642. callback(new Error('No HTTP method specified in options'));
  18643. return;
  18644. }
  18645. if (options.overrideMimeType) {
  18646. if (request.overrideMimeType) {
  18647. request.overrideMimeType(options.overrideMimeType);
  18648. }
  18649. delete options.overrideMimeType;
  18650. } // Setup callbacks to correctly respond to success and error callbacks. This includes
  18651. // interpreting the responses HTTP status, which XmlHttpRequest seems to ignore
  18652. // by default.
  18653. if (callback) {
  18654. $(request).on('load', event => {
  18655. const status = event.target.status; // We need to detect things that XMLHttpRequest considers a success,
  18656. // but we consider to be failures.
  18657. if (status >= 200 && (status < 300 || status === 304)) {
  18658. callback(null, event);
  18659. } else {
  18660. callback(event);
  18661. }
  18662. });
  18663. $(request).on('error', callback);
  18664. }
  18665. request.open(options.method, url, true);
  18666. if (!_options.headers) {
  18667. _options.headers = {};
  18668. }
  18669. for (const name in _options.headers) {
  18670. if (!Object.prototype.hasOwnProperty.call(_options.headers, name)) {
  18671. continue;
  18672. }
  18673. request.setRequestHeader(name, _options.headers[name]);
  18674. }
  18675. request.send(options.body && formatPostData(options.body));
  18676. };
  18677. browserAjax.get = function (url, options, callback) {
  18678. const _options = assign(options || {}, {
  18679. method: 'GET'
  18680. });
  18681. browserAjax.request(url, _options, callback);
  18682. };
  18683. browserAjax.post = function (url, options, callback) {
  18684. const _options = assign(options || {}, {
  18685. method: 'POST'
  18686. });
  18687. browserAjax.request(url, _options, callback);
  18688. };
  18689. browserAjax.getJSON = function (url, options, callback) {
  18690. options = options || {};
  18691. const done = function done(error, event) {
  18692. if (error) {
  18693. callback(error, event && event.target && event.target.responseText);
  18694. } else {
  18695. let response;
  18696. try {
  18697. response = JSON.parse(event.target.responseText);
  18698. } catch (e) {
  18699. // Badly formed JSON
  18700. callback(e, event && event.target && event.target.responseText);
  18701. return;
  18702. }
  18703. callback(null, response, event);
  18704. }
  18705. };
  18706. const extendedHeaders = assign({
  18707. Accept: 'application/json'
  18708. }, options.headers || {});
  18709. browserAjax.get(url, assign(options || {}, {
  18710. headers: extendedHeaders
  18711. }), done);
  18712. };
  18713. makeEverythingAttachToOTHelpers(browserAjax);
  18714. }
  18715. /***/ }),
  18716. /* 237 */
  18717. /***/ (function(module, exports, __webpack_require__) {
  18718. "use strict";
  18719. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  18720. /* eslint-disable no-underscore-dangle, no-param-reassign */
  18721. module.exports = function (mod) {
  18722. const attachments = {};
  18723. Object.keys(mod).forEach(key => {
  18724. attachments[key] = mod[key];
  18725. });
  18726. mod._attachToOTHelpers = attachments;
  18727. };
  18728. /***/ }),
  18729. /* 238 */
  18730. /***/ (function(module, exports, __webpack_require__) {
  18731. "use strict";
  18732. const assign = __webpack_require__(6);
  18733. const logging = __webpack_require__(1)('analytics');
  18734. const QueueRunner = __webpack_require__(514);
  18735. const uuid = __webpack_require__(15);
  18736. const defaultAjax = __webpack_require__(236);
  18737. const clientInstanceId = uuid();
  18738. const defaultQueue = new QueueRunner();
  18739. module.exports = function Analytics(_ref) {
  18740. var _this = this;
  18741. let loggingUrl = _ref.loggingUrl,
  18742. _ref$queue = _ref.queue,
  18743. queue = _ref$queue === void 0 ? defaultQueue : _ref$queue,
  18744. _ref$ajax = _ref.ajax,
  18745. ajax = _ref$ajax === void 0 ? defaultAjax : _ref$ajax;
  18746. this.loggingUrl = loggingUrl;
  18747. const endPoint = this.loggingUrl + "/logging/ClientEvent";
  18748. const endPointQos = this.loggingUrl + "/logging/ClientQos";
  18749. const reportedErrors = {};
  18750. const post = function post(data, onComplete, isQos) {
  18751. if (onComplete === void 0) {
  18752. onComplete = () => {};
  18753. }
  18754. queue.add(callback => {
  18755. logging.debug('sending analytics:', _this.loggingUrl, data);
  18756. ajax.post(isQos ? endPointQos : endPoint, {
  18757. body: data,
  18758. overrideMimeType: 'text/plain',
  18759. headers: {
  18760. Accept: 'text/plain',
  18761. 'Content-Type': 'application/json'
  18762. }
  18763. }, err => {
  18764. if (err) {
  18765. console.log('Failed to send ClientEvent, moving on to the next item.');
  18766. }
  18767. onComplete(err || undefined);
  18768. callback();
  18769. });
  18770. });
  18771. };
  18772. const shouldThrottleError = (code, type, partnerId) => {
  18773. if (!partnerId) {
  18774. return false;
  18775. }
  18776. const errKey = [partnerId, type, code].join('_');
  18777. const msgLimit = 100;
  18778. return (reportedErrors[errKey] || 0) >= msgLimit;
  18779. }; // Log an error via ClientEvents.
  18780. //
  18781. // @param [String] code
  18782. // @param [String] type
  18783. // @param [String] message
  18784. // @param [Hash] details additional error details
  18785. //
  18786. // @param [Hash] options the options to log the client event with.
  18787. // @option options [String] action The name of the Event that we are logging. E.g.
  18788. // 'TokShowLoaded'. Required.
  18789. // @option options [String] variation Usually used for Split A/B testing, when you
  18790. // have multiple variations of the +_action+.
  18791. // @option options [String] payload The payload. Required.
  18792. // @option options [String] sessionId The active OpenTok session, if there is one
  18793. // @option options [String] connectionId The active OpenTok connectionId, if there is one
  18794. // @option options [String] partnerId
  18795. // @option options [String] guid ...
  18796. // @option options [String] streamId ...
  18797. // @option options [String] section ...
  18798. // @option options [String] clientVersion ...
  18799. //
  18800. // Reports will be throttled to X reports (see exceptionLogging.messageLimitPerPartner
  18801. // from the dynamic config for X) of each error type for each partner. Reports can be
  18802. // disabled/enabled globally or on a per partner basis (per partner settings
  18803. // take precedence) using exceptionLogging.enabled.
  18804. //
  18805. this.logError = function (code, type, message, details, options) {
  18806. if (details === void 0) {
  18807. details = null;
  18808. }
  18809. if (options === void 0) {
  18810. options = {};
  18811. }
  18812. const _options = options,
  18813. partnerId = _options.partnerId;
  18814. if (shouldThrottleError(code, type, partnerId)) {
  18815. // OT.log('ClientEvents.error has throttled an error of type ' + type + '.' +
  18816. // code + ' for partner ' + (partnerId || 'No Partner Id'));
  18817. return;
  18818. }
  18819. const errKey = [partnerId, type, code].join('_');
  18820. const payload = details;
  18821. reportedErrors[errKey] = typeof reportedErrors[errKey] !== 'undefined' ? reportedErrors[errKey] + 1 : 1;
  18822. _this.logEvent(assign(options, {
  18823. action: type + "." + code,
  18824. payload
  18825. }), false);
  18826. }; // Log a client event to the analytics backend.
  18827. //
  18828. // @example Logs a client event called 'foo'
  18829. // this.logEvent({
  18830. // action: 'foo',
  18831. // payload: 'bar',
  18832. // sessionId: sessionId,
  18833. // connectionId: connectionId
  18834. // }, false)
  18835. //
  18836. // @param [Hash] data the data to log the client event with.
  18837. // @param [Boolean] qos Whether this is a QoS event.
  18838. // @param [Boolean] throttle A number specifying the ratio of events to be sent
  18839. // out of the total number of events (other events are not ignored). If not
  18840. // set to a number, all events are sent.
  18841. // @param [Number] completionHandler A completion handler function to call when the
  18842. // client event POST request succeeds or fails. If it fails, an error
  18843. // object is passed into the function. (See throttledPost().)
  18844. //
  18845. this.logEvent = function (data, qos, throttle, completionHandler) {
  18846. if (qos === void 0) {
  18847. qos = false;
  18848. }
  18849. if (completionHandler === void 0) {
  18850. completionHandler = () => {};
  18851. }
  18852. data.clientInstanceId = clientInstanceId; // eslint-disable-line no-param-reassign
  18853. if (throttle && !isNaN(throttle)) {
  18854. if (Math.random() > throttle) {
  18855. logging.debug('skipping sending analytics due to throttle:', data);
  18856. return;
  18857. }
  18858. }
  18859. logging.debug('queueing analytics:', _this.loggingUrl, data);
  18860. let serializedData;
  18861. try {
  18862. serializedData = JSON.stringify(data);
  18863. } catch (err) {
  18864. completionHandler(err);
  18865. return;
  18866. }
  18867. post(serializedData, completionHandler, qos);
  18868. }; // Log a client QOS to the analytics backend.
  18869. // @option options [String] action The name of the Event that we are logging.
  18870. // E.g. 'TokShowLoaded'. Required.
  18871. // @option options [String] variation Usually used for Split A/B testing, when
  18872. // you have multiple variations of the +_action+.
  18873. // @option options [String] payload The payload. Required.
  18874. // @option options [String] sessionId The active OpenTok session, if there is one
  18875. // @option options [String] connectionId The active OpenTok connectionId, if there is one
  18876. // @option options [String] partnerId
  18877. // @option options [String] guid ...
  18878. // @option options [String] streamId ...
  18879. // @option options [String] section ...
  18880. // @option options [String] clientVersion ...
  18881. //
  18882. this.logQOS = options => this.logEvent(options, true);
  18883. };
  18884. /***/ }),
  18885. /* 239 */
  18886. /***/ (function(module, exports) {
  18887. // Unique ID creation requires a high quality random # generator. In the
  18888. // browser this is a little complicated due to unknown quality of Math.random()
  18889. // and inconsistent support for the `crypto` API. We do the best we can via
  18890. // feature-detection
  18891. // getRandomValues needs to be invoked in a context where "this" is a Crypto
  18892. // implementation. Also, find the complete implementation of crypto on IE11.
  18893. var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
  18894. (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
  18895. if (getRandomValues) {
  18896. // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
  18897. var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
  18898. module.exports = function whatwgRNG() {
  18899. getRandomValues(rnds8);
  18900. return rnds8;
  18901. };
  18902. } else {
  18903. // Math.random()-based (RNG)
  18904. //
  18905. // If all else fails, use Math.random(). It's fast, but is of unspecified
  18906. // quality.
  18907. var rnds = new Array(16);
  18908. module.exports = function mathRNG() {
  18909. for (var i = 0, r; i < 16; i++) {
  18910. if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
  18911. rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
  18912. }
  18913. return rnds;
  18914. };
  18915. }
  18916. /***/ }),
  18917. /* 240 */
  18918. /***/ (function(module, exports) {
  18919. /**
  18920. * Convert array of 16 byte values to UUID string format of the form:
  18921. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  18922. */
  18923. var byteToHex = [];
  18924. for (var i = 0; i < 256; ++i) {
  18925. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  18926. }
  18927. function bytesToUuid(buf, offset) {
  18928. var i = offset || 0;
  18929. var bth = byteToHex;
  18930. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  18931. return ([
  18932. bth[buf[i++]], bth[buf[i++]],
  18933. bth[buf[i++]], bth[buf[i++]], '-',
  18934. bth[buf[i++]], bth[buf[i++]], '-',
  18935. bth[buf[i++]], bth[buf[i++]], '-',
  18936. bth[buf[i++]], bth[buf[i++]], '-',
  18937. bth[buf[i++]], bth[buf[i++]],
  18938. bth[buf[i++]], bth[buf[i++]],
  18939. bth[buf[i++]], bth[buf[i++]]
  18940. ]).join('');
  18941. }
  18942. module.exports = bytesToUuid;
  18943. /***/ }),
  18944. /* 241 */
  18945. /***/ (function(module, exports, __webpack_require__) {
  18946. "use strict";
  18947. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  18948. /* eslint-disable no-underscore-dangle, no-void, no-restricted-syntax, no-prototype-builtins */
  18949. /* eslint-disable no-continue, prefer-spread, prefer-rest-params */
  18950. const isFunction = __webpack_require__(13);
  18951. const eventing = __webpack_require__(5);
  18952. const logging = __webpack_require__(1)('Collection');
  18953. module.exports = function Collection(idField) {
  18954. let _models = [];
  18955. let _byId = {};
  18956. const _idField = idField || 'id';
  18957. eventing(this);
  18958. const modelProperty = function modelProperty(model, property) {
  18959. if (isFunction(model[property])) {
  18960. return model[property]();
  18961. }
  18962. return model[property];
  18963. };
  18964. const onModelUpdate = function onModelUpdate(event) {
  18965. this.trigger('update', event);
  18966. this.trigger("update:" + event.target.id, event);
  18967. }.bind(this);
  18968. const onModelDestroy = function onModelDestroyed(event) {
  18969. this.remove(event.target, event.reason);
  18970. }.bind(this);
  18971. this.reset = function () {
  18972. // Stop listening on the models, they are no longer our problem
  18973. _models.forEach(function (model) {
  18974. model.off('updated', onModelUpdate, this);
  18975. model.off('destroyed', onModelDestroy, this);
  18976. }, this);
  18977. _models = [];
  18978. _byId = {};
  18979. };
  18980. this.destroy = function (reason) {
  18981. _models.forEach(model => {
  18982. if (model && typeof model.destroy === 'function') {
  18983. model.destroy(reason, true);
  18984. }
  18985. });
  18986. this.reset();
  18987. this.off();
  18988. };
  18989. this.get = function (id) {
  18990. return id && _byId[id] !== void 0 ? _models[_byId[id]] : void 0;
  18991. };
  18992. this.has = function (id) {
  18993. return id && _byId[id] !== void 0;
  18994. };
  18995. this.toString = function () {
  18996. return _models.toString();
  18997. }; // Return only models filtered by either a dict of properties
  18998. // or a filter function.
  18999. //
  19000. // @example Return all publishers with a streamId of 1
  19001. // OT.publishers.where({streamId: 1})
  19002. //
  19003. // @example The same thing but filtering using a filter function
  19004. // OT.publishers.where(function(publisher) {
  19005. // return publisher.stream.id === 4;
  19006. // });
  19007. //
  19008. // @example The same thing but filtering using a filter function
  19009. // executed with a specific this
  19010. // OT.publishers.where(function(publisher) {
  19011. // return publisher.stream.id === 4;
  19012. // }, self);
  19013. //
  19014. this.where = function (attrsOrFilterFn, context) {
  19015. if (isFunction(attrsOrFilterFn)) {
  19016. return _models.filter(attrsOrFilterFn, context);
  19017. }
  19018. return _models.filter(model => {
  19019. for (const key in attrsOrFilterFn) {
  19020. if (!attrsOrFilterFn.hasOwnProperty(key)) {
  19021. continue;
  19022. }
  19023. if (modelProperty(model, key) !== attrsOrFilterFn[key]) {
  19024. return false;
  19025. }
  19026. }
  19027. return true;
  19028. });
  19029. }; // Similar to where in behaviour, except that it only returns
  19030. // the first match.
  19031. this.find = function (attrsOrFilterFn, context) {
  19032. let filterFn;
  19033. if (isFunction(attrsOrFilterFn)) {
  19034. filterFn = attrsOrFilterFn;
  19035. } else {
  19036. filterFn = function filterFn(model) {
  19037. for (const key in attrsOrFilterFn) {
  19038. if (!attrsOrFilterFn.hasOwnProperty(key)) {
  19039. continue;
  19040. }
  19041. if (modelProperty(model, key) !== attrsOrFilterFn[key]) {
  19042. return false;
  19043. }
  19044. }
  19045. return true;
  19046. };
  19047. }
  19048. filterFn = filterFn.bind(context);
  19049. for (let i = 0; i < _models.length; ++i) {
  19050. if (filterFn(_models[i]) === true) {
  19051. return _models[i];
  19052. }
  19053. }
  19054. return null;
  19055. };
  19056. this.forEach = function (fn, context) {
  19057. _models.forEach(fn, context);
  19058. return this;
  19059. };
  19060. this.map = function (fn) {
  19061. return _models.map(fn);
  19062. };
  19063. this.add = function (model) {
  19064. const id = modelProperty(model, _idField);
  19065. if (this.has(id)) {
  19066. logging.warn("Model " + id + " is already in the collection", _models);
  19067. return this;
  19068. }
  19069. _byId[id] = _models.push(model) - 1;
  19070. model.on('updated', onModelUpdate, this);
  19071. model.on('destroyed', onModelDestroy, this);
  19072. this.trigger('add', model);
  19073. this.trigger("add:" + id, model);
  19074. return this;
  19075. };
  19076. this.remove = function (model, reason) {
  19077. const id = modelProperty(model, _idField);
  19078. _models.splice(_byId[id], 1); // Shuffle everyone down one
  19079. for (let i = _byId[id]; i < _models.length; ++i) {
  19080. _byId[modelProperty(_models[i], _idField)] = i;
  19081. }
  19082. delete _byId[id];
  19083. model.off('updated', onModelUpdate, this);
  19084. model.off('destroyed', onModelDestroy, this);
  19085. this.trigger('remove', model, reason);
  19086. this.trigger("remove:" + id, model, reason);
  19087. return this;
  19088. }; // Retrigger the add event behaviour for each model. You can also
  19089. // select a subset of models to trigger using the same arguments
  19090. // as the #where method.
  19091. this._triggerAddEvents = function () {
  19092. this.where.apply(this, arguments).forEach(function (model) {
  19093. this.trigger('add', model);
  19094. this.trigger("add:" + modelProperty(model, _idField), model);
  19095. }, this);
  19096. };
  19097. this.length = function () {
  19098. return _models.length;
  19099. };
  19100. };
  19101. /***/ }),
  19102. /* 242 */
  19103. /***/ (function(module, exports, __webpack_require__) {
  19104. "use strict";
  19105. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  19106. /* eslint-disable no-underscore-dangle, no-param-reassign, no-void */
  19107. /* eslint-disable no-restricted-syntax, no-prototype-builtins, no-shadow, one-var, vars-on-top */
  19108. /* eslint-disable no-var */
  19109. const env = __webpack_require__(3);
  19110. const isObject = __webpack_require__(7);
  19111. let getErrorLocation; // Properties that we'll acknowledge from the JS Error object
  19112. const safeErrorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; // OTHelpers.Error
  19113. //
  19114. // A construct to contain error information that also helps with extracting error
  19115. // context, such as stack trace.
  19116. //
  19117. // @constructor
  19118. // @memberof OTHelpers
  19119. // @method Error
  19120. //
  19121. // @param {String} message
  19122. // Optional. The error message
  19123. //
  19124. // @param {Object} props
  19125. // Optional. A dictionary of properties containing extra Error info.
  19126. //
  19127. //
  19128. // @example Create a simple error with juts a custom message
  19129. // var error = new OTHelpers.Error('Something Broke!');
  19130. // error.message === 'Something Broke!';
  19131. //
  19132. // @example Create an Error with a message and a name
  19133. // var error = new OTHelpers.Error('Something Broke!', 'FooError');
  19134. // error.message === 'Something Broke!';
  19135. // error.name === 'FooError';
  19136. //
  19137. // @example Create an Error with a message, name, and custom properties
  19138. // var error = new OTHelpers.Error('Something Broke!', 'FooError', {
  19139. // foo: 'bar',
  19140. // listOfImportantThings: [1,2,3,4]
  19141. // });
  19142. // error.message === 'Something Broke!';
  19143. // error.name === 'FooError';
  19144. // error.foo === 'bar';
  19145. // error.listOfImportantThings == [1,2,3,4];
  19146. //
  19147. // @example Create an Error from a Javascript Error
  19148. // var error = new OTHelpers.Error(domSyntaxError);
  19149. // error.message === domSyntaxError.message;
  19150. // error.name === domSyntaxError.name === 'SyntaxError';
  19151. // // ...continues for each properties of domSyntaxError
  19152. //
  19153. // @references
  19154. // * https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
  19155. // * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack
  19156. // * http://www.w3.org/TR/dom/#interface-domerror
  19157. //
  19158. //
  19159. // @todo
  19160. // * update usage in OTMedia
  19161. // * replace error handling in OT.js
  19162. // * normalise stack behaviour under Chrome/Node/Safari with other browsers
  19163. // * unit test for stack parsing
  19164. //
  19165. const Error_ = function Error_(message, name, props) {
  19166. switch (arguments.length) {
  19167. case 1:
  19168. if (isObject(message)) {
  19169. props = message;
  19170. name = void 0;
  19171. message = void 0;
  19172. } // Otherwise it's the message
  19173. break;
  19174. case 2:
  19175. if (isObject(name)) {
  19176. props = name;
  19177. name = void 0;
  19178. } // Otherwise name is actually the name
  19179. break;
  19180. default: // FIXME: Should something go here?
  19181. }
  19182. if (props instanceof Error) {
  19183. // Special handling of this due to Chrome weirdness. It seems that
  19184. // properties of the Error object, and it's children, are not
  19185. // enumerable in Chrome?
  19186. for (let i = 0, num = safeErrorProps.length; i < num; ++i) {
  19187. this[safeErrorProps[i]] = props[safeErrorProps[i]];
  19188. }
  19189. } else if (isObject(props)) {
  19190. // Use an custom properties that are provided
  19191. for (const key in props) {
  19192. if (props.hasOwnProperty(key)) {
  19193. this[key] = props[key];
  19194. }
  19195. }
  19196. } // If any of the fundamental properties are missing then try and
  19197. // extract them.
  19198. if (!(this.fileName && this.lineNumber && this.columnNumber && this.stack)) {
  19199. const err = getErrorLocation();
  19200. if (!this.fileName && err.fileName) {
  19201. this.fileName = err.fileName;
  19202. }
  19203. if (!this.lineNumber && err.lineNumber) {
  19204. this.lineNumber = err.lineNumber;
  19205. }
  19206. if (!this.columnNumber && err.columnNumber) {
  19207. this.columnNumber = err.columnNumber;
  19208. }
  19209. if (!this.stack && err.stack) {
  19210. this.stack = err.stack;
  19211. }
  19212. }
  19213. if (!this.message && message) {
  19214. this.message = message;
  19215. }
  19216. if ((!this.name || this.name === 'Error') && name) {
  19217. this.name = name;
  19218. }
  19219. };
  19220. module.exports = Error_;
  19221. Error_.prototype = Object.create(Error.prototype);
  19222. Error_.prototype.toString = function () {
  19223. let locationDetails = '';
  19224. if (this.fileName) {
  19225. locationDetails += " " + this.fileName;
  19226. }
  19227. if (this.lineNumber) {
  19228. locationDetails += " " + this.lineNumber;
  19229. if (this.columnNumber) {
  19230. locationDetails += ":" + this.columnNumber;
  19231. }
  19232. }
  19233. return "<" + (this.name ? this.name + " " : '') + this.message + locationDetails + ">";
  19234. };
  19235. Error_.prototype.valueOf = Error_.prototype.toString; // Normalise err.stack so that it is the same format as the other browsers
  19236. // We skip the first two frames so that we don't capture getErrorLocation() and
  19237. // the callee.
  19238. //
  19239. // Used by Environments that support the StackTrace API. (Chrome, Node, Opera)
  19240. //
  19241. const prepareStackTrace = function prepareStackTrace(_, stack) {
  19242. return stack.slice(2).map(frame => {
  19243. const _f = {
  19244. fileName: frame.getFileName(),
  19245. linenumber: frame.getLineNumber(),
  19246. columnNumber: frame.getColumnNumber()
  19247. };
  19248. if (frame.getFunctionName()) {
  19249. _f.functionName = frame.getFunctionName();
  19250. }
  19251. if (frame.getMethodName()) {
  19252. _f.methodName = frame.getMethodName();
  19253. }
  19254. if (frame.getThis()) {
  19255. _f.self = frame.getThis();
  19256. }
  19257. return _f;
  19258. });
  19259. }; // Black magic to retrieve error location info for various environments
  19260. getErrorLocation = function getErrorLocation() {
  19261. const info = {};
  19262. let callstack, errLocation, err;
  19263. switch (env.name) {
  19264. case 'Firefox':
  19265. case 'Safari':
  19266. try {
  19267. (typeof window !== undefined ? window : global).call.js.is.explody();
  19268. } catch (e) {
  19269. err = e;
  19270. }
  19271. callstack = (err.stack || '').split('\n'); // Remove call to getErrorLocation() and the callee
  19272. callstack.shift();
  19273. callstack.shift();
  19274. info.stack = callstack;
  19275. errLocation = /@(.+?):([0-9]+)(:([0-9]+))?$/.exec(callstack[0]);
  19276. if (errLocation) {
  19277. info.fileName = errLocation[1];
  19278. info.lineNumber = parseInt(errLocation[2], 10);
  19279. if (errLocation.length > 3) {
  19280. info.columnNumber = parseInt(errLocation[4], 10);
  19281. }
  19282. }
  19283. break;
  19284. case 'Chrome':
  19285. case 'Node':
  19286. case 'Opera':
  19287. var currentPST = Error.prepareStackTrace;
  19288. Error.prepareStackTrace = prepareStackTrace;
  19289. err = new Error();
  19290. info.stack = err.stack;
  19291. Error.prepareStackTrace = currentPST;
  19292. var topFrame = info.stack[0];
  19293. info.lineNumber = topFrame.lineNumber;
  19294. info.columnNumber = topFrame.columnNumber;
  19295. info.fileName = topFrame.fileName;
  19296. if (topFrame.functionName) {
  19297. info.functionName = topFrame.functionName;
  19298. }
  19299. if (topFrame.methodName) {
  19300. info.methodName = topFrame.methodName;
  19301. }
  19302. if (topFrame.self) {
  19303. info.self = topFrame.self;
  19304. }
  19305. break;
  19306. default:
  19307. err = new Error();
  19308. if (err.stack) {
  19309. info.stack = err.stack.split('\n');
  19310. }
  19311. break;
  19312. }
  19313. if (err.message) {
  19314. info.message = err.message;
  19315. }
  19316. return info;
  19317. };
  19318. /***/ }),
  19319. /* 243 */
  19320. /***/ (function(module, exports) {
  19321. /*
  19322. json-stringify-safe
  19323. Like JSON.stringify, but doesn't throw on circular references.
  19324. Originally forked from https://github.com/isaacs/json-stringify-safe
  19325. version 5.0.1 on 3/8/2017 and modified to handle Errors serialization
  19326. and IE8 compatibility. Tests for this are in test/vendor.
  19327. ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
  19328. */
  19329. exports = module.exports = stringify;
  19330. exports.getSerialize = serializer;
  19331. function indexOf(haystack, needle) {
  19332. for (var i = 0; i < haystack.length; ++i) {
  19333. if (haystack[i] === needle) return i;
  19334. }
  19335. return -1;
  19336. }
  19337. function stringify(obj, replacer, spaces, cycleReplacer) {
  19338. return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
  19339. }
  19340. // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106
  19341. function stringifyError(value) {
  19342. var err = {
  19343. // These properties are implemented as magical getters and don't show up in for in
  19344. stack: value.stack,
  19345. message: value.message,
  19346. name: value.name
  19347. };
  19348. for (var i in value) {
  19349. if (Object.prototype.hasOwnProperty.call(value, i)) {
  19350. err[i] = value[i];
  19351. }
  19352. }
  19353. return err;
  19354. }
  19355. function serializer(replacer, cycleReplacer) {
  19356. var stack = [];
  19357. var keys = [];
  19358. if (cycleReplacer == null) {
  19359. cycleReplacer = function(key, value) {
  19360. if (stack[0] === value) {
  19361. return '[Circular ~]';
  19362. }
  19363. return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']';
  19364. };
  19365. }
  19366. return function(key, value) {
  19367. if (stack.length > 0) {
  19368. var thisPos = indexOf(stack, this);
  19369. ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
  19370. ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
  19371. if (~indexOf(stack, value)) {
  19372. value = cycleReplacer.call(this, key, value);
  19373. }
  19374. } else {
  19375. stack.push(value);
  19376. }
  19377. return replacer == null
  19378. ? value instanceof Error ? stringifyError(value) : value
  19379. : replacer.call(this, key, value);
  19380. };
  19381. }
  19382. /***/ }),
  19383. /* 244 */
  19384. /***/ (function(module, exports, __webpack_require__) {
  19385. var arrayMap = __webpack_require__(30),
  19386. baseIntersection = __webpack_require__(524),
  19387. baseRest = __webpack_require__(94),
  19388. castArrayLikeObject = __webpack_require__(525);
  19389. /**
  19390. * Creates an array of unique values that are included in all given arrays
  19391. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  19392. * for equality comparisons. The order and references of result values are
  19393. * determined by the first array.
  19394. *
  19395. * @static
  19396. * @memberOf _
  19397. * @since 0.1.0
  19398. * @category Array
  19399. * @param {...Array} [arrays] The arrays to inspect.
  19400. * @returns {Array} Returns the new array of intersecting values.
  19401. * @example
  19402. *
  19403. * _.intersection([2, 1], [2, 3]);
  19404. * // => [2]
  19405. */
  19406. var intersection = baseRest(function(arrays) {
  19407. var mapped = arrayMap(arrays, castArrayLikeObject);
  19408. return (mapped.length && mapped[0] === arrays[0])
  19409. ? baseIntersection(mapped)
  19410. : [];
  19411. });
  19412. module.exports = intersection;
  19413. /***/ }),
  19414. /* 245 */
  19415. /***/ (function(module, exports, __webpack_require__) {
  19416. "use strict";
  19417. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  19418. /* eslint-disable no-param-reassign, no-shadow */
  19419. const isFunction = __webpack_require__(13);
  19420. const uuid = __webpack_require__(15);
  19421. const logging = __webpack_require__(1)('guidStorage');
  19422. const guidStorage = {};
  19423. module.exports = guidStorage;
  19424. let currentGuidStorage;
  19425. let currentGuid;
  19426. const isInvalidStorage = function isInvalidStorage(storageInterface) {
  19427. return !(isFunction(storageInterface.get) && isFunction(storageInterface.set));
  19428. };
  19429. const getClientGuid = function getClientGuid(completion) {
  19430. if (currentGuid) {
  19431. completion(null, currentGuid);
  19432. return;
  19433. } // It's the first time that getClientGuid has been called
  19434. // in this page lifetime. Attempt to load any existing Guid
  19435. // from the storage
  19436. currentGuidStorage.get(completion);
  19437. };
  19438. /*
  19439. * Sets the methods for storing and retrieving client GUIDs persistently
  19440. * across sessions. By default, OpenTok.js attempts to use browser cookies to
  19441. * store GUIDs.
  19442. * <p>
  19443. * Pass in an object that has a <code>get()</code> method and
  19444. * a <code>set()</code> method.
  19445. * <p>
  19446. * The <code>get()</code> method must take one parameter: the callback
  19447. * method to invoke. The callback method is passed two parameters &mdash;
  19448. * the first parameter is an error object or null if the call is successful;
  19449. * and the second parameter is the GUID (a string) if successful.
  19450. * <p>
  19451. * The <code>set()</code> method must include two parameters: the GUID to set
  19452. * (a string) and the callback method to invoke. The callback method is
  19453. * passed an error object on error, or it is passed no parameter if the call is
  19454. * successful.
  19455. * <p>
  19456. * Here is an example:
  19457. * <p>
  19458. * <pre>
  19459. * var ComplexStorage = function() {
  19460. * this.set = function(guid, completion) {
  19461. * AwesomeBackendService.set(guid, function(response) {
  19462. * completion(response.error || null);
  19463. * });
  19464. * };
  19465. * this.get = function(completion) {
  19466. * AwesomeBackendService.get(function(response, guid) {
  19467. * completion(response.error || null, guid);
  19468. * });
  19469. * };
  19470. * };
  19471. *
  19472. * OT.overrideGuidStorage(new ComplexStorage());
  19473. * </pre>
  19474. */
  19475. guidStorage.override = storageInterface => {
  19476. if (isInvalidStorage(storageInterface)) {
  19477. throw new Error('The storageInterface argument does not seem to be valid, ' + 'it must implement get and set methods');
  19478. }
  19479. if (currentGuidStorage === storageInterface) {
  19480. return;
  19481. }
  19482. currentGuidStorage = storageInterface; // If a client Guid has already been assigned to this client then
  19483. // let the new storage know about it so that it's in sync.
  19484. if (currentGuid) {
  19485. currentGuidStorage.set(currentGuid, error => {
  19486. if (error) {
  19487. logging.error("Failed to send initial Guid value (" + currentGuid + ") to the newly assigned Guid Storage. The error was: " + error); // @todo error
  19488. }
  19489. });
  19490. }
  19491. };
  19492. guidStorage.get = completion => {
  19493. getClientGuid((error, guid) => {
  19494. if (error) {
  19495. completion(error);
  19496. return;
  19497. }
  19498. if (!guid) {
  19499. // Nothing came back, this client is entirely new.
  19500. // generate a new Guid and persist it
  19501. guid = uuid();
  19502. currentGuidStorage.set(guid, error => {
  19503. if (error) {
  19504. completion(error);
  19505. return;
  19506. }
  19507. currentGuid = guid;
  19508. });
  19509. } else if (!currentGuid) {
  19510. currentGuid = guid;
  19511. }
  19512. completion(null, currentGuid);
  19513. });
  19514. }; // Implement our default storage mechanism, which sets/gets a cookie
  19515. // called 'opentok_client_id'
  19516. guidStorage.override({
  19517. get(completion) {
  19518. let clientId;
  19519. try {
  19520. clientId = (typeof window !== undefined ? window : global).localStorage.getItem('opentok_client_id');
  19521. } catch (err) {
  19522. // will get Uncaught DOMException: Failed to read the 'localStorage' property from 'Window':
  19523. // The document is sandboxed and lacks the 'allow-same-origin' flag.
  19524. if (!clientId) {
  19525. clientId = uuid();
  19526. }
  19527. }
  19528. completion(null, clientId);
  19529. },
  19530. set(guid, completion) {
  19531. try {
  19532. (typeof window !== undefined ? window : global).localStorage.setItem('opentok_client_id', guid);
  19533. } catch (err) {// will get Uncaught DOMException: Failed to read the 'localStorage' property from 'Window':
  19534. // The document is sandboxed and lacks the 'allow-same-origin' flag.
  19535. }
  19536. completion(null);
  19537. }
  19538. }); // Test only
  19539. guidStorage.set = guid => {
  19540. currentGuid = guid;
  19541. };
  19542. /***/ }),
  19543. /* 246 */
  19544. /***/ (function(module, exports, __webpack_require__) {
  19545. "use strict";
  19546. var _interopRequireDefault = __webpack_require__(2);
  19547. var _createClass2 = _interopRequireDefault(__webpack_require__(40));
  19548. /* eslint-disable no-underscore-dangle */
  19549. const _get = __webpack_require__(51);
  19550. const cloneDeep = __webpack_require__(50);
  19551. /**
  19552. * Provides an interface around the raw session info from Anvil
  19553. *
  19554. * @class SessionInfo
  19555. * @param {Object} rawSessionInfo The raw session info from Anvil
  19556. *
  19557. */
  19558. let SessionInfo = /*#__PURE__*/function () {
  19559. function SessionInfo(rawSessionInfo) {
  19560. if (rawSessionInfo === void 0) {
  19561. rawSessionInfo = {};
  19562. }
  19563. Object.defineProperty(this, '_rawSessionInfo', {
  19564. value: cloneDeep(rawSessionInfo)
  19565. });
  19566. }
  19567. /**
  19568. * @type {String}
  19569. * @readonly
  19570. */
  19571. (0, _createClass2.default)(SessionInfo, [{
  19572. key: "sessionId",
  19573. get: function get() {
  19574. return this._rawSessionInfo.session_id;
  19575. }
  19576. /**
  19577. * @type {String}
  19578. * @readonly
  19579. */
  19580. }, {
  19581. key: "partnerId",
  19582. get: function get() {
  19583. return this._rawSessionInfo.partner_id;
  19584. }
  19585. /**
  19586. * @type {String}
  19587. * @readonly
  19588. */
  19589. }, {
  19590. key: "messagingServer",
  19591. get: function get() {
  19592. return this._rawSessionInfo.messaging_server_url;
  19593. }
  19594. /**
  19595. * @type {String}
  19596. * @readonly
  19597. */
  19598. }, {
  19599. key: "mediaServerName",
  19600. get: function get() {
  19601. return this._rawSessionInfo.media_server_hostname;
  19602. }
  19603. /**
  19604. * @type {String}
  19605. * @readonly
  19606. */
  19607. }, {
  19608. key: "messagingURL",
  19609. get: function get() {
  19610. return this._rawSessionInfo.messaging_url;
  19611. }
  19612. /**
  19613. * @type {String}
  19614. * @readonly
  19615. */
  19616. }, {
  19617. key: "symphonyAddress",
  19618. get: function get() {
  19619. return this._rawSessionInfo.symphony_address;
  19620. }
  19621. /**
  19622. * @type {Array}
  19623. * @readonly
  19624. */
  19625. }, {
  19626. key: "iceServers",
  19627. get: function get() {
  19628. return this._rawSessionInfo.ice_servers;
  19629. }
  19630. /**
  19631. * Simulcast is tri-state:
  19632. * * true - simulcast is on for this session
  19633. * * false - simulcast is off for this session
  19634. * * undefined - the developer can choose
  19635. * @type {Boolean|Undefined}
  19636. * @readonly
  19637. */
  19638. }, {
  19639. key: "simulcast",
  19640. get: function get() {
  19641. return _get(this._rawSessionInfo, 'properties.simulcast');
  19642. }
  19643. /**
  19644. * @type {Boolean}
  19645. * @readonly
  19646. */
  19647. }, {
  19648. key: "reconnection",
  19649. get: function get() {
  19650. return _get(this._rawSessionInfo, 'properties.reconnection', false);
  19651. }
  19652. /**
  19653. * @type {Boolean}
  19654. * @readonly
  19655. */
  19656. }, {
  19657. key: "renegotiation",
  19658. get: function get() {
  19659. return _get(this._rawSessionInfo, 'properties.renegotiation', false);
  19660. }
  19661. /**
  19662. * @type {Boolean}
  19663. * @readonly
  19664. */
  19665. }, {
  19666. key: "p2pEnabled",
  19667. get: function get() {
  19668. return _get(this._rawSessionInfo, 'properties.p2p.preference.value') === 'enabled';
  19669. }
  19670. /**
  19671. * If this contains a valid codec, it will be prioritized
  19672. *
  19673. * @type {String}
  19674. * @readonly
  19675. */
  19676. }, {
  19677. key: "priorityVideoCodec",
  19678. get: function get() {
  19679. return _get(this._rawSessionInfo, 'properties.priorityVideoCodec', '');
  19680. }
  19681. /**
  19682. * Is true if H264 codec is enabled
  19683. *
  19684. * @type {Boolean}
  19685. * @readonly
  19686. */
  19687. }, {
  19688. key: "h264",
  19689. get: function get() {
  19690. return _get(this._rawSessionInfo, 'properties.h264', true);
  19691. }
  19692. /**
  19693. * Is true if VP8 codec is enabled
  19694. *
  19695. * @type {Boolean}
  19696. * @readonly
  19697. */
  19698. }, {
  19699. key: "vp8",
  19700. get: function get() {
  19701. return _get(this._rawSessionInfo, 'properties.vp8', true);
  19702. }
  19703. /**
  19704. * Is true if VP9 codec is enabled
  19705. *
  19706. * @type {Boolean}
  19707. * @readonly
  19708. */
  19709. }, {
  19710. key: "vp9",
  19711. get: function get() {
  19712. return _get(this._rawSessionInfo, 'properties.vp9', true);
  19713. }
  19714. /**
  19715. * clientCandidates can be "relay". Other values are unknown.
  19716. *
  19717. * @type {String|Undefined}
  19718. * @readonly
  19719. */
  19720. }, {
  19721. key: "clientCandidates",
  19722. get: function get() {
  19723. const rawValue = _get(this._rawSessionInfo, 'properties.clientCandidates');
  19724. return rawValue === 'relayed' ? 'relay' : rawValue;
  19725. }
  19726. }, {
  19727. key: "peerRegeneration",
  19728. get: function get() {
  19729. return _get(this._rawSessionInfo, 'properties.peerRegeneration', true);
  19730. }
  19731. }]);
  19732. return SessionInfo;
  19733. }();
  19734. module.exports = SessionInfo;
  19735. /***/ }),
  19736. /* 247 */
  19737. /***/ (function(module, exports, __webpack_require__) {
  19738. "use strict";
  19739. /* eslint-env node */
  19740. // SDP helpers.
  19741. var SDPUtils = {};
  19742. // Generate an alphanumeric identifier for cname or mids.
  19743. // TODO: use UUIDs instead? https://gist.github.com/jed/982883
  19744. SDPUtils.generateIdentifier = function() {
  19745. return Math.random().toString(36).substr(2, 10);
  19746. };
  19747. // The RTCP CNAME used by all peerconnections from the same JS.
  19748. SDPUtils.localCName = SDPUtils.generateIdentifier();
  19749. // Splits SDP into lines, dealing with both CRLF and LF.
  19750. SDPUtils.splitLines = function(blob) {
  19751. return blob.trim().split('\n').map(function(line) {
  19752. return line.trim();
  19753. });
  19754. };
  19755. // Splits SDP into sessionpart and mediasections. Ensures CRLF.
  19756. SDPUtils.splitSections = function(blob) {
  19757. var parts = blob.split('\nm=');
  19758. return parts.map(function(part, index) {
  19759. return (index > 0 ? 'm=' + part : part).trim() + '\r\n';
  19760. });
  19761. };
  19762. // returns the session description.
  19763. SDPUtils.getDescription = function(blob) {
  19764. var sections = SDPUtils.splitSections(blob);
  19765. return sections && sections[0];
  19766. };
  19767. // returns the individual media sections.
  19768. SDPUtils.getMediaSections = function(blob) {
  19769. var sections = SDPUtils.splitSections(blob);
  19770. sections.shift();
  19771. return sections;
  19772. };
  19773. // Returns lines that start with a certain prefix.
  19774. SDPUtils.matchPrefix = function(blob, prefix) {
  19775. return SDPUtils.splitLines(blob).filter(function(line) {
  19776. return line.indexOf(prefix) === 0;
  19777. });
  19778. };
  19779. // Parses an ICE candidate line. Sample input:
  19780. // candidate:702786350 2 udp 41819902 8.8.8.8 60769 typ relay raddr 8.8.8.8
  19781. // rport 55996"
  19782. SDPUtils.parseCandidate = function(line) {
  19783. var parts;
  19784. // Parse both variants.
  19785. if (line.indexOf('a=candidate:') === 0) {
  19786. parts = line.substring(12).split(' ');
  19787. } else {
  19788. parts = line.substring(10).split(' ');
  19789. }
  19790. var candidate = {
  19791. foundation: parts[0],
  19792. component: parseInt(parts[1], 10),
  19793. protocol: parts[2].toLowerCase(),
  19794. priority: parseInt(parts[3], 10),
  19795. ip: parts[4],
  19796. address: parts[4], // address is an alias for ip.
  19797. port: parseInt(parts[5], 10),
  19798. // skip parts[6] == 'typ'
  19799. type: parts[7]
  19800. };
  19801. for (var i = 8; i < parts.length; i += 2) {
  19802. switch (parts[i]) {
  19803. case 'raddr':
  19804. candidate.relatedAddress = parts[i + 1];
  19805. break;
  19806. case 'rport':
  19807. candidate.relatedPort = parseInt(parts[i + 1], 10);
  19808. break;
  19809. case 'tcptype':
  19810. candidate.tcpType = parts[i + 1];
  19811. break;
  19812. case 'ufrag':
  19813. candidate.ufrag = parts[i + 1]; // for backward compability.
  19814. candidate.usernameFragment = parts[i + 1];
  19815. break;
  19816. default: // extension handling, in particular ufrag
  19817. candidate[parts[i]] = parts[i + 1];
  19818. break;
  19819. }
  19820. }
  19821. return candidate;
  19822. };
  19823. // Translates a candidate object into SDP candidate attribute.
  19824. SDPUtils.writeCandidate = function(candidate) {
  19825. var sdp = [];
  19826. sdp.push(candidate.foundation);
  19827. sdp.push(candidate.component);
  19828. sdp.push(candidate.protocol.toUpperCase());
  19829. sdp.push(candidate.priority);
  19830. sdp.push(candidate.address || candidate.ip);
  19831. sdp.push(candidate.port);
  19832. var type = candidate.type;
  19833. sdp.push('typ');
  19834. sdp.push(type);
  19835. if (type !== 'host' && candidate.relatedAddress &&
  19836. candidate.relatedPort) {
  19837. sdp.push('raddr');
  19838. sdp.push(candidate.relatedAddress);
  19839. sdp.push('rport');
  19840. sdp.push(candidate.relatedPort);
  19841. }
  19842. if (candidate.tcpType && candidate.protocol.toLowerCase() === 'tcp') {
  19843. sdp.push('tcptype');
  19844. sdp.push(candidate.tcpType);
  19845. }
  19846. if (candidate.usernameFragment || candidate.ufrag) {
  19847. sdp.push('ufrag');
  19848. sdp.push(candidate.usernameFragment || candidate.ufrag);
  19849. }
  19850. return 'candidate:' + sdp.join(' ');
  19851. };
  19852. // Parses an ice-options line, returns an array of option tags.
  19853. // a=ice-options:foo bar
  19854. SDPUtils.parseIceOptions = function(line) {
  19855. return line.substr(14).split(' ');
  19856. };
  19857. // Parses an rtpmap line, returns RTCRtpCoddecParameters. Sample input:
  19858. // a=rtpmap:111 opus/48000/2
  19859. SDPUtils.parseRtpMap = function(line) {
  19860. var parts = line.substr(9).split(' ');
  19861. var parsed = {
  19862. payloadType: parseInt(parts.shift(), 10) // was: id
  19863. };
  19864. parts = parts[0].split('/');
  19865. parsed.name = parts[0];
  19866. parsed.clockRate = parseInt(parts[1], 10); // was: clockrate
  19867. parsed.channels = parts.length === 3 ? parseInt(parts[2], 10) : 1;
  19868. // legacy alias, got renamed back to channels in ORTC.
  19869. parsed.numChannels = parsed.channels;
  19870. return parsed;
  19871. };
  19872. // Generate an a=rtpmap line from RTCRtpCodecCapability or
  19873. // RTCRtpCodecParameters.
  19874. SDPUtils.writeRtpMap = function(codec) {
  19875. var pt = codec.payloadType;
  19876. if (codec.preferredPayloadType !== undefined) {
  19877. pt = codec.preferredPayloadType;
  19878. }
  19879. var channels = codec.channels || codec.numChannels || 1;
  19880. return 'a=rtpmap:' + pt + ' ' + codec.name + '/' + codec.clockRate +
  19881. (channels !== 1 ? '/' + channels : '') + '\r\n';
  19882. };
  19883. // Parses an a=extmap line (headerextension from RFC 5285). Sample input:
  19884. // a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
  19885. // a=extmap:2/sendonly urn:ietf:params:rtp-hdrext:toffset
  19886. SDPUtils.parseExtmap = function(line) {
  19887. var parts = line.substr(9).split(' ');
  19888. return {
  19889. id: parseInt(parts[0], 10),
  19890. direction: parts[0].indexOf('/') > 0 ? parts[0].split('/')[1] : 'sendrecv',
  19891. uri: parts[1]
  19892. };
  19893. };
  19894. // Generates a=extmap line from RTCRtpHeaderExtensionParameters or
  19895. // RTCRtpHeaderExtension.
  19896. SDPUtils.writeExtmap = function(headerExtension) {
  19897. return 'a=extmap:' + (headerExtension.id || headerExtension.preferredId) +
  19898. (headerExtension.direction && headerExtension.direction !== 'sendrecv'
  19899. ? '/' + headerExtension.direction
  19900. : '') +
  19901. ' ' + headerExtension.uri + '\r\n';
  19902. };
  19903. // Parses an ftmp line, returns dictionary. Sample input:
  19904. // a=fmtp:96 vbr=on;cng=on
  19905. // Also deals with vbr=on; cng=on
  19906. SDPUtils.parseFmtp = function(line) {
  19907. var parsed = {};
  19908. var kv;
  19909. var parts = line.substr(line.indexOf(' ') + 1).split(';');
  19910. for (var j = 0; j < parts.length; j++) {
  19911. kv = parts[j].trim().split('=');
  19912. parsed[kv[0].trim()] = kv[1];
  19913. }
  19914. return parsed;
  19915. };
  19916. // Generates an a=ftmp line from RTCRtpCodecCapability or RTCRtpCodecParameters.
  19917. SDPUtils.writeFmtp = function(codec) {
  19918. var line = '';
  19919. var pt = codec.payloadType;
  19920. if (codec.preferredPayloadType !== undefined) {
  19921. pt = codec.preferredPayloadType;
  19922. }
  19923. if (codec.parameters && Object.keys(codec.parameters).length) {
  19924. var params = [];
  19925. Object.keys(codec.parameters).forEach(function(param) {
  19926. if (codec.parameters[param]) {
  19927. params.push(param + '=' + codec.parameters[param]);
  19928. } else {
  19929. params.push(param);
  19930. }
  19931. });
  19932. line += 'a=fmtp:' + pt + ' ' + params.join(';') + '\r\n';
  19933. }
  19934. return line;
  19935. };
  19936. // Parses an rtcp-fb line, returns RTCPRtcpFeedback object. Sample input:
  19937. // a=rtcp-fb:98 nack rpsi
  19938. SDPUtils.parseRtcpFb = function(line) {
  19939. var parts = line.substr(line.indexOf(' ') + 1).split(' ');
  19940. return {
  19941. type: parts.shift(),
  19942. parameter: parts.join(' ')
  19943. };
  19944. };
  19945. // Generate a=rtcp-fb lines from RTCRtpCodecCapability or RTCRtpCodecParameters.
  19946. SDPUtils.writeRtcpFb = function(codec) {
  19947. var lines = '';
  19948. var pt = codec.payloadType;
  19949. if (codec.preferredPayloadType !== undefined) {
  19950. pt = codec.preferredPayloadType;
  19951. }
  19952. if (codec.rtcpFeedback && codec.rtcpFeedback.length) {
  19953. // FIXME: special handling for trr-int?
  19954. codec.rtcpFeedback.forEach(function(fb) {
  19955. lines += 'a=rtcp-fb:' + pt + ' ' + fb.type +
  19956. (fb.parameter && fb.parameter.length ? ' ' + fb.parameter : '') +
  19957. '\r\n';
  19958. });
  19959. }
  19960. return lines;
  19961. };
  19962. // Parses an RFC 5576 ssrc media attribute. Sample input:
  19963. // a=ssrc:3735928559 cname:something
  19964. SDPUtils.parseSsrcMedia = function(line) {
  19965. var sp = line.indexOf(' ');
  19966. var parts = {
  19967. ssrc: parseInt(line.substr(7, sp - 7), 10)
  19968. };
  19969. var colon = line.indexOf(':', sp);
  19970. if (colon > -1) {
  19971. parts.attribute = line.substr(sp + 1, colon - sp - 1);
  19972. parts.value = line.substr(colon + 1);
  19973. } else {
  19974. parts.attribute = line.substr(sp + 1);
  19975. }
  19976. return parts;
  19977. };
  19978. SDPUtils.parseSsrcGroup = function(line) {
  19979. var parts = line.substr(13).split(' ');
  19980. return {
  19981. semantics: parts.shift(),
  19982. ssrcs: parts.map(function(ssrc) {
  19983. return parseInt(ssrc, 10);
  19984. })
  19985. };
  19986. };
  19987. // Extracts the MID (RFC 5888) from a media section.
  19988. // returns the MID or undefined if no mid line was found.
  19989. SDPUtils.getMid = function(mediaSection) {
  19990. var mid = SDPUtils.matchPrefix(mediaSection, 'a=mid:')[0];
  19991. if (mid) {
  19992. return mid.substr(6);
  19993. }
  19994. };
  19995. SDPUtils.parseFingerprint = function(line) {
  19996. var parts = line.substr(14).split(' ');
  19997. return {
  19998. algorithm: parts[0].toLowerCase(), // algorithm is case-sensitive in Edge.
  19999. value: parts[1]
  20000. };
  20001. };
  20002. // Extracts DTLS parameters from SDP media section or sessionpart.
  20003. // FIXME: for consistency with other functions this should only
  20004. // get the fingerprint line as input. See also getIceParameters.
  20005. SDPUtils.getDtlsParameters = function(mediaSection, sessionpart) {
  20006. var lines = SDPUtils.matchPrefix(mediaSection + sessionpart,
  20007. 'a=fingerprint:');
  20008. // Note: a=setup line is ignored since we use the 'auto' role.
  20009. // Note2: 'algorithm' is not case sensitive except in Edge.
  20010. return {
  20011. role: 'auto',
  20012. fingerprints: lines.map(SDPUtils.parseFingerprint)
  20013. };
  20014. };
  20015. // Serializes DTLS parameters to SDP.
  20016. SDPUtils.writeDtlsParameters = function(params, setupType) {
  20017. var sdp = 'a=setup:' + setupType + '\r\n';
  20018. params.fingerprints.forEach(function(fp) {
  20019. sdp += 'a=fingerprint:' + fp.algorithm + ' ' + fp.value + '\r\n';
  20020. });
  20021. return sdp;
  20022. };
  20023. // Parses a=crypto lines into
  20024. // https://rawgit.com/aboba/edgertc/master/msortc-rs4.html#dictionary-rtcsrtpsdesparameters-members
  20025. SDPUtils.parseCryptoLine = function(line) {
  20026. var parts = line.substr(9).split(' ');
  20027. return {
  20028. tag: parseInt(parts[0], 10),
  20029. cryptoSuite: parts[1],
  20030. keyParams: parts[2],
  20031. sessionParams: parts.slice(3),
  20032. };
  20033. };
  20034. SDPUtils.writeCryptoLine = function(parameters) {
  20035. return 'a=crypto:' + parameters.tag + ' ' +
  20036. parameters.cryptoSuite + ' ' +
  20037. (typeof parameters.keyParams === 'object'
  20038. ? SDPUtils.writeCryptoKeyParams(parameters.keyParams)
  20039. : parameters.keyParams) +
  20040. (parameters.sessionParams ? ' ' + parameters.sessionParams.join(' ') : '') +
  20041. '\r\n';
  20042. };
  20043. // Parses the crypto key parameters into
  20044. // https://rawgit.com/aboba/edgertc/master/msortc-rs4.html#rtcsrtpkeyparam*
  20045. SDPUtils.parseCryptoKeyParams = function(keyParams) {
  20046. if (keyParams.indexOf('inline:') !== 0) {
  20047. return null;
  20048. }
  20049. var parts = keyParams.substr(7).split('|');
  20050. return {
  20051. keyMethod: 'inline',
  20052. keySalt: parts[0],
  20053. lifeTime: parts[1],
  20054. mkiValue: parts[2] ? parts[2].split(':')[0] : undefined,
  20055. mkiLength: parts[2] ? parts[2].split(':')[1] : undefined,
  20056. };
  20057. };
  20058. SDPUtils.writeCryptoKeyParams = function(keyParams) {
  20059. return keyParams.keyMethod + ':'
  20060. + keyParams.keySalt +
  20061. (keyParams.lifeTime ? '|' + keyParams.lifeTime : '') +
  20062. (keyParams.mkiValue && keyParams.mkiLength
  20063. ? '|' + keyParams.mkiValue + ':' + keyParams.mkiLength
  20064. : '');
  20065. };
  20066. // Extracts all SDES paramters.
  20067. SDPUtils.getCryptoParameters = function(mediaSection, sessionpart) {
  20068. var lines = SDPUtils.matchPrefix(mediaSection + sessionpart,
  20069. 'a=crypto:');
  20070. return lines.map(SDPUtils.parseCryptoLine);
  20071. };
  20072. // Parses ICE information from SDP media section or sessionpart.
  20073. // FIXME: for consistency with other functions this should only
  20074. // get the ice-ufrag and ice-pwd lines as input.
  20075. SDPUtils.getIceParameters = function(mediaSection, sessionpart) {
  20076. var ufrag = SDPUtils.matchPrefix(mediaSection + sessionpart,
  20077. 'a=ice-ufrag:')[0];
  20078. var pwd = SDPUtils.matchPrefix(mediaSection + sessionpart,
  20079. 'a=ice-pwd:')[0];
  20080. if (!(ufrag && pwd)) {
  20081. return null;
  20082. }
  20083. return {
  20084. usernameFragment: ufrag.substr(12),
  20085. password: pwd.substr(10),
  20086. };
  20087. };
  20088. // Serializes ICE parameters to SDP.
  20089. SDPUtils.writeIceParameters = function(params) {
  20090. return 'a=ice-ufrag:' + params.usernameFragment + '\r\n' +
  20091. 'a=ice-pwd:' + params.password + '\r\n';
  20092. };
  20093. // Parses the SDP media section and returns RTCRtpParameters.
  20094. SDPUtils.parseRtpParameters = function(mediaSection) {
  20095. var description = {
  20096. codecs: [],
  20097. headerExtensions: [],
  20098. fecMechanisms: [],
  20099. rtcp: []
  20100. };
  20101. var lines = SDPUtils.splitLines(mediaSection);
  20102. var mline = lines[0].split(' ');
  20103. for (var i = 3; i < mline.length; i++) { // find all codecs from mline[3..]
  20104. var pt = mline[i];
  20105. var rtpmapline = SDPUtils.matchPrefix(
  20106. mediaSection, 'a=rtpmap:' + pt + ' ')[0];
  20107. if (rtpmapline) {
  20108. var codec = SDPUtils.parseRtpMap(rtpmapline);
  20109. var fmtps = SDPUtils.matchPrefix(
  20110. mediaSection, 'a=fmtp:' + pt + ' ');
  20111. // Only the first a=fmtp:<pt> is considered.
  20112. codec.parameters = fmtps.length ? SDPUtils.parseFmtp(fmtps[0]) : {};
  20113. codec.rtcpFeedback = SDPUtils.matchPrefix(
  20114. mediaSection, 'a=rtcp-fb:' + pt + ' ')
  20115. .map(SDPUtils.parseRtcpFb);
  20116. description.codecs.push(codec);
  20117. // parse FEC mechanisms from rtpmap lines.
  20118. switch (codec.name.toUpperCase()) {
  20119. case 'RED':
  20120. case 'ULPFEC':
  20121. description.fecMechanisms.push(codec.name.toUpperCase());
  20122. break;
  20123. default: // only RED and ULPFEC are recognized as FEC mechanisms.
  20124. break;
  20125. }
  20126. }
  20127. }
  20128. SDPUtils.matchPrefix(mediaSection, 'a=extmap:').forEach(function(line) {
  20129. description.headerExtensions.push(SDPUtils.parseExtmap(line));
  20130. });
  20131. // FIXME: parse rtcp.
  20132. return description;
  20133. };
  20134. // Generates parts of the SDP media section describing the capabilities /
  20135. // parameters.
  20136. SDPUtils.writeRtpDescription = function(kind, caps) {
  20137. var sdp = '';
  20138. // Build the mline.
  20139. sdp += 'm=' + kind + ' ';
  20140. sdp += caps.codecs.length > 0 ? '9' : '0'; // reject if no codecs.
  20141. sdp += ' UDP/TLS/RTP/SAVPF ';
  20142. sdp += caps.codecs.map(function(codec) {
  20143. if (codec.preferredPayloadType !== undefined) {
  20144. return codec.preferredPayloadType;
  20145. }
  20146. return codec.payloadType;
  20147. }).join(' ') + '\r\n';
  20148. sdp += 'c=IN IP4 0.0.0.0\r\n';
  20149. sdp += 'a=rtcp:9 IN IP4 0.0.0.0\r\n';
  20150. // Add a=rtpmap lines for each codec. Also fmtp and rtcp-fb.
  20151. caps.codecs.forEach(function(codec) {
  20152. sdp += SDPUtils.writeRtpMap(codec);
  20153. sdp += SDPUtils.writeFmtp(codec);
  20154. sdp += SDPUtils.writeRtcpFb(codec);
  20155. });
  20156. var maxptime = 0;
  20157. caps.codecs.forEach(function(codec) {
  20158. if (codec.maxptime > maxptime) {
  20159. maxptime = codec.maxptime;
  20160. }
  20161. });
  20162. if (maxptime > 0) {
  20163. sdp += 'a=maxptime:' + maxptime + '\r\n';
  20164. }
  20165. sdp += 'a=rtcp-mux\r\n';
  20166. if (caps.headerExtensions) {
  20167. caps.headerExtensions.forEach(function(extension) {
  20168. sdp += SDPUtils.writeExtmap(extension);
  20169. });
  20170. }
  20171. // FIXME: write fecMechanisms.
  20172. return sdp;
  20173. };
  20174. // Parses the SDP media section and returns an array of
  20175. // RTCRtpEncodingParameters.
  20176. SDPUtils.parseRtpEncodingParameters = function(mediaSection) {
  20177. var encodingParameters = [];
  20178. var description = SDPUtils.parseRtpParameters(mediaSection);
  20179. var hasRed = description.fecMechanisms.indexOf('RED') !== -1;
  20180. var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1;
  20181. // filter a=ssrc:... cname:, ignore PlanB-msid
  20182. var ssrcs = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')
  20183. .map(function(line) {
  20184. return SDPUtils.parseSsrcMedia(line);
  20185. })
  20186. .filter(function(parts) {
  20187. return parts.attribute === 'cname';
  20188. });
  20189. var primarySsrc = ssrcs.length > 0 && ssrcs[0].ssrc;
  20190. var secondarySsrc;
  20191. var flows = SDPUtils.matchPrefix(mediaSection, 'a=ssrc-group:FID')
  20192. .map(function(line) {
  20193. var parts = line.substr(17).split(' ');
  20194. return parts.map(function(part) {
  20195. return parseInt(part, 10);
  20196. });
  20197. });
  20198. if (flows.length > 0 && flows[0].length > 1 && flows[0][0] === primarySsrc) {
  20199. secondarySsrc = flows[0][1];
  20200. }
  20201. description.codecs.forEach(function(codec) {
  20202. if (codec.name.toUpperCase() === 'RTX' && codec.parameters.apt) {
  20203. var encParam = {
  20204. ssrc: primarySsrc,
  20205. codecPayloadType: parseInt(codec.parameters.apt, 10)
  20206. };
  20207. if (primarySsrc && secondarySsrc) {
  20208. encParam.rtx = {ssrc: secondarySsrc};
  20209. }
  20210. encodingParameters.push(encParam);
  20211. if (hasRed) {
  20212. encParam = JSON.parse(JSON.stringify(encParam));
  20213. encParam.fec = {
  20214. ssrc: primarySsrc,
  20215. mechanism: hasUlpfec ? 'red+ulpfec' : 'red'
  20216. };
  20217. encodingParameters.push(encParam);
  20218. }
  20219. }
  20220. });
  20221. if (encodingParameters.length === 0 && primarySsrc) {
  20222. encodingParameters.push({
  20223. ssrc: primarySsrc
  20224. });
  20225. }
  20226. // we support both b=AS and b=TIAS but interpret AS as TIAS.
  20227. var bandwidth = SDPUtils.matchPrefix(mediaSection, 'b=');
  20228. if (bandwidth.length) {
  20229. if (bandwidth[0].indexOf('b=TIAS:') === 0) {
  20230. bandwidth = parseInt(bandwidth[0].substr(7), 10);
  20231. } else if (bandwidth[0].indexOf('b=AS:') === 0) {
  20232. // use formula from JSEP to convert b=AS to TIAS value.
  20233. bandwidth = parseInt(bandwidth[0].substr(5), 10) * 1000 * 0.95
  20234. - (50 * 40 * 8);
  20235. } else {
  20236. bandwidth = undefined;
  20237. }
  20238. encodingParameters.forEach(function(params) {
  20239. params.maxBitrate = bandwidth;
  20240. });
  20241. }
  20242. return encodingParameters;
  20243. };
  20244. // parses http://draft.ortc.org/#rtcrtcpparameters*
  20245. SDPUtils.parseRtcpParameters = function(mediaSection) {
  20246. var rtcpParameters = {};
  20247. // Gets the first SSRC. Note tha with RTX there might be multiple
  20248. // SSRCs.
  20249. var remoteSsrc = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')
  20250. .map(function(line) {
  20251. return SDPUtils.parseSsrcMedia(line);
  20252. })
  20253. .filter(function(obj) {
  20254. return obj.attribute === 'cname';
  20255. })[0];
  20256. if (remoteSsrc) {
  20257. rtcpParameters.cname = remoteSsrc.value;
  20258. rtcpParameters.ssrc = remoteSsrc.ssrc;
  20259. }
  20260. // Edge uses the compound attribute instead of reducedSize
  20261. // compound is !reducedSize
  20262. var rsize = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-rsize');
  20263. rtcpParameters.reducedSize = rsize.length > 0;
  20264. rtcpParameters.compound = rsize.length === 0;
  20265. // parses the rtcp-mux attrіbute.
  20266. // Note that Edge does not support unmuxed RTCP.
  20267. var mux = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-mux');
  20268. rtcpParameters.mux = mux.length > 0;
  20269. return rtcpParameters;
  20270. };
  20271. // parses either a=msid: or a=ssrc:... msid lines and returns
  20272. // the id of the MediaStream and MediaStreamTrack.
  20273. SDPUtils.parseMsid = function(mediaSection) {
  20274. var parts;
  20275. var spec = SDPUtils.matchPrefix(mediaSection, 'a=msid:');
  20276. if (spec.length === 1) {
  20277. parts = spec[0].substr(7).split(' ');
  20278. return {stream: parts[0], track: parts[1]};
  20279. }
  20280. var planB = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')
  20281. .map(function(line) {
  20282. return SDPUtils.parseSsrcMedia(line);
  20283. })
  20284. .filter(function(msidParts) {
  20285. return msidParts.attribute === 'msid';
  20286. });
  20287. if (planB.length > 0) {
  20288. parts = planB[0].value.split(' ');
  20289. return {stream: parts[0], track: parts[1]};
  20290. }
  20291. };
  20292. // SCTP
  20293. // parses draft-ietf-mmusic-sctp-sdp-26 first and falls back
  20294. // to draft-ietf-mmusic-sctp-sdp-05
  20295. SDPUtils.parseSctpDescription = function(mediaSection) {
  20296. var mline = SDPUtils.parseMLine(mediaSection);
  20297. var maxSizeLine = SDPUtils.matchPrefix(mediaSection, 'a=max-message-size:');
  20298. var maxMessageSize;
  20299. if (maxSizeLine.length > 0) {
  20300. maxMessageSize = parseInt(maxSizeLine[0].substr(19), 10);
  20301. }
  20302. if (isNaN(maxMessageSize)) {
  20303. maxMessageSize = 65536;
  20304. }
  20305. var sctpPort = SDPUtils.matchPrefix(mediaSection, 'a=sctp-port:');
  20306. if (sctpPort.length > 0) {
  20307. return {
  20308. port: parseInt(sctpPort[0].substr(12), 10),
  20309. protocol: mline.fmt,
  20310. maxMessageSize: maxMessageSize
  20311. };
  20312. }
  20313. var sctpMapLines = SDPUtils.matchPrefix(mediaSection, 'a=sctpmap:');
  20314. if (sctpMapLines.length > 0) {
  20315. var parts = SDPUtils.matchPrefix(mediaSection, 'a=sctpmap:')[0]
  20316. .substr(10)
  20317. .split(' ');
  20318. return {
  20319. port: parseInt(parts[0], 10),
  20320. protocol: parts[1],
  20321. maxMessageSize: maxMessageSize
  20322. };
  20323. }
  20324. };
  20325. // SCTP
  20326. // outputs the draft-ietf-mmusic-sctp-sdp-26 version that all browsers
  20327. // support by now receiving in this format, unless we originally parsed
  20328. // as the draft-ietf-mmusic-sctp-sdp-05 format (indicated by the m-line
  20329. // protocol of DTLS/SCTP -- without UDP/ or TCP/)
  20330. SDPUtils.writeSctpDescription = function(media, sctp) {
  20331. var output = [];
  20332. if (media.protocol !== 'DTLS/SCTP') {
  20333. output = [
  20334. 'm=' + media.kind + ' 9 ' + media.protocol + ' ' + sctp.protocol + '\r\n',
  20335. 'c=IN IP4 0.0.0.0\r\n',
  20336. 'a=sctp-port:' + sctp.port + '\r\n'
  20337. ];
  20338. } else {
  20339. output = [
  20340. 'm=' + media.kind + ' 9 ' + media.protocol + ' ' + sctp.port + '\r\n',
  20341. 'c=IN IP4 0.0.0.0\r\n',
  20342. 'a=sctpmap:' + sctp.port + ' ' + sctp.protocol + ' 65535\r\n'
  20343. ];
  20344. }
  20345. if (sctp.maxMessageSize !== undefined) {
  20346. output.push('a=max-message-size:' + sctp.maxMessageSize + '\r\n');
  20347. }
  20348. return output.join('');
  20349. };
  20350. // Generate a session ID for SDP.
  20351. // https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-20#section-5.2.1
  20352. // recommends using a cryptographically random +ve 64-bit value
  20353. // but right now this should be acceptable and within the right range
  20354. SDPUtils.generateSessionId = function() {
  20355. return Math.random().toString().substr(2, 21);
  20356. };
  20357. // Write boilder plate for start of SDP
  20358. // sessId argument is optional - if not supplied it will
  20359. // be generated randomly
  20360. // sessVersion is optional and defaults to 2
  20361. // sessUser is optional and defaults to 'thisisadapterortc'
  20362. SDPUtils.writeSessionBoilerplate = function(sessId, sessVer, sessUser) {
  20363. var sessionId;
  20364. var version = sessVer !== undefined ? sessVer : 2;
  20365. if (sessId) {
  20366. sessionId = sessId;
  20367. } else {
  20368. sessionId = SDPUtils.generateSessionId();
  20369. }
  20370. var user = sessUser || 'thisisadapterortc';
  20371. // FIXME: sess-id should be an NTP timestamp.
  20372. return 'v=0\r\n' +
  20373. 'o=' + user + ' ' + sessionId + ' ' + version +
  20374. ' IN IP4 127.0.0.1\r\n' +
  20375. 's=-\r\n' +
  20376. 't=0 0\r\n';
  20377. };
  20378. SDPUtils.writeMediaSection = function(transceiver, caps, type, stream) {
  20379. var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps);
  20380. // Map ICE parameters (ufrag, pwd) to SDP.
  20381. sdp += SDPUtils.writeIceParameters(
  20382. transceiver.iceGatherer.getLocalParameters());
  20383. // Map DTLS parameters to SDP.
  20384. sdp += SDPUtils.writeDtlsParameters(
  20385. transceiver.dtlsTransport.getLocalParameters(),
  20386. type === 'offer' ? 'actpass' : 'active');
  20387. sdp += 'a=mid:' + transceiver.mid + '\r\n';
  20388. if (transceiver.direction) {
  20389. sdp += 'a=' + transceiver.direction + '\r\n';
  20390. } else if (transceiver.rtpSender && transceiver.rtpReceiver) {
  20391. sdp += 'a=sendrecv\r\n';
  20392. } else if (transceiver.rtpSender) {
  20393. sdp += 'a=sendonly\r\n';
  20394. } else if (transceiver.rtpReceiver) {
  20395. sdp += 'a=recvonly\r\n';
  20396. } else {
  20397. sdp += 'a=inactive\r\n';
  20398. }
  20399. if (transceiver.rtpSender) {
  20400. // spec.
  20401. var msid = 'msid:' + stream.id + ' ' +
  20402. transceiver.rtpSender.track.id + '\r\n';
  20403. sdp += 'a=' + msid;
  20404. // for Chrome.
  20405. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc +
  20406. ' ' + msid;
  20407. if (transceiver.sendEncodingParameters[0].rtx) {
  20408. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc +
  20409. ' ' + msid;
  20410. sdp += 'a=ssrc-group:FID ' +
  20411. transceiver.sendEncodingParameters[0].ssrc + ' ' +
  20412. transceiver.sendEncodingParameters[0].rtx.ssrc +
  20413. '\r\n';
  20414. }
  20415. }
  20416. // FIXME: this should be written by writeRtpDescription.
  20417. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc +
  20418. ' cname:' + SDPUtils.localCName + '\r\n';
  20419. if (transceiver.rtpSender && transceiver.sendEncodingParameters[0].rtx) {
  20420. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc +
  20421. ' cname:' + SDPUtils.localCName + '\r\n';
  20422. }
  20423. return sdp;
  20424. };
  20425. // Gets the direction from the mediaSection or the sessionpart.
  20426. SDPUtils.getDirection = function(mediaSection, sessionpart) {
  20427. // Look for sendrecv, sendonly, recvonly, inactive, default to sendrecv.
  20428. var lines = SDPUtils.splitLines(mediaSection);
  20429. for (var i = 0; i < lines.length; i++) {
  20430. switch (lines[i]) {
  20431. case 'a=sendrecv':
  20432. case 'a=sendonly':
  20433. case 'a=recvonly':
  20434. case 'a=inactive':
  20435. return lines[i].substr(2);
  20436. default:
  20437. // FIXME: What should happen here?
  20438. }
  20439. }
  20440. if (sessionpart) {
  20441. return SDPUtils.getDirection(sessionpart);
  20442. }
  20443. return 'sendrecv';
  20444. };
  20445. SDPUtils.getKind = function(mediaSection) {
  20446. var lines = SDPUtils.splitLines(mediaSection);
  20447. var mline = lines[0].split(' ');
  20448. return mline[0].substr(2);
  20449. };
  20450. SDPUtils.isRejected = function(mediaSection) {
  20451. return mediaSection.split(' ', 2)[1] === '0';
  20452. };
  20453. SDPUtils.parseMLine = function(mediaSection) {
  20454. var lines = SDPUtils.splitLines(mediaSection);
  20455. var parts = lines[0].substr(2).split(' ');
  20456. return {
  20457. kind: parts[0],
  20458. port: parseInt(parts[1], 10),
  20459. protocol: parts[2],
  20460. fmt: parts.slice(3).join(' ')
  20461. };
  20462. };
  20463. SDPUtils.parseOLine = function(mediaSection) {
  20464. var line = SDPUtils.matchPrefix(mediaSection, 'o=')[0];
  20465. var parts = line.substr(2).split(' ');
  20466. return {
  20467. username: parts[0],
  20468. sessionId: parts[1],
  20469. sessionVersion: parseInt(parts[2], 10),
  20470. netType: parts[3],
  20471. addressType: parts[4],
  20472. address: parts[5]
  20473. };
  20474. };
  20475. // a very naive interpretation of a valid SDP.
  20476. SDPUtils.isValidSDP = function(blob) {
  20477. if (typeof blob !== 'string' || blob.length === 0) {
  20478. return false;
  20479. }
  20480. var lines = SDPUtils.splitLines(blob);
  20481. for (var i = 0; i < lines.length; i++) {
  20482. if (lines[i].length < 2 || lines[i].charAt(1) !== '=') {
  20483. return false;
  20484. }
  20485. // TODO: check the modifier a bit more.
  20486. }
  20487. return true;
  20488. };
  20489. // Expose public methods.
  20490. if (true) {
  20491. module.exports = SDPUtils;
  20492. }
  20493. /***/ }),
  20494. /* 248 */
  20495. /***/ (function(module, exports, __webpack_require__) {
  20496. "use strict";
  20497. module.exports = function calculateCapableSimulcastStreams(opt) {
  20498. const supportedBrowsers = ['Chrome', 'Safari'];
  20499. if (supportedBrowsers.indexOf(opt.browserName) === -1 || opt.isScreenSharing || opt.sessionInfo.p2pEnabled || !opt.constraints.video && !opt.isCustomVideoTrack) {
  20500. // We only support simulcast on Chrome, and when not using
  20501. // screensharing.
  20502. return 1;
  20503. } // HD and above gets three streams. Otherwise they get 2.
  20504. if (opt.videoDimensions.width > 640 && opt.videoDimensions.height > 480) {
  20505. return 3;
  20506. }
  20507. return 2;
  20508. };
  20509. /***/ }),
  20510. /* 249 */
  20511. /***/ (function(module, exports, __webpack_require__) {
  20512. "use strict";
  20513. var _interopRequireDefault = __webpack_require__(2);
  20514. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  20515. var _temp;
  20516. /* eslint-disable no-underscore-dangle */
  20517. const now = __webpack_require__(46);
  20518. /*
  20519. * A <code>RTCPeerConnection.getStats</code> based audio level sampler.
  20520. *
  20521. * It uses the <code>getStats</code> method to get the <code>audioOutputLevel</code>.
  20522. * This implementation expects the single parameter version of the <code>getStats</code> method.
  20523. *
  20524. * Currently the <code>audioOutputLevel</code> stats is only supported in Chrome.
  20525. *
  20526. * @param {function} getStatsFn the "getStats" function
  20527. * @constructor
  20528. */
  20529. module.exports = (_temp = /*#__PURE__*/function () {
  20530. function GetStatsAudioLevelSampler(getStats, _temp2) {
  20531. var _context;
  20532. let _ref = _temp2 === void 0 ? {} : _temp2,
  20533. _ref$requestAnimation = _ref.requestAnimationFrame,
  20534. requestAnimationFrame = _ref$requestAnimation === void 0 ? (_context = window).requestAnimationFrame.bind(_context) : _ref$requestAnimation;
  20535. (0, _defineProperty2.default)(this, "_lastCalled", now());
  20536. (0, _defineProperty2.default)(this, "_audioLevel", undefined);
  20537. (0, _defineProperty2.default)(this, "_running", false);
  20538. this._requestAnimationFrame = requestAnimationFrame;
  20539. this._getStats = getStats;
  20540. this._startLoop();
  20541. }
  20542. var _proto = GetStatsAudioLevelSampler.prototype;
  20543. _proto._startLoop = function _startLoop() {
  20544. if (this._running) {
  20545. return;
  20546. }
  20547. this._running = true;
  20548. this._requestAnimationFrame(this._loop.bind(this));
  20549. };
  20550. _proto._loop = function _loop() {
  20551. this._getStats((error, stats) => {
  20552. // @todo we should measure how long the getStats so that we can determine
  20553. // our impact on the render loop, and skip frames if need to reduce our
  20554. // CPU utilization
  20555. // Stat entries without audio can have audioLevel 0 so we just look for the max level
  20556. let maxLevel = null;
  20557. if (!error) {
  20558. for (let idx = 0; idx < stats.length; idx += 1) {
  20559. const stat = stats[idx];
  20560. let level = null;
  20561. if (stat.audioOutputLevel !== undefined) {
  20562. // the max value delivered by getStats via audioOutputLevel is 2^15
  20563. const audioOutputLevel = parseFloat(stat.audioOutputLevel) / 32768;
  20564. if (!isNaN(audioOutputLevel)) {
  20565. level = audioOutputLevel;
  20566. }
  20567. } else if (stat.audioLevel !== undefined) {
  20568. level = stat.audioLevel;
  20569. }
  20570. if (level !== null && (maxLevel === null || level > maxLevel)) {
  20571. maxLevel = level;
  20572. }
  20573. }
  20574. }
  20575. this._audioLevel = maxLevel;
  20576. if (this._running && now() - this._lastCalled < 10000) {
  20577. this._requestAnimationFrame(this._loop.bind(this));
  20578. } else {
  20579. this._running = false;
  20580. }
  20581. });
  20582. };
  20583. _proto.destroy = function destroy() {
  20584. this._running = false;
  20585. };
  20586. _proto.sample = function sample(done) {
  20587. if (typeof done === 'function') {
  20588. throw new Error('sample no longer takes a callback');
  20589. }
  20590. this._startLoop();
  20591. this._lastCalled = now();
  20592. return this._audioLevel;
  20593. };
  20594. return GetStatsAudioLevelSampler;
  20595. }(), _temp);
  20596. /***/ }),
  20597. /* 250 */
  20598. /***/ (function(module, exports, __webpack_require__) {
  20599. "use strict";
  20600. const merge = __webpack_require__(143);
  20601. const normalizeConstraintInput = __webpack_require__(548);
  20602. const isScreenSharingSource = __webpack_require__(258);
  20603. function createSourceConstraint(media, enableRenegotiation, usingOptionalMandatoryStyle) {
  20604. if (!media.publish && enableRenegotiation) {
  20605. // FIXME: I'm still not quite happy with how this works. With renegotiation, when publish
  20606. // changes to true we shouldn't have to recalculate constraints. I think Publisher should handle
  20607. // this override instead and this component shouldn't know anything about renegotiation.
  20608. // Related: OPENTOK-31082
  20609. return false;
  20610. }
  20611. if (typeof media.source === 'boolean') {
  20612. return media.source;
  20613. }
  20614. if (usingOptionalMandatoryStyle) {
  20615. return {
  20616. mandatory: {
  20617. sourceId: media.source
  20618. }
  20619. };
  20620. } // getDisplayMedia doesn't support exact constraints
  20621. if (isScreenSharingSource(media.source)) {
  20622. return {
  20623. deviceId: media.source
  20624. };
  20625. }
  20626. return {
  20627. deviceId: {
  20628. exact: media.source
  20629. }
  20630. };
  20631. }
  20632. function generateAudioConstraints(opt) {
  20633. let constraints = createSourceConstraint(opt.audio, opt.enableRenegotiation, opt.usingOptionalMandatoryStyle);
  20634. if (constraints === false) {
  20635. return false;
  20636. }
  20637. const usingOptionalMandatoryStyle = opt.usingOptionalMandatoryStyle,
  20638. enableStereo = opt.enableStereo,
  20639. disableAudioProcessing = opt.disableAudioProcessing,
  20640. prefixedAudioConstraints = opt.prefixedAudioConstraints;
  20641. if ((enableStereo || disableAudioProcessing || prefixedAudioConstraints) && constraints === true) {
  20642. constraints = {};
  20643. }
  20644. if (enableStereo) {
  20645. // Chrome<61 uses optional/mandatory style because a boolean is equivalent to an ideal value
  20646. // See https://bugs.chromium.org/p/chromium/issues/detail?id=700223#c3
  20647. if (usingOptionalMandatoryStyle) {
  20648. merge(constraints, {
  20649. optional: []
  20650. });
  20651. constraints.optional.push({
  20652. channelCount: 2
  20653. });
  20654. } else {
  20655. constraints.channelCount = 2;
  20656. }
  20657. }
  20658. if (disableAudioProcessing) {
  20659. // Chrome<61 uses optional/mandatory style because a boolean is equivalent to an ideal value
  20660. // See https://bugs.chromium.org/p/chromium/issues/detail?id=700223#c3
  20661. if (usingOptionalMandatoryStyle) {
  20662. merge(constraints, {
  20663. optional: []
  20664. });
  20665. constraints.optional.push({
  20666. echoCancellation: false
  20667. });
  20668. } else {
  20669. constraints.echoCancellation = false;
  20670. }
  20671. }
  20672. if (prefixedAudioConstraints) {
  20673. if (usingOptionalMandatoryStyle) {
  20674. merge(constraints, {
  20675. optional: []
  20676. });
  20677. Object.keys(prefixedAudioConstraints).forEach(key => {
  20678. constraints.optional.push({
  20679. [key]: prefixedAudioConstraints[key]
  20680. });
  20681. });
  20682. } else {
  20683. merge(constraints, prefixedAudioConstraints);
  20684. }
  20685. }
  20686. return constraints;
  20687. }
  20688. function generateVideoConstraints(opt) {
  20689. let constraints = createSourceConstraint(opt.video, opt.enableRenegotiation, opt.usingOptionalMandatoryStyle);
  20690. if (constraints === false) {
  20691. return false;
  20692. }
  20693. const videoDimensions = opt.videoDimensions,
  20694. frameRate = opt.frameRate,
  20695. maxResolution = opt.maxResolution,
  20696. facingMode = opt.facingMode,
  20697. usingOptionalMandatoryStyle = opt.usingOptionalMandatoryStyle;
  20698. if ((videoDimensions || frameRate || maxResolution || facingMode) && constraints === true) {
  20699. constraints = {};
  20700. }
  20701. if (videoDimensions) {
  20702. const width = videoDimensions.width;
  20703. const height = videoDimensions.height;
  20704. if (usingOptionalMandatoryStyle) {
  20705. merge(constraints, {
  20706. optional: []
  20707. });
  20708. constraints.optional.push({
  20709. minWidth: width
  20710. }, {
  20711. maxWidth: width
  20712. }, {
  20713. minHeight: height
  20714. }, {
  20715. maxHeight: height
  20716. });
  20717. } else {
  20718. merge(constraints, {
  20719. width: {
  20720. ideal: width
  20721. },
  20722. height: {
  20723. ideal: height
  20724. }
  20725. });
  20726. }
  20727. }
  20728. if (frameRate) {
  20729. if (usingOptionalMandatoryStyle) {
  20730. merge(constraints, {
  20731. optional: []
  20732. });
  20733. constraints.optional.push({
  20734. minFrameRate: frameRate
  20735. }, {
  20736. maxFrameRate: frameRate
  20737. });
  20738. } else {
  20739. merge(constraints, {
  20740. frameRate: {
  20741. ideal: frameRate
  20742. }
  20743. });
  20744. }
  20745. }
  20746. if (maxResolution) {
  20747. if (usingOptionalMandatoryStyle) {
  20748. merge(constraints, {
  20749. mandatory: {
  20750. maxWidth: maxResolution.width,
  20751. maxHeight: maxResolution.height
  20752. }
  20753. });
  20754. } else {
  20755. merge(constraints, {
  20756. width: {
  20757. max: maxResolution.width
  20758. },
  20759. height: {
  20760. max: maxResolution.height
  20761. }
  20762. });
  20763. }
  20764. }
  20765. if (facingMode) {
  20766. if (usingOptionalMandatoryStyle) {
  20767. merge(constraints, {
  20768. optional: []
  20769. });
  20770. constraints.optional.push({
  20771. facingMode
  20772. });
  20773. } else {
  20774. merge(constraints, {
  20775. facingMode: {
  20776. ideal: facingMode
  20777. }
  20778. });
  20779. }
  20780. }
  20781. return constraints;
  20782. }
  20783. function generateConstraints(opt) {
  20784. return {
  20785. audio: generateAudioConstraints(opt),
  20786. video: generateVideoConstraints(opt)
  20787. };
  20788. }
  20789. module.exports = function generateConstraintInfo(opt) {
  20790. const normOpt = normalizeConstraintInput(opt);
  20791. const constraints = generateConstraints(normOpt);
  20792. return {
  20793. constraints,
  20794. publishAudio: normOpt.audio.publish,
  20795. publishVideo: normOpt.video.publish,
  20796. frameRate: normOpt.frameRate,
  20797. videoDimensions: normOpt.videoDimensions,
  20798. audioDeviceId: typeof normOpt.audio.source === 'string' ? normOpt.audio.source : undefined,
  20799. videoDeviceId: typeof normOpt.video.source === 'string' ? normOpt.video.source : undefined
  20800. };
  20801. };
  20802. /***/ }),
  20803. /* 251 */
  20804. /***/ (function(module, exports, __webpack_require__) {
  20805. var baseAssignValue = __webpack_require__(60),
  20806. eq = __webpack_require__(48);
  20807. /**
  20808. * This function is like `assignValue` except that it doesn't assign
  20809. * `undefined` values.
  20810. *
  20811. * @private
  20812. * @param {Object} object The object to modify.
  20813. * @param {string} key The key of the property to assign.
  20814. * @param {*} value The value to assign.
  20815. */
  20816. function assignMergeValue(object, key, value) {
  20817. if ((value !== undefined && !eq(object[key], value)) ||
  20818. (value === undefined && !(key in object))) {
  20819. baseAssignValue(object, key, value);
  20820. }
  20821. }
  20822. module.exports = assignMergeValue;
  20823. /***/ }),
  20824. /* 252 */
  20825. /***/ (function(module, exports) {
  20826. /**
  20827. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  20828. *
  20829. * @private
  20830. * @param {Object} object The object to query.
  20831. * @param {string} key The key of the property to get.
  20832. * @returns {*} Returns the property value.
  20833. */
  20834. function safeGet(object, key) {
  20835. if (key === 'constructor' && typeof object[key] === 'function') {
  20836. return;
  20837. }
  20838. if (key == '__proto__') {
  20839. return;
  20840. }
  20841. return object[key];
  20842. }
  20843. module.exports = safeGet;
  20844. /***/ }),
  20845. /* 253 */
  20846. /***/ (function(module, exports, __webpack_require__) {
  20847. "use strict";
  20848. const _require = __webpack_require__(3),
  20849. name = _require.name,
  20850. version = _require.version,
  20851. isChromiumEdge = _require.isChromiumEdge;
  20852. module.exports = isChromiumEdge || name === 'Chrome' && version >= 72 || name === 'Firefox' && version >= 66 || name === 'Opera' && version >= 60;
  20853. /***/ }),
  20854. /* 254 */
  20855. /***/ (function(module, exports, __webpack_require__) {
  20856. var toString = __webpack_require__(92),
  20857. upperFirst = __webpack_require__(553);
  20858. /**
  20859. * Converts the first character of `string` to upper case and the remaining
  20860. * to lower case.
  20861. *
  20862. * @static
  20863. * @memberOf _
  20864. * @since 3.0.0
  20865. * @category String
  20866. * @param {string} [string=''] The string to capitalize.
  20867. * @returns {string} Returns the capitalized string.
  20868. * @example
  20869. *
  20870. * _.capitalize('FRED');
  20871. * // => 'Fred'
  20872. */
  20873. function capitalize(string) {
  20874. return upperFirst(toString(string).toLowerCase());
  20875. }
  20876. module.exports = capitalize;
  20877. /***/ }),
  20878. /* 255 */
  20879. /***/ (function(module, exports) {
  20880. /**
  20881. * The base implementation of `_.slice` without an iteratee call guard.
  20882. *
  20883. * @private
  20884. * @param {Array} array The array to slice.
  20885. * @param {number} [start=0] The start position.
  20886. * @param {number} [end=array.length] The end position.
  20887. * @returns {Array} Returns the slice of `array`.
  20888. */
  20889. function baseSlice(array, start, end) {
  20890. var index = -1,
  20891. length = array.length;
  20892. if (start < 0) {
  20893. start = -start > length ? 0 : (length + start);
  20894. }
  20895. end = end > length ? length : end;
  20896. if (end < 0) {
  20897. end += length;
  20898. }
  20899. length = start > end ? 0 : ((end - start) >>> 0);
  20900. start >>>= 0;
  20901. var result = Array(length);
  20902. while (++index < length) {
  20903. result[index] = array[index + start];
  20904. }
  20905. return result;
  20906. }
  20907. module.exports = baseSlice;
  20908. /***/ }),
  20909. /* 256 */
  20910. /***/ (function(module, exports) {
  20911. /** Used to compose unicode character classes. */
  20912. var rsAstralRange = '\\ud800-\\udfff',
  20913. rsComboMarksRange = '\\u0300-\\u036f',
  20914. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  20915. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  20916. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  20917. rsVarRange = '\\ufe0e\\ufe0f';
  20918. /** Used to compose unicode capture groups. */
  20919. var rsZWJ = '\\u200d';
  20920. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  20921. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  20922. /**
  20923. * Checks if `string` contains Unicode symbols.
  20924. *
  20925. * @private
  20926. * @param {string} string The string to inspect.
  20927. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  20928. */
  20929. function hasUnicode(string) {
  20930. return reHasUnicode.test(string);
  20931. }
  20932. module.exports = hasUnicode;
  20933. /***/ }),
  20934. /* 257 */
  20935. /***/ (function(module, exports, __webpack_require__) {
  20936. var asciiToArray = __webpack_require__(556),
  20937. hasUnicode = __webpack_require__(256),
  20938. unicodeToArray = __webpack_require__(557);
  20939. /**
  20940. * Converts `string` to an array.
  20941. *
  20942. * @private
  20943. * @param {string} string The string to convert.
  20944. * @returns {Array} Returns the converted array.
  20945. */
  20946. function stringToArray(string) {
  20947. return hasUnicode(string)
  20948. ? unicodeToArray(string)
  20949. : asciiToArray(string);
  20950. }
  20951. module.exports = stringToArray;
  20952. /***/ }),
  20953. /* 258 */
  20954. /***/ (function(module, exports, __webpack_require__) {
  20955. "use strict";
  20956. const screenSharingSources = __webpack_require__(558);
  20957. module.exports = videoSource => screenSharingSources.indexOf(videoSource) > -1;
  20958. /***/ }),
  20959. /* 259 */
  20960. /***/ (function(module, exports, __webpack_require__) {
  20961. var baseForOwn = __webpack_require__(93),
  20962. createBaseEach = __webpack_require__(563);
  20963. /**
  20964. * The base implementation of `_.forEach` without support for iteratee shorthands.
  20965. *
  20966. * @private
  20967. * @param {Array|Object} collection The collection to iterate over.
  20968. * @param {Function} iteratee The function invoked per iteration.
  20969. * @returns {Array|Object} Returns `collection`.
  20970. */
  20971. var baseEach = createBaseEach(baseForOwn);
  20972. module.exports = baseEach;
  20973. /***/ }),
  20974. /* 260 */
  20975. /***/ (function(module, exports, __webpack_require__) {
  20976. "use strict";
  20977. module.exports = 15000;
  20978. /***/ }),
  20979. /* 261 */
  20980. /***/ (function(module, exports, __webpack_require__) {
  20981. "use strict";
  20982. /**
  20983. * castToBoolean
  20984. *
  20985. * @param {any} The value to cast
  20986. * @returns {Boolean} True if value === 'true' or value === true, otherwise false.
  20987. */
  20988. module.exports = function (value, defaultValue) {
  20989. if (defaultValue === void 0) {
  20990. defaultValue = false;
  20991. }
  20992. return value === undefined ? defaultValue : value === 'true' || value === true;
  20993. };
  20994. /***/ }),
  20995. /* 262 */
  20996. /***/ (function(module, exports) {
  20997. function _setPrototypeOf(o, p) {
  20998. module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  20999. o.__proto__ = p;
  21000. return o;
  21001. };
  21002. return _setPrototypeOf(o, p);
  21003. }
  21004. module.exports = _setPrototypeOf;
  21005. /***/ }),
  21006. /* 263 */
  21007. /***/ (function(module, exports, __webpack_require__) {
  21008. var arrayMap = __webpack_require__(30),
  21009. baseClone = __webpack_require__(74),
  21010. baseUnset = __webpack_require__(578),
  21011. castPath = __webpack_require__(52),
  21012. copyObject = __webpack_require__(38),
  21013. customOmitClone = __webpack_require__(580),
  21014. flatRest = __webpack_require__(126),
  21015. getAllKeysIn = __webpack_require__(179);
  21016. /** Used to compose bitmasks for cloning. */
  21017. var CLONE_DEEP_FLAG = 1,
  21018. CLONE_FLAT_FLAG = 2,
  21019. CLONE_SYMBOLS_FLAG = 4;
  21020. /**
  21021. * The opposite of `_.pick`; this method creates an object composed of the
  21022. * own and inherited enumerable property paths of `object` that are not omitted.
  21023. *
  21024. * **Note:** This method is considerably slower than `_.pick`.
  21025. *
  21026. * @static
  21027. * @since 0.1.0
  21028. * @memberOf _
  21029. * @category Object
  21030. * @param {Object} object The source object.
  21031. * @param {...(string|string[])} [paths] The property paths to omit.
  21032. * @returns {Object} Returns the new object.
  21033. * @example
  21034. *
  21035. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  21036. *
  21037. * _.omit(object, ['a', 'c']);
  21038. * // => { 'b': '2' }
  21039. */
  21040. var omit = flatRest(function(object, paths) {
  21041. var result = {};
  21042. if (object == null) {
  21043. return result;
  21044. }
  21045. var isDeep = false;
  21046. paths = arrayMap(paths, function(path) {
  21047. path = castPath(path, object);
  21048. isDeep || (isDeep = path.length > 1);
  21049. return path;
  21050. });
  21051. copyObject(object, getAllKeysIn(object), result);
  21052. if (isDeep) {
  21053. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  21054. }
  21055. var length = paths.length;
  21056. while (length--) {
  21057. baseUnset(result, paths[length]);
  21058. }
  21059. return result;
  21060. });
  21061. module.exports = omit;
  21062. /***/ }),
  21063. /* 264 */
  21064. /***/ (function(module, exports) {
  21065. /**
  21066. * Gets the last element of `array`.
  21067. *
  21068. * @static
  21069. * @memberOf _
  21070. * @since 0.1.0
  21071. * @category Array
  21072. * @param {Array} array The array to query.
  21073. * @returns {*} Returns the last element of `array`.
  21074. * @example
  21075. *
  21076. * _.last([1, 2, 3]);
  21077. * // => 3
  21078. */
  21079. function last(array) {
  21080. var length = array == null ? 0 : array.length;
  21081. return length ? array[length - 1] : undefined;
  21082. }
  21083. module.exports = last;
  21084. /***/ }),
  21085. /* 265 */
  21086. /***/ (function(module, exports, __webpack_require__) {
  21087. var baseFindIndex = __webpack_require__(205),
  21088. baseIteratee = __webpack_require__(29),
  21089. toInteger = __webpack_require__(87);
  21090. /* Built-in method references for those with the same name as other `lodash` methods. */
  21091. var nativeMax = Math.max;
  21092. /**
  21093. * This method is like `_.find` except that it returns the index of the first
  21094. * element `predicate` returns truthy for instead of the element itself.
  21095. *
  21096. * @static
  21097. * @memberOf _
  21098. * @since 1.1.0
  21099. * @category Array
  21100. * @param {Array} array The array to inspect.
  21101. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  21102. * @param {number} [fromIndex=0] The index to search from.
  21103. * @returns {number} Returns the index of the found element, else `-1`.
  21104. * @example
  21105. *
  21106. * var users = [
  21107. * { 'user': 'barney', 'active': false },
  21108. * { 'user': 'fred', 'active': false },
  21109. * { 'user': 'pebbles', 'active': true }
  21110. * ];
  21111. *
  21112. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  21113. * // => 0
  21114. *
  21115. * // The `_.matches` iteratee shorthand.
  21116. * _.findIndex(users, { 'user': 'fred', 'active': false });
  21117. * // => 1
  21118. *
  21119. * // The `_.matchesProperty` iteratee shorthand.
  21120. * _.findIndex(users, ['active', false]);
  21121. * // => 0
  21122. *
  21123. * // The `_.property` iteratee shorthand.
  21124. * _.findIndex(users, 'active');
  21125. * // => 2
  21126. */
  21127. function findIndex(array, predicate, fromIndex) {
  21128. var length = array == null ? 0 : array.length;
  21129. if (!length) {
  21130. return -1;
  21131. }
  21132. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  21133. if (index < 0) {
  21134. index = nativeMax(length + index, 0);
  21135. }
  21136. return baseFindIndex(array, baseIteratee(predicate, 3), index);
  21137. }
  21138. module.exports = findIndex;
  21139. /***/ }),
  21140. /* 266 */
  21141. /***/ (function(module, exports, __webpack_require__) {
  21142. "use strict";
  21143. const env = __webpack_require__(3);
  21144. const toArray = __webpack_require__(588);
  21145. /**
  21146. * @returns {function(RTCPeerConnection, function(DOMError, Array<RTCStats>))}
  21147. */
  21148. module.exports = function getStatsAdapter() {
  21149. // /
  21150. // Get Stats using the older API. Used by all current versions
  21151. // of Chrome.
  21152. //
  21153. function getStatsOldAPI(peerConnection, completion) {
  21154. peerConnection.getStats(rtcStatsReport => {
  21155. const stats = [];
  21156. rtcStatsReport.result().forEach(rtcStat => {
  21157. const stat = {};
  21158. rtcStat.names().forEach(name => {
  21159. stat[name] = rtcStat.stat(name);
  21160. }); // fake the structure of the "new" RTC stat object
  21161. stat.id = rtcStat.id;
  21162. stat.type = rtcStat.type;
  21163. stat.timestamp = rtcStat.timestamp;
  21164. stats.push(stat);
  21165. });
  21166. completion(null, stats);
  21167. });
  21168. } // /
  21169. // Get Stats using the newer API.
  21170. //
  21171. function getStatsNewAPI(peerConnection, completion) {
  21172. peerConnection.getStats(null).then(rtcStatsReport => {
  21173. let stats = []; // Firefox <= 45 can't use rtcStatsReport.values OPENTOK-32755
  21174. if (typeof rtcStatsReport.values === 'function') {
  21175. stats = toArray(rtcStatsReport.values());
  21176. } else if (typeof rtcStatsReport.forEach !== 'function') {
  21177. stats = Object.keys(rtcStatsReport).map(key => rtcStatsReport[key]);
  21178. } else {
  21179. rtcStatsReport.forEach(rtcStats => {
  21180. stats.push(rtcStats);
  21181. });
  21182. }
  21183. completion(null, stats);
  21184. }).catch(completion);
  21185. }
  21186. if (['Firefox', 'Edge', 'Safari'].indexOf(env.name) !== -1) {
  21187. return getStatsNewAPI;
  21188. }
  21189. return getStatsOldAPI;
  21190. };
  21191. /***/ }),
  21192. /* 267 */
  21193. /***/ (function(module, exports, __webpack_require__) {
  21194. var baseValues = __webpack_require__(591),
  21195. keys = __webpack_require__(27);
  21196. /**
  21197. * Creates an array of the own enumerable string keyed property values of `object`.
  21198. *
  21199. * **Note:** Non-object values are coerced to objects.
  21200. *
  21201. * @static
  21202. * @since 0.1.0
  21203. * @memberOf _
  21204. * @category Object
  21205. * @param {Object} object The object to query.
  21206. * @returns {Array} Returns the array of property values.
  21207. * @example
  21208. *
  21209. * function Foo() {
  21210. * this.a = 1;
  21211. * this.b = 2;
  21212. * }
  21213. *
  21214. * Foo.prototype.c = 3;
  21215. *
  21216. * _.values(new Foo);
  21217. * // => [1, 2] (iteration order is not guaranteed)
  21218. *
  21219. * _.values('hi');
  21220. * // => ['h', 'i']
  21221. */
  21222. function values(object) {
  21223. return object == null ? [] : baseValues(object, keys(object));
  21224. }
  21225. module.exports = values;
  21226. /***/ }),
  21227. /* 268 */
  21228. /***/ (function(module, exports, __webpack_require__) {
  21229. "use strict";
  21230. var _interopRequireDefault = __webpack_require__(2);
  21231. exports.__esModule = true;
  21232. exports.default = void 0;
  21233. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(152));
  21234. var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(55));
  21235. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  21236. var _events = __webpack_require__(43);
  21237. var _clone = _interopRequireDefault(__webpack_require__(35));
  21238. var _parseQOS = _interopRequireDefault(__webpack_require__(599));
  21239. var _TruthyChangeCounter = _interopRequireDefault(__webpack_require__(601));
  21240. var _now = _interopRequireDefault(__webpack_require__(46));
  21241. var _log = _interopRequireDefault(__webpack_require__(1));
  21242. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  21243. /* eslint-disable no-param-reassign, no-void, no-use-before-define, one-var */
  21244. /* eslint-disable no-restricted-syntax, no-prototype-builtins, no-underscore-dangle */
  21245. const logging = (0, _log.default)('QoS');
  21246. let Qos = /*#__PURE__*/function (_EventEmitter) {
  21247. (0, _inheritsLoose2.default)(Qos, _EventEmitter);
  21248. function Qos() {
  21249. var _this;
  21250. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  21251. args[_key] = arguments[_key];
  21252. }
  21253. _this = _EventEmitter.call(this, ...args) || this;
  21254. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_peerConnection", void 0);
  21255. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_isPublisher", void 0);
  21256. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "timeoutId", void 0);
  21257. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_creationTime", (0, _now.default)());
  21258. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "offerMessagesReceived", 0);
  21259. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "prevStats", {
  21260. timeStamp: (0, _now.default)()
  21261. });
  21262. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeCounters", {
  21263. videoCodec: new _TruthyChangeCounter.default(),
  21264. audioCodec: new _TruthyChangeCounter.default()
  21265. });
  21266. return _this;
  21267. }
  21268. var _proto = Qos.prototype;
  21269. _proto.startCollecting = function startCollecting(peerConnection, isPublisher) {
  21270. if (!peerConnection || !peerConnection.getStats) {
  21271. // this peerConnection doesn't support getStats, bail
  21272. return;
  21273. }
  21274. this._isPublisher = isPublisher;
  21275. const hadPeerConnection = Boolean(this._peerConnection);
  21276. this._peerConnection = peerConnection;
  21277. if (hadPeerConnection) {
  21278. return;
  21279. }
  21280. const collectionLoop = interval => {
  21281. const currentTime = (0, _now.default)(); // parseQOS pushes properties onto this object and gives it back
  21282. const blankStats = {
  21283. timeStamp: currentTime,
  21284. duration: Math.round((currentTime - this._creationTime) / 1000),
  21285. period: Math.round((currentTime - this.prevStats.timeStamp) / 1000)
  21286. };
  21287. (0, _parseQOS.default)(this._peerConnection, this.prevStats, blankStats, this._isPublisher, (err, parsedStats) => {
  21288. if (err) {
  21289. logging.error('Failed to Parse QOS Stats:', err);
  21290. return;
  21291. }
  21292. this.handleParsedStats(parsedStats); // Recalculate the stats
  21293. clearTimeout(this.timeoutId);
  21294. this.timeoutId = setTimeout(() => collectionLoop(Qos.INTERVAL), interval);
  21295. });
  21296. };
  21297. this.timeoutId = setTimeout(() => collectionLoop(Qos.INTERVAL - Qos.INITIAL_INTERVAL), Qos.INITIAL_INTERVAL);
  21298. };
  21299. _proto.stopCollecting = function stopCollecting() {
  21300. if (this.timeoutId) {
  21301. clearTimeout(this.timeoutId);
  21302. this.timeoutId = null;
  21303. }
  21304. this._peerConnection = null;
  21305. };
  21306. _proto.handleOfferMessageReceived = function handleOfferMessageReceived() {
  21307. this.offerMessagesReceived += 1;
  21308. };
  21309. _proto.handleParsedStats = function handleParsedStats(parsedStats) {
  21310. Object.keys(this.changeCounters).forEach(key => {
  21311. this.changeCounters[key].onValue(parsedStats[key]); // audioCodecChangeCount, videoCodecChangeCount
  21312. parsedStats[key + "ChangeCount"] = this.changeCounters[key].changeCount;
  21313. });
  21314. parsedStats.offerMessagesReceived = this.offerMessagesReceived;
  21315. const periodicStats = (0, _clone.default)(parsedStats); // The following stats are reported with cumulative values:
  21316. const periodicDataKeys = ['audioSentBytes', 'audioSentPackets', 'audioSentPacketsLost', 'videoSentBytes', 'videoSentPackets', 'videoSentPacketsLost', 'audioRecvBytes', 'audioRecvPackets', 'audioRecvPacketsLost', 'videoRecvBytes', 'videoRecvPackets', 'videoRecvPacketsLost']; // This adjusts the QoS values to be periodic, rather than cumulative:
  21317. periodicDataKeys.forEach(dataKey => {
  21318. periodicStats[dataKey] = this.prevStats && this.prevStats[dataKey] ? parsedStats[dataKey] - this.prevStats[dataKey] : parsedStats[dataKey];
  21319. });
  21320. if (this.prevStats && this.prevStats.videoFramesReceived) {
  21321. const framesReceived = parsedStats.videoFramesReceived - this.prevStats.videoFramesReceived;
  21322. const period = parsedStats.period;
  21323. periodicStats.videoFrameRateReceived = Math.round(framesReceived / period);
  21324. }
  21325. this.prevStats = parsedStats;
  21326. this.emit('stats', periodicStats);
  21327. };
  21328. return Qos;
  21329. }(_events.EventEmitter); // Send stats after 1 sec
  21330. Qos.INITIAL_INTERVAL = 1000; // Recalculate the stats every 30 sec
  21331. Qos.INTERVAL = 30000;
  21332. var _default = Qos;
  21333. exports.default = _default;
  21334. /***/ }),
  21335. /* 269 */
  21336. /***/ (function(module, exports, __webpack_require__) {
  21337. "use strict";
  21338. module.exports = priority => {
  21339. switch (priority >> 24) {
  21340. // eslint-disable-line no-bitwise
  21341. case 0:
  21342. return 'TURN/TLS';
  21343. case 1:
  21344. return 'TURN/TCP';
  21345. case 2:
  21346. return 'TURN/UDP';
  21347. default:
  21348. return '';
  21349. }
  21350. };
  21351. /***/ }),
  21352. /* 270 */
  21353. /***/ (function(module, exports, __webpack_require__) {
  21354. "use strict";
  21355. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  21356. /* eslint-disable no-param-reassign, global-require, no-void, prefer-rest-params, no-shadow */
  21357. const uuid = __webpack_require__(15);
  21358. const _require = __webpack_require__(154),
  21359. haveGetDisplayMediaDefault = _require.default;
  21360. const ErrorsDefault = __webpack_require__(8);
  21361. const otErrorDefault = __webpack_require__(12);
  21362. module.exports = function chromeExtensionHelperFactory(_temp) {
  21363. let _ref = _temp === void 0 ? {} : _temp,
  21364. _ref$haveGetDisplayMe = _ref.haveGetDisplayMedia,
  21365. haveGetDisplayMedia = _ref$haveGetDisplayMe === void 0 ? haveGetDisplayMediaDefault : _ref$haveGetDisplayMe,
  21366. _ref$global = _ref.global,
  21367. context = _ref$global === void 0 ? (typeof window !== undefined ? window : global) : _ref$global,
  21368. _ref$Errors = _ref.Errors,
  21369. Errors = _ref$Errors === void 0 ? ErrorsDefault : _ref$Errors,
  21370. _ref$otError = _ref.otError,
  21371. otError = _ref$otError === void 0 ? otErrorDefault() : _ref$otError;
  21372. const isSupportedInThisBrowser = // don't bother supporting extension when we have display media
  21373. !haveGetDisplayMedia && !!context.navigator.webkitGetUserMedia && !context.navigator.userAgent.match(/android/i) && typeof context.chrome !== 'undefined';
  21374. return {
  21375. isSupportedInThisBrowser,
  21376. autoRegisters: false,
  21377. extensionRequired: true,
  21378. getConstraintsShowsPermissionUI: true,
  21379. sources: {
  21380. screen: true,
  21381. application: false,
  21382. window: true,
  21383. browser: true
  21384. },
  21385. register(extensionID, version) {
  21386. if (version === 2) {
  21387. return this.registerVersion2(extensionID);
  21388. }
  21389. return this.registerVersion1(extensionID);
  21390. },
  21391. registerVersion1(extensionID) {
  21392. if (!extensionID) {
  21393. throw new Error('initChromeScreenSharingExtensionHelper: extensionID is required.');
  21394. }
  21395. const isChrome = isSupportedInThisBrowser;
  21396. const callbackRegistry = {};
  21397. let isInstalled = void 0;
  21398. const prefix = "com.tokbox.screenSharing." + extensionID;
  21399. const request = function request(method, payload) {
  21400. const res = {
  21401. payload,
  21402. from: 'jsapi'
  21403. };
  21404. res[prefix] = method;
  21405. return res;
  21406. };
  21407. const addCallback = function addCallback(fn, timeToWait) {
  21408. let timeout;
  21409. const requestId = uuid();
  21410. callbackRegistry[requestId] = function () {
  21411. clearTimeout(timeout);
  21412. timeout = null;
  21413. fn(...arguments);
  21414. };
  21415. if (timeToWait) {
  21416. timeout = setTimeout(() => {
  21417. delete callbackRegistry[requestId];
  21418. fn(otError(Errors.TIMEOUT, new Error('Timeout waiting for response to screensharing request.')));
  21419. }, timeToWait);
  21420. }
  21421. return requestId;
  21422. };
  21423. const isAvailable = function isAvailable(callback) {
  21424. if (!callback) {
  21425. throw new Error('isAvailable: callback is required.');
  21426. }
  21427. if (!isChrome) {
  21428. setTimeout(callback.bind(null, false));
  21429. return;
  21430. }
  21431. if (isInstalled !== void 0) {
  21432. setTimeout(callback.bind(null, isInstalled));
  21433. } else {
  21434. const requestId = addCallback(event => {
  21435. if (isInstalled !== true) {
  21436. isInstalled = event === 'extensionLoaded';
  21437. }
  21438. callback(isInstalled);
  21439. }, 2000);
  21440. const post = request('isExtensionInstalled', {
  21441. requestId
  21442. });
  21443. context.postMessage(post, '*');
  21444. }
  21445. };
  21446. const getConstraints = function getConstraints(source, constraints, callback) {
  21447. if (!callback) {
  21448. throw new Error('getSourceId: callback is required');
  21449. }
  21450. isAvailable(isInstalled => {
  21451. if (!isInstalled) {
  21452. return callback(otError(Errors.SCREEN_SHARING_EXTENSION_NOT_INSTALLED, new Error('Extension is not installed')));
  21453. }
  21454. const requestId = addCallback((event, payload) => {
  21455. if (typeof event === 'object' && event.name && event.stack) {
  21456. // FIXME: The callback shouldn't be overloaded like this ('event' is actually an
  21457. // error), but I'm adding tests and don't want to refactor right now without testing
  21458. // more thorougly.
  21459. const error = event;
  21460. callback(error);
  21461. } else if (event === 'permissionDenied') {
  21462. callback(otError(Errors.USER_MEDIA_ACCESS_DENIED, new Error('User denied access to screensharing')));
  21463. } else {
  21464. if (!constraints.video) {
  21465. constraints.video = {};
  21466. }
  21467. if (!constraints.video.mandatory) {
  21468. constraints.video.mandatory = {};
  21469. }
  21470. constraints.video.mandatory.chromeMediaSource = 'desktop';
  21471. constraints.video.mandatory.chromeMediaSourceId = payload.sourceId;
  21472. callback(void 0, constraints);
  21473. }
  21474. });
  21475. context.postMessage(request('getSourceId', {
  21476. requestId,
  21477. source
  21478. }), '*');
  21479. return undefined;
  21480. });
  21481. };
  21482. context.addEventListener('message', event => {
  21483. if (event.origin !== context.location.origin) {
  21484. return;
  21485. }
  21486. if (!(event.data != null && typeof event.data === 'object')) {
  21487. return;
  21488. }
  21489. if (event.data.from !== 'extension') {
  21490. return;
  21491. }
  21492. const method = event.data[prefix];
  21493. const payload = event.data.payload;
  21494. if (payload && payload.requestId) {
  21495. const callback = callbackRegistry[payload.requestId];
  21496. delete callbackRegistry[payload.requestId];
  21497. if (callback) {
  21498. callback(method, payload);
  21499. }
  21500. }
  21501. if (method === 'extensionLoaded') {
  21502. isInstalled = true;
  21503. }
  21504. });
  21505. return {
  21506. extensionAPIVersion: 1,
  21507. extensionID,
  21508. isInstalled: isAvailable,
  21509. getConstraints
  21510. };
  21511. },
  21512. registerVersion2(extensionID) {
  21513. const isChrome = isSupportedInThisBrowser && typeof context.chrome.runtime !== 'undefined';
  21514. const isInstalled = function isInstalled(callback) {
  21515. if (!callback) {
  21516. throw new Error('isAvailable: callback is required.');
  21517. }
  21518. if (!isChrome) {
  21519. setTimeout(callback.bind(null, false));
  21520. return;
  21521. }
  21522. context.chrome.runtime.sendMessage(extensionID, {
  21523. type: 'isInstalled'
  21524. }, null, response => {
  21525. setTimeout(callback.bind(null, !!response));
  21526. });
  21527. };
  21528. const getConstraints = function getConstraints(source, constraints, callback) {
  21529. if (!callback) {
  21530. throw new Error('getSourceId: callback is required');
  21531. }
  21532. isInstalled(installed => {
  21533. if (!installed) {
  21534. return callback(otError(Errors.SCREEN_SHARING_EXTENSION_NOT_INSTALLED, new Error('Extension is not installed')));
  21535. }
  21536. context.chrome.runtime.sendMessage(extensionID, {
  21537. type: 'getSourceId',
  21538. source
  21539. }, null, data => {
  21540. if (data.error === 'permissionDenied') {
  21541. callback(otError(Errors.USER_MEDIA_ACCESS_DENIED, new Error('User denied access to screensharing')));
  21542. } else if (data.error) {
  21543. callback(new Error("UnexpectError: " + data.error));
  21544. } else {
  21545. if (!constraints.video) {
  21546. constraints.video = {};
  21547. }
  21548. if (!constraints.video.mandatory) {
  21549. constraints.video.mandatory = {};
  21550. }
  21551. constraints.video.mandatory.chromeMediaSource = 'desktop';
  21552. constraints.video.mandatory.chromeMediaSourceId = data.sourceId;
  21553. callback(void 0, constraints);
  21554. }
  21555. });
  21556. return undefined;
  21557. });
  21558. };
  21559. return {
  21560. extensionAPIVersion: 2,
  21561. extensionID,
  21562. isInstalled,
  21563. getConstraints
  21564. };
  21565. }
  21566. };
  21567. };
  21568. /***/ }),
  21569. /* 271 */
  21570. /***/ (function(module, exports, __webpack_require__) {
  21571. "use strict";
  21572. /* WEBPACK VAR INJECTION */(function(Promise) {
  21573. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  21574. /* eslint-disable global-require */
  21575. const createCleanupJobs = __webpack_require__(150);
  21576. const RafRunner = __webpack_require__(101);
  21577. module.exports = function createChromeMixinFactory(deps) {
  21578. if (deps === void 0) {
  21579. deps = {};
  21580. }
  21581. const Archiving = deps.Archiving || __webpack_require__(605);
  21582. const AudioLevelMeter = deps.AudioLevelMeter || __webpack_require__(272);
  21583. const AudioLevelTransformer = deps.AudioLevelTransformer || __webpack_require__(139);
  21584. const BackingBar = deps.BackingBar || __webpack_require__(273);
  21585. const Chrome = deps.Chrome || __webpack_require__(140);
  21586. const MuteButton = deps.MuteButton || __webpack_require__(274)();
  21587. const NamePanel = deps.NamePanel || __webpack_require__(275);
  21588. const StylableComponent = deps.StylableComponent || __webpack_require__(147);
  21589. const logging = deps.logging || __webpack_require__(1)('createChromeMixin');
  21590. return function createChromeMixin(publisher, _temp) {
  21591. let _ref = _temp === void 0 ? {} : _temp,
  21592. name = _ref.name,
  21593. publishAudio = _ref.publishAudio,
  21594. publishVideo = _ref.publishVideo,
  21595. audioSource = _ref.audioSource,
  21596. showControls = _ref.showControls,
  21597. shouldAllowAudio = _ref.shouldAllowAudio,
  21598. logAnalyticsEvent = _ref.logAnalyticsEvent;
  21599. let audioLevelMeter;
  21600. let chrome;
  21601. let widgetView;
  21602. const chromeMixin = {};
  21603. const cleanupJobs = createCleanupJobs(); // If mode is false, then that is the mode. If mode is true then we'll
  21604. // definitely display the button, but we'll defer the model to the
  21605. // Publishers buttonDisplayMode style property.
  21606. const chromeButtonMode = mode => {
  21607. if (mode === false) {
  21608. return 'off';
  21609. }
  21610. const defaultMode = publisher.getStyle('buttonDisplayMode'); // The default model is false, but it's overridden by +mode+ being true
  21611. if (defaultMode === false) {
  21612. return 'on';
  21613. } // defaultMode is either true or auto.
  21614. return defaultMode;
  21615. };
  21616. let uiPromise = new Promise((resolve, reject) => {
  21617. chromeMixin.init = widgetViewParam => {
  21618. if (!publisher.getStyle('showArchiveStatus')) {
  21619. logAnalyticsEvent('showArchiveStatus', 'createChrome', {
  21620. mode: 'off'
  21621. });
  21622. }
  21623. const widgets = {
  21624. backingBar: new BackingBar({
  21625. nameMode: !name ? 'off' : publisher.getStyle('nameDisplayMode'),
  21626. muteMode: chromeButtonMode(publisher.getStyle('buttonDisplayMode'))
  21627. }),
  21628. name: new NamePanel({
  21629. name,
  21630. mode: publisher.getStyle('nameDisplayMode')
  21631. }),
  21632. archive: new Archiving({
  21633. show: Boolean(publisher.getStyle('showArchiveStatus')) && publisher.getStyle('archiveStatusDisplayMode') !== 'off',
  21634. archiving: false
  21635. }),
  21636. muteButton: new MuteButton({
  21637. muted: publishAudio === false,
  21638. mode: chromeButtonMode.call(null, publisher.getStyle('buttonDisplayMode'))
  21639. })
  21640. };
  21641. audioLevelMeter = new AudioLevelMeter({
  21642. mode: publisher.getStyle('audioLevelDisplayMode')
  21643. });
  21644. const audioLevelTransformer = new AudioLevelTransformer();
  21645. const audioWatcher = new RafRunner(() => {
  21646. // @FIXME
  21647. // We force the audio level value to be zero here if audio is disabled
  21648. // because the AudioLevelMeter cannot currently differentiate
  21649. // between video being disabled and audio being disabled.
  21650. // To be fixed as part of OPENTOK-29865
  21651. const audioLevel = !publishAudio ? 0 : audioLevelTransformer.transform(publisher.loudness);
  21652. audioLevelMeter.setValue(audioLevel);
  21653. });
  21654. audioLevelMeter.watchVisibilityChanged(visible => {
  21655. if (visible) {
  21656. audioWatcher.start();
  21657. } else {
  21658. audioWatcher.stop();
  21659. }
  21660. });
  21661. audioLevelMeter.audioOnly(!publishVideo && publishAudio);
  21662. widgets.audioLevel = audioLevelMeter;
  21663. if (widgetViewParam && widgetViewParam.domElement) {
  21664. widgetView = widgetViewParam;
  21665. chrome = new Chrome({
  21666. parent: widgetView.domElement
  21667. }).set(widgets).on({
  21668. muted: () => publisher.publishAudio(false),
  21669. unmuted: () => publisher.publishAudio(true)
  21670. });
  21671. if (audioSource === null || audioSource === false) {
  21672. chromeMixin.removeAudioTrack();
  21673. }
  21674. resolve();
  21675. }
  21676. };
  21677. chromeMixin.reset = () => {
  21678. // reject in case the chrome creating was still pending
  21679. reject(new Error('Chrome still being created'));
  21680. if (chrome) {
  21681. chrome.destroy();
  21682. chrome = null;
  21683. }
  21684. };
  21685. chromeMixin.destroy = () => {
  21686. chromeMixin.reset();
  21687. cleanupJobs.releaseAll();
  21688. uiPromise = null;
  21689. };
  21690. });
  21691. uiPromise.catch(err => {
  21692. // Only log unexpected rejections
  21693. if (!err || err.message !== 'Chrome still being created') {
  21694. logging.error('createChromeMixin failed to setup UI', err);
  21695. }
  21696. });
  21697. chromeMixin.setAudioOnly = value => {
  21698. if (audioLevelMeter) {
  21699. audioLevelMeter.audioOnly(value);
  21700. }
  21701. };
  21702. chromeMixin.setArchivingStatus = status => {
  21703. if (chrome) {
  21704. chrome.archive.setArchiving(status);
  21705. }
  21706. };
  21707. chromeMixin.setMuted = muted => {
  21708. if (chrome && chrome.muteButton) {
  21709. chrome.muteButton.muted(muted);
  21710. }
  21711. };
  21712. chromeMixin.removeAudioTrack = () => {
  21713. if (chrome && chrome.muteButton) {
  21714. chrome.muteButton.remove();
  21715. }
  21716. };
  21717. chromeMixin.addAudioTrack = () => {
  21718. if (chrome && chrome.muteButton) {
  21719. chrome.muteButton.add();
  21720. }
  21721. };
  21722. StylableComponent(publisher, {
  21723. showArchiveStatus: true,
  21724. nameDisplayMode: 'auto',
  21725. buttonDisplayMode: 'auto',
  21726. audioLevelDisplayMode: shouldAllowAudio ? 'auto' : 'off',
  21727. archiveStatusDisplayMode: 'auto',
  21728. backgroundImageURI: null
  21729. }, showControls, payload => {
  21730. logAnalyticsEvent('SetStyle', 'Publisher', payload, null, 0.1);
  21731. });
  21732. const onStyleValueChanged = (key, value) => {
  21733. // enlist style change for when the the chrome is created
  21734. uiPromise.then(() => {
  21735. switch (key) {
  21736. case 'nameDisplayMode':
  21737. chrome.name.setDisplayMode(value);
  21738. chrome.backingBar.setNameMode(value);
  21739. break;
  21740. case 'showArchiveStatus':
  21741. logAnalyticsEvent('showArchiveStatus', 'styleChange', {
  21742. mode: value ? 'on' : 'off'
  21743. });
  21744. chrome.archive.setShowArchiveStatus(Boolean(value));
  21745. break;
  21746. case 'archiveStatusDisplayMode':
  21747. chrome.archive.setShowArchiveStatus(value !== 'off');
  21748. break;
  21749. case 'buttonDisplayMode':
  21750. chrome.muteButton.setDisplayMode(value);
  21751. chrome.backingBar.setMuteMode(value);
  21752. break;
  21753. case 'audioLevelDisplayMode':
  21754. chrome.audioLevel.setDisplayMode(value);
  21755. break;
  21756. case 'backgroundImageURI':
  21757. widgetView.setBackgroundImageURI(value);
  21758. break;
  21759. default:
  21760. }
  21761. });
  21762. };
  21763. publisher.on('styleValueChanged', onStyleValueChanged);
  21764. cleanupJobs.add(() => publisher.off('styleValueChanged', onStyleValueChanged));
  21765. return chromeMixin;
  21766. };
  21767. };
  21768. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  21769. /***/ }),
  21770. /* 272 */
  21771. /***/ (function(module, exports, __webpack_require__) {
  21772. "use strict";
  21773. /* WEBPACK VAR INJECTION */(function(Promise) {
  21774. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  21775. /* eslint-disable no-underscore-dangle, one-var, no-mixed-operators */
  21776. const defineProperties = __webpack_require__(102);
  21777. const Widget = __webpack_require__(34);
  21778. const OTHelpers = __webpack_require__(4);
  21779. const EventEmitter = __webpack_require__(43);
  21780. module.exports = function AudioLevelMeter(options) {
  21781. const _audioLevelMeter = this;
  21782. const _eventEmitter = new EventEmitter();
  21783. let _voiceOnlyIconElement;
  21784. let _meterValueElement;
  21785. let _value;
  21786. let _lastComputedVisibility; // display the widget by default but can be hidden when calling hideWhileLoading
  21787. let _displayAroundLoading = true;
  21788. let _audioOnly = false;
  21789. let _displayMode = 'auto';
  21790. const _maxValue = options.maxValue || 1;
  21791. const _minValue = options.minValue || 0;
  21792. function onCreate() {
  21793. _meterValueElement = OTHelpers.createElement('div', {
  21794. className: 'OT_audio-level-meter__value'
  21795. }, '');
  21796. _voiceOnlyIconElement = OTHelpers.createElement('div', {
  21797. className: 'OT_audio-level-meter__audio-only-img'
  21798. }, '');
  21799. const domElement = _audioLevelMeter.domElement;
  21800. domElement.appendChild(_voiceOnlyIconElement);
  21801. domElement.appendChild(_meterValueElement);
  21802. _audioLevelMeter.watchVisibilityChanged(visible => {
  21803. if (visible) {
  21804. OTHelpers.removeClass(_audioLevelMeter.domElement, 'OT_hide-forced');
  21805. } else {
  21806. OTHelpers.addClass(_audioLevelMeter.domElement, 'OT_hide-forced');
  21807. }
  21808. });
  21809. }
  21810. function onDestroy() {
  21811. _eventEmitter.removeAllListeners('visibilityChanged');
  21812. }
  21813. function updateView() {
  21814. const percentSize = (_value - _minValue) / (_maxValue - _minValue);
  21815. _meterValueElement.style.transform = "scale(" + Math.sqrt(percentSize) + ")";
  21816. } // computes the visibility value from the different "inputs" variables and asynchronously triggers
  21817. // the internal "visibilityChanged" events if the value changed from last time it was computed
  21818. function computeVisibility() {
  21819. const computedVisibility = (_audioOnly && _displayMode === 'auto' || _displayMode === 'on') && _displayAroundLoading;
  21820. if (_lastComputedVisibility !== computedVisibility) {
  21821. _lastComputedVisibility = computedVisibility;
  21822. _eventEmitter.emit('visibilityChanged', computedVisibility);
  21823. }
  21824. }
  21825. defineProperties(_audioLevelMeter, {
  21826. audioOnly: {
  21827. get() {
  21828. return _audioOnly;
  21829. },
  21830. set(audioOnly) {
  21831. _audioOnly = audioOnly;
  21832. computeVisibility();
  21833. }
  21834. }
  21835. });
  21836. _audioLevelMeter.setValue = function (value) {
  21837. _value = value;
  21838. updateView();
  21839. };
  21840. /**
  21841. * Registers an callback to be executed when the visibility of the audio level meter changes.
  21842. * "true" means the widget is shown.
  21843. * The contracts is that the handlers should not try to change the visibility of the widget by
  21844. * changing the value of visibility "inputs" (setting "audioOnly", "displayMode" or calling
  21845. * "hideWhileLoading" and "showAfterLoading")
  21846. *
  21847. * @param {function(boolean)} cb the callback to be executed when the display value changes.
  21848. * The callback is also executed with the last computed value when registered.
  21849. * @returns {function} a callback to unregister the handler
  21850. */
  21851. _audioLevelMeter.watchVisibilityChanged = function (cb) {
  21852. _eventEmitter.on('visibilityChanged', cb);
  21853. Promise.resolve().then(() => {
  21854. cb(_lastComputedVisibility);
  21855. });
  21856. return function stopWatching() {
  21857. _eventEmitter.removeListener('visibilityChanged', cb);
  21858. };
  21859. }; // Mixin common widget behaviour
  21860. const widgetOptions = {
  21861. mode: options ? options.mode : 'auto',
  21862. nodeName: 'div',
  21863. htmlAttributes: {
  21864. className: 'OT_audio-level-meter'
  21865. },
  21866. onCreate,
  21867. onDestroy
  21868. };
  21869. Widget(this, widgetOptions); // The methods underneath are mixed in by "Widget" but overridden
  21870. // Doing so, we can bypass it and compute the display value ourselves without relying on CSS
  21871. _audioLevelMeter.setDisplayMode = function (mode) {
  21872. _displayMode = mode;
  21873. computeVisibility();
  21874. };
  21875. _audioLevelMeter.getDisplayMode = function () {
  21876. return _displayMode;
  21877. };
  21878. _audioLevelMeter.showAfterLoading = function () {
  21879. _displayAroundLoading = true;
  21880. computeVisibility();
  21881. };
  21882. _audioLevelMeter.hideWhileLoading = function () {
  21883. _displayAroundLoading = false;
  21884. computeVisibility();
  21885. }; // compute the initial visibility value
  21886. computeVisibility();
  21887. };
  21888. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  21889. /***/ }),
  21890. /* 273 */
  21891. /***/ (function(module, exports, __webpack_require__) {
  21892. "use strict";
  21893. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  21894. /* eslint-disable no-underscore-dangle */
  21895. const Widget = __webpack_require__(34); // BackingBar Chrome Widget
  21896. //
  21897. // nameMode (String)
  21898. // Whether or not the name panel is being displayed
  21899. // Possible values are: "auto" (the name is displayed
  21900. // when the stream is first displayed and when the user mouses over the display),
  21901. // "off" (the name is not displayed), and "on" (the name is displayed).
  21902. //
  21903. // muteMode (String)
  21904. // Whether or not the mute button is being displayed
  21905. // Possible values are: "auto" (the mute button is displayed
  21906. // when the stream is first displayed and when the user mouses over the display),
  21907. // "off" (the mute button is not displayed), and "on" (the mute button is displayed).
  21908. //
  21909. // displays a backing bar
  21910. // can be shown/hidden
  21911. // can be destroyed
  21912. module.exports = function BackingBar(options) {
  21913. let _nameMode = options.nameMode;
  21914. let _muteMode = options.muteMode;
  21915. function getDisplayMode() {
  21916. if (_nameMode === 'on' || _muteMode === 'on') {
  21917. return 'on';
  21918. } else if (_nameMode === 'mini' || _muteMode === 'mini') {
  21919. return 'mini';
  21920. } else if (_nameMode === 'mini-auto' || _muteMode === 'mini-auto') {
  21921. return 'mini-auto';
  21922. } else if (_nameMode === 'auto' || _muteMode === 'auto') {
  21923. return 'auto';
  21924. }
  21925. return 'off';
  21926. } // Mixin common widget behaviour
  21927. Widget(this, {
  21928. mode: getDisplayMode(),
  21929. nodeName: 'div',
  21930. htmlContent: '',
  21931. htmlAttributes: {
  21932. className: 'OT_bar OT_edge-bar-item'
  21933. }
  21934. });
  21935. this.setNameMode = function (nameMode) {
  21936. _nameMode = nameMode;
  21937. this.setDisplayMode(getDisplayMode());
  21938. };
  21939. this.setMuteMode = function (muteMode) {
  21940. _muteMode = muteMode;
  21941. this.setDisplayMode(getDisplayMode());
  21942. };
  21943. };
  21944. /***/ }),
  21945. /* 274 */
  21946. /***/ (function(module, exports, __webpack_require__) {
  21947. "use strict";
  21948. const globalOTHelpers = __webpack_require__(4);
  21949. const globalWidget = __webpack_require__(34);
  21950. const defineProperties = __webpack_require__(102);
  21951. module.exports = function MuteButtonFactory(deps) {
  21952. if (deps === void 0) {
  21953. deps = {};
  21954. }
  21955. const OTHelpers = deps.OTHelpers || globalOTHelpers;
  21956. const Widget = deps.Widget || globalWidget;
  21957. return function MuteButton(options) {
  21958. let muted = options.muted || false;
  21959. const updateClasses = () => {
  21960. if (muted) {
  21961. OTHelpers.addClass(this.domElement, 'OT_active');
  21962. } else {
  21963. OTHelpers.removeClass(this.domElement, 'OT_active ');
  21964. }
  21965. };
  21966. const onClick = () => {
  21967. muted = !muted;
  21968. updateClasses();
  21969. if (muted) {
  21970. this.parent.trigger('muted', this);
  21971. } else {
  21972. this.parent.trigger('unmuted', this);
  21973. }
  21974. return false;
  21975. }; // Private Event Callbacks
  21976. const attachEvents = elem => {
  21977. OTHelpers.on(elem, 'click', onClick);
  21978. };
  21979. const detachEvents = elem => {
  21980. OTHelpers.off(elem, 'click', onClick);
  21981. };
  21982. defineProperties(this, {
  21983. muted: {
  21984. get() {
  21985. return muted;
  21986. },
  21987. set(m) {
  21988. muted = m;
  21989. updateClasses();
  21990. }
  21991. }
  21992. }); // Mixin common widget behaviour
  21993. const classNames = muted ? 'OT_edge-bar-item OT_mute OT_active' : 'OT_edge-bar-item OT_mute';
  21994. Widget(this, {
  21995. mode: options.mode,
  21996. nodeName: 'button',
  21997. htmlContent: 'Mute',
  21998. htmlAttributes: {
  21999. className: classNames,
  22000. type: 'button'
  22001. },
  22002. onCreate: attachEvents,
  22003. onDestroy: detachEvents
  22004. });
  22005. let parentNode;
  22006. this.remove = () => {
  22007. if (this.domElement && this.domElement.parentNode) {
  22008. parentNode = this.domElement.parentNode; // store in case we want to add it again
  22009. this.domElement.parentNode.removeChild(this.domElement);
  22010. }
  22011. };
  22012. this.add = () => {
  22013. if (parentNode && this.domElement && !this.domElement.parentNode) {
  22014. parentNode.appendChild(this.domElement);
  22015. }
  22016. };
  22017. };
  22018. };
  22019. /***/ }),
  22020. /* 275 */
  22021. /***/ (function(module, exports, __webpack_require__) {
  22022. "use strict";
  22023. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  22024. /* eslint-disable no-underscore-dangle, no-param-reassign */
  22025. const Widget = __webpack_require__(34); // The "name" that we receive (e.g., from RUMOR) may actually be malicious HTML
  22026. // so we need to sanitize it before it gets rendered.
  22027. // See: OPENTOK-41141.
  22028. const sanitizeName = name => {
  22029. const temp = document.createElement('div');
  22030. temp.textContent = name;
  22031. return temp.innerHTML;
  22032. }; // NamePanel Chrome Widget
  22033. //
  22034. // mode (String)
  22035. // Whether to display the name. Possible values are: "auto" (the name is displayed
  22036. // when the stream is first displayed and when the user mouses over the display),
  22037. // "off" (the name is not displayed), and "on" (the name is displayed).
  22038. //
  22039. // displays a name
  22040. // can be shown/hidden
  22041. // can be destroyed
  22042. module.exports = function NamePanel(options) {
  22043. let _name = options.name;
  22044. if (!_name || _name.trim().length === '') {
  22045. _name = null; // THere's no name, just flip the mode off
  22046. options.mode = 'off';
  22047. }
  22048. this.setName = function (name) {
  22049. if (!_name) {
  22050. this.setDisplayMode('auto');
  22051. }
  22052. _name = sanitizeName(name); // The "name" is initially rendered as `innerHTML` when instantiated (as a
  22053. // `Widget`). That's why we don't use `textContent` here, instead.
  22054. this.domElement.innerHTML = _name;
  22055. }.bind(this);
  22056. _name = sanitizeName(_name); // Mixin common widget behaviour
  22057. Widget(this, {
  22058. mode: options.mode,
  22059. nodeName: 'h1',
  22060. htmlContent: _name,
  22061. htmlAttributes: {
  22062. className: 'OT_name OT_edge-bar-item'
  22063. }
  22064. });
  22065. };
  22066. /***/ }),
  22067. /* 276 */
  22068. /***/ (function(module, exports, __webpack_require__) {
  22069. "use strict";
  22070. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  22071. /* eslint-disable no-param-reassign, global-require */
  22072. module.exports = function getNativeEnumerateDevicesFactory(deps) {
  22073. if (deps === void 0) {
  22074. deps = {};
  22075. }
  22076. const windowMock = deps.global || (typeof window !== undefined ? window : global);
  22077. return function getNativeEnumerateDevices() {
  22078. if (windowMock.navigator.mediaDevices) {
  22079. const mediaDevices = windowMock.navigator.mediaDevices;
  22080. return mediaDevices.enumerateDevices && mediaDevices.enumerateDevices.bind(mediaDevices);
  22081. } // @todo perhaps we should throw here?
  22082. return undefined;
  22083. };
  22084. };
  22085. /***/ }),
  22086. /* 277 */
  22087. /***/ (function(module, exports, __webpack_require__) {
  22088. "use strict";
  22089. /* WEBPACK VAR INJECTION */(function(Promise) {
  22090. module.exports = function promiseDelay(timeoutMs) {
  22091. return new Promise(resolve => setTimeout(resolve, timeoutMs));
  22092. };
  22093. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  22094. /***/ }),
  22095. /* 278 */
  22096. /***/ (function(module, exports, __webpack_require__) {
  22097. "use strict";
  22098. const env = __webpack_require__(3);
  22099. const haveDisplayMedia = __webpack_require__(154).default;
  22100. const isSupportedInThisBrowser = () => // Even though getDisplayMedia is supported in Edge, we haven't gotten it
  22101. // to work with our SDK
  22102. !env.isLegacyEdge && // Even though getDisplayMedia is exposed in Electron, devs need to use
  22103. // desktopCapturer instead
  22104. !env.isElectron && haveDisplayMedia;
  22105. module.exports = {
  22106. isSupportedInThisBrowser: isSupportedInThisBrowser(),
  22107. autoRegisters: true,
  22108. extensionRequired: false,
  22109. getConstraintsShowsPermissionUI: false,
  22110. sources: {
  22111. screen: true,
  22112. application: false,
  22113. window: env.name !== 'Safari',
  22114. browser: env.name !== 'Safari'
  22115. },
  22116. register() {
  22117. return {
  22118. isInstalled(callback) {
  22119. callback(undefined);
  22120. },
  22121. getConstraints(source, constraints, callback) {
  22122. callback(undefined, {
  22123. video: constraints.video
  22124. });
  22125. }
  22126. };
  22127. }
  22128. };
  22129. /***/ }),
  22130. /* 279 */
  22131. /***/ (function(module, exports, __webpack_require__) {
  22132. "use strict";
  22133. const isMediaStreamTrack = source => source && typeof source === 'object' && typeof source.kind === 'string' && typeof source.stop === 'function' && typeof source.enabled === 'boolean';
  22134. exports.isMediaStreamTrack = isMediaStreamTrack;
  22135. /***/ }),
  22136. /* 280 */
  22137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22138. "use strict";
  22139. __webpack_require__.r(__webpack_exports__);
  22140. /* WEBPACK VAR INJECTION */(function(Promise) {var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
  22141. return new (P || (P = Promise))(function (resolve, reject) {
  22142. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  22143. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  22144. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  22145. step((generator = generator.apply(thisArg, _arguments || [])).next());
  22146. });
  22147. };
  22148. var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
  22149. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  22150. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  22151. function verb(n) { return function (v) { return step([n, v]); }; }
  22152. function step(op) {
  22153. if (f) throw new TypeError("Generator is already executing.");
  22154. while (_) try {
  22155. if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
  22156. if (y = 0, t) op = [0, t.value];
  22157. switch (op[0]) {
  22158. case 0: case 1: t = op; break;
  22159. case 4: _.label++; return { value: op[1], done: false };
  22160. case 5: _.label++; y = op[1]; op = [0]; continue;
  22161. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  22162. default:
  22163. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  22164. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  22165. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  22166. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  22167. if (t[2]) _.ops.pop();
  22168. _.trys.pop(); continue;
  22169. }
  22170. op = body.call(thisArg, _);
  22171. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  22172. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  22173. }
  22174. };
  22175. function getGlobal() {
  22176. return typeof window !== 'undefined' ?
  22177. window : /* istanbul ignore next */ (typeof window !== undefined ? window : global);
  22178. }
  22179. var CALLBACK_INVALID_RETURN = 'onFailure must return boolean, or delay in ms';
  22180. /**
  22181. * Retry a promise
  22182. *
  22183. * Uses promiseFactory to construct promises and calls onFailure when the
  22184. * promise rejects.
  22185. *
  22186. * onFailure is called with error and attempt.
  22187. *
  22188. * You may inspect error to decide whether to retry or not. You may use attempt
  22189. * to control the delay/ decide how many times to retry.
  22190. *
  22191. * To retry: A numeric delay in milliseconds can be returned to control how long
  22192. * between retries.
  22193. *
  22194. * To stop retrying: Return false/ undefined/ null.
  22195. *
  22196. * The returned promise will be the final promise from promiseFactory once
  22197. * fulfilled or in the case of errors, once no longer retrying.
  22198. *
  22199. * @example
  22200. *
  22201. * const promiseEndeavour = require('../dist/promiseEndeavour.js');
  22202. * const fetch = require('node-fetch');
  22203. *
  22204. * async function getDogs() {
  22205. * const response = await fetch('https://dog.ceo/api/breeds/list/all');
  22206. * return response.json();
  22207. * }
  22208. *
  22209. * const retries = [100, 500, 1000];
  22210. *
  22211. * function retry(error, attempt) {
  22212. * return retries[attempt - 1] || false;
  22213. * }
  22214. *
  22215. * promiseEndeavour(getDogs, retry)()
  22216. * .then(dogs => console.log(dogs));
  22217. *
  22218. * @param promiseFactory A promise returning function
  22219. * @param onFailure A function to be called when the promise returned by promiseFactory is rejected
  22220. * @param maxAttempts Maximum number of attempts regardless of onFailure
  22221. * @return A function with the same interface to promiseFactory
  22222. */
  22223. function promiseEndeavour(promiseFactory, onFailure, maxAttempts) {
  22224. if (maxAttempts === void 0) { maxAttempts = 10; }
  22225. return function () {
  22226. var args = [];
  22227. for (var _i = 0; _i < arguments.length; _i++) {
  22228. args[_i] = arguments[_i];
  22229. }
  22230. return __awaiter(this, void 0, void 0, function () {
  22231. var attempt, _loop_1, state_1;
  22232. return __generator(this, function (_a) {
  22233. switch (_a.label) {
  22234. case 0:
  22235. attempt = 0;
  22236. _loop_1 = function () {
  22237. var _a, error_1, delay_1;
  22238. return __generator(this, function (_b) {
  22239. switch (_b.label) {
  22240. case 0:
  22241. _b.trys.push([0, 2, , 6]);
  22242. _a = {};
  22243. return [4 /*yield*/, promiseFactory.apply(void 0, args)];
  22244. case 1: return [2 /*return*/, (_a.value = _b.sent(), _a)];
  22245. case 2:
  22246. error_1 = _b.sent();
  22247. delay_1 = onFailure(error_1, attempt);
  22248. if (delay_1 === false || delay_1 == null || attempt >= maxAttempts) {
  22249. throw error_1;
  22250. }
  22251. if (!(typeof delay_1 === 'number')) return [3 /*break*/, 4];
  22252. return [4 /*yield*/, new Promise(function (resolve) { return getGlobal().setTimeout(resolve, delay_1); })];
  22253. case 3:
  22254. _b.sent();
  22255. return [3 /*break*/, 5];
  22256. case 4:
  22257. if (delay_1 !== true) {
  22258. throw new Error(CALLBACK_INVALID_RETURN);
  22259. }
  22260. _b.label = 5;
  22261. case 5: return [3 /*break*/, 6];
  22262. case 6: return [2 /*return*/];
  22263. }
  22264. });
  22265. };
  22266. _a.label = 1;
  22267. case 1:
  22268. if (!(attempt += 1) /* istanbul ignore next: condition is always true */) return [3 /*break*/, 3];
  22269. return [5 /*yield**/, _loop_1()];
  22270. case 2:
  22271. state_1 = _a.sent();
  22272. if (typeof state_1 === "object")
  22273. return [2 /*return*/, state_1.value];
  22274. return [3 /*break*/, 1];
  22275. case 3: return [2 /*return*/];
  22276. }
  22277. });
  22278. });
  22279. };
  22280. }
  22281. /* harmony default export */ __webpack_exports__["default"] = (promiseEndeavour);
  22282. //# sourceMappingURL=promiseEndeavour.js.map
  22283. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  22284. /***/ }),
  22285. /* 281 */
  22286. /***/ (function(module, exports, __webpack_require__) {
  22287. "use strict";
  22288. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  22289. /* eslint-disable no-param-reassign, global-require, no-underscore-dangle, no-shadow */
  22290. const defineProperties = __webpack_require__(102);
  22291. module.exports = function MicrophoneFactory() {
  22292. /*
  22293. * A Publishers Microphone.
  22294. *
  22295. * TODO
  22296. * * bind to changes in mute/unmute/volume/etc and respond to them
  22297. */
  22298. return function Microphone(webRTCStream, muted) {
  22299. let _muted;
  22300. defineProperties(this, {
  22301. muted: {
  22302. get() {
  22303. return _muted;
  22304. },
  22305. set(muted) {
  22306. if (_muted === muted) {
  22307. return;
  22308. }
  22309. _muted = muted;
  22310. const audioTracks = webRTCStream.getAudioTracks();
  22311. for (let i = 0, num = audioTracks.length; i < num; ++i) {
  22312. audioTracks[i].enabled = !_muted;
  22313. }
  22314. }
  22315. }
  22316. }); // Set the initial value
  22317. if (muted !== undefined) {
  22318. this.muted(muted === true);
  22319. } else if (webRTCStream.getAudioTracks().length) {
  22320. this.muted(!webRTCStream.getAudioTracks()[0].enabled);
  22321. } else {
  22322. this.muted(false);
  22323. }
  22324. };
  22325. };
  22326. /***/ }),
  22327. /* 282 */
  22328. /***/ (function(module, exports, __webpack_require__) {
  22329. "use strict";
  22330. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  22331. /* eslint-disable no-param-reassign, global-require */
  22332. module.exports = function videoElementErrorMapFactory(deps) {
  22333. if (deps === void 0) {
  22334. deps = {};
  22335. }
  22336. const Errors = deps.Errors || __webpack_require__(8);
  22337. const otError = deps.otError || __webpack_require__(12)(); // See http://www.w3.org/TR/2010/WD-html5-20101019/video.html#error-codes
  22338. const videoErrorDetails = {}; // Checking for global.MediaError for IE compatibility, just so we don't throw
  22339. // exceptions when the script is included
  22340. if ((typeof window !== undefined ? window : global).MediaError) {
  22341. videoErrorDetails[(typeof window !== undefined ? window : global).MediaError.MEDIA_ERR_ABORTED] = {
  22342. name: Errors.MEDIA_ERR_ABORTED,
  22343. message: 'The fetching process for the media resource was aborted by the ' + 'user agent at the user\'s request.'
  22344. };
  22345. videoErrorDetails[(typeof window !== undefined ? window : global).MediaError.MEDIA_ERR_NETWORK] = {
  22346. name: Errors.MEDIA_ERR_NETWORK,
  22347. message: 'A network error of some description caused the user agent to ' + 'stop fetching the media resource, after the resource was established ' + 'to be usable.'
  22348. };
  22349. videoErrorDetails[(typeof window !== undefined ? window : global).MediaError.MEDIA_ERR_DECODE] = {
  22350. name: Errors.MEDIA_ERR_DECODE,
  22351. message: 'An error of some description occurred while decoding the media ' + 'resource, after the resource was established to be usable.'
  22352. };
  22353. videoErrorDetails[(typeof window !== undefined ? window : global).MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED] = {
  22354. name: Errors.MEDIA_ERR_SRC_NOT_SUPPORTED,
  22355. message: 'The media resource indicated by the src attribute was not ' + 'suitable.'
  22356. };
  22357. }
  22358. return function videoElementErrorMap(error) {
  22359. const errorDetails = videoErrorDetails[error.code];
  22360. if (!errorDetails) {
  22361. return new Error("An unknown error occurred" + (error.message ? ": " + error.message : '.'));
  22362. }
  22363. return otError(errorDetails.name, new Error("There was an unexpected problem with the Video Stream: " + errorDetails.message));
  22364. };
  22365. };
  22366. /***/ }),
  22367. /* 283 */
  22368. /***/ (function(module, exports, __webpack_require__) {
  22369. "use strict";
  22370. /* WEBPACK VAR INJECTION */(function(Promise) {
  22371. var _interopRequireDefault = __webpack_require__(2);
  22372. var _extends2 = _interopRequireDefault(__webpack_require__(23));
  22373. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  22374. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  22375. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  22376. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  22377. /* eslint-disable no-param-reassign, global-require, one-var, no-underscore-dangle */
  22378. /* eslint-disable no-cond-assign, max-len, no-void, prefer-const */
  22379. const eventing = __webpack_require__(5);
  22380. const eventHelper = __webpack_require__(59);
  22381. const destroyObj = __webpack_require__(616);
  22382. const patchSrcObject = __webpack_require__(617);
  22383. const isIos = __webpack_require__(157);
  22384. const env = __webpack_require__(3);
  22385. function createDomVideoElement(fallbackText, muted) {
  22386. const videoElement = document.createElement('video');
  22387. patchSrcObject(videoElement);
  22388. videoElement.autoplay = true;
  22389. videoElement.playsinline = true;
  22390. videoElement.innerHTML = fallbackText; // Safari on iOS requires setAttribute OPENTOK-37229
  22391. videoElement.setAttribute('autoplay', true);
  22392. videoElement.setAttribute('playsinline', true);
  22393. if (muted === true) {
  22394. videoElement.muted = 'true';
  22395. }
  22396. return videoElement;
  22397. }
  22398. function createDomAudioElement(muted) {
  22399. const audioElement = document.createElement('audio');
  22400. patchSrcObject(audioElement);
  22401. audioElement.autoplay = true; // Safari on iOS requires setAttribute OPENTOK-37229
  22402. audioElement.setAttribute('autoplay', true);
  22403. audioElement.muted = muted;
  22404. return audioElement;
  22405. }
  22406. const noop = /*#__PURE__*/function () {
  22407. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  22408. return _regenerator.default.wrap(function _callee$(_context) {
  22409. while (1) switch (_context.prev = _context.next) {
  22410. case 0:
  22411. return _context.abrupt("return", new Promise(resolve => setTimeout(resolve)));
  22412. case 1:
  22413. case "end":
  22414. return _context.stop();
  22415. }
  22416. }, _callee);
  22417. }));
  22418. return function noop() {
  22419. return _ref.apply(this, arguments);
  22420. };
  22421. }();
  22422. /**
  22423. * NativeVideoElementWrapperFactory DI container
  22424. *
  22425. * @package
  22426. * @param {any} [deps={}]
  22427. * @return {typeof NativeVideoElementWrapper}
  22428. */
  22429. function NativeVideoElementWrapperFactory(deps) {
  22430. if (deps === void 0) {
  22431. deps = {};
  22432. }
  22433. const audioContextProvider = deps.audioContext || __webpack_require__(153)();
  22434. const canBeOrientatedMixin = deps.canBeOrientatedMixin || __webpack_require__(618);
  22435. /** @type {Document} */
  22436. const document = deps.document || (typeof window !== undefined ? window : global).document;
  22437. const listenForTracksEnded = deps.listenForTracksEnded || __webpack_require__(619)();
  22438. const createLog = deps.logging || __webpack_require__(1);
  22439. const OTHelpers = deps.OTHelpers || __webpack_require__(4);
  22440. const videoElementErrorMap = deps.videoElementErrorMap || __webpack_require__(282)();
  22441. const WebAudioLevelSampler = deps.WebaudioAudioLevelSampler || __webpack_require__(141);
  22442. const windowMock = deps.global || (typeof window !== undefined ? window : global);
  22443. let id = 1;
  22444. /**
  22445. * NativeVideoElementWrapper
  22446. *
  22447. * @package
  22448. * @class
  22449. * @param {Object} options
  22450. * @param {Object} [options._inject] injected variables @todo move to DI
  22451. * @param {Function} [options._inject.createVideoElement] function used to create video element
  22452. * @param {Function} [options._inject.createAudioElement] function used to create audio element
  22453. * @param {Boolean} [options.muted] initial mute state
  22454. * @param {String} [options.fallbackText] text to display when not supported
  22455. * @param {Function} errorHandler callback for when there are errors
  22456. * @param {Number} defaultAudioVolume the initial audio volume
  22457. */
  22458. let NativeVideoElementWrapper = /*#__PURE__*/function () {
  22459. /** @type {HTMLVideoElement|undefined} */
  22460. /** @type {number|undefined} */
  22461. function NativeVideoElementWrapper(_ref2, defaultAudioVolume) {
  22462. var _this = this;
  22463. let _ref2$_inject = _ref2._inject,
  22464. _ref2$_inject2 = _ref2$_inject === void 0 ? {} : _ref2$_inject,
  22465. _ref2$_inject2$create = _ref2$_inject2.createVideoElement,
  22466. _createVideoElement = _ref2$_inject2$create === void 0 ? createDomVideoElement : _ref2$_inject2$create,
  22467. _ref2$_inject2$create2 = _ref2$_inject2.createAudioElement,
  22468. _createAudioElement = _ref2$_inject2$create2 === void 0 ? createDomAudioElement : _ref2$_inject2$create2,
  22469. muted = _ref2.muted,
  22470. fallbackText = _ref2.fallbackText,
  22471. widgetType = _ref2.widgetType;
  22472. (0, _defineProperty2.default)(this, "_domElement", void 0);
  22473. (0, _defineProperty2.default)(this, "_domAudioElement", void 0);
  22474. (0, _defineProperty2.default)(this, "_blockedVolume", void 0);
  22475. (0, _defineProperty2.default)(this, "_mediaStoppedListener", void 0);
  22476. (0, _defineProperty2.default)(this, "_audioLevelSampler", void 0);
  22477. (0, _defineProperty2.default)(this, "_playInterrupts", 0);
  22478. this.logging = createLog("NativeVideoElementWrapper:" + id);
  22479. id += 1;
  22480. eventing(this);
  22481. this._defaultAudioVolume = defaultAudioVolume;
  22482. this._widgetType = widgetType;
  22483. let _videoElementMovedWarning = false; // / Private API
  22484. // The video element pauses itself when it's reparented, this is
  22485. // unfortunate. This function plays the video again and is triggered
  22486. // on the pause event.
  22487. const _playVideoOnPause = () => {
  22488. if (!_videoElementMovedWarning) {
  22489. this.logging.warn('Video element paused, auto-resuming. If you intended to do this, ' + 'use publishVideo(false) or subscribeToVideo(false) instead.');
  22490. _videoElementMovedWarning = true;
  22491. }
  22492. this.play();
  22493. };
  22494. this._domElement = _createVideoElement(fallbackText, muted);
  22495. this.trigger('videoElementCreated', this._domElement);
  22496. this._domElementEvents = eventHelper(this._domElement);
  22497. this._domElementEvents.on('timeupdate', function () {
  22498. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  22499. args[_key] = arguments[_key];
  22500. }
  22501. return _this.trigger('timeupdate', ...args);
  22502. });
  22503. this._domElementEvents.on('loadedmetadata', function () {
  22504. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  22505. args[_key2] = arguments[_key2];
  22506. }
  22507. return _this.trigger('loadedmetadata', ...args);
  22508. });
  22509. const onError = event => {
  22510. this.trigger('error', videoElementErrorMap(event.target.error));
  22511. };
  22512. this._domElementEvents.on('error', onError, false);
  22513. this._domElementEvents.on('pause', _playVideoOnPause);
  22514. this.on('destroyed', () => {
  22515. this._domElementEvents.removeAll();
  22516. if (this._domAudioElementEvents) {
  22517. this._domAudioElementEvents.removeAll();
  22518. }
  22519. });
  22520. canBeOrientatedMixin(this, () => this._domElement); // Safari subscribers needs special handling for audio-only video
  22521. // https://bugs.webkit.org/show_bug.cgi?id=174152
  22522. if (env.name === 'Safari' && this._widgetType === 'subscriber') {
  22523. this._domAudioElement = _createAudioElement();
  22524. this._bindAudioElementEvents();
  22525. }
  22526. }
  22527. var _proto = NativeVideoElementWrapper.prototype;
  22528. _proto._bindAudioElementEvents = function _bindAudioElementEvents() {
  22529. var _this2 = this;
  22530. this._domAudioElementEvents = eventHelper(this._domAudioElement); // Safari may stop playing audio if the browser is not visible or losses
  22531. // focus. When it does, continue playing it.
  22532. this._domAudioElementEvents.on('pause', () => this.play());
  22533. this._domAudioElementEvents.on('timeupdate', function () {
  22534. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  22535. args[_key3] = arguments[_key3];
  22536. }
  22537. return _this2.trigger('timeupdate', ...args);
  22538. });
  22539. this._domAudioElementEvents.on('loadedmetadata', function () {
  22540. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  22541. args[_key4] = arguments[_key4];
  22542. }
  22543. return _this2.trigger('loadedmetadata', ...args);
  22544. });
  22545. };
  22546. _proto.whenTimeIncrements = function whenTimeIncrements(callback, context) {
  22547. this.once('timeupdate', () => {
  22548. callback.call(context, this);
  22549. });
  22550. }
  22551. /**
  22552. * Get the underlying DOM video element
  22553. * @return {Element}
  22554. */
  22555. ;
  22556. _proto.domElement = function domElement() {
  22557. return this._domElement;
  22558. };
  22559. _proto.videoWidth = function videoWidth() {
  22560. return this._domElement ? Number(this._domElement["video" + (this.isRotated() ? 'Height' : 'Width')]) : 0;
  22561. };
  22562. _proto.videoHeight = function videoHeight() {
  22563. return this._domElement ? Number(this._domElement["video" + (this.isRotated() ? 'Width' : 'Height')]) : 0;
  22564. };
  22565. _proto.aspectRatio = function aspectRatio() {
  22566. return this.videoWidth() / this.videoHeight();
  22567. };
  22568. _proto.imgData = function imgData() {
  22569. const canvas = OTHelpers.createElement('canvas', {
  22570. width: this.videoWidth(),
  22571. height: this.videoHeight(),
  22572. style: {
  22573. display: 'none'
  22574. }
  22575. });
  22576. document.body.appendChild(canvas);
  22577. let imgData = null;
  22578. try {
  22579. canvas.getContext('2d').drawImage(this._domElement, 0, 0, canvas.width, canvas.height);
  22580. imgData = canvas.toDataURL('image/png');
  22581. } catch (err) {// Warning emitted for imgData === null below
  22582. }
  22583. OTHelpers.removeElement(canvas);
  22584. if (imgData === null || imgData === 'data:,') {
  22585. // 'data:,' is sometimes returned by canvas.toDataURL when one cannot be
  22586. // generated.
  22587. this.logging.warn('Cannot get image data yet');
  22588. return null;
  22589. }
  22590. return imgData.replace('data:image/png;base64,', '').trim();
  22591. } // Append the Video DOM element to a parent node
  22592. ;
  22593. _proto.appendTo = function appendTo(parentDomElement) {
  22594. parentDomElement.appendChild(this._domElement);
  22595. if (this._domAudioElement) {
  22596. parentDomElement.appendChild(this._domAudioElement);
  22597. }
  22598. return this;
  22599. };
  22600. _proto.isAudioBlocked = function isAudioBlocked() {
  22601. return this._blockedVolume !== undefined;
  22602. };
  22603. _proto.unblockAudio = /*#__PURE__*/function () {
  22604. var _unblockAudio = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
  22605. var blockedVolume;
  22606. return _regenerator.default.wrap(function _callee2$(_context2) {
  22607. while (1) switch (_context2.prev = _context2.next) {
  22608. case 0:
  22609. if (this.isAudioBlocked()) {
  22610. _context2.next = 3;
  22611. break;
  22612. }
  22613. this.logging.warn('Unexpected call to unblockAudio() without blocked audio');
  22614. return _context2.abrupt("return");
  22615. case 3:
  22616. blockedVolume = this._blockedVolume;
  22617. this._blockedVolume = undefined;
  22618. this.setAudioVolume(blockedVolume);
  22619. _context2.prev = 6;
  22620. _context2.next = 9;
  22621. return this.play();
  22622. case 9:
  22623. _context2.next = 16;
  22624. break;
  22625. case 11:
  22626. _context2.prev = 11;
  22627. _context2.t0 = _context2["catch"](6);
  22628. this._blockedVolume = blockedVolume;
  22629. this._domElement.muted = true;
  22630. throw _context2.t0;
  22631. case 16:
  22632. this.trigger('audioUnblocked');
  22633. case 17:
  22634. case "end":
  22635. return _context2.stop();
  22636. }
  22637. }, _callee2, this, [[6, 11]]);
  22638. }));
  22639. function unblockAudio() {
  22640. return _unblockAudio.apply(this, arguments);
  22641. }
  22642. return unblockAudio;
  22643. }() // useful for some browsers (old chrome) that show black when a peer connection
  22644. // is renegotiated
  22645. ;
  22646. _proto.rebind =
  22647. /*#__PURE__*/
  22648. function () {
  22649. var _rebind = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  22650. return _regenerator.default.wrap(function _callee3$(_context3) {
  22651. while (1) switch (_context3.prev = _context3.next) {
  22652. case 0:
  22653. if (this._domElement) {
  22654. _context3.next = 2;
  22655. break;
  22656. }
  22657. throw new Error('Can\'t rebind because _domElement no longer exists');
  22658. case 2:
  22659. this._playInterrupts++;
  22660. this._domElement.srcObject = this._domElement.srcObject;
  22661. if (this._hasAudioElement()) {
  22662. this._domAudioElement.srcObject = this._domAudioElement.srcObject;
  22663. }
  22664. case 5:
  22665. case "end":
  22666. return _context3.stop();
  22667. }
  22668. }, _callee3, this);
  22669. }));
  22670. function rebind() {
  22671. return _rebind.apply(this, arguments);
  22672. }
  22673. return rebind;
  22674. }();
  22675. _proto._createAudioLevelSampler = function _createAudioLevelSampler() {
  22676. this._removeAudioLevelSampler();
  22677. if (this._stream.getAudioTracks().length > 0) {
  22678. try {
  22679. this._audioContext = audioContextProvider();
  22680. } catch (e) {
  22681. this.logging.warn('Failed to get AudioContext(), audio level visualisation will not work', e);
  22682. }
  22683. if (this._audioContext) {
  22684. this._audioLevelSampler = new WebAudioLevelSampler(this._audioContext);
  22685. this._audioLevelSampler.webRTCStream(this._stream);
  22686. }
  22687. }
  22688. };
  22689. _proto._removeAudioLevelSampler = function _removeAudioLevelSampler() {
  22690. if (this._audioContext) {
  22691. delete this._audioContext;
  22692. delete this._audioLevelSampler;
  22693. }
  22694. } // For MediaStreams with multiple tracks, video tracks are disabled and
  22695. // then re-enabled
  22696. ;
  22697. _proto._toggleVideoTracks =
  22698. /*#__PURE__*/
  22699. function () {
  22700. var _toggleVideoTracks2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
  22701. var enabledTracks, hasMultipleTracks, videoTracks;
  22702. return _regenerator.default.wrap(function _callee4$(_context4) {
  22703. while (1) switch (_context4.prev = _context4.next) {
  22704. case 0:
  22705. enabledTracks = this._domElement.srcObject.getTracks().filter(track => track.enabled);
  22706. hasMultipleTracks = enabledTracks.length > 1;
  22707. if (!hasMultipleTracks) {
  22708. _context4.next = 8;
  22709. break;
  22710. }
  22711. videoTracks = enabledTracks.filter(track => track.kind === 'video');
  22712. videoTracks.forEach(track => {
  22713. track.enabled = false;
  22714. });
  22715. _context4.next = 7;
  22716. return noop();
  22717. case 7:
  22718. videoTracks.forEach(track => {
  22719. track.enabled = true;
  22720. });
  22721. case 8:
  22722. case "end":
  22723. return _context4.stop();
  22724. }
  22725. }, _callee4, this);
  22726. }));
  22727. function _toggleVideoTracks() {
  22728. return _toggleVideoTracks2.apply(this, arguments);
  22729. }
  22730. return _toggleVideoTracks;
  22731. }();
  22732. _proto._hasAudioElement = function _hasAudioElement() {
  22733. return this._domAudioElement && this._domAudioElement.srcObject;
  22734. };
  22735. _proto.play = /*#__PURE__*/function () {
  22736. var _play = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
  22737. var playInterruptsOnStart, isSafari, isIosSafari, domElement, _ref3, errorName, isAbortError;
  22738. return _regenerator.default.wrap(function _callee5$(_context5) {
  22739. while (1) switch (_context5.prev = _context5.next) {
  22740. case 0:
  22741. playInterruptsOnStart = this._playInterrupts;
  22742. isSafari = env.name === 'Safari';
  22743. isIosSafari = isSafari && isIos(); // In Safari, if a HTMLMediaElement property is mutated or if the element is moved,
  22744. // a delay is needed else element may fail to play
  22745. if (!isSafari) {
  22746. _context5.next = 6;
  22747. break;
  22748. }
  22749. _context5.next = 6;
  22750. return noop();
  22751. case 6:
  22752. // OPENTOK-39347: Toggle video tracks, else audio maybe garbled
  22753. if (isIosSafari) {
  22754. this._toggleVideoTracks();
  22755. }
  22756. _context5.prev = 7;
  22757. // Which element do we try to play? The `audio` or `video` element?
  22758. domElement = this._hasAudioElement() ? this._domAudioElement : this._domElement;
  22759. _context5.next = 11;
  22760. return domElement.play();
  22761. case 11:
  22762. return _context5.abrupt("return", _context5.sent);
  22763. case 14:
  22764. _context5.prev = 14;
  22765. _context5.t0 = _context5["catch"](7);
  22766. _ref3 = _context5.t0 || {}, errorName = _ref3.name;
  22767. isAbortError = errorName === 'AbortError'; // Play request was interrupted
  22768. if (isAbortError) {
  22769. this._playInterrupts++;
  22770. }
  22771. if (!(this._playInterrupts > playInterruptsOnStart)) {
  22772. _context5.next = 21;
  22773. break;
  22774. }
  22775. return _context5.abrupt("return", this.play());
  22776. case 21:
  22777. throw _context5.t0;
  22778. case 22:
  22779. case "end":
  22780. return _context5.stop();
  22781. }
  22782. }, _callee5, this, [[7, 14]]);
  22783. }));
  22784. function play() {
  22785. return _play.apply(this, arguments);
  22786. }
  22787. return play;
  22788. }();
  22789. _proto._bindToStream = function _bindToStream(webRtcStream) {
  22790. this._stream = webRtcStream;
  22791. const videoTracks = webRtcStream.getVideoTracks();
  22792. const audioTracks = webRtcStream.getAudioTracks();
  22793. const _videoTracks$ = videoTracks[0],
  22794. videoTrack = _videoTracks$ === void 0 ? {} : _videoTracks$;
  22795. const _audioTracks$ = audioTracks[0],
  22796. audioTrack = _audioTracks$ === void 0 ? {} : _audioTracks$;
  22797. const isAudioOnlyVideo = !videoTrack.enabled && audioTrack.enabled; // Audio-only video won't play in Safari since the browser won't dispatch
  22798. // the `loadedmetadata` event (since the video has unknown dimensions)
  22799. // https://bugs.webkit.org/show_bug.cgi?id=174152
  22800. if (this._domAudioElement && isAudioOnlyVideo) {
  22801. // The `loadedmetadata` event will fire if bind the audio track to an
  22802. // audio element
  22803. this._domAudioElement.srcObject = new windowMock.MediaStream(audioTracks);
  22804. this._domElement.srcObject = new windowMock.MediaStream(videoTracks);
  22805. } else {
  22806. this._domElement.srcObject = webRtcStream;
  22807. }
  22808. };
  22809. _proto.bindToStream = /*#__PURE__*/function () {
  22810. var _bindToStream2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(webRtcStream) {
  22811. var _this3 = this;
  22812. var currentVideoSize, onAllEnded, onSingleEnded;
  22813. return _regenerator.default.wrap(function _callee7$(_context7) {
  22814. while (1) switch (_context7.prev = _context7.next) {
  22815. case 0:
  22816. if (this._domElement) {
  22817. _context7.next = 2;
  22818. break;
  22819. }
  22820. throw new Error('Can\'t bind because _domElement no longer exists');
  22821. case 2:
  22822. this._bindToStream(webRtcStream);
  22823. (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
  22824. var hasAudio;
  22825. return _regenerator.default.wrap(function _callee6$(_context6) {
  22826. while (1) switch (_context6.prev = _context6.next) {
  22827. case 0:
  22828. _context6.prev = 0;
  22829. _context6.next = 3;
  22830. return _this3.play();
  22831. case 3:
  22832. _context6.next = 26;
  22833. break;
  22834. case 5:
  22835. _context6.prev = 5;
  22836. _context6.t0 = _context6["catch"](0);
  22837. hasAudio = !!webRtcStream.getAudioTracks().length;
  22838. if (!(_this3._hasAudioElement() && _context6.t0.name === 'NotAllowedError')) {
  22839. _context6.next = 15;
  22840. break;
  22841. }
  22842. // Audio-only video failed to play. Mute audio and try again.
  22843. _this3._domAudioElement.muted = true;
  22844. _context6.next = 12;
  22845. return _this3.play();
  22846. case 12:
  22847. // Now that audio-only stream is playing, unmute it.
  22848. _this3._domAudioElement.muted = false;
  22849. _context6.next = 26;
  22850. break;
  22851. case 15:
  22852. if (!hasAudio) {
  22853. _context6.next = 23;
  22854. break;
  22855. }
  22856. // Media (with audio) failed to play. Mute audio and try again.
  22857. _this3._blockedVolume = _this3.getAudioVolume();
  22858. _this3._domElement.muted = true;
  22859. _context6.next = 20;
  22860. return _this3.play();
  22861. case 20:
  22862. _this3.trigger('audioBlocked');
  22863. _context6.next = 26;
  22864. break;
  22865. case 23:
  22866. // Media failed to play. Mute audio, even though there's no audio
  22867. // track (e.g., a screenshare), and try again.
  22868. _this3._domElement.muted = true;
  22869. _context6.next = 26;
  22870. return _this3.play();
  22871. case 26:
  22872. case "end":
  22873. return _context6.stop();
  22874. }
  22875. }, _callee6, null, [[0, 5]]);
  22876. }))().catch(err => {
  22877. this.logging.debug('.play() failed: ', err);
  22878. });
  22879. currentVideoSize = {
  22880. width: this._domElement.videoWidth,
  22881. height: this._domElement.videoHeight
  22882. };
  22883. this.trigger('videoDimensionsChanged', (0, _extends2.default)({}, currentVideoSize), (0, _extends2.default)({}, currentVideoSize));
  22884. this._domElementEvents.on('resize', () => {
  22885. const _this$_domElement = this._domElement,
  22886. width = _this$_domElement.videoWidth,
  22887. height = _this$_domElement.videoHeight;
  22888. const widthChanged = width !== currentVideoSize.width;
  22889. const heightChanged = height !== currentVideoSize.height;
  22890. if (widthChanged || heightChanged) {
  22891. this.trigger('videoDimensionsChanged', (0, _extends2.default)({}, currentVideoSize), {
  22892. width,
  22893. height
  22894. });
  22895. currentVideoSize.width = width;
  22896. currentVideoSize.height = height;
  22897. }
  22898. });
  22899. onAllEnded = () => {
  22900. this._mediaStoppedListener.stop();
  22901. if (this._domElement) {
  22902. this._domElement.onended = null;
  22903. }
  22904. this.trigger('mediaStopped');
  22905. };
  22906. onSingleEnded = track => {
  22907. this.trigger('mediaStopped', track);
  22908. }; // OPENTOK-22428: Firefox doesn't emit the ended event on the webRtcStream when the user
  22909. // stops sharing their camera, but we do get the ended event on the video element.
  22910. // TODO: should this apply to all elements?
  22911. this._domElement.onended = () => onAllEnded();
  22912. this._mediaStoppedListener = listenForTracksEnded(webRtcStream, onAllEnded, onSingleEnded);
  22913. this._createAudioLevelSampler();
  22914. return _context7.abrupt("return", undefined);
  22915. case 13:
  22916. case "end":
  22917. return _context7.stop();
  22918. }
  22919. }, _callee7, this);
  22920. }));
  22921. function bindToStream(_x) {
  22922. return _bindToStream2.apply(this, arguments);
  22923. }
  22924. return bindToStream;
  22925. }() // Unbind the currently bound stream from the video element.
  22926. ;
  22927. _proto.unbindStream = function unbindStream() {
  22928. if (this._domElement) {
  22929. this._domElement.srcObject = null;
  22930. }
  22931. if (this._domAudioElement) {
  22932. this._domAudioElement.srcObject = null;
  22933. }
  22934. this._removeAudioLevelSampler();
  22935. return this;
  22936. };
  22937. _proto.setAudioVolume = function setAudioVolume(rawValue) {
  22938. if (this.isAudioBlocked()) {
  22939. this._blockedVolume = rawValue;
  22940. return;
  22941. }
  22942. const value = parseFloat(rawValue) / 100;
  22943. const domElement = this.domElement();
  22944. if (domElement) {
  22945. domElement.volume = value; // In Safari on iOS setting the volume does not work but setting muted does so at
  22946. // least this will mute when you click the mute icon
  22947. // https://bugs.webkit.org/show_bug.cgi?id=176045
  22948. if (value === 0) {
  22949. domElement.muted = true;
  22950. } else {
  22951. domElement.muted = false;
  22952. }
  22953. }
  22954. };
  22955. _proto.getAudioVolume = function getAudioVolume() {
  22956. if (this.isAudioBlocked()) {
  22957. return this._blockedVolume;
  22958. } // Return the actual volume of the DOM element
  22959. const domElement = this.domElement();
  22960. if (domElement) {
  22961. return domElement.muted ? 0 : domElement.volume * 100;
  22962. }
  22963. return this._defaultAudioVolume;
  22964. } // see https://wiki.mozilla.org/WebAPI/AudioChannels
  22965. // The audioChannelType is currently only available in Firefox. This property returns
  22966. // "unknown" in other browser. The related HTML tag attribute is "mozaudiochannel"
  22967. ;
  22968. _proto.audioChannelType = function audioChannelType(type) {
  22969. const domElement = this.domElement();
  22970. if (type !== void 0) {
  22971. domElement.mozAudioChannelType = type;
  22972. }
  22973. if ('mozAudioChannelType' in this._domElement) {
  22974. return domElement.mozAudioChannelType;
  22975. }
  22976. return 'unknown';
  22977. };
  22978. _proto.getAudioInputLevel = function getAudioInputLevel() {
  22979. return this._audioLevelSampler.sample();
  22980. };
  22981. _proto.refreshTracks = function refreshTracks() {
  22982. if (this._mediaStoppedListener) {
  22983. this._mediaStoppedListener.refresh();
  22984. }
  22985. this._createAudioLevelSampler();
  22986. if (this._stream && this._stream.getTracks().length > 0) {
  22987. this._playInterrupts++;
  22988. const domElement = this.domElement();
  22989. domElement.srcObject = new windowMock.MediaStream(this._stream.getTracks());
  22990. }
  22991. };
  22992. _proto.destroy = function destroy() {
  22993. // Unbind events first, otherwise 'pause' will trigger when the
  22994. // video element is removed from the DOM.
  22995. if (this._mediaStoppedListener) {
  22996. this._mediaStoppedListener.stop();
  22997. }
  22998. this.logging.debug('removing domElementEvents');
  22999. this._domElementEvents.removeAll();
  23000. if (this._domAudioElementEvents) {
  23001. this._domAudioElementEvents.removeAll();
  23002. }
  23003. this.unbindStream();
  23004. if (this._domElement) {
  23005. OTHelpers.removeElement(this._domElement);
  23006. this._domElement = null;
  23007. }
  23008. if (this._domAudioElement) {
  23009. OTHelpers.removeElement(this._domAudioElement);
  23010. this._domAudioElement = null;
  23011. }
  23012. this.trigger('destroyed');
  23013. destroyObj('NativeVideoElementWrapper', this);
  23014. return void 0;
  23015. };
  23016. return NativeVideoElementWrapper;
  23017. }();
  23018. return NativeVideoElementWrapper;
  23019. }
  23020. module.exports = NativeVideoElementWrapperFactory;
  23021. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  23022. /***/ }),
  23023. /* 284 */
  23024. /***/ (function(module, exports, __webpack_require__) {
  23025. "use strict";
  23026. /* WEBPACK VAR INJECTION */(function(Promise) {
  23027. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  23028. /* eslint-disable no-param-reassign, global-require, no-underscore-dangle, func-names */
  23029. const assign = __webpack_require__(6);
  23030. const pick = __webpack_require__(42);
  23031. const find = __webpack_require__(58);
  23032. const eventing = __webpack_require__(5);
  23033. module.exports = function PublisherPeerConnectionFactory(deps) {
  23034. if (deps === void 0) {
  23035. deps = {};
  23036. }
  23037. const getStatsHelpers = deps.getStatsHelpers || __webpack_require__(72);
  23038. const OTHelpers = deps.OTHelpers || __webpack_require__(4);
  23039. const PeerConnection = deps.PeerConnection || __webpack_require__(99)();
  23040. const setCertificates = deps.setCertificates || __webpack_require__(159)();
  23041. const watchAudioAcquisition = deps.watchAudioAcquisition || __webpack_require__(621);
  23042. /**
  23043. * @typedef {object} PublisherPeerConnectionConfig
  23044. * @property {function(string, string=, object=, object=, boolean=)} logAnalyticsEvent
  23045. * @property {Connection} remoteConnection
  23046. * @property {boolean} reconnection
  23047. * @property {MediaStream} webRTCStream
  23048. * @property {object<string, object>} channels
  23049. * @property {boolean} capableSimulcastStreams
  23050. * @property {boolean} overrideSimulcastEnabled
  23051. * @property {string} subscriberUri
  23052. * @property {object<string, object>} offerOverrides
  23053. * @property {object<string, object>} answerOverrides
  23054. */
  23055. /**
  23056. * Abstracts PeerConnection related stuff away from Publisher.
  23057. *
  23058. * Responsible for:
  23059. * * setting up the underlying PeerConnection (delegates to PeerConnections)
  23060. * * triggering a connected event when the Peer connection is opened
  23061. * * triggering a disconnected event when the Peer connection is closed
  23062. * * providing a destroy method
  23063. * * providing a processMessage method
  23064. *
  23065. * Once the PeerConnection is connected and the video element playing it triggers
  23066. * the connected event
  23067. *
  23068. * Triggers the following events
  23069. * * connected
  23070. * * disconnected
  23071. *
  23072. * @class PublisherPeerConnection
  23073. * @constructor
  23074. *
  23075. * @param {PublisherPeerConnectionConfig} config
  23076. */
  23077. return function PublisherPeerConnection(_ref) {
  23078. let iceConfig = _ref.iceConfig,
  23079. webRTCStream = _ref.webRTCStream,
  23080. channels = _ref.channels,
  23081. sendMessage = _ref.sendMessage,
  23082. capableSimulcastStreams = _ref.capableSimulcastStreams,
  23083. overrideSimulcastEnabled = _ref.overrideSimulcastEnabled,
  23084. logAnalyticsEvent = _ref.logAnalyticsEvent,
  23085. offerOverrides = _ref.offerOverrides,
  23086. answerOverrides = _ref.answerOverrides;
  23087. let _peerConnection;
  23088. let _awaitingIceRestart = false;
  23089. let _cancelWatchAudioAcquisition; // Private
  23090. const _onPeerClosed = function _onPeerClosed() {
  23091. this.destroy();
  23092. if (_awaitingIceRestart) {
  23093. _awaitingIceRestart = false;
  23094. this.trigger('iceRestartFailure');
  23095. }
  23096. this.trigger('disconnected');
  23097. };
  23098. const _onPeerError = function _onPeerError(_ref2) {
  23099. let reason = _ref2.reason,
  23100. prefix = _ref2.prefix;
  23101. this.trigger('error', {
  23102. reason,
  23103. prefix
  23104. });
  23105. };
  23106. const _onIceConnectionStateChange = function _onIceConnectionStateChange(state) {
  23107. if (_awaitingIceRestart && _peerConnection.iceConnectionStateIsConnected()) {
  23108. _awaitingIceRestart = false;
  23109. this.trigger('iceRestartSuccess');
  23110. } // watch for the Chrome bug where audio can't be acquired
  23111. // can not use iceConnectionStateIsConnected since it is too broad
  23112. if (state === 'connected') {
  23113. if (OTHelpers.env.name === 'Chrome') {
  23114. // cancel any pending watcher (in case of ice restart for example)
  23115. if (_cancelWatchAudioAcquisition) {
  23116. _cancelWatchAudioAcquisition();
  23117. }
  23118. _cancelWatchAudioAcquisition = watchAudioAcquisition(_peerConnection.getStats.bind(_peerConnection), () => this.trigger('audioAcquisitionProblem'));
  23119. }
  23120. }
  23121. this.trigger('iceConnectionStateChange', state);
  23122. };
  23123. eventing(this); // / Public API
  23124. this.getDataChannel = function (label, options, completion) {
  23125. _peerConnection.getDataChannel(label, options, completion);
  23126. };
  23127. this.destroy = function () {
  23128. if (_cancelWatchAudioAcquisition) {
  23129. _cancelWatchAudioAcquisition();
  23130. _cancelWatchAudioAcquisition = null;
  23131. } // Clean up our PeerConnection
  23132. if (_peerConnection) {
  23133. _peerConnection.disconnect();
  23134. _peerConnection = null;
  23135. }
  23136. this.off();
  23137. };
  23138. this.processMessage = function (type, message) {
  23139. _peerConnection.processMessage(type, message);
  23140. };
  23141. this.addTrack = function (track, stream, callback) {
  23142. return _peerConnection.addTrack(track, stream, callback);
  23143. };
  23144. this.removeTrack = function (RTCRtpSender) {
  23145. return _peerConnection.removeTrack(RTCRtpSender);
  23146. };
  23147. this.getLocalStreams = function () {
  23148. return _peerConnection.getLocalStreams();
  23149. }; // Init
  23150. this.init = function (rumorIceServers, completion) {
  23151. const pcConfig = {
  23152. iceConfig: !iceConfig.needRumorIceServersFallback ? iceConfig : assign(iceConfig, {
  23153. servers: [...rumorIceServers, ...iceConfig.servers]
  23154. }),
  23155. channels,
  23156. capableSimulcastStreams,
  23157. overrideSimulcastEnabled
  23158. };
  23159. setCertificates(pcConfig, (err, pcConfigWithCerts) => {
  23160. if (err) {
  23161. completion(err);
  23162. return;
  23163. }
  23164. const peerConnectionConfig = assign({
  23165. logAnalyticsEvent,
  23166. isPublisher: true,
  23167. offerOverrides,
  23168. answerOverrides
  23169. }, pcConfigWithCerts);
  23170. _peerConnection = new PeerConnection(assign({
  23171. sendMessage
  23172. }, peerConnectionConfig));
  23173. _peerConnection.on({
  23174. close: _onPeerClosed,
  23175. error: _onPeerError,
  23176. qos: _qos => this.trigger('qos', _qos),
  23177. iceConnectionStateChange: _onIceConnectionStateChange
  23178. }, this);
  23179. _peerConnection.addLocalStream(webRTCStream).then(() => {
  23180. completion(undefined);
  23181. }).catch(completion);
  23182. });
  23183. };
  23184. this.getSenders = function () {
  23185. return _peerConnection.getSenders();
  23186. };
  23187. this.iceRestart = function () {
  23188. _awaitingIceRestart = true;
  23189. return _peerConnection.iceRestart();
  23190. };
  23191. this.hasRelayCandidates = () => _peerConnection.hasRelayCandidates();
  23192. this.iceConnectionStateIsConnected = function () {
  23193. return _peerConnection.iceConnectionStateIsConnected();
  23194. };
  23195. this.findAndReplaceTrack = (oldTrack, newTrack) => _peerConnection.findAndReplaceTrack(oldTrack, newTrack);
  23196. this._testOnlyGetFramesEncoded = () => new Promise((resolve, reject) => {
  23197. _peerConnection.getStats((err, stats) => {
  23198. if (err) {
  23199. reject(err);
  23200. return;
  23201. }
  23202. const videoStat = find(stats, stat => getStatsHelpers.isVideoSenderStat(stat) && getStatsHelpers.isOutboundStat(stat));
  23203. if (!videoStat) {
  23204. reject(new Error('Could not find framesEncoded in getStats report'));
  23205. return;
  23206. }
  23207. resolve(pick(videoStat, ['timestamp', 'framesEncoded']));
  23208. });
  23209. });
  23210. this.getStats = callback => _peerConnection.getStats(callback);
  23211. };
  23212. };
  23213. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  23214. /***/ }),
  23215. /* 285 */
  23216. /***/ (function(module, exports, __webpack_require__) {
  23217. "use strict";
  23218. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  23219. /* eslint-disable global-require, no-underscore-dangle, no-param-reassign, no-void, no-shadow */
  23220. /* eslint-disable func-names */
  23221. const assign = __webpack_require__(6);
  23222. const eventing = __webpack_require__(5);
  23223. module.exports = function SubscriberPeerConnectionFactory(deps) {
  23224. if (deps === void 0) {
  23225. deps = {};
  23226. }
  23227. const OTHelpers = deps.OTHelpers || __webpack_require__(4);
  23228. const PeerConnection = deps.PeerConnection || __webpack_require__(99)();
  23229. const setCertificates = deps.setCertificates || __webpack_require__(159)();
  23230. /*
  23231. * Abstracts PeerConnection related stuff away from Subscriber.
  23232. *
  23233. * Responsible for:
  23234. * * setting up the underlying PeerConnection (delegates to PeerConnections)
  23235. * * triggering a connected event when the Peer connection is opened
  23236. * * triggering a disconnected event when the Peer connection is closed
  23237. * * creating a video element when a stream is added
  23238. * * responding to stream removed intelligently
  23239. * * providing a destroy method
  23240. * * providing a processMessage method
  23241. *
  23242. * Once the PeerConnection is connected and the video element playing it
  23243. * triggers the connected event
  23244. *
  23245. * Triggers the following events
  23246. * * connected
  23247. * * disconnected
  23248. * * remoteStreamAdded
  23249. * * remoteStreamRemoved
  23250. * * error
  23251. *
  23252. */
  23253. return function SubscriberPeerConnection(_ref) {
  23254. let clientCandidates = _ref.clientCandidates,
  23255. iceConfig = _ref.iceConfig,
  23256. send = _ref.send,
  23257. logAnalyticsEvent = _ref.logAnalyticsEvent,
  23258. p2p = _ref.p2p,
  23259. codecFlags = _ref.codecFlags;
  23260. const _subscriberPeerConnection = this;
  23261. let _peerConnection;
  23262. let _destroyed = false;
  23263. let _awaitingIceRestart = false; // Private
  23264. const _onPeerClosed = function _onPeerClosed() {
  23265. this.destroy();
  23266. if (_awaitingIceRestart) {
  23267. this.trigger('iceRestartFailure', this);
  23268. }
  23269. this.trigger('disconnected', this);
  23270. };
  23271. const _onRemoteStreamAdded = function _onRemoteStreamAdded(remoteRTCStream) {
  23272. this.trigger('remoteStreamAdded', remoteRTCStream, this);
  23273. };
  23274. const _onRemoteStreamRemoved = function _onRemoteStreamRemoved(remoteRTCStream) {
  23275. this.trigger('remoteStreamRemoved', remoteRTCStream, this);
  23276. };
  23277. const _onRemoteVideoSupported = supported => {
  23278. this.trigger('remoteVideoSupported', supported);
  23279. }; // Note: All Peer errors are fatal right now.
  23280. const _onPeerError = function _onPeerError(_ref2) {
  23281. let reason = _ref2.reason,
  23282. prefix = _ref2.prefix;
  23283. this.trigger('error', null, reason, this, prefix);
  23284. };
  23285. const _onIceConnectionStateChange = function _onIceConnectionStateChange(state) {
  23286. if (_awaitingIceRestart && (state === 'connected' || state === 'completed')) {
  23287. _awaitingIceRestart = false;
  23288. this.trigger('iceRestartSuccess');
  23289. }
  23290. this.trigger('iceConnectionStateChange', state);
  23291. };
  23292. const _onsignalingStateChange = function _onsignalingStateChange(state) {
  23293. this.trigger('signalingStateChange', state);
  23294. };
  23295. const _onsignalingStateStable = function _onsignalingStateStable(state) {
  23296. this.trigger('signalingStateStable', state);
  23297. };
  23298. const _relayMessageToPeer = (type, content) => {
  23299. if (type === 'answer' || type === 'pranswer') {
  23300. this.trigger('connected');
  23301. }
  23302. send(type, content);
  23303. };
  23304. eventing(this); // Public
  23305. this.close = function () {
  23306. if (_destroyed) {
  23307. return;
  23308. }
  23309. _destroyed = true;
  23310. if (_peerConnection) {
  23311. _peerConnection.disconnect();
  23312. _peerConnection = null;
  23313. }
  23314. this.off();
  23315. };
  23316. this.destroy = function () {
  23317. if (_destroyed) {
  23318. return;
  23319. } // Ref: OPENTOK-2458 disable all audio tracks before removing it.
  23320. // @todo I'm not sure if this is neccessary anymore. when disconnecting a
  23321. // session usbsubscribe should be called, and that should tear down all
  23322. // publishers and subscribers and when publishers/subscribers are torn down
  23323. // their respective media element should be removed, and no sound should be
  23324. // played. I'm not sure why we fixed it here.
  23325. this.subscribeToAudio(false);
  23326. this.close();
  23327. };
  23328. this.getDataChannel = function (label, options, completion) {
  23329. _peerConnection.getDataChannel(label, options, completion);
  23330. };
  23331. this.processMessage = function (type, message) {
  23332. _peerConnection.processMessage(type, message);
  23333. };
  23334. this.remoteDescription = function () {
  23335. return _peerConnection.remoteDescription();
  23336. };
  23337. this.getStats = function (callback) {
  23338. if (_peerConnection) {
  23339. _peerConnection.getStats(callback);
  23340. } else {
  23341. callback(new OTHelpers.Error('Subscriber is not connected cannot getStats', 'NotConnectedError', {
  23342. code: 1015
  23343. }));
  23344. }
  23345. }; // Helper method used by subscribeToAudio/subscribeToVideo
  23346. const _createSetEnabledForTracks = function _createSetEnabledForTracks(kind) {
  23347. return function (enabled) {
  23348. if (!_peerConnection) {
  23349. // We haven't created the peer connection yet, so there are no remote streams right now.
  23350. // Subscriber will try again after onRemoteStreamAdded so this works out ok.
  23351. return;
  23352. }
  23353. _peerConnection.remoteTracks().forEach(track => {
  23354. if (track.kind === kind && track.enabled !== enabled) {
  23355. track.enabled = enabled;
  23356. }
  23357. });
  23358. };
  23359. };
  23360. this.subscribeToAudio = _createSetEnabledForTracks('audio');
  23361. this.subscribeToVideo = _createSetEnabledForTracks('video');
  23362. this.hasRelayCandidates = function () {
  23363. return _peerConnection.hasRelayCandidates();
  23364. };
  23365. this.iceRestart = function () {
  23366. _awaitingIceRestart = true;
  23367. return _peerConnection.iceRestart();
  23368. };
  23369. this.iceConnectionStateIsConnected = function () {
  23370. return _peerConnection.iceConnectionStateIsConnected();
  23371. }; // Init
  23372. this.init = function (completion) {
  23373. const pcConfig = {
  23374. iceConfig
  23375. };
  23376. setCertificates(pcConfig, (err, pcConfigWithCerts) => {
  23377. if (err) {
  23378. completion(err);
  23379. return;
  23380. }
  23381. const peerConnectionConfig = assign({
  23382. logAnalyticsEvent,
  23383. clientCandidates,
  23384. codecFlags
  23385. }, pcConfigWithCerts);
  23386. _peerConnection = new PeerConnection(assign({
  23387. sendMessage: _relayMessageToPeer,
  23388. p2p
  23389. }, peerConnectionConfig));
  23390. _peerConnection.on({
  23391. iceConnected: () => _subscriberPeerConnection.emit('iceConnected'),
  23392. close: _onPeerClosed,
  23393. streamAdded: _onRemoteStreamAdded,
  23394. streamRemoved: _onRemoteStreamRemoved,
  23395. signalingStateChange: _onsignalingStateChange,
  23396. signalingStateStable: _onsignalingStateStable,
  23397. error: _onPeerError,
  23398. qos: _qos => this.trigger('qos', _qos),
  23399. iceConnectionStateChange: _onIceConnectionStateChange,
  23400. remoteVideoSupported: _onRemoteVideoSupported
  23401. }, _subscriberPeerConnection); // If there are already remoteStreams, add them immediately
  23402. // (Using .remoteTracks to avoid deprecated .remoteStreams where possible.
  23403. // FIXME: Is this even possible anyway? How could we already have remote streams in the same
  23404. // tick the peer connection was created?)
  23405. if (_peerConnection.remoteTracks().length > 0) {
  23406. // @todo i really don't think this branch is ever entered, it might be an artifact of the
  23407. // unit tests
  23408. // @todo ahh maybe reconnections?
  23409. _peerConnection.remoteStreams().forEach(_onRemoteStreamAdded, _subscriberPeerConnection);
  23410. } else {
  23411. completion(undefined, _subscriberPeerConnection);
  23412. }
  23413. });
  23414. };
  23415. };
  23416. };
  23417. /***/ }),
  23418. /* 286 */
  23419. /***/ (function(module, exports, __webpack_require__) {
  23420. "use strict";
  23421. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  23422. /* eslint-disable no-param-reassign, global-require */
  23423. module.exports = function PublishingStateFactory(deps) {
  23424. if (deps === void 0) {
  23425. deps = {};
  23426. }
  23427. const generateSimpleStateMachine = deps.generateSimpleStateMachine || __webpack_require__(155)(); // Models a Publisher's publishing State
  23428. //
  23429. // Valid States:
  23430. // NotPublishing
  23431. // GetUserMedia
  23432. // BindingMedia
  23433. // MediaBound
  23434. // PublishingToSession
  23435. // Publishing
  23436. // Failed
  23437. // Destroyed
  23438. //
  23439. //
  23440. // Valid Transitions:
  23441. // NotPublishing ->
  23442. // GetUserMedia
  23443. //
  23444. // GetUserMedia ->
  23445. // BindingMedia
  23446. // | Failed (Failure Reasons -> stream error, constraints,
  23447. // (permission denied
  23448. // | NotPublishing (destroy()
  23449. //
  23450. //
  23451. // BindingMedia ->
  23452. // MediaBound
  23453. // | Failed (Failure Reasons -> Anything to do with the media
  23454. // (being invalid, the media never plays
  23455. // | NotPublishing (destroy()
  23456. //
  23457. // MediaBound ->
  23458. // PublishingToSession (MediaBound could transition to PublishingToSession
  23459. // (if a stand-alone publish is bound to a session
  23460. // | Failed (Failure Reasons -> media issues with a stand-alone publisher
  23461. // | NotPublishing (destroy()
  23462. //
  23463. // PublishingToSession
  23464. // Publishing
  23465. // | Failed
  23466. // | NotPublishing (destroy()
  23467. // | MediaBound (disconnect()
  23468. //
  23469. //
  23470. // Publishing ->
  23471. // NotPublishing (Unpublish
  23472. // | Failed (Failure Reasons -> loss of network, media error, anything
  23473. // (that causes *all* Peer Connections to fail (less than all
  23474. // (failing is just an error, all is failure)
  23475. // | NotPublishing (destroy()
  23476. //
  23477. // Failed ->
  23478. // Destroyed
  23479. //
  23480. // Destroyed -> (Terminal state
  23481. //
  23482. //
  23483. const validStates = ['NotPublishing', 'GetUserMedia', 'BindingMedia', 'MediaBound', 'PublishingToSession', 'Publishing', 'Failed', 'Destroyed'];
  23484. const validTransitions = {
  23485. NotPublishing: ['NotPublishing', 'GetUserMedia', 'Destroyed'],
  23486. GetUserMedia: ['BindingMedia', 'Failed', 'NotPublishing', 'Destroyed'],
  23487. BindingMedia: ['MediaBound', 'Failed', 'NotPublishing', 'Destroyed'],
  23488. MediaBound: ['NotPublishing', 'PublishingToSession', 'Failed', 'Destroyed'],
  23489. PublishingToSession: ['NotPublishing', 'Publishing', 'Failed', 'Destroyed', 'MediaBound'],
  23490. Publishing: ['NotPublishing', 'MediaBound', 'Failed', 'Destroyed'],
  23491. Failed: ['Destroyed'],
  23492. Destroyed: []
  23493. };
  23494. const initialState = 'NotPublishing';
  23495. const PublishingState = generateSimpleStateMachine(initialState, validStates, validTransitions);
  23496. PublishingState.prototype.isDestroyed = function () {
  23497. return this.current === 'Destroyed';
  23498. };
  23499. PublishingState.prototype.isAttemptingToPublish = function () {
  23500. return ['GetUserMedia', 'BindingMedia', 'MediaBound', 'PublishingToSession'].indexOf(this.current) !== -1;
  23501. };
  23502. PublishingState.prototype.isPublishing = function () {
  23503. return this.current === 'Publishing';
  23504. };
  23505. return PublishingState;
  23506. };
  23507. /***/ }),
  23508. /* 287 */
  23509. /***/ (function(module, exports, __webpack_require__) {
  23510. "use strict";
  23511. Object.defineProperty(exports, "__esModule", {
  23512. value: true
  23513. });
  23514. exports.default = CancellationError;
  23515. // Note: Babel does not support extending builtin types like error:
  23516. // https://phabricator.babeljs.io/T3083
  23517. /**
  23518. * The error that is thrown when an operation is canceled.
  23519. *
  23520. * @class
  23521. * @param {string=} message The error message.
  23522. * @extends Error
  23523. */
  23524. function CancellationError(message) {
  23525. this.message = message || 'Operation has been canceled.';
  23526. this.name = 'CancellationError';
  23527. if (Error.captureStackTrace) {
  23528. Error.captureStackTrace(this, this.constructor);
  23529. }
  23530. }
  23531. CancellationError.prototype = Object.create(Error.prototype);
  23532. CancellationError.prototype.constructor = CancellationError;
  23533. /***/ }),
  23534. /* 288 */
  23535. /***/ (function(module, exports, __webpack_require__) {
  23536. /*** IMPORTS FROM imports-loader ***/
  23537. var Promise = __webpack_require__(0);
  23538. "use strict";
  23539. Object.defineProperty(exports, "__esModule", { value: true });
  23540. function promiseFinally(value, cb) {
  23541. return Promise.resolve(value).then(value => Promise.resolve(cb()).then(() => value), reason => Promise.resolve(cb()).then(() => Promise.reject(reason)));
  23542. }
  23543. exports.default = promiseFinally;
  23544. //# sourceMappingURL=index.js.map
  23545. /***/ }),
  23546. /* 289 */
  23547. /***/ (function(module, exports, __webpack_require__) {
  23548. "use strict";
  23549. /* WEBPACK VAR INJECTION */(function(Promise) {
  23550. var _interopRequireDefault = __webpack_require__(2);
  23551. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  23552. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  23553. var _extends2 = _interopRequireDefault(__webpack_require__(23));
  23554. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  23555. /* eslint-disable no-param-reassign, no-underscore-dangle */
  23556. /* eslint-disable no-use-before-define, no-shadow, max-len */
  23557. const defaults = __webpack_require__(133);
  23558. const merge = __webpack_require__(143);
  23559. const assign = __webpack_require__(6);
  23560. const values = __webpack_require__(267);
  23561. const last = __webpack_require__(264);
  23562. const get = __webpack_require__(51);
  23563. const once = __webpack_require__(47);
  23564. const _require = __webpack_require__(161),
  23565. CancellationError = _require.CancellationError;
  23566. const uuid = __webpack_require__(15);
  23567. const EventEmitter = __webpack_require__(43);
  23568. const now = __webpack_require__(46);
  23569. const castToBoolean = __webpack_require__(261);
  23570. const eventNames = __webpack_require__(24);
  23571. const eventing = __webpack_require__(5);
  23572. const waitUntil = __webpack_require__(632);
  23573. const RafRunner = __webpack_require__(101);
  23574. const eventHelper = __webpack_require__(59);
  23575. const interpretSubscriberCreateError = __webpack_require__(633);
  23576. const Errors = __webpack_require__(8);
  23577. const defaultWidgetView = __webpack_require__(160)();
  23578. const audioLevelBehaviour = __webpack_require__(634);
  23579. const audioContextDefault = __webpack_require__(153)();
  23580. const AudioLevelMeterDefault = __webpack_require__(272);
  23581. const AudioLevelTransformerDefault = __webpack_require__(139);
  23582. const BackingBarDefault = __webpack_require__(273);
  23583. const ChromeDefault = __webpack_require__(140);
  23584. const envDefault = __webpack_require__(3);
  23585. const errorsDefault = __webpack_require__(8);
  23586. const EventsDefault = __webpack_require__(20)();
  23587. const ExceptionCodesDefault = __webpack_require__(11);
  23588. const GetStatsAudioLevelSamplerDefault = __webpack_require__(249);
  23589. const getStatsHelpersDefault = __webpack_require__(72);
  23590. const hasAudioOutputLevelStatCapabilityDefault = __webpack_require__(635);
  23591. const hasRemoteStreamsWithWebAudioDefault = __webpack_require__(636);
  23592. const interpretPeerConnectionErrorDefault = __webpack_require__(158)();
  23593. const loggingDefault = __webpack_require__(1)('Subscriber');
  23594. const MuteButtonDefault = __webpack_require__(274)();
  23595. const NamePanelDefault = __webpack_require__(275);
  23596. const otErrorDefault = __webpack_require__(12)();
  23597. const OTErrorClassDefault = __webpack_require__(33);
  23598. const OTHelpersDefault = __webpack_require__(4);
  23599. const StylableComponentDefault = __webpack_require__(147);
  23600. const windowMock = __webpack_require__(138)((typeof window !== undefined ? window : global));
  23601. const PeerConnection = __webpack_require__(99)({
  23602. global: windowMock
  23603. });
  23604. const SubscriberPeerConnectionDefault = __webpack_require__(285)({
  23605. PeerConnection
  23606. });
  23607. const SubscribingStateDefault = __webpack_require__(290);
  23608. const VideoDisabledIndicatorDefault = __webpack_require__(637);
  23609. const AudioBlockedIndicatorDefault = __webpack_require__(638);
  23610. const VideoUnsupportedIndicatorDefault = __webpack_require__(639);
  23611. const watchFrameRateDefault = __webpack_require__(640);
  23612. const WebAudioLevelSamplerDefault = __webpack_require__(141);
  23613. const createSendMethodDefault = __webpack_require__(291);
  23614. const parseIceServersDefault = __webpack_require__(98).parseIceServers;
  23615. const overallTimeout = __webpack_require__(641);
  23616. const createConnectivityState = __webpack_require__(642);
  23617. const createConnectivityAttemptPinger = __webpack_require__(643);
  23618. const DEFAULT_AUDIO_VOLUME = 100;
  23619. const isLocalStream = (stream, session) => stream.connection.id === session.connection.id;
  23620. const constructSubscriberUri = (_ref) => {
  23621. let apiKey = _ref.apiKey,
  23622. sessionId = _ref.sessionId,
  23623. streamId = _ref.streamId,
  23624. subscriberId = _ref.subscriberId;
  23625. return ['/v2/partner', apiKey, 'session', sessionId, 'stream', streamId, 'subscriber', subscriberId].join('/');
  23626. };
  23627. function hasExpectedTracks(mediaStream, oTStream) {
  23628. const isMissingVideo = oTStream && oTStream.hasVideo && mediaStream && mediaStream.getVideoTracks().length === 0;
  23629. const isMissingAudio = oTStream && oTStream.hasAudio && mediaStream && mediaStream.getAudioTracks().length === 0;
  23630. return !(isMissingVideo || isMissingAudio);
  23631. }
  23632. function normalizeAudioVolume(volume) {
  23633. return Math.max(0, Math.min(100, parseInt(volume, 10)));
  23634. }
  23635. function determineAudioVolume(props) {
  23636. if (props.audioVolume !== undefined) {
  23637. return props.audioVolume;
  23638. } else if (props.subscribeToAudio === false) {
  23639. return 0;
  23640. }
  23641. return DEFAULT_AUDIO_VOLUME;
  23642. }
  23643. module.exports = function SubscriberFactory(_temp) {
  23644. let _ref2 = _temp === void 0 ? {} : _temp,
  23645. _ref2$audioContext = _ref2.audioContext,
  23646. audioContext = _ref2$audioContext === void 0 ? audioContextDefault : _ref2$audioContext,
  23647. _ref2$AudioLevelMeter = _ref2.AudioLevelMeter,
  23648. AudioLevelMeter = _ref2$AudioLevelMeter === void 0 ? AudioLevelMeterDefault : _ref2$AudioLevelMeter,
  23649. _ref2$AudioLevelTrans = _ref2.AudioLevelTransformer,
  23650. AudioLevelTransformer = _ref2$AudioLevelTrans === void 0 ? AudioLevelTransformerDefault : _ref2$AudioLevelTrans,
  23651. _ref2$BackingBar = _ref2.BackingBar,
  23652. BackingBar = _ref2$BackingBar === void 0 ? BackingBarDefault : _ref2$BackingBar,
  23653. _ref2$Chrome = _ref2.Chrome,
  23654. Chrome = _ref2$Chrome === void 0 ? ChromeDefault : _ref2$Chrome,
  23655. _ref2$env = _ref2.env,
  23656. env = _ref2$env === void 0 ? envDefault : _ref2$env,
  23657. _ref2$Errors = _ref2.Errors,
  23658. errors = _ref2$Errors === void 0 ? errorsDefault : _ref2$Errors,
  23659. _ref2$Events = _ref2.Events,
  23660. Events = _ref2$Events === void 0 ? EventsDefault : _ref2$Events,
  23661. _ref2$ExceptionCodes = _ref2.ExceptionCodes,
  23662. ExceptionCodes = _ref2$ExceptionCodes === void 0 ? ExceptionCodesDefault : _ref2$ExceptionCodes,
  23663. _ref2$GetstatsAudioOu = _ref2.GetstatsAudioOutputLevelSampler,
  23664. GetStatsAudioOutputLevelSampler = _ref2$GetstatsAudioOu === void 0 ? GetStatsAudioLevelSamplerDefault : _ref2$GetstatsAudioOu,
  23665. _ref2$getStatsHelpers = _ref2.getStatsHelpers,
  23666. getStatsHelpers = _ref2$getStatsHelpers === void 0 ? getStatsHelpersDefault : _ref2$getStatsHelpers,
  23667. _ref2$hasAudioOutputL = _ref2.hasAudioOutputLevelStatCapability,
  23668. hasAudioOutputLevelStatCapability = _ref2$hasAudioOutputL === void 0 ? hasAudioOutputLevelStatCapabilityDefault : _ref2$hasAudioOutputL,
  23669. _ref2$hasRemoteStream = _ref2.hasRemoteStreamsWithWebAudio,
  23670. hasRemoteStreamsWithWebAudio = _ref2$hasRemoteStream === void 0 ? hasRemoteStreamsWithWebAudioDefault : _ref2$hasRemoteStream,
  23671. _ref2$interpretPeerCo = _ref2.interpretPeerConnectionError,
  23672. interpretPeerConnectionError = _ref2$interpretPeerCo === void 0 ? interpretPeerConnectionErrorDefault : _ref2$interpretPeerCo,
  23673. _ref2$logging = _ref2.logging,
  23674. logging = _ref2$logging === void 0 ? loggingDefault : _ref2$logging,
  23675. _ref2$MuteButton = _ref2.MuteButton,
  23676. MuteButton = _ref2$MuteButton === void 0 ? MuteButtonDefault : _ref2$MuteButton,
  23677. _ref2$NamePanel = _ref2.NamePanel,
  23678. NamePanel = _ref2$NamePanel === void 0 ? NamePanelDefault : _ref2$NamePanel,
  23679. _ref2$otError = _ref2.otError,
  23680. otError = _ref2$otError === void 0 ? otErrorDefault : _ref2$otError,
  23681. _ref2$OTErrorClass = _ref2.OTErrorClass,
  23682. OTErrorClass = _ref2$OTErrorClass === void 0 ? OTErrorClassDefault : _ref2$OTErrorClass,
  23683. _ref2$OTHelpers = _ref2.OTHelpers,
  23684. OTHelpers = _ref2$OTHelpers === void 0 ? OTHelpersDefault : _ref2$OTHelpers,
  23685. _ref2$StylableCompone = _ref2.StylableComponent,
  23686. StylableComponent = _ref2$StylableCompone === void 0 ? StylableComponentDefault : _ref2$StylableCompone,
  23687. _ref2$SubscriberPeerC = _ref2.SubscriberPeerConnection,
  23688. SubscriberPeerConnection = _ref2$SubscriberPeerC === void 0 ? SubscriberPeerConnectionDefault : _ref2$SubscriberPeerC,
  23689. _ref2$SubscribingStat = _ref2.SubscribingState,
  23690. SubscribingState = _ref2$SubscribingStat === void 0 ? SubscribingStateDefault : _ref2$SubscribingStat,
  23691. _ref2$VideoDisabledIn = _ref2.VideoDisabledIndicator,
  23692. VideoDisabledIndicator = _ref2$VideoDisabledIn === void 0 ? VideoDisabledIndicatorDefault : _ref2$VideoDisabledIn,
  23693. _ref2$AudioBlockedInd = _ref2.AudioBlockedIndicator,
  23694. AudioBlockedIndicator = _ref2$AudioBlockedInd === void 0 ? AudioBlockedIndicatorDefault : _ref2$AudioBlockedInd,
  23695. _ref2$VideoUnsupporte = _ref2.VideoUnsupportedIndicator,
  23696. VideoUnsupportedIndicator = _ref2$VideoUnsupporte === void 0 ? VideoUnsupportedIndicatorDefault : _ref2$VideoUnsupporte,
  23697. _ref2$watchFrameRate = _ref2.watchFrameRate,
  23698. watchFrameRate = _ref2$watchFrameRate === void 0 ? watchFrameRateDefault : _ref2$watchFrameRate,
  23699. _ref2$WebaudioAudioLe = _ref2.WebaudioAudioLevelSampler,
  23700. WebAudioAudioLevelSampler = _ref2$WebaudioAudioLe === void 0 ? WebAudioLevelSamplerDefault : _ref2$WebaudioAudioLe,
  23701. _ref2$createSendMetho = _ref2.createSendMethod,
  23702. createSendMethod = _ref2$createSendMetho === void 0 ? createSendMethodDefault : _ref2$createSendMetho,
  23703. _ref2$parseIceServers = _ref2.parseIceServers,
  23704. parseIceServers = _ref2$parseIceServers === void 0 ? parseIceServersDefault : _ref2$parseIceServers,
  23705. _ref2$document = _ref2.document,
  23706. document = _ref2$document === void 0 ? (typeof window !== undefined ? window : global).document : _ref2$document,
  23707. _ref2$WidgetView = _ref2.WidgetView,
  23708. WidgetView = _ref2$WidgetView === void 0 ? defaultWidgetView : _ref2$WidgetView;
  23709. const BIND_VIDEO_DELAY_MAX = 30000;
  23710. const BIND_VIDEO_DELAY_WARNING = 15000;
  23711. /**
  23712. * The Subscriber object is a representation of the local video element that is playing back
  23713. * a remote stream. The Subscriber object includes methods that let you disable and enable
  23714. * local audio playback for the subscribed stream. The <code>subscribe()</code> method of the
  23715. * {@link Session} object returns a Subscriber object.
  23716. *
  23717. * @property {Element} element The HTML DOM element containing the Subscriber.
  23718. * @property {String} id The DOM ID of the Subscriber.
  23719. * @property {Stream} stream The stream to which you are subscribing.
  23720. *
  23721. * @class Subscriber
  23722. * @augments EventDispatcher
  23723. */
  23724. const Subscriber = function Subscriber(targetElement, options, completionHandler) {
  23725. var _this = this;
  23726. if (options === void 0) {
  23727. options = {};
  23728. }
  23729. if (completionHandler === void 0) {
  23730. completionHandler = () => {};
  23731. }
  23732. if (options.analytics === undefined) {
  23733. // @todo does anyone instantiate a Subscriber outside of `session.subscribe`?
  23734. // it might be best to instantiate an analytics object and replace it on subscribe like
  23735. // we do in the publisher.
  23736. throw new Error('Subscriber requires an instance of analytics');
  23737. }
  23738. /** @type AnalyticsHelperDefault */
  23739. const analytics = options.analytics;
  23740. const _widgetId = uuid();
  23741. const _audioLevelCapable = Subscriber.hasAudioOutputLevelStatCapability() || hasRemoteStreamsWithWebAudio();
  23742. const _subscriber = this;
  23743. const _pcConnected = {};
  23744. const peerConnections = {};
  23745. /** @type {defaultWidgetView|null} */
  23746. let _widgetView;
  23747. let _chrome;
  23748. let _muteDisplayMode;
  23749. let _audioLevelMeter;
  23750. let _subscribeStartTime;
  23751. let _state;
  23752. let _audioLevelSampler;
  23753. let destroyAudioLevelBehaviour;
  23754. let _webRTCStream;
  23755. let _lastSubscribeToVideoReason;
  23756. let _attemptStartTime;
  23757. /** @type IntervalRunnerDefault | undefined */
  23758. let _streamEventHandlers;
  23759. let _isSubscribingToAudio;
  23760. let _loaded = false;
  23761. let _domId = targetElement || _widgetId;
  23762. let _session = options.session;
  23763. let _stream = options.stream;
  23764. let _audioVolume;
  23765. let _latestPositiveVolume;
  23766. let _frameRateRestricted = false;
  23767. let _frameRateWatcher;
  23768. let _lastIceConnectionState = eventNames.SUBSCRIBER_DISCONNECTED;
  23769. let _preDisconnectStats = {};
  23770. let _congestionLevel = null;
  23771. let _hasLoadedAtLeastOnce = false;
  23772. let _isVideoSupported = true;
  23773. let fallbackIceServers = [];
  23774. let _properties = defaults({}, options, {
  23775. showControls: true,
  23776. testNetwork: false,
  23777. fitMode: _stream.defaultFitMode || 'cover',
  23778. insertDefaultUI: true
  23779. });
  23780. let _currentPeerConnectionEvents;
  23781. const socket = _session._.getSocket();
  23782. const getAllPeerConnections = () => values(peerConnections);
  23783. const getPeerConnectionByPriority = priority => peerConnections[priority];
  23784. const getMaxPriority = () => last(Object.keys(peerConnections).map(Number).sort());
  23785. const getPriorityPeerConnection = () => getPeerConnectionByPriority(getMaxPriority());
  23786. const removePeerConnectionByPromise = futurePc => {
  23787. Object.keys(peerConnections).forEach(key => {
  23788. if (peerConnections[key] === futurePc) {
  23789. delete peerConnections[key];
  23790. }
  23791. });
  23792. };
  23793. const logAnalyticsEvent = (action, variation, payload, options, throttle) => {
  23794. let stats = assign({
  23795. action,
  23796. variation,
  23797. payload,
  23798. streamId: _stream ? _stream.id : null,
  23799. sessionId: _session ? _session.sessionId : null,
  23800. connectionId: _session && _session.isConnected() ? _session.connection.connectionId : null,
  23801. partnerId: _session && _session.sessionInfo ? _session.sessionInfo.partnerId : null,
  23802. subscriberId: _widgetId,
  23803. widgetType: 'Subscriber'
  23804. }, options);
  23805. if (variation === 'Failure' || variation === 'iceconnectionstatechange' && payload === 'closed') {
  23806. stats = assign(stats, _preDisconnectStats);
  23807. }
  23808. const args = [stats];
  23809. if (throttle) {
  23810. args.push(throttle);
  23811. }
  23812. analytics.logEvent(...args);
  23813. };
  23814. const connectivityState = createConnectivityState({
  23815. onInvalidTransition(transition, from) {
  23816. const err = "Invalid state transition: Event '" + transition + "' not possible in state '" + from + "'";
  23817. logging.error(err);
  23818. logAnalyticsEvent('Subscriber:InvalidStateTransition', 'Event', {
  23819. details: err
  23820. });
  23821. }
  23822. });
  23823. {
  23824. const errMessage = 'Unable to subscribe to stream in a reasonable amount of time'; // make sure we trigger an error if we are not getting any "data" after a reasonable
  23825. // amount of time
  23826. overallTimeout({
  23827. connectivityState,
  23828. onWarning() {
  23829. logConnectivityEvent('Warning', {});
  23830. },
  23831. onTimeout: () => {
  23832. if (_widgetView) {
  23833. _widgetView.addError(errMessage);
  23834. }
  23835. if (_state.isAttemptingToSubscribe()) {
  23836. _state.set('Failed');
  23837. this._disconnect({
  23838. noStateTransition: true
  23839. });
  23840. const error = otError(Errors.TIMEOUT, new Error(errMessage), ExceptionCodes.UNABLE_TO_SUBSCRIBE);
  23841. connectivityState.fail({
  23842. options: {
  23843. failureReason: 'Subscribe',
  23844. failureMessage: errMessage,
  23845. failureCode: ExceptionCodes.UNABLE_TO_SUBSCRIBE
  23846. },
  23847. error
  23848. });
  23849. }
  23850. },
  23851. warningMs: BIND_VIDEO_DELAY_WARNING,
  23852. timeoutMs: BIND_VIDEO_DELAY_MAX
  23853. });
  23854. }
  23855. _pcConnected.promise = new Promise((resolve, reject) => {
  23856. _pcConnected.resolve = resolve;
  23857. _pcConnected.reject = reject;
  23858. });
  23859. if (_properties.testNetwork && _session.sessionInfo.p2pEnabled) {
  23860. logging.warn('You cannot test your network with a relayed session. Use a routed session.');
  23861. }
  23862. this.id = _domId;
  23863. this.widgetId = _widgetId;
  23864. this.session = _session;
  23865. this.stream = _properties.stream;
  23866. _stream = _properties.stream;
  23867. this.streamId = _stream.id;
  23868. if (!_session) {
  23869. OTErrorClass.handleJsException({
  23870. errorMsg: 'OT.Subscriber must be passed a session option',
  23871. code: 2000,
  23872. target: this,
  23873. analytics
  23874. });
  23875. return null;
  23876. }
  23877. eventing(this);
  23878. _subscriber.once('subscribeComplete', function () {
  23879. try {
  23880. completionHandler(...arguments);
  23881. } catch (err) {
  23882. console.error('Completion handler threw an exception', err);
  23883. }
  23884. });
  23885. const getVariationFromState = (_ref3) => {
  23886. let transition = _ref3.transition,
  23887. from = _ref3.from;
  23888. if (transition === 'fail') {
  23889. if (from === 'connected') {
  23890. return 'Disconnect';
  23891. }
  23892. return 'Failure';
  23893. }
  23894. if (transition === 'disconnect' && from === 'connected') {
  23895. return 'Disconnect';
  23896. }
  23897. return 'Cancel';
  23898. };
  23899. connectivityState.observe({
  23900. onEnterConnecting() {
  23901. logConnectivityEvent('Attempt', null, {});
  23902. },
  23903. onEnterConnected() {
  23904. logConnectivityEvent('Success', null, {});
  23905. },
  23906. onEnterDisconnected(state, _temp2) {
  23907. let _ref4 = _temp2 === void 0 ? {} : _temp2,
  23908. _ref4$options = _ref4.options,
  23909. options = _ref4$options === void 0 ? {} : _ref4$options,
  23910. _ref4$payload = _ref4.payload,
  23911. payload = _ref4$payload === void 0 ? null : _ref4$payload;
  23912. logConnectivityEvent(getVariationFromState(state), payload, options);
  23913. }
  23914. });
  23915. connectivityState.observe({
  23916. onEnterConnected: () => {
  23917. this.trigger('subscribeComplete', undefined, this);
  23918. },
  23919. onEnterDisconnected: function onEnterDisconnected(_ref5, _temp3) {
  23920. let from = _ref5.from;
  23921. let _ref6 = _temp3 === void 0 ? {} : _temp3,
  23922. error = _ref6.error;
  23923. if (from === 'connecting') {
  23924. _this.trigger('subscribeComplete', error || new Error('An unknown error occurred'), _this);
  23925. }
  23926. }
  23927. });
  23928. createConnectivityAttemptPinger({
  23929. connectivityState,
  23930. logAttempt() {
  23931. logAnalyticsEvent('Subscribe', 'Attempting', null, {
  23932. connectionId: _session && _session.isConnected() ? _session.connection.connectionId : null
  23933. });
  23934. }
  23935. });
  23936. const logConnectivityEvent = (variation, payload, options) => {
  23937. if (variation === 'Attempt') {
  23938. _attemptStartTime = new Date().getTime();
  23939. }
  23940. if (variation === 'Failure' || variation === 'Success' || variation === 'Cancel') {
  23941. logAnalyticsEvent('Subscribe', variation, payload, (0, _extends2.default)({}, options, {
  23942. attemptDuration: new Date().getTime() - _attemptStartTime
  23943. }));
  23944. } else {
  23945. logAnalyticsEvent('Subscribe', variation, payload, options);
  23946. }
  23947. };
  23948. const logResubscribe = (variation, payload) => {
  23949. logAnalyticsEvent('ICERestart', variation, payload);
  23950. };
  23951. const recordQOS = (_ref7) => {
  23952. let parsedStats = _ref7.parsedStats,
  23953. remoteConnectionId = _ref7.remoteConnectionId,
  23954. peerPriority = _ref7.peerPriority,
  23955. peerId = _ref7.peerId;
  23956. const QoSBlob = {
  23957. widgetType: 'Subscriber',
  23958. width: _widgetView.width,
  23959. height: _widgetView.height,
  23960. audioTrack: _webRTCStream && _webRTCStream.getAudioTracks().length > 0,
  23961. hasAudio: _stream && _stream.hasAudio,
  23962. subscribeToAudio: _isSubscribingToAudio,
  23963. audioVolume: this.getAudioVolume(),
  23964. videoTrack: _webRTCStream && _webRTCStream.getVideoTracks().length > 0,
  23965. connectionId: _session ? _session.connection.connectionId : null,
  23966. hasVideo: _stream && _stream.hasVideo,
  23967. subscribeToVideo: _properties.subscribeToVideo,
  23968. congestionLevel: _congestionLevel,
  23969. streamId: _stream.id,
  23970. subscriberId: _widgetId,
  23971. duration: Math.round((now() - _subscribeStartTime) / 1000),
  23972. remoteConnectionId,
  23973. peerPriority,
  23974. peerId
  23975. };
  23976. const combinedStats = assign(QoSBlob, parsedStats);
  23977. analytics.logQOS(combinedStats);
  23978. this.trigger('qos', analytics.combineWithCommon(combinedStats));
  23979. };
  23980. const stateChangeFailed = changeFailed => {
  23981. logging.error('OT.Subscriber State Change Failed: ', changeFailed.message);
  23982. logging.debug(changeFailed);
  23983. };
  23984. const onLoaded = () => {
  23985. if (_state.isSubscribing() || !_widgetView || !_widgetView.video()) {
  23986. return;
  23987. }
  23988. _loaded = true;
  23989. if (!_hasLoadedAtLeastOnce) {
  23990. connectivityState.connect();
  23991. _hasLoadedAtLeastOnce = true;
  23992. }
  23993. logging.debug('OT.Subscriber.onLoaded');
  23994. _state.set('Subscribing');
  23995. _subscribeStartTime = now();
  23996. _widgetView.loading(false);
  23997. if (_chrome) {
  23998. _chrome.showAfterLoading();
  23999. }
  24000. if (_frameRateRestricted) {
  24001. _stream.setRestrictFrameRate(true);
  24002. }
  24003. if (_audioLevelMeter) {
  24004. _audioLevelMeter.audioOnly(_widgetView.audioOnly());
  24005. }
  24006. this.setAudioVolume(_audioVolume);
  24007. this.trigger('loaded', this);
  24008. };
  24009. const onPeerDisconnected = () => {
  24010. logging.debug('OT.Subscriber has been disconnected from the Publisher\'s PeerConnection');
  24011. connectivityState.fail({
  24012. options: {
  24013. failureReason: 'PeerConnectionError',
  24014. failureCode: ExceptionCodes.UNABLE_TO_PUBLISH,
  24015. failureMessage: 'PeerConnection disconnected'
  24016. },
  24017. error: otError(errors.DISCONNECTED, new Error('ClientDisconnected'))
  24018. });
  24019. this._disconnect({
  24020. noStateTransition: true
  24021. });
  24022. if (_state.isAttemptingToSubscribe() || _state.isSubscribing()) {
  24023. _state.set('Failed');
  24024. }
  24025. };
  24026. const onVideoError = plainErr => {
  24027. const err = otError(errors.MEDIA_ERR_DECODE, plainErr, plainErr.code || ExceptionCodes.P2P_CONNECTION_FAILED);
  24028. err.message = "OT.Subscriber while playing stream: " + err.message;
  24029. logging.error('OT.Subscriber.onVideoError');
  24030. connectivityState.fail({
  24031. options: {
  24032. failureReason: 'VideoElement',
  24033. failureMessage: err.message,
  24034. failureCode: err.code || ExceptionCodes.P2P_CONNECTION_FAILED
  24035. },
  24036. error: err
  24037. });
  24038. const isAttemptingToSubscribe = _state.isAttemptingToSubscribe();
  24039. _state.set('Failed');
  24040. if (!isAttemptingToSubscribe) {
  24041. // FIXME: This emits a string instead of an error here for backwards compatibility despite
  24042. // being undocumented. When possible we should remove access to this and other undocumented
  24043. // events, and restore emitting actual errors here.
  24044. _subscriber.trigger('error', err.message);
  24045. }
  24046. OTErrorClass.handleJsException({
  24047. error: err,
  24048. code: ExceptionCodes.UNABLE_TO_SUBSCRIBE,
  24049. // @todo why do we override the code?
  24050. target: _subscriber,
  24051. analytics
  24052. });
  24053. };
  24054. const onSubscriberCreateError = rawError => {
  24055. // @todo v3 These errors used to come from the peer connection hence the mention
  24056. // of peer connection in the logs/ errors. However they actually have nothing to do
  24057. // with the peer connection. I have chosen to keep the messages / errors the same for
  24058. // now, but we should consider changing them
  24059. const err = interpretSubscriberCreateError(rawError);
  24060. OTErrorClass.handleJsException({
  24061. error: err,
  24062. code: err.code,
  24063. target: _subscriber,
  24064. analytics
  24065. });
  24066. this._disconnect({
  24067. noStateTransition: true
  24068. });
  24069. const options = {
  24070. failureReason: 'Subscribe',
  24071. failureMessage: "OT.Subscriber PeerConnection Error: " + err.message,
  24072. failureCode: ExceptionCodes.P2P_CONNECTION_FAILED
  24073. };
  24074. logAnalyticsEvent('createPeerConnection', 'Failure', {}, options);
  24075. _showError(err.code);
  24076. connectivityState.fail({
  24077. options,
  24078. error: otError(err.name, new Error('Subscribe: Subscriber PeerConnection with connection (not found) ' + ("failed: " + err.message)), err.code)
  24079. });
  24080. if (err.name === Errors.STREAM_NOT_FOUND) {
  24081. // Usually, the subscriber should be kept in an error state when the peer connection fails
  24082. // because it still exists in the session. But when we get a 404 that means it doesn't
  24083. // exist, even if the session still thinks it does.
  24084. this._destroy({
  24085. reason: 'streamNotFound',
  24086. noStateTransition: true
  24087. });
  24088. }
  24089. };
  24090. const onPeerConnectionFailure = (code, reason, peerConnection, prefix) => {
  24091. if (prefix === 'SetRemoteDescription' && !_isVideoSupported && reason.match(/Unsupported video without audio for fallback/)) {
  24092. if (_widgetView) {
  24093. _widgetView.addError('The stream is unable to be played.', 'Your browser does not support the video format.');
  24094. }
  24095. let err;
  24096. if (OTHelpers.env.name === 'Safari') {
  24097. err = new Error('VP8 is not supported in this version of Safari. You might want to consider switching to ' + 'an H264 project. See https://tokbox.com/safari for more information.');
  24098. } else {
  24099. err = new Error('Video format not supported in this browser.');
  24100. }
  24101. err.code = ExceptionCodes.UNSUPPORTED_VIDEO_CODEC;
  24102. onVideoError(err);
  24103. return;
  24104. }
  24105. if (prefix === 'ICEWorkflow' && _session.sessionInfo.reconnection && _loaded) {
  24106. logging.debug('Ignoring peer connection failure due to possibility of reconnection.');
  24107. return;
  24108. }
  24109. let errorCode;
  24110. if (prefix === 'ICEWorkflow') {
  24111. errorCode = ExceptionCodes.SUBSCRIBER_ICE_WORKFLOW_FAILED;
  24112. } else if (code === ExceptionCodes.STREAM_LIMIT_EXCEEDED) {
  24113. errorCode = code;
  24114. } else {
  24115. errorCode = ExceptionCodes.P2P_CONNECTION_FAILED;
  24116. }
  24117. const options = {
  24118. failureReason: prefix || 'PeerConnectionError',
  24119. failureMessage: "OT.Subscriber PeerConnection Error: " + reason,
  24120. failureCode: errorCode
  24121. };
  24122. const error = interpretPeerConnectionError(code, reason, prefix, '(not found)', 'Subscriber');
  24123. connectivityState.fail({
  24124. options,
  24125. error
  24126. });
  24127. if (_state.isAttemptingToSubscribe()) {
  24128. // We weren't subscribing yet so this was a failure in setting
  24129. // up the PeerConnection or receiving the initial stream.
  24130. const payload = {
  24131. hasRelayCandidates: peerConnection && peerConnection.hasRelayCandidates()
  24132. };
  24133. logAnalyticsEvent('createPeerConnection', 'Failure', payload, options);
  24134. _state.set('Failed');
  24135. } else if (_state.isSubscribing()) {
  24136. // we were disconnected after we were already subscribing
  24137. _state.set('Failed');
  24138. this.trigger('error', reason);
  24139. }
  24140. this._disconnect({
  24141. noStateTransition: true
  24142. });
  24143. if (Number(code) === 404) {
  24144. // Usually, the subscriber should be kept in an error state when the peer connection fails
  24145. // because it still exists in the session. But when we get a 404 that means it doesn't
  24146. // exist, even if the session still thinks it does.
  24147. this._destroy({
  24148. noStateTransition: true
  24149. });
  24150. }
  24151. OTErrorClass.handleJsException({
  24152. errorMsg: "OT.Subscriber PeerConnection Error: " + reason,
  24153. errorCode,
  24154. target: this,
  24155. analytics
  24156. });
  24157. _showError(code);
  24158. };
  24159. const onRemoteStreamAdded = /*#__PURE__*/function () {
  24160. var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(webRTCStream) {
  24161. var videoContainerOptions, currentPc, video, videoIndicator, videoElementCreated, peerConnection;
  24162. return _regenerator.default.wrap(function _callee2$(_context2) {
  24163. while (1) switch (_context2.prev = _context2.next) {
  24164. case 0:
  24165. _webRTCStream = webRTCStream;
  24166. logging.debug('OT.Subscriber.onRemoteStreamAdded');
  24167. _context2.prev = 2;
  24168. _context2.next = 5;
  24169. return waitUntil(() => hasExpectedTracks(_webRTCStream, _stream));
  24170. case 5:
  24171. _context2.next = 14;
  24172. break;
  24173. case 7:
  24174. _context2.prev = 7;
  24175. _context2.t0 = _context2["catch"](2);
  24176. if (!(_context2.t0.message === 'TIMEOUT')) {
  24177. _context2.next = 13;
  24178. break;
  24179. }
  24180. logging.error('The expected tracks never arrived');
  24181. _context2.next = 14;
  24182. break;
  24183. case 13:
  24184. throw _context2.t0;
  24185. case 14:
  24186. _state.set('BindingRemoteStream'); // Disable the audio/video, if needed
  24187. _this.subscribeToAudio(_isSubscribingToAudio, false);
  24188. _lastSubscribeToVideoReason = 'loading';
  24189. _this.subscribeToVideo(_properties.subscribeToVideo, 'loading'); // setting resolution and frame rate doesn't work in P2P
  24190. if (!_session.sessionInfo.p2pEnabled) {
  24191. _this.setPreferredResolution(_properties.preferredResolution);
  24192. _this.setPreferredFrameRate(_properties.preferredFrameRate);
  24193. }
  24194. videoContainerOptions = {
  24195. error: onVideoError,
  24196. audioVolume: _audioVolume
  24197. }; // This is a workaround for a bug in Chrome where a track disabled on
  24198. // the remote end doesn't fire loadedmetadata causing the subscriber to timeout
  24199. // https://jira.tokbox.com/browse/OPENTOK-15605
  24200. // Also https://jira.tokbox.com/browse/OPENTOK-16425
  24201. // Also https://tokbox.atlassian.net/browse/OPENTOK-27112
  24202. webRTCStream.getVideoTracks().forEach(track => {
  24203. if ((typeof window !== undefined ? window : global).webkitMediaStream) {
  24204. track.enabled = false;
  24205. } else {
  24206. track.enabled = _stream.hasVideo && _properties.subscribeToVideo;
  24207. }
  24208. });
  24209. _context2.prev = 21;
  24210. _context2.next = 24;
  24211. return _widgetView.bindVideo(webRTCStream, videoContainerOptions);
  24212. case 24:
  24213. _context2.next = 32;
  24214. break;
  24215. case 26:
  24216. _context2.prev = 26;
  24217. _context2.t1 = _context2["catch"](21);
  24218. if (!(_context2.t1 instanceof CancellationError)) {
  24219. _context2.next = 30;
  24220. break;
  24221. }
  24222. return _context2.abrupt("return");
  24223. case 30:
  24224. onVideoError(_context2.t1);
  24225. throw _context2.t1;
  24226. case 32:
  24227. _context2.prev = 32;
  24228. _widgetView.loading(false);
  24229. return _context2.finish(32);
  24230. case 35:
  24231. currentPc = getPriorityPeerConnection();
  24232. getAllPeerConnections().filter(x => x !== currentPc).forEach( /*#__PURE__*/function () {
  24233. var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(futurePc) {
  24234. var pc;
  24235. return _regenerator.default.wrap(function _callee$(_context) {
  24236. while (1) switch (_context.prev = _context.next) {
  24237. case 0:
  24238. removePeerConnectionByPromise(futurePc);
  24239. _context.next = 3;
  24240. return futurePc;
  24241. case 3:
  24242. pc = _context.sent;
  24243. logging.debug('closing old peer connection');
  24244. pc.close();
  24245. case 6:
  24246. case "end":
  24247. return _context.stop();
  24248. }
  24249. }, _callee);
  24250. }));
  24251. return function (_x2) {
  24252. return _ref9.apply(this, arguments);
  24253. };
  24254. }());
  24255. if (!_state.isDestroyed()) {
  24256. _context2.next = 39;
  24257. break;
  24258. }
  24259. throw new Error('Subscriber destroyed');
  24260. case 39:
  24261. if ((typeof window !== undefined ? window : global).webkitMediaStream) {
  24262. // Enable any video streams that we previously disabled for OPENTOK-27112
  24263. webRTCStream.getVideoTracks().forEach(track => {
  24264. track.enabled = _stream.hasVideo && _properties.subscribeToVideo;
  24265. });
  24266. }
  24267. video = _widgetView && _widgetView.video();
  24268. if (video) {
  24269. video.orientation({
  24270. width: _stream.videoDimensions.width,
  24271. height: _stream.videoDimensions.height,
  24272. videoOrientation: _stream.videoDimensions.orientation
  24273. });
  24274. }
  24275. videoIndicator = _chrome && _chrome.videoUnsupportedIndicator;
  24276. if (videoIndicator) {
  24277. videoIndicator.setVideoUnsupported(!_isVideoSupported);
  24278. }
  24279. videoElementCreated = new Promise((resolve, reject) => {
  24280. const video = _widgetView && _widgetView.video();
  24281. if (video && video.domElement()) {
  24282. resolve();
  24283. return;
  24284. }
  24285. _widgetView.once('videoElementCreated', resolve);
  24286. _subscriber.once('destroyed', reject);
  24287. });
  24288. _context2.next = 47;
  24289. return videoElementCreated;
  24290. case 47:
  24291. _context2.next = 49;
  24292. return _pcConnected.promise;
  24293. case 49:
  24294. onLoaded(); // if the audioLevelSampler implementation requires a stream we need to set it now
  24295. if (_audioLevelSampler && 'webRTCStream' in _audioLevelSampler && webRTCStream.getAudioTracks().length > 0) {
  24296. _audioLevelSampler.webRTCStream(webRTCStream);
  24297. } // We only need frame rate watcher in Safari because framesPerSecond is
  24298. // always zero so we need to rely on calculating the difference of
  24299. // framesDecoded across multiple getStats invocations.
  24300. // See https://bugs.webkit.org/show_bug.cgi?id=172682
  24301. if (!(OTHelpers.env.name === 'Safari' || OTHelpers.env.isChromiumEdge)) {
  24302. _context2.next = 57;
  24303. break;
  24304. }
  24305. if (_frameRateWatcher) {
  24306. _frameRateWatcher.destroy();
  24307. _frameRateWatcher = null;
  24308. }
  24309. _context2.next = 55;
  24310. return getPriorityPeerConnection();
  24311. case 55:
  24312. peerConnection = _context2.sent;
  24313. _frameRateWatcher = watchFrameRate(peerConnection.getStats.bind(peerConnection));
  24314. case 57:
  24315. _this.trigger('streamAdded', _this);
  24316. case 58:
  24317. case "end":
  24318. return _context2.stop();
  24319. }
  24320. }, _callee2, null, [[2, 7], [21, 26, 32, 35]]);
  24321. }));
  24322. return function onRemoteStreamAdded(_x) {
  24323. return _ref8.apply(this, arguments);
  24324. };
  24325. }();
  24326. const onRemoteStreamRemoved = webRTCStream => {
  24327. _webRTCStream = null;
  24328. logging.debug('OT.Subscriber.onStreamRemoved');
  24329. const video = _widgetView && _widgetView.video();
  24330. if (video && video.stream === webRTCStream) {
  24331. _widgetView.destroyVideo();
  24332. }
  24333. this.trigger('streamRemoved', this);
  24334. };
  24335. const onRemoteVideoSupported = supported => {
  24336. // as _isVideoSupported is true by default, this will only ever be hit if we receive
  24337. // a onRemoteVideoSupported false, and then a onRemoteVideoSupported true. In other words
  24338. // it will not trigger an event if video is enabled and is never disabled due to codec issues.
  24339. if (_isVideoSupported !== supported) {
  24340. this.dispatchEvent(new Events.VideoEnabledChangedEvent(supported ? 'videoEnabled' : 'videoDisabled', {
  24341. reason: supported ? 'codecChanged' : 'codecNotSupported'
  24342. }));
  24343. }
  24344. _isVideoSupported = supported;
  24345. };
  24346. const audioBlockedStateChange = value => {
  24347. _widgetView.setAudioBlockedUi(value);
  24348. const indicator = _chrome && _chrome.audioBlockedIndicator;
  24349. if (indicator) {
  24350. indicator.setAudioBlocked(value);
  24351. }
  24352. const videoIndicator = _chrome && _chrome.videoUnsupportedIndicator;
  24353. if (videoIndicator) {
  24354. videoIndicator.setVideoUnsupported(!value && !_isVideoSupported);
  24355. }
  24356. };
  24357. this.on('audioBlocked', () => {
  24358. audioBlockedStateChange(true);
  24359. });
  24360. this.on('audioUnblocked', () => {
  24361. audioBlockedStateChange(false);
  24362. });
  24363. const connectionStateMap = {
  24364. new: eventNames.SUBSCRIBER_DISCONNECTED,
  24365. checking: eventNames.SUBSCRIBER_DISCONNECTED,
  24366. connected: eventNames.SUBSCRIBER_CONNECTED,
  24367. completed: eventNames.SUBSCRIBER_CONNECTED,
  24368. disconnected: eventNames.SUBSCRIBER_DISCONNECTED
  24369. };
  24370. const onIceConnectionStateChange = state => {
  24371. const mappedState = connectionStateMap[state];
  24372. if (mappedState && mappedState !== _lastIceConnectionState) {
  24373. _lastIceConnectionState = mappedState;
  24374. if (_widgetView) {
  24375. _widgetView.loading(mappedState !== eventNames.SUBSCRIBER_CONNECTED);
  24376. }
  24377. logging.debug("OT.Subscriber.connectionStateChanged to " + state);
  24378. this.dispatchEvent(new Events.ConnectionStateChangedEvent(mappedState, this));
  24379. }
  24380. };
  24381. const onIceRestartSuccess = () => {
  24382. logResubscribe('Success');
  24383. };
  24384. const onIceRestartFailure = () => {
  24385. logResubscribe('Failure', {
  24386. reason: 'ICEWorkflow',
  24387. message: 'OT.Subscriber PeerConnection Error: ' + 'The stream was unable to connect due to a network error.' + ' Make sure your connection isn\'t blocked by a firewall.'
  24388. });
  24389. };
  24390. const streamUpdated = event => {
  24391. const video = _widgetView && _widgetView.video();
  24392. switch (event.changedProperty) {
  24393. case 'videoDimensions':
  24394. if (!video) {
  24395. // Ignore videoDimensions updates before video is created OPENTOK-17253
  24396. break;
  24397. }
  24398. video.orientation({
  24399. width: event.newValue.width,
  24400. height: event.newValue.height,
  24401. videoOrientation: event.newValue.orientation
  24402. });
  24403. this.dispatchEvent(new Events.VideoDimensionsChangedEvent(this, event.oldValue, event.newValue));
  24404. break;
  24405. case 'videoDisableWarning':
  24406. if (_chrome) {
  24407. _chrome.videoDisabledIndicator.setWarning(event.newValue);
  24408. }
  24409. this.dispatchEvent(new Events.VideoDisableWarningEvent(event.newValue ? 'videoDisableWarning' : 'videoDisableWarningLifted'));
  24410. _congestionLevel = event.newValue === 'videoDisableWarning' ? 1 : null;
  24411. break;
  24412. case 'hasVideo':
  24413. // @todo setAudioOnly affects peer connections, what happens with new ones?
  24414. setAudioOnly(!_stream.hasVideo || !_properties.subscribeToVideo);
  24415. this.dispatchEvent(new Events.VideoEnabledChangedEvent(_stream.hasVideo ? 'videoEnabled' : 'videoDisabled', {
  24416. reason: 'publishVideo'
  24417. }));
  24418. break;
  24419. case 'hasAudio':
  24420. _muteDisplayMode.update();
  24421. break;
  24422. default:
  24423. }
  24424. }; // Use _stream.getChannelsOfType instead of _webRTCStream.getAudioTracks
  24425. // because its available as soon as Subscriber is instantiated.
  24426. const _hasAudioTracks = () => _stream.getChannelsOfType('audio').length > 0; // / Chrome
  24427. _muteDisplayMode = {
  24428. get() {
  24429. // Use buttonDisplayMode if we have an audio track, even if its muted
  24430. return _hasAudioTracks() ? _subscriber.getStyle('buttonDisplayMode') : 'off';
  24431. },
  24432. update() {
  24433. const mode = _muteDisplayMode.get();
  24434. if (_chrome) {
  24435. _chrome.muteButton.setDisplayMode(mode);
  24436. _chrome.backingBar.setMuteMode(mode);
  24437. }
  24438. }
  24439. };
  24440. const updateChromeForStyleChange = (key, value
  24441. /* , oldValue */
  24442. ) => {
  24443. if (!_chrome) {
  24444. return;
  24445. }
  24446. switch (key) {
  24447. case 'nameDisplayMode':
  24448. _chrome.name.setDisplayMode(value);
  24449. _chrome.backingBar.setNameMode(value);
  24450. break;
  24451. case 'videoUnsupportedDisplayMode':
  24452. _chrome.videoUnsupportedIndicator.setDisplayMode(value);
  24453. break;
  24454. case 'videoDisabledDisplayMode':
  24455. _chrome.videoDisabledIndicator.setDisplayMode(value);
  24456. break;
  24457. case 'audioBlockedDisplayMode':
  24458. _chrome.audioBlockedIndicator.setDisplayMode(value);
  24459. break;
  24460. case 'showArchiveStatus':
  24461. _chrome.archive.setShowArchiveStatus(value);
  24462. break;
  24463. case 'buttonDisplayMode':
  24464. _muteDisplayMode.update();
  24465. break;
  24466. case 'audioLevelDisplayMode':
  24467. _chrome.audioLevel.setDisplayMode(value);
  24468. break;
  24469. case 'bugDisplayMode':
  24470. // bugDisplayMode can't be updated but is used by some partners
  24471. break;
  24472. case 'backgroundImageURI':
  24473. _widgetView.setBackgroundImageURI(value);
  24474. break;
  24475. default:
  24476. }
  24477. };
  24478. const _createChrome = () => {
  24479. const widgets = {
  24480. backingBar: new BackingBar({
  24481. nameMode: !_properties.name ? 'off' : this.getStyle('nameDisplayMode'),
  24482. muteMode: _muteDisplayMode.get()
  24483. }),
  24484. name: new NamePanel({
  24485. name: _properties.name,
  24486. mode: this.getStyle('nameDisplayMode')
  24487. }),
  24488. muteButton: new MuteButton({
  24489. muted: _audioVolume === 0,
  24490. mode: _muteDisplayMode.get()
  24491. })
  24492. };
  24493. if (_audioLevelCapable) {
  24494. const audioLevelTransformer = new AudioLevelTransformer();
  24495. _audioLevelMeter = new AudioLevelMeter({
  24496. mode: _subscriber.getStyle('audioLevelDisplayMode')
  24497. });
  24498. const updateAudioLevel = new RafRunner(() => {
  24499. _audioLevelMeter.setValue(audioLevelTransformer.transform(this.loudness));
  24500. });
  24501. _audioLevelMeter.watchVisibilityChanged(visible => {
  24502. if (visible) {
  24503. updateAudioLevel.start();
  24504. } else {
  24505. updateAudioLevel.stop();
  24506. }
  24507. });
  24508. _audioLevelMeter.setDisplayMode(this.getStyle('audioLevelDisplayMode'));
  24509. _audioLevelMeter.audioOnly(false);
  24510. widgets.audioLevel = _audioLevelMeter;
  24511. }
  24512. widgets.videoDisabledIndicator = new VideoDisabledIndicator({
  24513. mode: this.getStyle('videoDisabledDisplayMode')
  24514. });
  24515. widgets.audioBlockedIndicator = new AudioBlockedIndicator({
  24516. mode: this.getStyle('audioBlockedDisplayMode')
  24517. });
  24518. widgets.videoUnsupportedIndicator = new VideoUnsupportedIndicator({
  24519. mode: this.getStyle('videoUnsupportedDisplayMode')
  24520. });
  24521. if (_widgetView && _widgetView.domElement) {
  24522. _chrome = new Chrome({
  24523. parent: _widgetView.domElement
  24524. }).set(widgets).on({
  24525. muted() {
  24526. _subscriber.setAudioVolume(0);
  24527. },
  24528. unmuted() {
  24529. _subscriber.setAudioVolume(_latestPositiveVolume);
  24530. }
  24531. }, this); // Hide the chrome until we explicitly show it
  24532. _chrome.hideWhileLoading();
  24533. }
  24534. };
  24535. const _showError = code => {
  24536. let errorMessage;
  24537. let helpMessage; // Display the error message inside the container, assuming it's
  24538. // been created by now.
  24539. if (_widgetView) {
  24540. if (code === ExceptionCodes.STREAM_LIMIT_EXCEEDED) {
  24541. errorMessage = 'The stream was unable to connect.';
  24542. helpMessage = 'The limit for the number of media streams has been reached.';
  24543. } else {
  24544. errorMessage = 'The stream was unable to connect due to a network error.';
  24545. if (_hasLoadedAtLeastOnce) {
  24546. helpMessage = 'Ensure you have a stable connection and try again.';
  24547. } else {
  24548. helpMessage = 'Make sure you have a stable network connection and that it isn\'t ' + 'blocked by a firewall.';
  24549. }
  24550. }
  24551. _widgetView.addError(errorMessage, helpMessage);
  24552. }
  24553. };
  24554. StylableComponent(this, {
  24555. nameDisplayMode: 'auto',
  24556. buttonDisplayMode: 'auto',
  24557. audioLevelDisplayMode: 'auto',
  24558. videoDisabledDisplayMode: 'auto',
  24559. audioBlockedDisplayMode: 'auto',
  24560. backgroundImageURI: null,
  24561. showArchiveStatus: true,
  24562. showMicButton: true
  24563. }, _properties.showControls, payload => {
  24564. logAnalyticsEvent('SetStyle', 'Subscriber', payload, null, 0.1);
  24565. });
  24566. function setAudioOnly(audioOnly) {
  24567. getAllPeerConnections().forEach( /*#__PURE__*/function () {
  24568. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(peerConnection) {
  24569. return _regenerator.default.wrap(function _callee3$(_context3) {
  24570. while (1) switch (_context3.prev = _context3.next) {
  24571. case 0:
  24572. _context3.next = 2;
  24573. return peerConnection;
  24574. case 2:
  24575. _context3.sent.subscribeToVideo(!audioOnly);
  24576. case 3:
  24577. case "end":
  24578. return _context3.stop();
  24579. }
  24580. }, _callee3);
  24581. }));
  24582. return function (_x3) {
  24583. return _ref10.apply(this, arguments);
  24584. };
  24585. }());
  24586. if (_widgetView) {
  24587. _widgetView.audioOnly(audioOnly);
  24588. _widgetView.showPoster(audioOnly);
  24589. }
  24590. if (_audioLevelMeter) {
  24591. _audioLevelMeter.audioOnly(audioOnly);
  24592. }
  24593. } // logs an analytics event for getStats on the first call
  24594. const notifyGetStatsCalled = once(() => {
  24595. logAnalyticsEvent('GetStats', 'Called');
  24596. });
  24597. this._destroy = (_ref11) => {
  24598. let _ref11$reason = _ref11.reason,
  24599. reason = _ref11$reason === void 0 ? 'Unknown' : _ref11$reason,
  24600. quiet = _ref11.quiet,
  24601. _ref11$noStateTransit = _ref11.noStateTransition,
  24602. noStateTransition = _ref11$noStateTransit === void 0 ? false : _ref11$noStateTransit;
  24603. if (_state.isDestroyed()) {
  24604. return this;
  24605. }
  24606. _state.set('Destroyed');
  24607. if (_frameRateWatcher) {
  24608. _frameRateWatcher.destroy();
  24609. _frameRateWatcher = null;
  24610. }
  24611. _preDisconnectStats = {
  24612. sessionId: _session.sessionId,
  24613. connectionId: _session && _session.isConnected() ? _session.connection.connectionId : null,
  24614. partnerId: _session && _session.sessionInfo ? _session.sessionInfo.partnerId : null,
  24615. streamId: _stream && !_stream.destroyed ? _stream.id : null
  24616. };
  24617. this._disconnect({
  24618. reason,
  24619. noStateTransition
  24620. });
  24621. if (_chrome) {
  24622. _chrome.destroy();
  24623. _chrome = null;
  24624. }
  24625. if (_widgetView) {
  24626. _widgetView.destroy();
  24627. _widgetView.off();
  24628. _widgetView = null;
  24629. this.element = null;
  24630. }
  24631. if (_stream && !_stream.destroyed) {
  24632. logAnalyticsEvent('unsubscribe', null, {
  24633. streamId: _stream.id
  24634. });
  24635. }
  24636. _stream.off(_streamEventHandlers, this);
  24637. this.id = null;
  24638. _domId = null;
  24639. this.stream = null;
  24640. _stream = null;
  24641. this.streamId = null;
  24642. this.session = null;
  24643. _session = null;
  24644. _properties = null;
  24645. if (quiet !== true) {
  24646. this.dispatchEvent(new Events.DestroyedEvent(eventNames.SUBSCRIBER_DESTROYED, this, reason));
  24647. this.off();
  24648. }
  24649. return this;
  24650. };
  24651. this.destroy = function (reason, quiet) {
  24652. if (reason === void 0) {
  24653. reason = 'Unsubscribe';
  24654. }
  24655. logging.warn('Subscriber#destroy is deprecated and will be removed. Please use Session#unsubscribe instead');
  24656. _this._destroy({
  24657. reason,
  24658. quiet
  24659. });
  24660. };
  24661. this._disconnect = function (_temp4) {
  24662. let _ref12 = _temp4 === void 0 ? {} : _temp4,
  24663. _ref12$reason = _ref12.reason,
  24664. reason = _ref12$reason === void 0 ? 'Unknown' : _ref12$reason,
  24665. noStateTransition = _ref12.noStateTransition;
  24666. // known reasons:
  24667. // forceUnpublished (publisher stream was destroyed by forceUnpublish)
  24668. // clientDisconnected (publisher unpublished)
  24669. // Unsubscribe (when calling session.unsubscribe)
  24670. // Unknown (when reason is not determined)
  24671. if (!noStateTransition) {
  24672. const error = reason === 'Unsubscribe' ? undefined : otError(errors.STREAM_DESTROYED, new Error('Stream was destroyed before it could be subscribed to'));
  24673. connectivityState.disconnect({
  24674. payload: {
  24675. reason
  24676. },
  24677. error
  24678. });
  24679. }
  24680. if (!_state.isDestroyed() && !_state.isFailed()) {
  24681. // If we are already in the destroyed state then disconnect
  24682. // has been called after (or from within) destroy.
  24683. _state.set('NotSubscribing');
  24684. }
  24685. if (_widgetView) {
  24686. _widgetView.destroyVideo();
  24687. } // @todo check peer connection destroy triggers disconnect, and then gets logged...
  24688. getAllPeerConnections().forEach( /*#__PURE__*/function () {
  24689. var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(peerConnection) {
  24690. return _regenerator.default.wrap(function _callee4$(_context4) {
  24691. while (1) switch (_context4.prev = _context4.next) {
  24692. case 0:
  24693. _context4.next = 2;
  24694. return peerConnection;
  24695. case 2:
  24696. _context4.sent.destroy();
  24697. case 3:
  24698. case "end":
  24699. return _context4.stop();
  24700. }
  24701. }, _callee4);
  24702. }));
  24703. return function (_x4) {
  24704. return _ref13.apply(this, arguments);
  24705. };
  24706. }());
  24707. Object.keys(peerConnections).forEach(key => {
  24708. delete peerConnections[key];
  24709. }); // Unsubscribe us from the stream, if it hasn't already been destroyed
  24710. if (socket.is('connected') && _stream && !_stream.destroyed) {
  24711. // Notify the server components
  24712. // @todo I assume we don't want to send this message, but is there anything
  24713. // we need to do in p2p->mantis for when a peer conn is destroyed?
  24714. socket.subscriberDestroy(_stream.id, _this.widgetId);
  24715. }
  24716. };
  24717. this.disconnect = () => {
  24718. logging.warn('Subscriber#disconnect is deprecated and will be removed. Please use Session#unsubscribe instead');
  24719. this._disconnect({
  24720. reason: 'Unsubscribe'
  24721. });
  24722. };
  24723. const processOffer = /*#__PURE__*/function () {
  24724. var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(_ref14) {
  24725. var peerPriority, peerId, fromConnectionId, uri, send, log, logQoS;
  24726. return _regenerator.default.wrap(function _callee5$(_context5) {
  24727. while (1) switch (_context5.prev = _context5.next) {
  24728. case 0:
  24729. peerPriority = _ref14.peerPriority, peerId = _ref14.peerId, fromConnectionId = _ref14.fromConnectionId;
  24730. if (getPeerConnectionByPriority(peerPriority)) {
  24731. _context5.next = 9;
  24732. break;
  24733. }
  24734. logging.info("PeerConnection escalation to " + peerPriority);
  24735. uri = constructSubscriberUri({
  24736. apiKey: _session.apiKey,
  24737. sessionId: _session.sessionId,
  24738. streamId: _stream.id,
  24739. subscriberId: _this.widgetId
  24740. });
  24741. send = createSendMethod({
  24742. socket: _this.session._.getSocket(),
  24743. uri,
  24744. content: {
  24745. peerPriority,
  24746. peerId
  24747. }
  24748. });
  24749. log = function log(action, variation, payload, options, throttle) {
  24750. if (options === void 0) {
  24751. options = {};
  24752. }
  24753. const transformedOptions = (0, _extends2.default)({
  24754. peerId,
  24755. peerPriority
  24756. }, options);
  24757. return logAnalyticsEvent(action, variation, payload, transformedOptions, throttle);
  24758. };
  24759. logQoS = qos => recordQOS((0, _extends2.default)({}, qos, {
  24760. peerId,
  24761. peerPriority,
  24762. remoteConnectionId: fromConnectionId
  24763. }));
  24764. _context5.next = 9;
  24765. return _this._setupPeerConnection({
  24766. peerPriority,
  24767. send,
  24768. log,
  24769. logQoS
  24770. });
  24771. case 9:
  24772. case "end":
  24773. return _context5.stop();
  24774. }
  24775. }, _callee5);
  24776. }));
  24777. return function processOffer(_x5) {
  24778. return _ref15.apply(this, arguments);
  24779. };
  24780. }();
  24781. this.processMessage = /*#__PURE__*/function () {
  24782. var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(type, fromConnectionId, message) {
  24783. var peerPriority, peerId, peerConnection;
  24784. return _regenerator.default.wrap(function _callee6$(_context6) {
  24785. while (1) switch (_context6.prev = _context6.next) {
  24786. case 0:
  24787. logging.debug("OT.Subscriber.processMessage: Received " + type + " message from " + fromConnectionId);
  24788. logging.debug(message);
  24789. peerPriority = Number(get(message, 'content.peerPriority', 0));
  24790. peerId = get(message, 'content.peerId');
  24791. if (!(peerPriority < getMaxPriority())) {
  24792. _context6.next = 7;
  24793. break;
  24794. }
  24795. logging.debug("Ignoring " + type + " message from " + fromConnectionId + " with " + peerPriority + ". PeerConnection is marked as obsolete");
  24796. return _context6.abrupt("return");
  24797. case 7:
  24798. if (!(type === 'offer')) {
  24799. _context6.next = 10;
  24800. break;
  24801. }
  24802. _context6.next = 10;
  24803. return processOffer({
  24804. peerPriority,
  24805. peerId,
  24806. fromConnectionId
  24807. });
  24808. case 10:
  24809. _context6.next = 12;
  24810. return getPeerConnectionByPriority(peerPriority);
  24811. case 12:
  24812. peerConnection = _context6.sent;
  24813. peerConnection.processMessage(type, message);
  24814. case 14:
  24815. case "end":
  24816. return _context6.stop();
  24817. }
  24818. }, _callee6);
  24819. }));
  24820. return function (_x6, _x7, _x8) {
  24821. return _ref16.apply(this, arguments);
  24822. };
  24823. }();
  24824. this.disableVideo = active => {
  24825. if (!active) {
  24826. logging.warn('Due to high packet loss and low bandwidth, video has been disabled');
  24827. } else if (_lastSubscribeToVideoReason === 'auto') {
  24828. logging.info('Video has been re-enabled');
  24829. } else {
  24830. logging.info('Video was not re-enabled because it was manually disabled');
  24831. return;
  24832. }
  24833. this.subscribeToVideo(active, 'auto');
  24834. const payload = active ? {
  24835. videoEnabled: true
  24836. } : {
  24837. videoDisabled: true
  24838. };
  24839. logAnalyticsEvent('updateQuality', 'video', payload);
  24840. };
  24841. /**
  24842. * Returns the base-64-encoded string of PNG data representing the Subscriber video.
  24843. *
  24844. * <p>You can use the string as the value for a data URL scheme passed to the src parameter of
  24845. * an image file, as in the following:</p>
  24846. *
  24847. * <pre>
  24848. * var imgData = subscriber.getImgData();
  24849. *
  24850. * var img = document.createElement("img");
  24851. * img.setAttribute("src", "data:image/png;base64," + imgData);
  24852. * var imgWin = window.open("about:blank", "Screenshot");
  24853. * imgWin.document.write("&lt;body&gt;&lt;/body&gt;");
  24854. * imgWin.document.body.appendChild(img);
  24855. * </pre>
  24856. * @method #getImgData
  24857. * @memberOf Subscriber
  24858. * @return {String} The base-64 encoded string. Returns an empty string if there is no video.
  24859. */
  24860. this.getImgData = () => {
  24861. if (!this.isSubscribing()) {
  24862. logging.error('OT.Subscriber.getImgData: Cannot getImgData before the Subscriber ' + 'is subscribing.');
  24863. return null;
  24864. }
  24865. const video = _widgetView && _widgetView.video();
  24866. return video ? video.imgData() : null;
  24867. };
  24868. /**
  24869. * Returns the details on the subscriber stream quality, including the following:
  24870. *
  24871. * <ul>
  24872. *
  24873. * <li>Total audio and video packets lost</li>
  24874. * <li>Total audio and video packets received</li>
  24875. * <li>Total audio and video bytes received</li>
  24876. * <li>Current video frame rate</li>
  24877. *
  24878. * </ul>
  24879. *
  24880. * You can publish a test stream, subscribe to it (on the publishing client), and use this method
  24881. * to check its quality. Based on the stream's quality, you can determine what video resolution is
  24882. * supported and whether conditions support video or audio. You can then publish an appropriate
  24883. * stream, based on the results. When using this method to test a stream published by your
  24884. * own client, set the <code>testNetwork</code> property to <code>true</code> in the options you
  24885. * pass into the <a href="Session.html#subscribe">Session.subscribe()</a> method. For an example,
  24886. * see the <a href="https://github.com/opentok/opentok-network-test">opentok-network-test</a>
  24887. * project on GitHub.
  24888. * <p>
  24889. * You may also use these statistics to have a Subscriber subscribe to audio-only if the audio
  24890. * packet loss reaches a certain threshold. If you choose to do this, you should set the
  24891. * <code>audioFallbackEnabled</code> setting to <code>false</code> when you initialize Publisher
  24892. * objects for the session. This prevents the OpenTok Media Router from using its own audio-only
  24893. * toggling implementation. (See the documentation for the
  24894. * <a href="OT.html#initPublisher">OT.initPublisher()</a> method.)
  24895. *
  24896. * @param {Function} completionHandler A function that takes the following
  24897. * parameters:
  24898. *
  24899. * <ul>
  24900. *
  24901. * <li><code>error</code> (<a href="Error.html">Error</a>) &mdash; The error property is
  24902. * set if the client is not connected. Upon completion of a successful call to the method,
  24903. * this property is undefined.</li>
  24904. *
  24905. * <li><code>stats</code> (Object) &mdash; An object with the following properties:
  24906. * <p>
  24907. * <ul>
  24908. * <li><code>audio.bytesReceived</code> (Number) &mdash; The total number of audio bytes
  24909. * received by the subscriber</li>
  24910. * <li><code>audio.packetsLost</code> (Number) &mdash; Total audio packets that did not reach
  24911. * the subscriber</li>
  24912. * <li><code>audio.packetsReceived</code> (Number) &mdash; The total number of audio packets
  24913. * received by the subscriber</li>
  24914. * <li><code>timestamp</code> (Number) &mdash; The timestamp, in milliseconds since the Unix
  24915. * epoch, for when these stats were gathered</li>
  24916. * <li><code>video.bytesReceived</code> (Number) &mdash; The total video bytes received by
  24917. * the subscriber</li>
  24918. * <li><code>video.packetsLost</code> (Number) &mdash; The total number of video packets that
  24919. * did not reach the subscriber</li>
  24920. * <li><code>video.packetsReceived</code> (Number) &mdash; The total number of video packets
  24921. * received by the subscriber</li>
  24922. * <li><code>video.frameRate</code> (Number) &mdash; The current video frame rate</li>
  24923. * </ul>
  24924. * </li>
  24925. * </ul>
  24926. *
  24927. * @see <a href="Publisher.html#getStats">Publisher.getStats()</a>
  24928. *
  24929. * @method #getStats
  24930. * @memberOf Subscriber
  24931. */
  24932. this.getStats = /*#__PURE__*/function () {
  24933. var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(callback) {
  24934. var pc;
  24935. return _regenerator.default.wrap(function _callee7$(_context7) {
  24936. while (1) switch (_context7.prev = _context7.next) {
  24937. case 0:
  24938. if (getPriorityPeerConnection()) {
  24939. _context7.next = 3;
  24940. break;
  24941. }
  24942. callback(otError(errors.NOT_CONNECTED, new Error('OT.Subscriber is not connected cannot getStats'), 1015));
  24943. return _context7.abrupt("return");
  24944. case 3:
  24945. notifyGetStatsCalled();
  24946. _context7.next = 6;
  24947. return getPriorityPeerConnection();
  24948. case 6:
  24949. pc = _context7.sent;
  24950. pc.getStats((error, stats) => {
  24951. if (error) {
  24952. if (error.code === 1015) {
  24953. error = otError(errors.NOT_CONNECTED, error, 1015);
  24954. }
  24955. callback(error);
  24956. return;
  24957. }
  24958. const otStats = {
  24959. timestamp: 0
  24960. };
  24961. stats.forEach(stat => {
  24962. if (getStatsHelpers.isInboundStat(stat)) {
  24963. const video = getStatsHelpers.isVideoStat(stat, stats);
  24964. const audio = getStatsHelpers.isAudioStat(stat, stats); // it is safe to override the timestamp of one by another
  24965. // if they are from the same getStats "batch" video and audio ts have the same value
  24966. if (audio || video) {
  24967. otStats.timestamp = getStatsHelpers.normalizeTimestamp(stat.timestamp);
  24968. }
  24969. if (video) {
  24970. merge(otStats, {
  24971. video: getStatsHelpers.parseStatCategory(stat)
  24972. });
  24973. } else if (audio) {
  24974. merge(otStats, {
  24975. audio: getStatsHelpers.parseStatCategory(stat)
  24976. });
  24977. }
  24978. } else if (getStatsHelpers.isVideoTrackStat(stat)) {
  24979. let frameRate = stat.framesPerSecond;
  24980. if (_frameRateWatcher) {
  24981. if (frameRate) {
  24982. _frameRateWatcher.destroy();
  24983. _frameRateWatcher = null;
  24984. } else {
  24985. frameRate = _frameRateWatcher.getFrameRateFromStats(stats);
  24986. }
  24987. }
  24988. merge(otStats, {
  24989. video: {
  24990. frameRate
  24991. }
  24992. });
  24993. }
  24994. });
  24995. callback(null, otStats);
  24996. });
  24997. case 8:
  24998. case "end":
  24999. return _context7.stop();
  25000. }
  25001. }, _callee7);
  25002. }));
  25003. return function (_x9) {
  25004. return _ref17.apply(this, arguments);
  25005. };
  25006. }();
  25007. function setAudioVolume(audioVolume) {
  25008. const video = _widgetView && _widgetView.video();
  25009. if (video) {
  25010. try {
  25011. video.setAudioVolume(audioVolume);
  25012. } catch (e) {
  25013. logging.warn("setAudioVolume: " + e);
  25014. if (_audioVolume === 0) {
  25015. logging.info('Using subscribeToAudio to mute Audio because setAudioVolume(0) failed'); // If we can't set the audioVolume to 0 then at least mute by setting subscribeToAudio(false)
  25016. _subscriber.subscribeToAudio(false);
  25017. }
  25018. }
  25019. }
  25020. if (_chrome) {
  25021. _chrome.muteButton.muted(audioVolume === 0);
  25022. }
  25023. }
  25024. /**
  25025. * Sets the audio volume, between 0 and 100, of the Subscriber.
  25026. *
  25027. * <p>You can set the initial volume when you call the <code>Session.subscribe()</code>
  25028. * method. Pass a <code>audioVolume</code> property of the <code>properties</code> parameter
  25029. * of the method.</p>
  25030. *
  25031. * @param {Number} value The audio volume, between 0 and 100.
  25032. *
  25033. * @return {Subscriber} The Subscriber object. This lets you chain method calls, as in the
  25034. * following:
  25035. *
  25036. * <pre>mySubscriber.setAudioVolume(50).setStyle(newStyle);</pre>
  25037. *
  25038. * @see <a href="#getAudioVolume">getAudioVolume()</a>
  25039. * @see <a href="Session.html#subscribe">Session.subscribe()</a>
  25040. * @method #setAudioVolume
  25041. * @memberOf Subscriber
  25042. */
  25043. this.setAudioVolume = requestedVolume => {
  25044. const volume = normalizeAudioVolume(requestedVolume);
  25045. logAnalyticsEvent('setAudioVolume', 'Attempt', {
  25046. audioVolume: volume
  25047. });
  25048. if (isNaN(volume)) {
  25049. logging.error('OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100');
  25050. logAnalyticsEvent('setAudioVolume', 'Failure', {
  25051. message: 'value should be an integer between 0 and 100'
  25052. });
  25053. return this;
  25054. }
  25055. if (volume !== requestedVolume) {
  25056. logging.warn('OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100');
  25057. }
  25058. if (volume === _audioVolume) {
  25059. setAudioVolume(_audioVolume);
  25060. logAnalyticsEvent('setAudioVolume', 'Success', {
  25061. audioVolume: _audioVolume,
  25062. message: 'Requested volume is same as already set audioVolume'
  25063. });
  25064. return this;
  25065. }
  25066. if (_audioVolume > 0) {
  25067. _latestPositiveVolume = _audioVolume;
  25068. }
  25069. _audioVolume = volume;
  25070. setAudioVolume(_audioVolume);
  25071. if (_audioVolume > 0 && !_isSubscribingToAudio) {
  25072. // in Firefox (and others) we don't stop subscribing to audio when muted, however if we are 'unmuting' and in
  25073. // the subscribeToAudio: false state we should subscribe to audio again
  25074. // subscribeToAudio is going to call us with _latestPositiveVolume so we'll update it here
  25075. _latestPositiveVolume = _audioVolume;
  25076. this.subscribeToAudio(true);
  25077. }
  25078. logAnalyticsEvent('setAudioVolume', 'Success', {
  25079. audioVolume: _audioVolume
  25080. });
  25081. return this;
  25082. };
  25083. /**
  25084. * Returns the audio volume, between 0 and 100, of the Subscriber.
  25085. *
  25086. * <p>Generally you use this method in conjunction with the <code>setAudioVolume()</code>
  25087. * method.</p>
  25088. *
  25089. * @return {Number} The audio volume, between 0 and 100, of the Subscriber.
  25090. * @see <a href="#setAudioVolume">setAudioVolume()</a>
  25091. * @method #getAudioVolume
  25092. * @memberOf Subscriber
  25093. */
  25094. this.getAudioVolume = () => {
  25095. const video = _widgetView && _widgetView.video();
  25096. if (video) {
  25097. try {
  25098. return video.getAudioVolume();
  25099. } catch (e) {
  25100. logging.warn("getAudioVolume " + e);
  25101. }
  25102. }
  25103. return _audioVolume;
  25104. };
  25105. /**
  25106. * Toggles audio on and off. Starts subscribing to audio (if it is available and currently
  25107. * not being subscribed to) when the <code>value</code> is <code>true</code>; stops
  25108. * subscribing to audio (if it is currently being subscribed to) when the <code>value</code>
  25109. * is <code>false</code>.
  25110. * <p>
  25111. * <i>Note:</i> This method only affects the local playback of audio. It has no impact on the
  25112. * audio for other connections subscribing to the same stream. If the Publisher is not
  25113. * publishing audio, enabling the Subscriber audio will have no practical effect.
  25114. * </p>
  25115. *
  25116. * @param {Boolean} value Whether to start subscribing to audio (<code>true</code>) or not
  25117. * (<code>false</code>).
  25118. *
  25119. * @return {Subscriber} The Subscriber object. This lets you chain method calls, as in the
  25120. * following:
  25121. *
  25122. * <pre>mySubscriber.subscribeToAudio(true).subscribeToVideo(false);</pre>
  25123. *
  25124. * @see <a href="#subscribeToVideo">subscribeToVideo()</a>
  25125. * @see <a href="Session.html#subscribe">Session.subscribe()</a>
  25126. * @see <a href="StreamPropertyChangedEvent.html">StreamPropertyChangedEvent</a>
  25127. *
  25128. * @method #subscribeToAudio
  25129. * @memberOf Subscriber
  25130. */
  25131. this.subscribeToAudio = pValue => {
  25132. const value = castToBoolean(pValue, true);
  25133. getAllPeerConnections().forEach( /*#__PURE__*/function () {
  25134. var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(peerConnection) {
  25135. return _regenerator.default.wrap(function _callee8$(_context8) {
  25136. while (1) switch (_context8.prev = _context8.next) {
  25137. case 0:
  25138. _context8.next = 2;
  25139. return peerConnection;
  25140. case 2:
  25141. _context8.sent.subscribeToAudio(value);
  25142. case 3:
  25143. case "end":
  25144. return _context8.stop();
  25145. }
  25146. }, _callee8);
  25147. }));
  25148. return function (_x10) {
  25149. return _ref18.apply(this, arguments);
  25150. };
  25151. }());
  25152. if (_stream && getAllPeerConnections().length !== 0) {
  25153. _stream.setChannelActiveState('audio', value);
  25154. }
  25155. const changed = _isSubscribingToAudio !== value;
  25156. _isSubscribingToAudio = value;
  25157. if (changed) {
  25158. this.setAudioVolume(value ? _latestPositiveVolume : 0);
  25159. }
  25160. logAnalyticsEvent('subscribeToAudio', 'Event', {
  25161. subscribeToAudio: value
  25162. });
  25163. return this;
  25164. };
  25165. const reasonMap = {
  25166. auto: 'quality',
  25167. publishVideo: 'publishVideo',
  25168. subscribeToVideo: 'subscribeToVideo'
  25169. };
  25170. if (env.name === 'Safari') {
  25171. const onVisibilityChange = () => {
  25172. if (!document.hidden && _properties.subscribeToVideo) {
  25173. logging.debug('document visibility restored in Safari - resubscribing to video');
  25174. this.subscribeToVideo(false);
  25175. this.subscribeToVideo(true);
  25176. }
  25177. };
  25178. document.addEventListener('visibilitychange', onVisibilityChange);
  25179. this.once('destroyed', () => {
  25180. document.removeEventListener('visibilitychange', onVisibilityChange);
  25181. });
  25182. }
  25183. /**
  25184. * Toggles video on and off. Starts subscribing to video (if it is available and
  25185. * currently not being subscribed to) when the <code>value</code> is <code>true</code>;
  25186. * stops subscribing to video (if it is currently being subscribed to) when the
  25187. * <code>value</code> is <code>false</code>.
  25188. * <p>
  25189. * <i>Note:</i> This method only affects the local playback of video. It has no impact on
  25190. * the video for other connections subscribing to the same stream. If the Publisher is not
  25191. * publishing video, enabling the Subscriber video will have no practical effect.
  25192. * </p>
  25193. *
  25194. * @param {Boolean} value Whether to start subscribing to video (<code>true</code>) or not
  25195. * (<code>false</code>).
  25196. *
  25197. * @return {Subscriber} The Subscriber object. This lets you chain method calls, as in the
  25198. * following:
  25199. *
  25200. * <pre>mySubscriber.subscribeToVideo(true).subscribeToAudio(false);</pre>
  25201. *
  25202. * @see <a href="#subscribeToAudio">subscribeToAudio()</a>
  25203. * @see <a href="Session.html#subscribe">Session.subscribe()</a>
  25204. * @see <a href="StreamPropertyChangedEvent.html">StreamPropertyChangedEvent</a>
  25205. *
  25206. * @method #subscribeToVideo
  25207. * @memberOf Subscriber
  25208. */
  25209. this.subscribeToVideo = (pValue, reason) => {
  25210. const value = castToBoolean(pValue, true);
  25211. logAnalyticsEvent('subscribeToVideo', 'Attempt', {
  25212. subscribeToVideo: value,
  25213. reason
  25214. });
  25215. setAudioOnly(!value || !_stream.hasVideo || !(_webRTCStream && _webRTCStream.getVideoTracks().length > 0));
  25216. if (_stream.hasVideo && _webRTCStream && _webRTCStream.getVideoTracks().length === 0) {
  25217. if (value) {
  25218. logging.info('Subscriber is audio-only due to incompatibility, can\'t subscribeToVideo.');
  25219. }
  25220. _properties.subscribeToVideo = false;
  25221. logAnalyticsEvent('subscribeToVideo', 'Failure', {
  25222. message: 'No video tracks available'
  25223. });
  25224. return this;
  25225. }
  25226. if (_chrome && _chrome.videoDisabledIndicator) {
  25227. // If this is an auto disableVideo then we want to show the indicator, otherwise hide it again
  25228. _chrome.videoDisabledIndicator.disableVideo(reason === 'auto' && !value);
  25229. }
  25230. if (getAllPeerConnections().length > 0) {
  25231. if (_session && _stream && (value !== _properties.subscribeToVideo || reason !== _lastSubscribeToVideoReason)) {
  25232. _stream.setChannelActiveState('video', value, reason);
  25233. }
  25234. }
  25235. _properties.subscribeToVideo = value;
  25236. _lastSubscribeToVideoReason = reason;
  25237. logAnalyticsEvent('subscribeToVideo', 'Success', {
  25238. subscribeToVideo: value,
  25239. reason
  25240. });
  25241. if (reason !== 'loading') {
  25242. this.dispatchEvent(new Events.VideoEnabledChangedEvent(value ? 'videoEnabled' : 'videoDisabled', {
  25243. reason: reasonMap[reason] || 'subscribeToVideo'
  25244. }));
  25245. if (value === 'videoDisabled' && reason === 'auto') {
  25246. _congestionLevel = 2;
  25247. }
  25248. }
  25249. return this;
  25250. };
  25251. /**
  25252. * Sets the preferred resolution of the subscriber's video.
  25253. * <p>
  25254. * Lowering the preferred resolution
  25255. * lowers video quality on the subscribing client, but it also reduces network and CPU usage.
  25256. * You may want to use a lower resolution based on the dimensions of subscriber's video on
  25257. * the web page. You may want to use a resolution rate for a subscriber to a stream that is less
  25258. * important (and smaller) than other streams.
  25259. * <p>
  25260. * <p>
  25261. * This method only applies when subscribing to a stream that uses the
  25262. * <a href="https://tokbox.com/developer/guides/scalable-video">
  25263. * scalable video feature</a>. Scalable video is available:
  25264. * <ul>
  25265. * <li>
  25266. * Only in sessions that use the OpenTok Media Router (sessions with the
  25267. * <a href="https://tokbox.com/developer/guides/create-session/#media-mode">media
  25268. * mode</a> set to routed).
  25269. * </li>
  25270. * <li>
  25271. * Only for streams published by clients that support scalable video:
  25272. * clients that use the OpenTok iOS SDK (on certain devices), the OpenTok
  25273. * Android SDK (on certain devices), or OpenTok.js in Chrome and Safari.
  25274. * </li>
  25275. * </ul>
  25276. * <p>
  25277. * In streams that do not use scalable video, calling this method has no effect.
  25278. * <p>
  25279. * <b>Note:</b> The resolution for scalable video streams automatically adjusts for each
  25280. * subscriber, based on network conditions and CPU usage, even if you do not call this method.
  25281. * Call this method if you want to set a maximum resolution for this subscriber.
  25282. * <p>
  25283. * In streams that do not use scalable video, calling this method has no effect.
  25284. * <p>
  25285. * Not every frame rate is available to a subscriber. When you set the preferred resolution for
  25286. * the subscriber, OpenTok.js picks the best resolution available that matches your setting.
  25287. * The resolutions available are based on the value of the Subscriber object's
  25288. * <code>stream.resolution</code> property, which represents the maximum resolution available for
  25289. * the stream. The actual resolutions available depend, dynamically, on network and CPU resources
  25290. * available to the publisher and subscriber.
  25291. * <p>
  25292. * You can set the initial preferred resolution used by setting the
  25293. * <code>preferredResolution</code> property of the <code>options</code> object you pass into the
  25294. * <code>Session.subscribe()</code> method.
  25295. *
  25296. * @param {Object} resolution Set this to an object with two properties: <code>width</code> and
  25297. * <code>height</code> (both numbers), such as <code>{width: 320, height: 240}</code>. Set this to
  25298. * <code>null</code> to remove the preferred resolution, and the client will use the highest
  25299. * resolution available.
  25300. *
  25301. * @see <a href="#setPreferredFrameRate">Subscriber.setPreferredFrameRate()</a>
  25302. * @see <a href="Session.html#subscribe">Session.subscribe()</a>
  25303. *
  25304. * @method #setPreferredResolution
  25305. * @memberOf Subscriber
  25306. */
  25307. this.setPreferredResolution = preferredResolution => {
  25308. if (_state.isDestroyed() || getAllPeerConnections().length === 0 && !_state.current === 'Connecting') {
  25309. logging.warn('Cannot set the max Resolution when not subscribing to a publisher');
  25310. return;
  25311. }
  25312. _properties.preferredResolution = preferredResolution;
  25313. if (_session.sessionInfo.p2pEnabled) {
  25314. logging.warn('OT.Subscriber.setPreferredResolution will not work in a P2P Session');
  25315. return;
  25316. }
  25317. const curMaxResolution = _stream.getPreferredResolution();
  25318. const isUnchanged = curMaxResolution && preferredResolution && curMaxResolution.width === preferredResolution.width && curMaxResolution.height === preferredResolution.height || !curMaxResolution && !preferredResolution;
  25319. if (isUnchanged) {
  25320. return;
  25321. }
  25322. _stream.setPreferredResolution(preferredResolution);
  25323. };
  25324. /**
  25325. * Sets the preferred frame rate of the subscriber's video.
  25326. * <p>
  25327. * Lowering the preferred frame rate
  25328. * lowers video quality on the subscribing client, but it also reduces network and CPU usage.
  25329. * You may want to use a lower frame rate for a subscriber to a stream that is less important
  25330. * than other streams.
  25331. * <p>
  25332. * <p>
  25333. * This method only applies when subscribing to a stream that uses the
  25334. * <a href="https://tokbox.com/developer/guides/scalable-video">
  25335. * scalable video feature</a>. Scalable video is available:
  25336. * <ul>
  25337. * <li>
  25338. * Only in sessions that use the OpenTok Media Router (sessions with the
  25339. * <a href="https://tokbox.com/developer/guides/create-session/#media-mode">media
  25340. * mode</a> set to routed).
  25341. * </li>
  25342. * <li>
  25343. * Only for streams published by clients that support scalable video:
  25344. * clients that use the OpenTok iOS SDK (on certain devices), the OpenTok
  25345. * Android SDK (on certain devices), or OpenTok.js in Chrome and Safari.
  25346. * </li>
  25347. * </ul>
  25348. * <p>
  25349. * In streams that do not use scalable video, calling this method has no effect.
  25350. * <p>
  25351. * <b>Note:</b> The frame rate for scalable video streams automatically adjusts for each
  25352. * subscriber, based on network conditions and CPU usage, even if you do not call this method.
  25353. * Call this method if you want to set a maximum frame rate for this subscriber.
  25354. * <p>
  25355. * Not every frame rate is available to a subscriber. When you set the preferred frame rate for
  25356. * the subscriber, OpenTok.js picks the best frame rate available that matches your setting.
  25357. * The frame rates available are based on the value of the Subscriber object's
  25358. * <code>stream.frameRate</code> property, which represents the maximum value available for the
  25359. * stream. The actual frame rates available depend, dynamically, on network and CPU resources
  25360. * available to the publisher and subscriber.
  25361. * <p>
  25362. * You can set the initial preferred frame rate used by setting the <code>preferredFrameRate</code>
  25363. * property of the <code>options</code> object you pass into the <code>Session.subscribe()</code>
  25364. * method.
  25365. *
  25366. * @param {Number} frameRate Set this to the desired frame rate (in frames per second). Set this to
  25367. * <code>null</code> to remove the preferred frame rate, and the client will use the highest
  25368. * frame rate available.
  25369. *
  25370. * @see <a href="#setPreferredResolution">Subscriber.setPreferredResolution()</a>
  25371. * @see <a href="Session.html#subscribe">Session.subscribe()</a>
  25372. *
  25373. * @method #setPreferredFrameRate
  25374. * @memberOf Subscriber
  25375. */
  25376. this.setPreferredFrameRate = preferredFrameRate => {
  25377. if (_state.isDestroyed() || getAllPeerConnections().length === 0 && !_state.current === 'Connecting') {
  25378. logging.warn('Cannot set the max frameRate when not subscribing to a publisher');
  25379. return;
  25380. }
  25381. _properties.preferredFrameRate = preferredFrameRate;
  25382. if (_session.sessionInfo.p2pEnabled) {
  25383. logging.warn('OT.Subscriber.setPreferredFrameRate will not work in a P2P Session');
  25384. return;
  25385. }
  25386. const currentPreferredFrameRate = _stream.getPreferredFrameRate();
  25387. const isUnchangedFrameRate = preferredFrameRate && currentPreferredFrameRate && currentPreferredFrameRate === preferredFrameRate || !currentPreferredFrameRate && !preferredFrameRate;
  25388. if (isUnchangedFrameRate) {
  25389. return;
  25390. }
  25391. _stream.setPreferredFrameRate(preferredFrameRate);
  25392. };
  25393. this.isSubscribing = () => _state.isSubscribing();
  25394. this.isWebRTC = true;
  25395. this.isLoading = () => _widgetView && _widgetView.loading();
  25396. /**
  25397. * Indicates whether the subscriber's audio is blocked because of
  25398. * the browser's audio autoplay policy.
  25399. *
  25400. * @see <a href="OT.html#unblockAudio">OT.unblockAudio()</a>
  25401. * @see The <a href="#event:audioBlocked">audioBlocked</a>
  25402. * and <a href="#event:audioUnblocked">audioUnblocked</a>
  25403. * Subscriber events
  25404. * @see The <code>style.audioBlockedDisplayMode</code> property of the
  25405. * <code>options</code> parameter of the
  25406. * <a href="Session.html#subscribe">Session.subscribe()</a> method
  25407. *
  25408. * @method #isAudioBlocked
  25409. * @memberof Subscriber
  25410. */
  25411. this.isAudioBlocked = () => Boolean(_widgetView && _widgetView.isAudioBlocked());
  25412. this.videoElement = () => {
  25413. const video = _widgetView && _widgetView.video();
  25414. return video ? video.domElement() : null;
  25415. };
  25416. /**
  25417. * Returns the width, in pixels, of the Subscriber video.
  25418. *
  25419. * @method #videoWidth
  25420. * @memberOf Subscriber
  25421. * @return {Number} the width, in pixels, of the Subscriber video.
  25422. */
  25423. this.videoWidth = () => {
  25424. const video = _widgetView && _widgetView.video();
  25425. return video ? video.videoWidth() : undefined;
  25426. };
  25427. /**
  25428. * Returns the height, in pixels, of the Subscriber video.
  25429. *
  25430. * @method #videoHeight
  25431. * @memberOf Subscriber
  25432. * @return {Number} the width, in pixels, of the Subscriber video.
  25433. */
  25434. this.videoHeight = () => {
  25435. const video = _widgetView && _widgetView.video();
  25436. return video ? video.videoHeight() : undefined;
  25437. };
  25438. this._subscribeToSelf = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  25439. var publisher;
  25440. return _regenerator.default.wrap(function _callee9$(_context9) {
  25441. while (1) switch (_context9.prev = _context9.next) {
  25442. case 0:
  25443. publisher = _session.getPublisherForStream(_stream);
  25444. if (publisher && publisher._.webRtcStream()) {
  25445. _context9.next = 5;
  25446. break;
  25447. }
  25448. connectivityState.fail({
  25449. payload: {
  25450. reason: 'streamNotFound'
  25451. },
  25452. error: otError(errors.STREAM_DESTROYED, new Error('Tried to subscribe to a local publisher, but its stream no longer exists'))
  25453. });
  25454. _context9.next = 14;
  25455. break;
  25456. case 5:
  25457. _pcConnected.resolve();
  25458. _context9.prev = 6;
  25459. _context9.next = 9;
  25460. return onRemoteStreamAdded(publisher._.webRtcStream());
  25461. case 9:
  25462. _context9.next = 14;
  25463. break;
  25464. case 11:
  25465. _context9.prev = 11;
  25466. _context9.t0 = _context9["catch"](6);
  25467. logging.error(_context9.t0);
  25468. case 14:
  25469. case "end":
  25470. return _context9.stop();
  25471. }
  25472. }, _callee9, null, [[6, 11]]);
  25473. }));
  25474. this._setupPeerConnection = /*#__PURE__*/function () {
  25475. var _ref21 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(_ref20) {
  25476. var peerPriority, send, log, logQoS;
  25477. return _regenerator.default.wrap(function _callee12$(_context12) {
  25478. while (1) switch (_context12.prev = _context12.next) {
  25479. case 0:
  25480. peerPriority = _ref20.peerPriority, send = _ref20.send, log = _ref20.log, logQoS = _ref20.logQoS;
  25481. if (_properties.testNetwork) {
  25482. _this.setAudioVolume(0);
  25483. }
  25484. if (getAllPeerConnections().length === 0) {
  25485. // @todo The subscribers states should be something like:
  25486. // disconnected || connecting || reconnecting || connected || destroyed
  25487. // the state of peer connections belong to the peer connection itself
  25488. _state.set('Connecting');
  25489. }
  25490. peerConnections[peerPriority] = new Promise((resolve, reject) => {
  25491. _session._.getIceConfig().then(iceConfig => {
  25492. if (iceConfig.needRumorIceServersFallback) {
  25493. iceConfig.servers = [...(fallbackIceServers || []), ...(iceConfig.servers || [])];
  25494. }
  25495. const props = {
  25496. iceConfig,
  25497. subscriberId: _this.widgetId,
  25498. send,
  25499. logAnalyticsEvent: log,
  25500. p2p: _session.sessionInfo.p2pEnabled
  25501. };
  25502. if (Object.prototype.hasOwnProperty.call(_properties, 'codecFlags')) {
  25503. props.codecFlags = _properties.codecFlags;
  25504. }
  25505. const peerConnection = new Subscriber.SubscriberPeerConnection(props);
  25506. peerConnection.once('iceConnected', _pcConnected.resolve);
  25507. peerConnection.once('error', _pcConnected.reject);
  25508. if (_currentPeerConnectionEvents) {
  25509. _currentPeerConnectionEvents.removeAll();
  25510. const onDisconnected = () => {
  25511. peerConnection.off('error', onDisconnected);
  25512. peerConnection.off('disconnected', onDisconnected);
  25513. delete peerConnections[peerPriority];
  25514. };
  25515. peerConnection.on('error', onDisconnected);
  25516. peerConnection.on('disconnected', onDisconnected);
  25517. }
  25518. _currentPeerConnectionEvents = eventHelper(peerConnection);
  25519. _currentPeerConnectionEvents.on('disconnected', onPeerDisconnected);
  25520. _currentPeerConnectionEvents.on('error', onPeerConnectionFailure);
  25521. _currentPeerConnectionEvents.on('remoteStreamAdded', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
  25522. var _args10 = arguments;
  25523. return _regenerator.default.wrap(function _callee10$(_context10) {
  25524. while (1) switch (_context10.prev = _context10.next) {
  25525. case 0:
  25526. _context10.prev = 0;
  25527. _context10.next = 3;
  25528. return onRemoteStreamAdded(..._args10);
  25529. case 3:
  25530. _context10.next = 8;
  25531. break;
  25532. case 5:
  25533. _context10.prev = 5;
  25534. _context10.t0 = _context10["catch"](0);
  25535. logging.error(_context10.t0);
  25536. case 8:
  25537. case "end":
  25538. return _context10.stop();
  25539. }
  25540. }, _callee10, null, [[0, 5]]);
  25541. })));
  25542. _currentPeerConnectionEvents.on('remoteStreamRemoved', onRemoteStreamRemoved);
  25543. _currentPeerConnectionEvents.on('signalingStateStable', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
  25544. var video;
  25545. return _regenerator.default.wrap(function _callee11$(_context11) {
  25546. while (1) switch (_context11.prev = _context11.next) {
  25547. case 0:
  25548. _subscriber.trigger('signalingStateStable');
  25549. video = _widgetView && _widgetView.video();
  25550. if (!(video && _webRTCStream)) {
  25551. _context11.next = 12;
  25552. break;
  25553. }
  25554. _context11.prev = 3;
  25555. _context11.next = 6;
  25556. return video.rebind();
  25557. case 6:
  25558. _context11.next = 11;
  25559. break;
  25560. case 8:
  25561. _context11.prev = 8;
  25562. _context11.t0 = _context11["catch"](3);
  25563. logging.error('Could not bind to stream', _context11.t0);
  25564. case 11:
  25565. if (_audioLevelSampler && 'webRTCStream' in _audioLevelSampler && _webRTCStream.getAudioTracks().length > 0) {
  25566. _audioLevelSampler.webRTCStream(_webRTCStream);
  25567. }
  25568. case 12:
  25569. case "end":
  25570. return _context11.stop();
  25571. }
  25572. }, _callee11, null, [[3, 8]]);
  25573. })));
  25574. peerConnection.on('qos', logQoS);
  25575. _currentPeerConnectionEvents.on('iceConnectionStateChange', onIceConnectionStateChange);
  25576. _currentPeerConnectionEvents.on('iceRestartSuccess', onIceRestartSuccess);
  25577. _currentPeerConnectionEvents.on('iceRestartFailure', onIceRestartFailure);
  25578. _currentPeerConnectionEvents.on('remoteVideoSupported', onRemoteVideoSupported); // initialize the peer connection AFTER we've added the event listeners
  25579. peerConnection.init(err => {
  25580. if (err) {
  25581. reject(err);
  25582. } else {
  25583. resolve(peerConnection);
  25584. }
  25585. });
  25586. _currentPeerConnectionEvents.once('remoteStreamAdded', () => {
  25587. if (destroyAudioLevelBehaviour) {
  25588. destroyAudioLevelBehaviour();
  25589. destroyAudioLevelBehaviour = undefined;
  25590. } // prefer the audioLevelSampler (more efficient and better responsiveness)
  25591. if (hasRemoteStreamsWithWebAudio()) {
  25592. try {
  25593. _audioLevelSampler = new WebAudioAudioLevelSampler(audioContext());
  25594. } catch (e) {
  25595. logging.warn('Failed to get AudioContext()', e);
  25596. }
  25597. }
  25598. if (!_audioLevelSampler && Subscriber.hasAudioOutputLevelStatCapability()) {
  25599. _audioLevelSampler = new GetStatsAudioOutputLevelSampler(peerConnection.getStats);
  25600. }
  25601. if (_audioLevelSampler) {
  25602. var _audioLevelBehaviour = audioLevelBehaviour({
  25603. subscriber: _this,
  25604. audioLevelSampler: _audioLevelSampler
  25605. });
  25606. destroyAudioLevelBehaviour = _audioLevelBehaviour.destroyAudioLevelBehaviour;
  25607. } else {
  25608. Object.defineProperty(_this, 'loudness', {
  25609. value: undefined,
  25610. configurable: true,
  25611. writable: false
  25612. });
  25613. logging.error('No suitable audio level samplers found, audio level visualisation will not work');
  25614. }
  25615. });
  25616. }).catch(reject);
  25617. });
  25618. return _context12.abrupt("return", peerConnections[peerPriority]);
  25619. case 5:
  25620. case "end":
  25621. return _context12.stop();
  25622. }
  25623. }, _callee12);
  25624. }));
  25625. return function (_x11) {
  25626. return _ref21.apply(this, arguments);
  25627. };
  25628. }();
  25629. /**
  25630. * Restricts the frame rate of the Subscriber's video stream, when you pass in
  25631. * <code>true</code>. When you pass in <code>false</code>, the frame rate of the video stream
  25632. * is not restricted.
  25633. * <p>
  25634. * When the frame rate is restricted, the Subscriber video frame will update once or less per
  25635. * second.
  25636. * <p>
  25637. * This feature is only available in sessions that use the OpenTok Media Router (sessions with
  25638. * the <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
  25639. * set to routed), not in sessions with the media mode set to relayed. In relayed sessions,
  25640. * calling this method has no effect.
  25641. * <p>
  25642. * Restricting the subscriber frame rate has the following benefits:
  25643. * <ul>
  25644. * <li>It reduces CPU usage.</li>
  25645. * <li>It reduces the network bandwidth consumed.</li>
  25646. * <li>It lets you subscribe to more streams simultaneously.</li>
  25647. * </ul>
  25648. * <p>
  25649. * Reducing a subscriber's frame rate has no effect on the frame rate of the video in
  25650. * other clients.
  25651. *
  25652. * @param {Boolean} value Whether to restrict the Subscriber's video frame rate
  25653. * (<code>true</code>) or not (<code>false</code>).
  25654. *
  25655. * @return {Subscriber} The Subscriber object. This lets you chain method calls, as in the
  25656. * following:
  25657. *
  25658. * <pre>mySubscriber.restrictFrameRate(false).subscribeToAudio(true);</pre>
  25659. *
  25660. * @method #restrictFrameRate
  25661. * @memberOf Subscriber
  25662. */
  25663. this.restrictFrameRate = val => {
  25664. logging.debug("OT.Subscriber.restrictFrameRate(" + val + ")");
  25665. logAnalyticsEvent('restrictFrameRate', val.toString(), {
  25666. streamId: _stream.id
  25667. });
  25668. if (_session.sessionInfo.p2pEnabled) {
  25669. logging.warn('OT.Subscriber.restrictFrameRate: Cannot restrictFrameRate on a P2P session');
  25670. }
  25671. if (typeof val !== 'boolean') {
  25672. logging.error("OT.Subscriber.restrictFrameRate: expected a boolean value got a " + typeof val);
  25673. } else {
  25674. _frameRateRestricted = val;
  25675. _stream.setRestrictFrameRate(val);
  25676. }
  25677. return this;
  25678. };
  25679. this.on('styleValueChanged', updateChromeForStyleChange, this);
  25680. this._ = {
  25681. getDataChannel(label, options, completion) {
  25682. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  25683. return _regenerator.default.wrap(function _callee13$(_context13) {
  25684. while (1) switch (_context13.prev = _context13.next) {
  25685. case 0:
  25686. if (getPriorityPeerConnection()) {
  25687. _context13.next = 3;
  25688. break;
  25689. }
  25690. completion(new OTHelpers.Error('Cannot create a DataChannel before there is a publisher connection.'));
  25691. return _context13.abrupt("return");
  25692. case 3:
  25693. _context13.next = 5;
  25694. return getPriorityPeerConnection();
  25695. case 5:
  25696. _context13.sent.getDataChannel(label, options, completion);
  25697. case 6:
  25698. case "end":
  25699. return _context13.stop();
  25700. }
  25701. }, _callee13);
  25702. }))();
  25703. },
  25704. iceRestart() {
  25705. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
  25706. var peerConnection;
  25707. return _regenerator.default.wrap(function _callee14$(_context14) {
  25708. while (1) switch (_context14.prev = _context14.next) {
  25709. case 0:
  25710. _context14.next = 2;
  25711. return getPriorityPeerConnection();
  25712. case 2:
  25713. peerConnection = _context14.sent;
  25714. if (!peerConnection) {
  25715. logging.debug('Subscriber: Skipping ice restart, we have no peer connection');
  25716. } else {
  25717. logResubscribe('Attempt');
  25718. logging.debug('Subscriber: iceRestart attempt');
  25719. peerConnection.iceRestart();
  25720. }
  25721. case 4:
  25722. case "end":
  25723. return _context14.stop();
  25724. }
  25725. }, _callee14);
  25726. }))();
  25727. },
  25728. unblockAudio: () => _widgetView && _widgetView.unblockAudio(),
  25729. webRtcStream: () => _webRTCStream,
  25730. privateEvents: new EventEmitter()
  25731. };
  25732. _state = new SubscribingState(stateChangeFailed);
  25733. logging.debug("OT.Subscriber: subscribe to " + _stream.id);
  25734. _state.set('Init');
  25735. if (!_stream) {
  25736. // @todo error
  25737. logging.error('OT.Subscriber: No stream parameter.');
  25738. return false;
  25739. }
  25740. _streamEventHandlers = {
  25741. updated: streamUpdated
  25742. };
  25743. _stream.on(_streamEventHandlers, this);
  25744. _properties.name = _properties.name || _stream.name;
  25745. _properties.classNames = 'OT_root OT_subscriber';
  25746. if (_properties.style) {
  25747. this.setStyle(_properties.style, null, true);
  25748. }
  25749. _latestPositiveVolume = DEFAULT_AUDIO_VOLUME;
  25750. _properties.subscribeToVideo = castToBoolean(_properties.subscribeToVideo, true);
  25751. _properties.subscribeToAudio = castToBoolean(_properties.subscribeToAudio, true);
  25752. this.subscribeToAudio(_properties.subscribeToAudio);
  25753. this.setAudioVolume(determineAudioVolume(_properties));
  25754. _widgetView = new Subscriber.WidgetView(targetElement, (0, _extends2.default)({}, _properties, {
  25755. widgetType: 'subscriber'
  25756. }));
  25757. _widgetView.on('error', onVideoError);
  25758. _widgetView.on('audioBlocked', () => this.trigger('audioBlocked'));
  25759. _widgetView.on('audioUnblocked', () => this.trigger('audioUnblocked'));
  25760. this.id = _widgetView.domId();
  25761. _domId = _widgetView.domId();
  25762. this.element = _widgetView.domElement;
  25763. _widgetView.on('videoElementCreated', element => {
  25764. const event = new Events.VideoElementCreatedEvent(element);
  25765. const self = this;
  25766. if (!_loaded) {
  25767. this.once('loaded', () => {
  25768. self.dispatchEvent(event);
  25769. });
  25770. } else {
  25771. this.dispatchEvent(event);
  25772. }
  25773. });
  25774. if (this.element) {
  25775. // Only create the chrome if there is an element to insert it in
  25776. // for insertDefautlUI:false we don't create the chrome
  25777. _createChrome.call(this);
  25778. }
  25779. let channelsToSubscribeTo;
  25780. if (_properties.subscribeToVideo || _properties.subscribeToAudio) {
  25781. const audio = _stream.getChannelsOfType('audio');
  25782. const video = _stream.getChannelsOfType('video');
  25783. channelsToSubscribeTo = audio.map(channel => ({
  25784. id: channel.id,
  25785. type: channel.type,
  25786. active: _properties.subscribeToAudio
  25787. })).concat(video.map(channel => {
  25788. const props = {
  25789. id: channel.id,
  25790. type: channel.type,
  25791. active: _properties.subscribeToVideo,
  25792. restrictFrameRate: _properties.restrictFrameRate !== undefined ? _properties.restrictFrameRate : false
  25793. };
  25794. if (_properties.preferredFrameRate !== undefined) {
  25795. props.preferredFrameRate = parseFloat(_properties.preferredFrameRate);
  25796. }
  25797. if (_properties.preferredHeight !== undefined) {
  25798. props.preferredHeight = parseInt(_properties.preferredHeight, 10);
  25799. }
  25800. if (_properties.preferredWidth !== undefined) {
  25801. props.preferredWidth = parseInt(_properties.preferredWidth, 10);
  25802. }
  25803. return props;
  25804. }));
  25805. }
  25806. const shouldSubscribeToSelf = !_properties.testNetwork && isLocalStream(_stream, _session);
  25807. connectivityState.beginConnect();
  25808. if (shouldSubscribeToSelf) {
  25809. // bypass rumor etc and just subscribe locally
  25810. this._subscribeToSelf();
  25811. return this;
  25812. }
  25813. socket.subscriberCreate(_stream.id, _widgetId, // subscriberId
  25814. channelsToSubscribeTo, (err, message) => {
  25815. // when the publisher is destroyed before we subscribe, chances are we have been told about
  25816. // before we get the subscriberCreate error, so this can be ignored.
  25817. if (err && !connectivityState.is('disconnected')) {
  25818. onSubscriberCreateError(err);
  25819. }
  25820. fallbackIceServers = parseIceServers(message);
  25821. });
  25822. /**
  25823. * Dispatched when the subscriber's audio is blocked because of the
  25824. * browser's autoplay policy.
  25825. *
  25826. * @see <a href="OT.html#unblockAudio">OT.unblockAudio()</a>
  25827. * @see <a href="Subscriber.html#isAudioBlocked">Subscriber.isAudioBlocked()</a>
  25828. * @see The <a href="#event:audioUnblocked">audioUnblocked</a> event
  25829. * @see The <code>style.audioBlockedDisplayMode</code> property of the
  25830. * <code>options</code> parameter of the
  25831. * <a href="Session.html#subscribe">Session.subscribe()</a> method)
  25832. *
  25833. * @name audioBlocked
  25834. * @event
  25835. * @memberof Subscriber
  25836. */
  25837. /**
  25838. * Dispatched when the subscriber's audio is unblocked after
  25839. * being paused because of the browser's autoplay policy.
  25840. * <p>
  25841. * Subscriber audio is unblocked when any of the following occurs:
  25842. * <ul>
  25843. * <li>
  25844. * The user clicks the default Subscriber audio playback icon
  25845. * </li>
  25846. * <li>
  25847. * The <a href="OT.html#unblockAudio">OT.unblockAudio()</a>
  25848. * method is called in response to an HTML element dispatching
  25849. * a <code>click</code> event (if you have disabled the default
  25850. * audio playback icon)
  25851. * </li>
  25852. * <li>
  25853. * The local client gains access to the camera or microphone
  25854. * (for instance, in response to a successful call to
  25855. * <code>OT.initPublisher()</code>).
  25856. * </li>
  25857. * </ul>
  25858. *
  25859. * @see <a href="OT.html#unblockAudio">OT.unblockAudio()</a>
  25860. * @see The <a href="l#event:audioBlocked">audioBlocked</a> event
  25861. * @see The <code>style.audioBlockedDisplayMode</code> property of the
  25862. * <code>options</code> parameter of the
  25863. * <a href="Session.html#subscribe">Session#subscribe()</a> method)
  25864. *
  25865. * @name audioUnblocked
  25866. * @event
  25867. * @memberof Subscriber
  25868. */
  25869. /**
  25870. * Dispatched periodically to indicate the subscriber's audio level. The event is dispatched
  25871. * up to 60 times per second, depending on the browser. The <code>audioLevel</code> property
  25872. * of the event is audio level, from 0 to 1.0. See {@link AudioLevelUpdatedEvent} for more
  25873. * information.
  25874. * <p>
  25875. * The following example adjusts the value of a meter element that shows volume of the
  25876. * subscriber. Note that the audio level is adjusted logarithmically and a moving average
  25877. * is applied:
  25878. * <pre>
  25879. * var movingAvg = null;
  25880. * subscriber.on('audioLevelUpdated', function(event) {
  25881. * if (movingAvg === null || movingAvg &lt;= event.audioLevel) {
  25882. * movingAvg = event.audioLevel;
  25883. * } else {
  25884. * movingAvg = 0.7 * movingAvg + 0.3 * event.audioLevel;
  25885. * }
  25886. *
  25887. * // 1.5 scaling to map the -30 - 0 dBm range to [0,1]
  25888. * var logLevel = (Math.log(movingAvg) / Math.LN10) / 1.5 + 1;
  25889. * logLevel = Math.min(Math.max(logLevel, 0), 1);
  25890. * document.getElementById('subscriberMeter').value = logLevel;
  25891. * });
  25892. * </pre>
  25893. * <p>This example shows the algorithm used by the default audio level indicator displayed
  25894. * in an audio-only Subscriber.
  25895. *
  25896. * @name audioLevelUpdated
  25897. * @event
  25898. * @memberof Subscriber
  25899. * @see AudioLevelUpdatedEvent
  25900. */
  25901. /**
  25902. * Dispatched when the video for the subscriber is disabled.
  25903. * <p>
  25904. * The <code>reason</code> property defines the reason the video was disabled. This can be set to
  25905. * one of the following values:
  25906. * <p>
  25907. *
  25908. * <ul>
  25909. *
  25910. * <li><code>"codecNotSupported"</code> &mdash; The client's browser does not support the
  25911. * video codec used by the stream. For example, in Safari if you connect to a
  25912. * <a href="https://tokbox.com/developer/guides/create-session/#media-mode">routed session</a>
  25913. * in a <a href="https://tokbox.com/developer/sdks/js/safari/#step1">non-Safari OpenTok
  25914. * project</a>, and you try to subscribe to a stream that includes video, the Subscriber
  25915. * will dispatch a <code>videoDisabled</code> event with the <code>reason</code> property
  25916. * set to <code>"codecNotSupported"</code>. (In routed sessions in a non-Safari project,
  25917. * streams use the VP8 video codec, which is not supported in Safari.) The subscriber
  25918. * element will also display a "Video format not supported" message. (See
  25919. * <a href="OT.html#getSupportedCodecs">OT.getSupportedCodecs()</a>.)</li>
  25920. *
  25921. * <li><code>"publishVideo"</code> &mdash; The publisher stopped publishing video by calling
  25922. * <code>publishVideo(false)</code>.</li>
  25923. *
  25924. * <li><code>"quality"</code> &mdash; The OpenTok Media Router stopped sending video
  25925. * to the subscriber based on stream quality changes. This feature of the OpenTok Media
  25926. * Router has a subscriber drop the video stream when connectivity degrades. (The subscriber
  25927. * continues to receive the audio stream, if there is one.)
  25928. * <p>
  25929. * Before sending this event, when the Subscriber's stream quality deteriorates to a level
  25930. * that is low enough that the video stream is at risk of being disabled, the Subscriber
  25931. * dispatches a <code>videoDisableWarning</code> event.
  25932. * <p>
  25933. * If connectivity improves to support video again, the Subscriber object dispatches
  25934. * a <code>videoEnabled</code> event, and the Subscriber resumes receiving video.
  25935. * <p>
  25936. * By default, the Subscriber displays a video disabled indicator when a
  25937. * <code>videoDisabled</code> event with this reason is dispatched and removes the indicator
  25938. * when the <code>videoEnabled</code> event with this reason is dispatched. You can control
  25939. * the display of this icon by calling the <code>setStyle()</code> method of the Subscriber,
  25940. * setting the <code>videoDisabledDisplayMode</code> property(or you can set the style when
  25941. * calling the <code>Session.subscribe()</code> method, setting the <code>style</code> property
  25942. * of the <code>properties</code> parameter).
  25943. * <p>
  25944. * This feature is only available in sessions that use the OpenTok Media Router (sessions with
  25945. * the <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
  25946. * set to routed), not in sessions with the media mode set to relayed.
  25947. * <p>
  25948. * You can disable this audio-only fallback feature, by setting the
  25949. * <code>audioFallbackEnabled</code> property to <code>false</code> in the options you pass
  25950. * into the <code>OT.initPublisher()</code> method on the publishing client. (See
  25951. * <a href="OT.html#initPublisher">OT.initPublisher()</a>.)
  25952. * </li>
  25953. *
  25954. * <li><code>"subscribeToVideo"</code> &mdash; The subscriber started or stopped subscribing to
  25955. * video, by calling <code>subscribeToVideo(false)</code>.
  25956. * </li>
  25957. *
  25958. * </ul>
  25959. *
  25960. * @see VideoEnabledChangedEvent
  25961. * @see <a href="Subscriber.html#event:videoDisableWarning">videoDisableWarning</a> event
  25962. * @see <a href="Subscriber.html#event:videoEnabled">videoEnabled</a> event
  25963. * @name videoDisabled
  25964. * @event
  25965. * @memberof Subscriber
  25966. */
  25967. /**
  25968. * Dispatched when the OpenTok Media Router determines that the stream quality has degraded
  25969. * and the video will be disabled if the quality degrades more. If the quality degrades further,
  25970. * the Subscriber disables the video and dispatches a <code>videoDisabled</code> event.
  25971. * <p>
  25972. * By default, the Subscriber displays a video disabled warning indicator when this event
  25973. * is dispatched (and the video is disabled). You can control the display of this icon by
  25974. * calling the <code>setStyle()</code> method and setting the
  25975. * <code>videoDisabledDisplayMode</code> property (or you can set the style when calling
  25976. * the <code>Session.subscribe()</code> method and setting the <code>style</code> property
  25977. * of the <code>properties</code> parameter).
  25978. * <p>
  25979. * This feature is only available in sessions that use the OpenTok Media Router (sessions with
  25980. * the <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
  25981. * set to routed), not in sessions with the media mode set to relayed.
  25982. *
  25983. * @see Event
  25984. * @see <a href="Subscriber.html#event:videoDisabled">videoDisabled</a> event
  25985. * @see <a href="Subscriber.html#event:videoDisableWarningLifted">videoDisableWarningLifted</a> event
  25986. * @name videoDisableWarning
  25987. * @event
  25988. * @memberof Subscriber
  25989. */
  25990. /**
  25991. * Dispatched when the Subscriber's video element is created. Add a listener for this event when
  25992. * you set the <code>insertDefaultUI</code> option to <code>false</code> in the call to the
  25993. * <a href="Session.html#subscribe">Session.subscribe()</a> method. The <code>element</code>
  25994. * property of the event object is a reference to the Subscriber's <code>video</code> element
  25995. * (or in Internet Explorer the <code>object</code> element containing the video). Add it to
  25996. * the HTML DOM to display the video. When you set the <code>insertDefaultUI</code> option to
  25997. * <code>false</code>, the <code>video</code> (or <code>object</code>) element is not automatically
  25998. * inserted into the DOM.
  25999. * <p>
  26000. * Add a listener for this event only if you have set the <code>insertDefaultUI</code> option to
  26001. * <code>false</code>. If you have not set <code>insertDefaultUI</code> option to
  26002. * <code>false</code>, do not move the <code>video</code> (or <code>object</code>) element in
  26003. * in the HTML DOM. Doing so causes the Subscriber object to be destroyed.
  26004. *
  26005. * @name videoElementCreated
  26006. * @event
  26007. * @memberof Subscriber
  26008. * @see VideoElementCreatedEvent
  26009. */
  26010. /**
  26011. * Dispatched when the OpenTok Media Router determines that the stream quality has improved
  26012. * to the point at which the video being disabled is not an immediate risk. This event is
  26013. * dispatched after the Subscriber object dispatches a <code>videoDisableWarning</code> event.
  26014. * <p>
  26015. * This feature is only available in sessions that use the OpenTok Media Router (sessions with
  26016. * the <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
  26017. * set to routed), not in sessions with the media mode set to relayed.
  26018. *
  26019. * @see Event
  26020. * @see <a href="Subscriber.html#event:videoDisableWarning">videoDisableWarning</a> event
  26021. * @see <a href="Subscriber.html#event:videoDisabled">videoDisabled</a> event
  26022. * @name videoDisableWarningLifted
  26023. * @event
  26024. * @memberof Subscriber
  26025. */
  26026. /**
  26027. * Dispatched when the OpenTok Media Router resumes sending video to the subscriber
  26028. * after video was previously disabled.
  26029. * <p>
  26030. * The <code>reason</code> property defines the reason the video was enabled. This can be set to
  26031. * one of the following values:
  26032. * <p>
  26033. *
  26034. * <ul>
  26035. *
  26036. * <li><code>"codecChanged"</code> &mdash; The subscriber video was enabled after
  26037. * a codec change from an incompatible codec.</li>
  26038. *
  26039. * <li><code>"publishVideo"</code> &mdash; The publisher started publishing video by calling
  26040. * <code>publishVideo(true)</code>.</li>
  26041. *
  26042. * <li><code>"quality"</code> &mdash; The OpenTok Media Router resumed sending video
  26043. * to the subscriber based on stream quality changes. This feature of the OpenTok Media
  26044. * Router has a subscriber drop the video stream when connectivity degrades and then resume
  26045. * the video stream if the stream quality improves.
  26046. * <p>
  26047. * This feature is only available in sessions that use the OpenTok Media Router (sessions with
  26048. * the <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
  26049. * set to routed), not in sessions with the media mode set to relayed.
  26050. * </li>
  26051. *
  26052. * <li><code>"subscribeToVideo"</code> &mdash; The subscriber started or stopped subscribing to
  26053. * video, by calling <code>subscribeToVideo(false)</code>.
  26054. * </li>
  26055. *
  26056. * </ul>
  26057. *
  26058. * <p>
  26059. * To prevent video from resuming, in the <code>videoEnabled</code> event listener,
  26060. * call <code>subscribeToVideo(false)</code> on the Subscriber object.
  26061. *
  26062. * @see VideoEnabledChangedEvent
  26063. * @see <a href="Subscriber.html#event:videoDisabled">videoDisabled</a> event
  26064. * @name videoEnabled
  26065. * @event
  26066. * @memberof Subscriber
  26067. */
  26068. /**
  26069. * Sent when the subscriber's stream has been interrupted.
  26070. * <p>
  26071. * In response to this event, you may want to provide a user interface notification, to let the
  26072. * user know that the audio-video stream is temporarily disconnected and that the app is trying
  26073. * to reconnect to it.
  26074. * <p>
  26075. * If the client reconnects to the stream, the Subscriber object dispatches a
  26076. * <code>connected</code> event. Otherwise, if the client cannot reconnect to the stream,
  26077. * the Subscriber object dispatches a <code>destroyed</code> event.
  26078. *
  26079. * @name disconnected
  26080. * @event
  26081. * @memberof Subscriber
  26082. * @see <a href="Subscriber.html#event:connected">connected event</a>
  26083. * @see Event
  26084. */
  26085. /**
  26086. * Sent when the subscriber's stream has resumed, after the Subscriber dispatches a
  26087. * <code>disconnected</code> event.
  26088. *
  26089. * @name connected
  26090. * @event
  26091. * @memberof Subscriber
  26092. * @see <a href="Subscriber.html#event:disconnected">disconnected event</a>
  26093. * @see Event
  26094. */
  26095. /**
  26096. * Dispatched when the Subscriber element is removed from the HTML DOM. When this event is
  26097. * dispatched, you may choose to adjust or remove HTML DOM elements related to the subscriber.
  26098. * <p>
  26099. * To prevent the Subscriber from being removed from the DOM when the stream is destroyed,
  26100. * listen for the <a href="Session.html#event:streamDestroyed">streamDestroyed event</a>
  26101. * dispatched by the Session object. The <code>streamDestroyed</code> event dispatched by the
  26102. * Session object is cancelable, and calling the <code>preventDefault()</code> method of the
  26103. * event object prevents Subscribers of the stream from being removed from the HTML DOM.
  26104. *
  26105. * @see Event
  26106. * @name destroyed
  26107. * @event
  26108. * @memberof Subscriber
  26109. */
  26110. /**
  26111. * Dispatched when the video dimensions of the video change. This can occur when the
  26112. * <code>stream.videoType</code> property is set to <code>"screen"</code> (for a screen-sharing
  26113. * video stream), when the user resizes the window being captured. It can also occur if the video
  26114. * is being published by a mobile device and the user rotates the device (causing the camera
  26115. * orientation to change). This event object has a <code>newValue</code> property and an
  26116. * <code>oldValue</code> property, representing the new and old dimensions of the video.
  26117. * Each of these has a <code>height</code> property and a <code>width</code> property,
  26118. * representing the height and width, in pixels.
  26119. * @name videoDimensionsChanged
  26120. * @event
  26121. * @memberof Subscriber
  26122. * @see VideoDimensionsChangedEvent
  26123. */
  26124. return this;
  26125. };
  26126. Subscriber.hasAudioOutputLevelStatCapability = hasAudioOutputLevelStatCapability;
  26127. Subscriber.WidgetView = WidgetView;
  26128. Subscriber.SubscriberPeerConnection = SubscriberPeerConnection;
  26129. return Subscriber;
  26130. };
  26131. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  26132. /***/ }),
  26133. /* 290 */
  26134. /***/ (function(module, exports, __webpack_require__) {
  26135. "use strict";
  26136. const generateSimpleStateMachine = __webpack_require__(155)(); // Models a Subscriber's subscribing State
  26137. //
  26138. // Valid States:
  26139. // NotSubscribing (the initial state
  26140. // Init (basic setup of DOM
  26141. // Connecting (Failure Cases -> No Route, Bad Offer, Bad Answer
  26142. // BindingRemoteStream (Failure Cases -> Anything to do with the media being
  26143. // (invalid, the media never plays
  26144. // Subscribing (this is 'onLoad'
  26145. // Failed (terminal state, with a reason that maps to one of the
  26146. // (failure cases above
  26147. // Destroyed (The subscriber has been cleaned up, terminal state
  26148. //
  26149. //
  26150. // Valid Transitions:
  26151. // NotSubscribing ->
  26152. // Init
  26153. //
  26154. // Init ->
  26155. // Connecting
  26156. // | BindingRemoteStream (if we are subscribing to ourselves and we alreay
  26157. // (have a stream
  26158. // | NotSubscribing (destroy()
  26159. //
  26160. // Connecting ->
  26161. // BindingRemoteStream
  26162. // | NotSubscribing
  26163. // | Failed
  26164. // | NotSubscribing (destroy()
  26165. //
  26166. // BindingRemoteStream ->
  26167. // Subscribing
  26168. // | Failed
  26169. // | NotSubscribing (destroy()
  26170. //
  26171. // Subscribing ->
  26172. // NotSubscribing (unsubscribe
  26173. // | Failed (probably a peer connection failure after we began
  26174. // (subscribing
  26175. //
  26176. // Failed ->
  26177. // Destroyed
  26178. //
  26179. // Destroyed -> (terminal state)
  26180. //
  26181. //
  26182. // @example
  26183. // var state = new SubscribingState(function(change) {
  26184. // console.log(change.message);
  26185. // });
  26186. //
  26187. // state.set('Init');
  26188. // state.current; -> 'Init'
  26189. //
  26190. // state.set('Subscribing'); -> triggers stateChangeFailed and logs out the error message
  26191. //
  26192. //
  26193. const initialState = 'NotSubscribing';
  26194. const validStates = ['NotSubscribing', 'Init', 'Connecting', 'BindingRemoteStream', 'Subscribing', 'Failed', 'Destroyed'];
  26195. const validTransitions = {
  26196. NotSubscribing: ['NotSubscribing', 'Init', 'Destroyed'],
  26197. Init: ['NotSubscribing', 'Connecting', 'BindingRemoteStream', 'Destroyed'],
  26198. Connecting: ['NotSubscribing', 'BindingRemoteStream', 'Failed', 'Destroyed'],
  26199. BindingRemoteStream: ['NotSubscribing', 'Subscribing', 'Failed', 'Destroyed'],
  26200. Subscribing: ['NotSubscribing', 'Failed', 'Destroyed', 'BindingRemoteStream'],
  26201. Failed: ['Destroyed'],
  26202. Destroyed: []
  26203. };
  26204. const SubscribingState = generateSimpleStateMachine(initialState, validStates, validTransitions);
  26205. SubscribingState.prototype.isDestroyed = function () {
  26206. return this.current === 'Destroyed';
  26207. };
  26208. SubscribingState.prototype.isFailed = function () {
  26209. return this.current === 'Failed';
  26210. };
  26211. SubscribingState.prototype.isSubscribing = function () {
  26212. return this.current === 'Subscribing';
  26213. };
  26214. SubscribingState.prototype.isAttemptingToSubscribe = function () {
  26215. return ['Init', 'Connecting', 'BindingRemoteStream'].indexOf(this.current) !== -1;
  26216. };
  26217. module.exports = SubscribingState;
  26218. /***/ }),
  26219. /* 291 */
  26220. /***/ (function(module, exports, __webpack_require__) {
  26221. "use strict";
  26222. var _interopRequireDefault = __webpack_require__(2);
  26223. var _extends2 = _interopRequireDefault(__webpack_require__(23));
  26224. module.exports = (_ref) => {
  26225. let socket = _ref.socket,
  26226. uri = _ref.uri,
  26227. defaultContent = _ref.content;
  26228. return (method, content) => socket.send({
  26229. uri,
  26230. method,
  26231. content: (0, _extends2.default)({}, defaultContent, {}, content)
  26232. });
  26233. };
  26234. /***/ }),
  26235. /* 292 */
  26236. /***/ (function(module, exports, __webpack_require__) {
  26237. (function webpackUniversalModuleDefinition(root, factory) {
  26238. if(true)
  26239. module.exports = factory();
  26240. else {}
  26241. })(this, function() {
  26242. return /******/ (function(modules) { // webpackBootstrap
  26243. /******/ // The module cache
  26244. /******/ var installedModules = {};
  26245. /******/
  26246. /******/ // The require function
  26247. /******/ function __webpack_require__(moduleId) {
  26248. /******/
  26249. /******/ // Check if module is in cache
  26250. /******/ if(installedModules[moduleId]) {
  26251. /******/ return installedModules[moduleId].exports;
  26252. /******/ }
  26253. /******/ // Create a new module (and put it into the cache)
  26254. /******/ var module = installedModules[moduleId] = {
  26255. /******/ i: moduleId,
  26256. /******/ l: false,
  26257. /******/ exports: {}
  26258. /******/ };
  26259. /******/
  26260. /******/ // Execute the module function
  26261. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  26262. /******/
  26263. /******/ // Flag the module as loaded
  26264. /******/ module.l = true;
  26265. /******/
  26266. /******/ // Return the exports of the module
  26267. /******/ return module.exports;
  26268. /******/ }
  26269. /******/
  26270. /******/
  26271. /******/ // expose the modules object (__webpack_modules__)
  26272. /******/ __webpack_require__.m = modules;
  26273. /******/
  26274. /******/ // expose the module cache
  26275. /******/ __webpack_require__.c = installedModules;
  26276. /******/
  26277. /******/ // identity function for calling harmony imports with the correct context
  26278. /******/ __webpack_require__.i = function(value) { return value; };
  26279. /******/
  26280. /******/ // define getter function for harmony exports
  26281. /******/ __webpack_require__.d = function(exports, name, getter) {
  26282. /******/ if(!__webpack_require__.o(exports, name)) {
  26283. /******/ Object.defineProperty(exports, name, {
  26284. /******/ configurable: false,
  26285. /******/ enumerable: true,
  26286. /******/ get: getter
  26287. /******/ });
  26288. /******/ }
  26289. /******/ };
  26290. /******/
  26291. /******/ // getDefaultExport function for compatibility with non-harmony modules
  26292. /******/ __webpack_require__.n = function(module) {
  26293. /******/ var getter = module && module.__esModule ?
  26294. /******/ function getDefault() { return module['default']; } :
  26295. /******/ function getModuleExports() { return module; };
  26296. /******/ __webpack_require__.d(getter, 'a', getter);
  26297. /******/ return getter;
  26298. /******/ };
  26299. /******/
  26300. /******/ // Object.prototype.hasOwnProperty.call
  26301. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  26302. /******/
  26303. /******/ // __webpack_public_path__
  26304. /******/ __webpack_require__.p = "";
  26305. /******/
  26306. /******/ // Load entry module and return exports
  26307. /******/ return __webpack_require__(__webpack_require__.s = 5);
  26308. /******/ })
  26309. /************************************************************************/
  26310. /******/ ([
  26311. /* 0 */
  26312. /***/ (function(module, exports, __webpack_require__) {
  26313. "use strict";
  26314. module.exports = function(target, sources) {
  26315. var n, source, key;
  26316. for(n = 1 ; n < arguments.length ; n++) {
  26317. source = arguments[n];
  26318. for(key in source) {
  26319. if (source.hasOwnProperty(key))
  26320. target[key] = source[key];
  26321. }
  26322. }
  26323. return target;
  26324. }
  26325. /***/ }),
  26326. /* 1 */
  26327. /***/ (function(module, exports, __webpack_require__) {
  26328. "use strict";
  26329. //-------------------------------------------------------------------------------------------------
  26330. var mixin = __webpack_require__(0);
  26331. //-------------------------------------------------------------------------------------------------
  26332. module.exports = {
  26333. build: function(target, config) {
  26334. var n, max, plugin, plugins = config.plugins;
  26335. for(n = 0, max = plugins.length ; n < max ; n++) {
  26336. plugin = plugins[n];
  26337. if (plugin.methods)
  26338. mixin(target, plugin.methods);
  26339. if (plugin.properties)
  26340. Object.defineProperties(target, plugin.properties);
  26341. }
  26342. },
  26343. hook: function(fsm, name, additional) {
  26344. var n, max, method, plugin,
  26345. plugins = fsm.config.plugins,
  26346. args = [fsm.context];
  26347. if (additional)
  26348. args = args.concat(additional)
  26349. for(n = 0, max = plugins.length ; n < max ; n++) {
  26350. plugin = plugins[n]
  26351. method = plugins[n][name]
  26352. if (method)
  26353. method.apply(plugin, args);
  26354. }
  26355. }
  26356. }
  26357. //-------------------------------------------------------------------------------------------------
  26358. /***/ }),
  26359. /* 2 */
  26360. /***/ (function(module, exports, __webpack_require__) {
  26361. "use strict";
  26362. //-------------------------------------------------------------------------------------------------
  26363. function camelize(label) {
  26364. if (label.length === 0)
  26365. return label;
  26366. var n, result, word, words = label.split(/[_-]/);
  26367. // single word with first character already lowercase, return untouched
  26368. if ((words.length === 1) && (words[0][0].toLowerCase() === words[0][0]))
  26369. return label;
  26370. result = words[0].toLowerCase();
  26371. for(n = 1 ; n < words.length ; n++) {
  26372. result = result + words[n].charAt(0).toUpperCase() + words[n].substring(1).toLowerCase();
  26373. }
  26374. return result;
  26375. }
  26376. //-------------------------------------------------------------------------------------------------
  26377. camelize.prepended = function(prepend, label) {
  26378. label = camelize(label);
  26379. return prepend + label[0].toUpperCase() + label.substring(1);
  26380. }
  26381. //-------------------------------------------------------------------------------------------------
  26382. module.exports = camelize;
  26383. /***/ }),
  26384. /* 3 */
  26385. /***/ (function(module, exports, __webpack_require__) {
  26386. "use strict";
  26387. //-------------------------------------------------------------------------------------------------
  26388. var mixin = __webpack_require__(0),
  26389. camelize = __webpack_require__(2);
  26390. //-------------------------------------------------------------------------------------------------
  26391. function Config(options, StateMachine) {
  26392. options = options || {};
  26393. this.options = options; // preserving original options can be useful (e.g visualize plugin)
  26394. this.defaults = StateMachine.defaults;
  26395. this.states = [];
  26396. this.transitions = [];
  26397. this.map = {};
  26398. this.lifecycle = this.configureLifecycle();
  26399. this.init = this.configureInitTransition(options.init);
  26400. this.data = this.configureData(options.data);
  26401. this.methods = this.configureMethods(options.methods);
  26402. this.map[this.defaults.wildcard] = {};
  26403. this.configureTransitions(options.transitions || []);
  26404. this.plugins = this.configurePlugins(options.plugins, StateMachine.plugin);
  26405. }
  26406. //-------------------------------------------------------------------------------------------------
  26407. mixin(Config.prototype, {
  26408. addState: function(name) {
  26409. if (!this.map[name]) {
  26410. this.states.push(name);
  26411. this.addStateLifecycleNames(name);
  26412. this.map[name] = {};
  26413. }
  26414. },
  26415. addStateLifecycleNames: function(name) {
  26416. this.lifecycle.onEnter[name] = camelize.prepended('onEnter', name);
  26417. this.lifecycle.onLeave[name] = camelize.prepended('onLeave', name);
  26418. this.lifecycle.on[name] = camelize.prepended('on', name);
  26419. },
  26420. addTransition: function(name) {
  26421. if (this.transitions.indexOf(name) < 0) {
  26422. this.transitions.push(name);
  26423. this.addTransitionLifecycleNames(name);
  26424. }
  26425. },
  26426. addTransitionLifecycleNames: function(name) {
  26427. this.lifecycle.onBefore[name] = camelize.prepended('onBefore', name);
  26428. this.lifecycle.onAfter[name] = camelize.prepended('onAfter', name);
  26429. this.lifecycle.on[name] = camelize.prepended('on', name);
  26430. },
  26431. mapTransition: function(transition) {
  26432. var name = transition.name,
  26433. from = transition.from,
  26434. to = transition.to;
  26435. this.addState(from);
  26436. if (typeof to !== 'function')
  26437. this.addState(to);
  26438. this.addTransition(name);
  26439. this.map[from][name] = transition;
  26440. return transition;
  26441. },
  26442. configureLifecycle: function() {
  26443. return {
  26444. onBefore: { transition: 'onBeforeTransition' },
  26445. onAfter: { transition: 'onAfterTransition' },
  26446. onEnter: { state: 'onEnterState' },
  26447. onLeave: { state: 'onLeaveState' },
  26448. on: { transition: 'onTransition' }
  26449. };
  26450. },
  26451. configureInitTransition: function(init) {
  26452. if (typeof init === 'string') {
  26453. return this.mapTransition(mixin({}, this.defaults.init, { to: init, active: true }));
  26454. }
  26455. else if (typeof init === 'object') {
  26456. return this.mapTransition(mixin({}, this.defaults.init, init, { active: true }));
  26457. }
  26458. else {
  26459. this.addState(this.defaults.init.from);
  26460. return this.defaults.init;
  26461. }
  26462. },
  26463. configureData: function(data) {
  26464. if (typeof data === 'function')
  26465. return data;
  26466. else if (typeof data === 'object')
  26467. return function() { return data; }
  26468. else
  26469. return function() { return {}; }
  26470. },
  26471. configureMethods: function(methods) {
  26472. return methods || {};
  26473. },
  26474. configurePlugins: function(plugins, builtin) {
  26475. plugins = plugins || [];
  26476. var n, max, plugin;
  26477. for(n = 0, max = plugins.length ; n < max ; n++) {
  26478. plugin = plugins[n];
  26479. if (typeof plugin === 'function')
  26480. plugins[n] = plugin = plugin()
  26481. if (plugin.configure)
  26482. plugin.configure(this);
  26483. }
  26484. return plugins
  26485. },
  26486. configureTransitions: function(transitions) {
  26487. var i, n, transition, from, to, wildcard = this.defaults.wildcard;
  26488. for(n = 0 ; n < transitions.length ; n++) {
  26489. transition = transitions[n];
  26490. from = Array.isArray(transition.from) ? transition.from : [transition.from || wildcard]
  26491. to = transition.to || wildcard;
  26492. for(i = 0 ; i < from.length ; i++) {
  26493. this.mapTransition({ name: transition.name, from: from[i], to: to });
  26494. }
  26495. }
  26496. },
  26497. transitionFor: function(state, transition) {
  26498. var wildcard = this.defaults.wildcard;
  26499. return this.map[state][transition] ||
  26500. this.map[wildcard][transition];
  26501. },
  26502. transitionsFor: function(state) {
  26503. var wildcard = this.defaults.wildcard;
  26504. return Object.keys(this.map[state]).concat(Object.keys(this.map[wildcard]));
  26505. },
  26506. allStates: function() {
  26507. return this.states;
  26508. },
  26509. allTransitions: function() {
  26510. return this.transitions;
  26511. }
  26512. });
  26513. //-------------------------------------------------------------------------------------------------
  26514. module.exports = Config;
  26515. //-------------------------------------------------------------------------------------------------
  26516. /***/ }),
  26517. /* 4 */
  26518. /***/ (function(module, exports, __webpack_require__) {
  26519. var mixin = __webpack_require__(0),
  26520. Exception = __webpack_require__(6),
  26521. plugin = __webpack_require__(1),
  26522. UNOBSERVED = [ null, [] ];
  26523. //-------------------------------------------------------------------------------------------------
  26524. function JSM(context, config) {
  26525. this.context = context;
  26526. this.config = config;
  26527. this.state = config.init.from;
  26528. this.observers = [context];
  26529. }
  26530. //-------------------------------------------------------------------------------------------------
  26531. mixin(JSM.prototype, {
  26532. init: function(args) {
  26533. mixin(this.context, this.config.data.apply(this.context, args));
  26534. plugin.hook(this, 'init');
  26535. if (this.config.init.active)
  26536. return this.fire(this.config.init.name, []);
  26537. },
  26538. is: function(state) {
  26539. return Array.isArray(state) ? (state.indexOf(this.state) >= 0) : (this.state === state);
  26540. },
  26541. isPending: function() {
  26542. return this.pending;
  26543. },
  26544. can: function(transition) {
  26545. return !this.isPending() && !!this.seek(transition);
  26546. },
  26547. cannot: function(transition) {
  26548. return !this.can(transition);
  26549. },
  26550. allStates: function() {
  26551. return this.config.allStates();
  26552. },
  26553. allTransitions: function() {
  26554. return this.config.allTransitions();
  26555. },
  26556. transitions: function() {
  26557. return this.config.transitionsFor(this.state);
  26558. },
  26559. seek: function(transition, args) {
  26560. var wildcard = this.config.defaults.wildcard,
  26561. entry = this.config.transitionFor(this.state, transition),
  26562. to = entry && entry.to;
  26563. if (typeof to === 'function')
  26564. return to.apply(this.context, args);
  26565. else if (to === wildcard)
  26566. return this.state
  26567. else
  26568. return to
  26569. },
  26570. fire: function(transition, args) {
  26571. return this.transit(transition, this.state, this.seek(transition, args), args);
  26572. },
  26573. transit: function(transition, from, to, args) {
  26574. var lifecycle = this.config.lifecycle,
  26575. changed = this.config.options.observeUnchangedState || (from !== to);
  26576. if (!to)
  26577. return this.context.onInvalidTransition(transition, from, to);
  26578. if (this.isPending())
  26579. return this.context.onPendingTransition(transition, from, to);
  26580. this.config.addState(to); // might need to add this state if it's unknown (e.g. conditional transition or goto)
  26581. this.beginTransit();
  26582. args.unshift({ // this context will be passed to each lifecycle event observer
  26583. transition: transition,
  26584. from: from,
  26585. to: to,
  26586. fsm: this.context
  26587. });
  26588. return this.observeEvents([
  26589. this.observersForEvent(lifecycle.onBefore.transition),
  26590. this.observersForEvent(lifecycle.onBefore[transition]),
  26591. changed ? this.observersForEvent(lifecycle.onLeave.state) : UNOBSERVED,
  26592. changed ? this.observersForEvent(lifecycle.onLeave[from]) : UNOBSERVED,
  26593. this.observersForEvent(lifecycle.on.transition),
  26594. changed ? [ 'doTransit', [ this ] ] : UNOBSERVED,
  26595. changed ? this.observersForEvent(lifecycle.onEnter.state) : UNOBSERVED,
  26596. changed ? this.observersForEvent(lifecycle.onEnter[to]) : UNOBSERVED,
  26597. changed ? this.observersForEvent(lifecycle.on[to]) : UNOBSERVED,
  26598. this.observersForEvent(lifecycle.onAfter.transition),
  26599. this.observersForEvent(lifecycle.onAfter[transition]),
  26600. this.observersForEvent(lifecycle.on[transition])
  26601. ], args);
  26602. },
  26603. beginTransit: function() { this.pending = true; },
  26604. endTransit: function(result) { this.pending = false; return result; },
  26605. failTransit: function(result) { this.pending = false; throw result; },
  26606. doTransit: function(lifecycle) { this.state = lifecycle.to; },
  26607. observe: function(args) {
  26608. if (args.length === 2) {
  26609. var observer = {};
  26610. observer[args[0]] = args[1];
  26611. this.observers.push(observer);
  26612. }
  26613. else {
  26614. this.observers.push(args[0]);
  26615. }
  26616. },
  26617. observersForEvent: function(event) { // TODO: this could be cached
  26618. var n = 0, max = this.observers.length, observer, result = [];
  26619. for( ; n < max ; n++) {
  26620. observer = this.observers[n];
  26621. if (observer[event])
  26622. result.push(observer);
  26623. }
  26624. return [ event, result, true ]
  26625. },
  26626. observeEvents: function(events, args, previousEvent, previousResult) {
  26627. if (events.length === 0) {
  26628. return this.endTransit(previousResult === undefined ? true : previousResult);
  26629. }
  26630. var event = events[0][0],
  26631. observers = events[0][1],
  26632. pluggable = events[0][2];
  26633. args[0].event = event;
  26634. if (event && pluggable && event !== previousEvent)
  26635. plugin.hook(this, 'lifecycle', args);
  26636. if (observers.length === 0) {
  26637. events.shift();
  26638. return this.observeEvents(events, args, event, previousResult);
  26639. }
  26640. else {
  26641. var observer = observers.shift(),
  26642. result = observer[event].apply(observer, args);
  26643. if (result && typeof result.then === 'function') {
  26644. return result.then(this.observeEvents.bind(this, events, args, event))
  26645. .catch(this.failTransit.bind(this))
  26646. }
  26647. else if (result === false) {
  26648. return this.endTransit(false);
  26649. }
  26650. else {
  26651. return this.observeEvents(events, args, event, result);
  26652. }
  26653. }
  26654. },
  26655. onInvalidTransition: function(transition, from, to) {
  26656. throw new Exception("transition is invalid in current state", transition, from, to, this.state);
  26657. },
  26658. onPendingTransition: function(transition, from, to) {
  26659. throw new Exception("transition is invalid while previous transition is still in progress", transition, from, to, this.state);
  26660. }
  26661. });
  26662. //-------------------------------------------------------------------------------------------------
  26663. module.exports = JSM;
  26664. //-------------------------------------------------------------------------------------------------
  26665. /***/ }),
  26666. /* 5 */
  26667. /***/ (function(module, exports, __webpack_require__) {
  26668. "use strict";
  26669. //-----------------------------------------------------------------------------------------------
  26670. var mixin = __webpack_require__(0),
  26671. camelize = __webpack_require__(2),
  26672. plugin = __webpack_require__(1),
  26673. Config = __webpack_require__(3),
  26674. JSM = __webpack_require__(4);
  26675. //-----------------------------------------------------------------------------------------------
  26676. var PublicMethods = {
  26677. is: function(state) { return this._fsm.is(state) },
  26678. can: function(transition) { return this._fsm.can(transition) },
  26679. cannot: function(transition) { return this._fsm.cannot(transition) },
  26680. observe: function() { return this._fsm.observe(arguments) },
  26681. transitions: function() { return this._fsm.transitions() },
  26682. allTransitions: function() { return this._fsm.allTransitions() },
  26683. allStates: function() { return this._fsm.allStates() },
  26684. onInvalidTransition: function(t, from, to) { return this._fsm.onInvalidTransition(t, from, to) },
  26685. onPendingTransition: function(t, from, to) { return this._fsm.onPendingTransition(t, from, to) },
  26686. }
  26687. var PublicProperties = {
  26688. state: {
  26689. configurable: false,
  26690. enumerable: true,
  26691. get: function() {
  26692. return this._fsm.state;
  26693. },
  26694. set: function(state) {
  26695. throw Error('use transitions to change state')
  26696. }
  26697. }
  26698. }
  26699. //-----------------------------------------------------------------------------------------------
  26700. function StateMachine(options) {
  26701. return apply(this || {}, options);
  26702. }
  26703. function factory() {
  26704. var cstor, options;
  26705. if (typeof arguments[0] === 'function') {
  26706. cstor = arguments[0];
  26707. options = arguments[1] || {};
  26708. }
  26709. else {
  26710. cstor = function() { this._fsm.apply(this, arguments) };
  26711. options = arguments[0] || {};
  26712. }
  26713. var config = new Config(options, StateMachine);
  26714. build(cstor.prototype, config);
  26715. cstor.prototype._fsm.config = config; // convenience access to shared config without needing an instance
  26716. return cstor;
  26717. }
  26718. //-------------------------------------------------------------------------------------------------
  26719. function apply(instance, options) {
  26720. var config = new Config(options, StateMachine);
  26721. build(instance, config);
  26722. instance._fsm();
  26723. return instance;
  26724. }
  26725. function build(target, config) {
  26726. if ((typeof target !== 'object') || Array.isArray(target))
  26727. throw Error('StateMachine can only be applied to objects');
  26728. plugin.build(target, config);
  26729. Object.defineProperties(target, PublicProperties);
  26730. mixin(target, PublicMethods);
  26731. mixin(target, config.methods);
  26732. config.allTransitions().forEach(function(transition) {
  26733. target[camelize(transition)] = function() {
  26734. return this._fsm.fire(transition, [].slice.call(arguments))
  26735. }
  26736. });
  26737. target._fsm = function() {
  26738. this._fsm = new JSM(this, config);
  26739. this._fsm.init(arguments);
  26740. }
  26741. }
  26742. //-----------------------------------------------------------------------------------------------
  26743. StateMachine.version = '3.0.1';
  26744. StateMachine.factory = factory;
  26745. StateMachine.apply = apply;
  26746. StateMachine.defaults = {
  26747. wildcard: '*',
  26748. init: {
  26749. name: 'init',
  26750. from: 'none'
  26751. }
  26752. }
  26753. //===============================================================================================
  26754. module.exports = StateMachine;
  26755. /***/ }),
  26756. /* 6 */
  26757. /***/ (function(module, exports, __webpack_require__) {
  26758. "use strict";
  26759. module.exports = function(message, transition, from, to, current) {
  26760. this.message = message;
  26761. this.transition = transition;
  26762. this.from = from;
  26763. this.to = to;
  26764. this.current = current;
  26765. }
  26766. /***/ })
  26767. /******/ ]);
  26768. });
  26769. /***/ }),
  26770. /* 293 */
  26771. /***/ (function(module, exports, __webpack_require__) {
  26772. "use strict";
  26773. /* WEBPACK VAR INJECTION */(function(Promise) {
  26774. /**
  26775. * promisify - Promisify a node style callback function into a promise
  26776. *
  26777. * Returns a promisifed version of the function, if it's callback is called
  26778. * with a truthy error parameter the promise will be rejected. If the callback
  26779. * is called with one argument, it's value will be resolved. If the callback
  26780. * is called with multiple arguments, the promise will resolve to an array
  26781. * of those arguments.
  26782. *
  26783. * @param {function} fn Function to promisify
  26784. * @returns {function} Promise returning function
  26785. */
  26786. module.exports = function promisify(fn) {
  26787. return function promisified() {
  26788. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  26789. args[_key] = arguments[_key];
  26790. }
  26791. return new Promise((resolve, reject) => {
  26792. fn(...args, function (err) {
  26793. if (err) {
  26794. reject(err);
  26795. return;
  26796. }
  26797. for (var _len2 = arguments.length, callbackArgs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  26798. callbackArgs[_key2 - 1] = arguments[_key2];
  26799. }
  26800. if (callbackArgs.length === 1) {
  26801. resolve(callbackArgs[0]);
  26802. return;
  26803. }
  26804. resolve(callbackArgs);
  26805. });
  26806. });
  26807. };
  26808. };
  26809. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  26810. /***/ }),
  26811. /* 294 */
  26812. /***/ (function(module, exports, __webpack_require__) {
  26813. "use strict";
  26814. module.exports = {
  26815. TEARDOWN_REQUIRED: 'The proxyUrl was set after a session or publisher were created. Please tear down the session and all publishers and try again',
  26816. ALREADY_SET: 'The proxyUrl has already been set. Setting it again will not have any effect.',
  26817. DEPRECATED_METHOD: 'Setting the proxyUrl via initSession has been deprecated because it can result in some HTTPS traffic going directly to OpenTok. Please tear down the session and use OT.setProxyUrl() instead.'
  26818. };
  26819. /***/ }),
  26820. /* 295 */
  26821. /***/ (function(module, exports, __webpack_require__) {
  26822. "use strict";
  26823. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  26824. /* eslint-disable no-param-reassign, global-require, max-len, prefer-rest-params */
  26825. /* eslint-disable no-use-before-define */
  26826. const isFunction = __webpack_require__(13);
  26827. const isObject = __webpack_require__(7);
  26828. module.exports = function initPublisherFactory(deps) {
  26829. if (deps === void 0) {
  26830. deps = {};
  26831. }
  26832. const Errors = deps.Errors || __webpack_require__(8);
  26833. const ExceptionCodes = deps.ExceptionCodes || __webpack_require__(11);
  26834. const logging = deps.logging || __webpack_require__(1)('publisherInit');
  26835. const otError = deps.otError || __webpack_require__(12)();
  26836. const OTHelpers = deps.OTHelpers || __webpack_require__(4);
  26837. const Publisher = deps.Publisher || __webpack_require__(163)();
  26838. const sessionObjects = deps.sessionObjects || __webpack_require__(22);
  26839. /**
  26840. * <p class="mSummary">
  26841. * Initializes and returns a Publisher object. You can then pass this Publisher
  26842. * object to <code>Session.publish()</code> to publish a stream to a session.
  26843. * </p>
  26844. * <p>
  26845. * <i>Note:</i> If you intend to reuse a Publisher object created using
  26846. * <code>OT.initPublisher()</code> to publish to different sessions sequentially,
  26847. * call either <code>Session.disconnect()</code> or <code>Session.unpublish()</code>.
  26848. * Do not call both. Then call the <code>preventDefault()</code> method of the
  26849. * <code>streamDestroyed</code> or <code>sessionDisconnected</code> event object to prevent the
  26850. * Publisher object from being removed from the page.
  26851. * </p>
  26852. *
  26853. * @param {Object} targetElement (Optional) The DOM element or the <code>id</code> attribute of the
  26854. * existing DOM element used to determine the location of the Publisher video in the HTML DOM. See
  26855. * the <code>insertMode</code> property of the <code>properties</code> parameter. If you do not
  26856. * specify a <code>targetElement</code>, the application appends a new DOM element to the HTML
  26857. * <code>body</code>.
  26858. *
  26859. * <p>
  26860. * The application throws an error if an element with an ID set to the
  26861. * <code>targetElement</code> value does not exist in the HTML DOM.
  26862. * </p>
  26863. *
  26864. * @param {Object} properties (Optional) This object contains the following properties (each of which
  26865. * are optional):
  26866. * </p>
  26867. * <ul>
  26868. * <li>
  26869. * <strong>audioBitrate</strong> (Number) &#151; The desired bitrate for the published audio,
  26870. * in bits per second. The supported range of values is 6,000 - 510,000. (Invalid values are
  26871. * ignored.) Set this value to enable high-quality audio (or to reduce bandwidth usage with
  26872. * lower-quality audio).
  26873. * <p>
  26874. * The following are recommended settings:
  26875. * <ul>
  26876. * <li>8,000 - 12,000 for narrowband (NB) speech</li>
  26877. * <li>16,000 - 20,000 for wideband (WB) speech</li>
  26878. * <li>28,000 - 40,000 for full-band (FB) speech</li>
  26879. * <li>48,000 - 64,000 for full-band (FB) music</li>
  26880. * </ul>
  26881. * </p>
  26882. * <p>
  26883. * The default value is 40,000.
  26884. * </p>
  26885. * <p>
  26886. * Currently, this setting is not supported in streams published in Firefox.
  26887. * </p>
  26888. * </li>
  26889. * <li>
  26890. * <strong>audioFallbackEnabled</strong> (Boolean) &#151; Whether the stream will use the
  26891. * audio-fallback feature (<code>true</code>) or not (<code>false</code>). The audio-fallback
  26892. * feature is available in sessions that use the OpenTok Media Router. With the audio-fallback
  26893. * feature enabled (the default), when the server determines that a stream's quality has degraded
  26894. * significantly for a specific subscriber, it disables the video in that subscriber in order to
  26895. * preserve audio quality. For streams that use a camera as a video source, the default setting is
  26896. * <code>true</code> (the audio-fallback feature is enabled). The default setting is
  26897. * <code>false</code> (the audio-fallback feature is disabled) for screen-sharing streams, which
  26898. * have the <code>videoSource</code> property set to <code>"application"</code>,
  26899. * <code>"screen"</code>, or <code>"window"</code> in the <code>OT.initPublisher()</code>
  26900. * options. For more information, see the Subscriber
  26901. * <a href="Subscriber.html#event:videoDisabled">videoDisabled</a> event and
  26902. * <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">the OpenTok Media
  26903. * Router and media modes</a>.
  26904. * </li>
  26905. * <li>
  26906. * <strong>audioSource</strong> (String, MediaStreamTrack, Boolean, or null) &#151;
  26907. * The ID of the audio input device (such as a
  26908. * microphone) to be used by the publisher. You can obtain a list of available devices, including
  26909. * audio input devices, by calling the <a href="#getDevices">OT.getDevices()</a> method. Each
  26910. * device listed by the method has a unique device ID. If you pass in a device ID that does not
  26911. * match an existing audio input device, the call to <code>OT.initPublisher()</code> fails with an
  26912. * error (error code 1500, "Unable to Publish") passed to the completion handler function.
  26913. * <p>
  26914. * If you set this property to <code>null</code> or <code>false</code>, the browser does not
  26915. * request access to the microphone, and no audio is published.
  26916. * </p>
  26917. * <p>
  26918. * You can also set this property to an audio
  26919. * <a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack">
  26920. * MediaStreamTrack</a> object. This lets you use the object as the audio source for
  26921. * the published stream. For example, you can get an array of audio MediaStreamTrack objects
  26922. * from the <code>audioTracks</code> property of an HTMLMediaElement object. Or you can call
  26923. * the <code>getLocalStreams()</code> or <code>getRemoteStreams()</code> method of an
  26924. * RTCPeerConnection object to get an array of MediaStream objects, and then call the
  26925. * <code>getAudioTracks()</code> method of one of the MediaStream objects to get an audio
  26926. * MediaStreamTrack object.
  26927. * </p>
  26928. * </li>
  26929. * <li>
  26930. * <strong>disableAudioProcessing</strong> (Boolean) &#151; Whether to disable echo cancellation,
  26931. * automatic gain control, and noise suppression for the published audio. You may want to set
  26932. * this to <code>true</code> when publishing high-quality audio (by setting the
  26933. * <code>audioBitrate</code> property of the <code>OT.initPublisher()</code> options). The
  26934. * default value is <code>false</code>.
  26935. * </li>
  26936. * <li>
  26937. * <strong>enableStereo</strong> (Boolean) &#151; Whether to publish stereo audio. The default
  26938. * value is <code>false</code>.
  26939. * <p>
  26940. * <i>Note:</i> Some browsers (such as Chome 73+) do not support
  26941. * echo cancellation for stereo audio (see <a target="_blank"
  26942. * href="https://bugs.chromium.org/p/webrtc/issues/detail?id=10465">this
  26943. * Chrome issue report</a>).
  26944. * </li>
  26945. * <li>
  26946. * <strong>facingMode</strong> (String) &#151; The preferred camera position to use for the
  26947. * video source. Generally, this setting only applies to mobile devices. This can be set to
  26948. * one of the following values:
  26949. * <p>
  26950. * <ul>
  26951. * <li>
  26952. * <code>"user"</code> &mdash; The front-facing camera.
  26953. * </li>
  26954. * <li>
  26955. * <code>"environment"</code> &mdash; The back camera.
  26956. * </li>
  26957. * <li>
  26958. * <code>"left"</code> &mdash; The camera facing the user but to the left
  26959. * (uncommon).
  26960. * </li>
  26961. * <li>
  26962. * <code>"right"</code> &mdash; The camera facing the user but to the right
  26963. * (uncommon).
  26964. * </li>
  26965. * </ul>
  26966. * </p>
  26967. * </li>
  26968. * <li>
  26969. * <strong>fitMode</strong> (String) &#151; Determines how the video is displayed if the its
  26970. * dimensions do not match those of the DOM element. You can set this property to one of the
  26971. * following values:
  26972. * <p>
  26973. * <ul>
  26974. * <li>
  26975. * <code>"cover"</code> &mdash; The video is cropped if its dimensions do not match those of
  26976. * the DOM element. This is the default setting for videos publishing a camera feed.
  26977. * </li>
  26978. * <li>
  26979. * <code>"contain"</code> &mdash; The video is letterboxed if its dimensions do not match
  26980. * those of the DOM element. This is the default setting for screen-sharing videos.
  26981. * </li>
  26982. * </ul>
  26983. * </li>
  26984. * <li>
  26985. * <strong>frameRate</strong> (Number) &#151; The desired frame rate, in frames per second,
  26986. * of the video. Valid values are 30, 15, 7, and 1. The published stream will use the closest
  26987. * value supported on the publishing client. The frame rate can differ slightly from the value
  26988. * you set, depending on the browser of the client. And the video will only use the desired
  26989. * frame rate if the client configuration supports it.
  26990. * <br><br><p>If the publisher specifies a frame rate, the actual frame rate of the video stream
  26991. * is set as the <code>frameRate</code> property of the Stream object, though the actual frame rate
  26992. * will vary based on changing network and system conditions. If the developer does not specify a
  26993. * frame rate, this property is undefined. Also, if the video source is a video MediaStreamTrack
  26994. * object (see the <code>videoSource</code>), this value is ignored and the frame rate is
  26995. * defined by the MediaStreamTrack object, which you can get by calling the
  26996. * <code>getConstraints()</code> method of the MediaStreamTrack object.
  26997. * </p>
  26998. * <p>
  26999. * For sessions that use the OpenTok Media Router (sessions with
  27000. * the <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
  27001. * set to routed, lowering the frame rate proportionally reduces the maximum bandwidth the stream
  27002. * uses. However, in sessions with the media mode set to relayed, lowering the frame rate does not
  27003. * reduce the stream's bandwidth.
  27004. * </p>
  27005. * <p>
  27006. * You can also restrict the frame rate of a Subscriber's video stream. To restrict the frame rate
  27007. * a Subscriber, call the <code>restrictFrameRate()</code> method of the subscriber, passing in
  27008. * <code>true</code>.
  27009. * (See <a href="Subscriber.html#restrictFrameRate">Subscriber.restrictFrameRate()</a>.)
  27010. * </p>
  27011. * </li>
  27012. * <li>
  27013. * <strong>height</strong> (Number or String) &#151; The desired initial height of the displayed Publisher
  27014. * video in the HTML page (default: 198 pixels). You can specify the number of pixels as either
  27015. * a number (such as 300) or a string ending in "px" (such as "300px"). Or you can specify a
  27016. * percentage of the size of the parent element, with a string ending in "%" (such as "100%").
  27017. * <i>Note:</i> To resize the publisher video, adjust the CSS of the publisher's DOM element
  27018. * (the <code>element</code> property of the Publisher object) or (if the height is specified as
  27019. * a percentage) its parent DOM element (see
  27020. * <a href="https://tokbox.com/developer/guides/customize-ui/js/#video_resize_reposition">Resizing
  27021. * or repositioning a video</a>).
  27022. * </li>
  27023. * <li>
  27024. * <strong>insertDefaultUI</strong> (Boolean) &#151; Whether to use the default OpenTok UI
  27025. * (<code>true</code>, the default) or not (<code>false</code>). The default UI element contains
  27026. * user interface controls, a video loading indicator, and automatic video cropping or
  27027. * letterboxing, in addition to the video. (If you leave <code>insertDefaultUI</code> set to
  27028. * <code>true</code>, you can control individual UI settings using the <code>fitMode</code>,
  27029. * <code>showControls</code>, and <code>style</code> options.)
  27030. * <p>
  27031. * If you set this option to <code>false</code>, OpenTok.js does not insert a default UI element
  27032. * in the HTML DOM, and the <code>element</code> property of the Publisher object is undefined.
  27033. * Instead, the Publisher object dispatches a
  27034. * <a href="Publisher.html#event:videoElementCreated">videoElementCreated</a> event when
  27035. * the <code>video</code> element (or in Internet Explorer the <code>object</code> element
  27036. * containing the video) is created. The <code>element</code> property of the event object is a
  27037. * reference to the Publisher's <code>video</code> (or <code>object</code>) element. Add it to
  27038. * the HTML DOM to display the video.
  27039. * <p>
  27040. * Set this option to <code>false</code> if you want to move the Publisher's <code>video</code>
  27041. * (or <code>object</code>) element in the HTML DOM.
  27042. * <p>
  27043. * If you set this to <code>false</code>, do not set the <code>targetElement</code> parameter.
  27044. * (This results in an error passed into to the <code>OT.initPublisher()</code> callback
  27045. * function.) To add the video to the HTML DOM, add an event listener for the
  27046. * <code>videoElementCreated</code> event, and then add the <code>element</code> property of
  27047. * the event object into the HTML DOM.
  27048. * </li>
  27049. * <li>
  27050. * <strong>insertMode</strong> (String) &#151; Specifies how the Publisher object will be
  27051. * inserted in the HTML DOM. See the <code>targetElement</code> parameter. This string can
  27052. * have the following values:
  27053. * <p>
  27054. * <ul>
  27055. * <li><code>"replace"</code> &#151; The Publisher object replaces contents of the
  27056. * targetElement. This is the default.</li>
  27057. * <li><code>"after"</code> &#151; The Publisher object is a new element inserted after
  27058. * the targetElement in the HTML DOM. (Both the Publisher and targetElement have the
  27059. * same parent element.)</li>
  27060. * <li><code>"before"</code> &#151; The Publisher object is a new element inserted before
  27061. * the targetElement in the HTML DOM. (Both the Publisher and targetElement have the same
  27062. * parent element.)</li>
  27063. * <li><code>"append"</code> &#151; The Publisher object is a new element added as a child
  27064. * of the targetElement. If there are other child elements, the Publisher is appended as
  27065. * the last child element of the targetElement.</li>
  27066. * </ul></p>
  27067. * <li>
  27068. * <strong>maxResolution</strong> (Object) &#151; Sets the maximum resolution to stream.
  27069. * This setting only applies to when the <code>videoSource</code> property is set to
  27070. * <code>"application"</code>, <code>"screen"</code>, or <code>"window"</code>
  27071. * (when the publisher is screen-sharing). The resolution of the
  27072. * stream will match the captured screen region unless the region is greater than the
  27073. * <code>maxResolution</code> setting. Set this to an object that has two properties:
  27074. * <code>width</code> and <code>height</code> (both numbers). The maximum value for each of
  27075. * the <code>width</code> and <code>height</code> properties is 1920, and the minimum value
  27076. * is 10.
  27077. * </li>
  27078. * <li>
  27079. * <strong>mirror</strong> (Boolean) &#151; Whether the publisher's video image
  27080. * is mirrored in the publisher's page. The default value is <code>true</code>
  27081. * (the video image is mirrored), except for a screen-sharing video (when the
  27082. * <code>videoSource</code> property is set to <code>"application"</code>,
  27083. * <code>"screen"</code>, or <code>"window"</code>
  27084. * (in which case the default is <code>false</code>). This property
  27085. * does not affect the display on subscribers' views of the video.
  27086. * </li>
  27087. * <li>
  27088. * <strong>name</strong> (String) &#151; The name for this stream. The name appears at
  27089. * the bottom of Subscriber videos. The default value is "" (an empty string). Setting
  27090. * this to a string longer than 1000 characters results in an runtime exception.
  27091. * </li>
  27092. * <li>
  27093. * <strong>publishAudio</strong> (Boolean) &#151; Whether to initially publish audio
  27094. * for the stream (default: <code>true</code>). This setting applies when you pass
  27095. * the Publisher object in a call to the <code>Session.publish()</code> method.
  27096. * </li>
  27097. * <li>
  27098. * <strong>publishVideo</strong> (Boolean) &#151; Whether to initially publish video
  27099. * for the stream (default: <code>true</code>). This setting applies when you pass
  27100. * the Publisher object in a call to the <code>Session.publish()</code> method.
  27101. * </li>
  27102. * <li>
  27103. * <strong>resolution</strong> (String) &#151; The desired resolution of the video. The format
  27104. * of the string is <code>"widthxheight"</code>, where the width and height are represented in
  27105. * pixels. Valid values are <code>"1280x720"</code>, <code>"640x480"</code>, and
  27106. * <code>"320x240"</code>. The published video will only use the desired resolution if the
  27107. * client configuration supports it. Some browsers and clients do not support each of these
  27108. * resolution settings.
  27109. * <br><br><p>
  27110. * The requested resolution of a video stream is set as the <code>videoDimensions.width</code> and
  27111. * <code>videoDimensions.height</code> properties of the Stream object.
  27112. * </p>
  27113. * <p>
  27114. * The default resolution for a stream (if you do not specify a resolution) is 640x480 pixels.
  27115. * If the client system cannot support the resolution you requested, the stream will use the
  27116. * next largest setting supported.
  27117. * </p>
  27118. * <p>
  27119. * The actual resolution used by the Publisher is returned by the <code>videoHeight()</code> and
  27120. * <code>videoWidth()</code> methods of the Publisher object. The actual resolution of a
  27121. * Subscriber video stream is returned by the <code>videoHeight()</code> and
  27122. * <code>videoWidth()</code> properties of the Subscriber object. These may differ from the values
  27123. * of the <code>resolution</code> property passed in as the <code>properties</code> property of the
  27124. * <code>OT.initPublisher()</code> method, if the browser does not support the requested
  27125. * resolution, this value is ignored. Also, if the video source is a video MediaStreamTrack
  27126. * object (see the <code>videoSource</code>), this value is ignored and the resolution
  27127. * is defined by the MediaStreamTrack object, which you can get by calling the
  27128. * <code>getConstraints()</code> method of the MediaStreamTrack object.
  27129. * </p>
  27130. * </li>
  27131. * <li>
  27132. * <strong>showControls</strong> (Boolean) &#151; Whether to display the built-in user interface
  27133. * controls (default: <code>true</code>) for the Publisher. These controls include the name
  27134. * display, the audio level indicator, and the microphone control button. You can turn off all user
  27135. * interface controls by setting this property to <code>false</code>. You can control the display
  27136. * of individual user interface controls by leaving this property set to <code>true</code> (the
  27137. * default) and setting individual properties of the <code>style</code> property.
  27138. * </li>
  27139. * <li>
  27140. * <strong>style</strong> (Object) &#151; An object containing properties that define the initial
  27141. * appearance of user interface controls of the Publisher. The <code>style</code> object includes
  27142. * the following properties:
  27143. * <ul>
  27144. * <li><code>audioLevelDisplayMode</code> (String) &mdash; How to display the audio level
  27145. * indicator. Possible values are: <code>"auto"</code> (the indicator is displayed when the
  27146. * video is disabled), <code>"off"</code> (the indicator is not displayed), and
  27147. * <code>"on"</code> (the indicator is always displayed).</li>
  27148. *
  27149. * <li><code>archiveStatusDisplayMode</code> (String) &mdash; How to display the archive status
  27150. * indicator. Possible values are: <code>"auto"</code> (the indicator is displayed when the
  27151. * session is being recorded), <code>"off"</code> (the indicator is not displayed). If you
  27152. * disable the archive status display indicator, you can display your own user interface
  27153. * notifications based on the <code>archiveStarted</code> and <code>archiveStopped</code>
  27154. * events dispatched by the Session object.</li>
  27155. *
  27156. * <li><code>backgroundImageURI</code> (String) &mdash; A URI for an image to display as
  27157. * the background image when a video is not displayed. (A video may not be displayed if
  27158. * you call <code>publishVideo(false)</code> on the Publisher object). You can pass an http
  27159. * or https URI to a PNG, JPEG, or non-animated GIF file location. You can also use the
  27160. * <code>data</code> URI scheme (instead of http or https) and pass in base-64-encrypted
  27161. * PNG data, such as that obtained from the
  27162. * <a href="Publisher.html#getImgData">Publisher.getImgData()</a> method. (For example,
  27163. * you could set the property to a value returned by calling <code>getImgData()</code> on
  27164. * a previous Publisher object.) If the URL or the image data is invalid, the property
  27165. * is ignored (the attempt to set the image fails silently).</li>
  27166. *
  27167. * <li><code>buttonDisplayMode</code> (String) &mdash; How to display the microphone controls
  27168. * Possible values are: <code>"auto"</code> (controls are displayed when the stream is first
  27169. * displayed and when the user mouses over the display), <code>"off"</code> (controls are not
  27170. * displayed), and <code>"on"</code> (controls are always displayed).</li>
  27171. *
  27172. * <li><code>nameDisplayMode</code> (String) &#151; Whether to display the stream name.
  27173. * Possible values are: <code>"auto"</code> (the name is displayed when the stream is first
  27174. * displayed and when the user mouses over the display), <code>"off"</code> (the name is not
  27175. * displayed), and <code>"on"</code> (the name is always displayed).</li>
  27176. * </ul>
  27177. * </li>
  27178. * <li>
  27179. * <strong>videoSource</strong> (String, MediaStreamTrack, Boolean, or null) &#151;
  27180. * The ID of the video input device (such as a
  27181. * camera) to be used by the publisher. You can obtain a list of available devices, including
  27182. * video input devices, by calling the <a href="#getDevices">OT.getDevices()</a> method. Each
  27183. * device listed by the method has a unique device ID. If you pass in a device ID that does not
  27184. * match an existing video input device, the call to <code>OT.initPublisher()</code> fails with an
  27185. * error (error code 1500, "Unable to Publish") passed to the completion handler function.
  27186. * <p>
  27187. * If you set this property to <code>null</code> or <code>false</code>, the browser does not
  27188. * request access to the camera, and no video is published. In a voice-only call, set this
  27189. * property to <code>null</code> or <code>false</code> for each Publisher.
  27190. * </p>
  27191. * <p>
  27192. * To publish a screen-sharing stream, set this property to <code>"application"</code>,
  27193. * <code>"screen"</code>, or <code>"window"</code>. In Firefox, the screen sharing source
  27194. * reflects the value set. For example, if you set the property to <code>"window"</code>,
  27195. * Firefox will prompt the end user to select the <i>window</i> to share. In other browsers,
  27196. * setting the <code>videoSource</code> property to any of these values results in a prompt
  27197. * that asks the user to determine the screen-sharing source. Call
  27198. * <a href="OT.html#checkScreenSharingCapability">OT.checkScreenSharingCapability()</a>
  27199. * to check if screen sharing is supported and which video sources (<code>"application"</code>,
  27200. * <code>"screen"</code>, or <code>"window"</code>) are supported. For screen-sharing streams,
  27201. * the following are default values for other properties: <code>audioFallbackEnabled == false</code>,
  27202. * <code>maxResolution == {width: 1920, height: 1920}</code>, <code>mirror == false</code>,
  27203. * <code>scaleMode == "fit"</code>. Also, the default <code>scaleMode</code> setting for
  27204. * subscribers to the stream is <code>"fit"</code>.
  27205. * </p>
  27206. * <p>
  27207. * You can also set this property to a video
  27208. * <a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack">
  27209. * MediaStreamTrack</a> object. This lets you use the MediaStreamTrack object as the
  27210. * video source for the published stream. For example, you can get a CanvasCaptureMediaStream
  27211. * object by calling the <code>captureStream()</code> method of a HTMLCanvasElement, and then
  27212. * you can call the <code>getVideoTracks()</code> method of the CanvasCaptureMediaStream object
  27213. * to get a video MediaStreamTrack object. Or you can get an array of video MediaStreamTrack
  27214. * object from the <code>videoTracks</code> property of an HTMLMediaElement object. Or you can
  27215. * call the <code>getLocalStreams()</code> or <code>getRemoteStreams()</code> method of an
  27216. * RTCPeerConnection object to get an array of MediaStream objects, and then call the
  27217. * <code>getVideoTracks()</code> method of one of the MediaStream objects to get an array
  27218. * of video MediaStreamTrack objects. Note that by default the publisher uses a microphone
  27219. * as the audio source, so be sure to set the <code>audioSource</code> option if you want
  27220. * to use a MediaStreamTrack as the audio source or if you do not want to publish an audio
  27221. * track. The default <code>mirror</code> setting for a Publisher with a MediaStreamTrack video
  27222. * source is <code>false</code>. You can also call
  27223. * <a href="OT.html#getUserMedia">OT.getUserMedia()</a> to get a MediaStream object that uses
  27224. * the microphone and camera as the audio and video sources.
  27225. * </p>
  27226. * </li>
  27227. * <li>
  27228. * <strong>width</strong> (Number or String) &#151; The desired initial width of the displayed Publisher
  27229. * video in the HTML page (default: 264 pixels). You can specify the number of pixels as either
  27230. * a number (such as 400) or a string ending in "px" (such as "400px"). Or you can specify a
  27231. * percentage of the size of the parent element, with a string ending in "%" (such as "100%").
  27232. * <i>Note:</i> To resize the publisher video, adjust the CSS of the publisher's DOM element
  27233. * (the <code>element</code> property of the Publisher object) or (if the width is specified as
  27234. * a percentage) its parent DOM element (see
  27235. * <a href="https://tokbox.com/developer/guides/customize-ui/js/#video_resize_reposition">Resizing
  27236. * or repositioning a video</a>).
  27237. * </li>
  27238. * </ul>
  27239. * @param {Function} completionHandler (Optional) A function to be called when the method succeeds
  27240. * or fails in initializing a Publisher object. This function takes one parameter &mdash;
  27241. * <code>error</code>. On success, the <code>error</code> object is set to <code>null</code>. On
  27242. * failure, the <code>error</code> object has two properties: <code>code</code> (an integer) and
  27243. * <code>message</code> (a string), which identify the cause of the failure. The method succeeds
  27244. * when the user grants access to the camera and microphone. The method fails if the user denies
  27245. * access to the camera and microphone. The <code>completionHandler</code> function is called
  27246. * before the Publisher dispatches an <code>accessAllowed</code> (success) event or an
  27247. * <code>accessDenied</code> (failure) event.
  27248. * <p>
  27249. * The following code adds a <code>completionHandler</code> when calling the
  27250. * <code>OT.initPublisher()</code> method:
  27251. * </p>
  27252. * <pre>
  27253. * var publisher = OT.initPublisher('publisher', null, function (error) {
  27254. * if (error) {
  27255. * console.log(error);
  27256. * } else {
  27257. * console.log("Publisher initialized.");
  27258. * }
  27259. * });
  27260. * </pre>
  27261. *
  27262. * @returns {Publisher} The Publisher object.
  27263. * @see <a href="Session.html#publish">Session.publish()</a>
  27264. * @method OT.initPublisher
  27265. * @memberof OT
  27266. */
  27267. return function initPublisher(targetElement, properties, completionHandler) {
  27268. logging.debug("OT.initPublisher(" + targetElement + ")"); // To support legacy (apikey, targetElement, properties) users
  27269. // we check to see if targetElement is actually an apikey. Which we ignore.
  27270. if (typeof targetElement === 'string' && !document.getElementById(targetElement)) {
  27271. targetElement = properties;
  27272. properties = completionHandler;
  27273. completionHandler = arguments[3];
  27274. }
  27275. if (typeof targetElement === 'function') {
  27276. completionHandler = targetElement;
  27277. properties = undefined;
  27278. targetElement = undefined;
  27279. } else if (isObject(targetElement) && !OTHelpers.isElementNode(targetElement)) {
  27280. completionHandler = properties;
  27281. properties = targetElement;
  27282. targetElement = undefined;
  27283. }
  27284. if (typeof properties === 'function') {
  27285. completionHandler = properties;
  27286. properties = undefined;
  27287. }
  27288. let errMsg;
  27289. if (properties && !isObject(properties)) {
  27290. errMsg = 'properties argument to Publisher constructor, if provided, should be an object';
  27291. properties = undefined;
  27292. }
  27293. if (properties && properties.insertDefaultUI === false && targetElement) {
  27294. errMsg = 'You cannot specify a target element if insertDefaultUI is false';
  27295. }
  27296. const publisher = new Publisher(properties || {});
  27297. sessionObjects.publishers.add(publisher);
  27298. const triggerCallback = function triggerCallback() {
  27299. if (completionHandler && isFunction(completionHandler)) {
  27300. completionHandler(...arguments);
  27301. completionHandler = undefined;
  27302. }
  27303. };
  27304. if (errMsg !== undefined) {
  27305. logging.error(errMsg);
  27306. triggerCallback(otError(Errors.INVALID_PARAMETER, new Error(errMsg), ExceptionCodes.INVALID_PARAMETER));
  27307. }
  27308. const removeInitSuccessAndCallComplete = function removeInitSuccessAndCallComplete(err) {
  27309. publisher.off('publishComplete', removeHandlersAndCallComplete);
  27310. triggerCallback(err);
  27311. };
  27312. let removeHandlersAndCallComplete = function removeHandlersAndCallComplete(err) {
  27313. publisher.off('initSuccess', removeInitSuccessAndCallComplete); // We're only handling the error case here as we're just
  27314. // initing the publisher, not actually attempting to publish.
  27315. if (err) {
  27316. triggerCallback(err);
  27317. }
  27318. };
  27319. publisher.once('initSuccess', removeInitSuccessAndCallComplete);
  27320. publisher.once('publishComplete', removeHandlersAndCallComplete);
  27321. publisher.publish(targetElement);
  27322. return publisher;
  27323. };
  27324. };
  27325. /***/ }),
  27326. /* 296 */
  27327. /***/ (function(module, exports, __webpack_require__) {
  27328. "use strict";
  27329. /* WEBPACK VAR INJECTION */(function(Promise) {
  27330. var _interopRequireDefault = __webpack_require__(2);
  27331. var _extends2 = _interopRequireDefault(__webpack_require__(23));
  27332. /* eslint-disable no-param-reassign, global-require, no-underscore-dangle, func-names */
  27333. /* eslint-disable max-len */
  27334. const EventEmitter = __webpack_require__(43);
  27335. const findKey = __webpack_require__(650);
  27336. const isObject = __webpack_require__(7);
  27337. const isFunction = __webpack_require__(13);
  27338. const assign = __webpack_require__(6);
  27339. const eventNames = __webpack_require__(24);
  27340. const eventing = __webpack_require__(5);
  27341. const AnalyticsHelperDefault = __webpack_require__(54);
  27342. const StaticConfigDefault = __webpack_require__(28)();
  27343. const IntervalRunner = __webpack_require__(71);
  27344. const promisify = __webpack_require__(293);
  27345. const testRemovingVideoCodecs = __webpack_require__(652);
  27346. const validateIceConfigFactory = __webpack_require__(653);
  27347. const _require = __webpack_require__(128),
  27348. prependProxyToUrlIfNeeded = _require.prependProxyToUrlIfNeeded;
  27349. const _require2 = __webpack_require__(164),
  27350. getProxyUrl = _require2.getProxyUrl;
  27351. const ProxyUrlWarnings = __webpack_require__(294);
  27352. module.exports = function SessionFactory(deps) {
  27353. if (deps === void 0) {
  27354. deps = {};
  27355. }
  27356. const adaptIceServers = deps.adaptIceServers || __webpack_require__(98).adaptIceServers;
  27357. /** @type {AnalyticsHelper} */
  27358. const AnalyticsHelper = deps.AnalyticsHelper || AnalyticsHelperDefault;
  27359. const APIKEY = deps.APIKEY || __webpack_require__(69);
  27360. const Capabilities = deps.Capabilities || __webpack_require__(165);
  27361. const convertAnvilErrorCode = deps.convertAnvilErrorCode || __webpack_require__(654);
  27362. const convertRumorError = deps.convertRumorError || __webpack_require__(297);
  27363. const errors = deps.Errors || __webpack_require__(8);
  27364. const Events = deps.Events || __webpack_require__(20)();
  27365. const ExceptionCodes = deps.ExceptionCodes || __webpack_require__(11);
  27366. const hasIceRestartsCapability = deps.hasIceRestartsCapability || __webpack_require__(298);
  27367. const logging = deps.logging || __webpack_require__(1)('Session');
  27368. const otError = deps.otError || __webpack_require__(12)();
  27369. const OTErrorClass = deps.OTErrorClass || __webpack_require__(33);
  27370. const OTHelpers = deps.OTHelpers || __webpack_require__(4);
  27371. /** @type {typeof StaticConfigDefault} */
  27372. const StaticConfig = deps.StaticConfig || StaticConfigDefault;
  27373. /** @type {StaticConfigDefault} */
  27374. const localStaticConfig = deps.staticConfig || StaticConfig.onlyLocal();
  27375. const Publisher = deps.Publisher || __webpack_require__(163)();
  27376. const RaptorSocket = deps.RaptorSocket || __webpack_require__(655).default();
  27377. const SessionDispatcher = deps.SessionDispatcher || __webpack_require__(305);
  27378. const sessionObjects = deps.sessionObjects || __webpack_require__(22);
  27379. const sessionTag = deps.sessionTag || __webpack_require__(304);
  27380. const socketCloseCodes = deps.socketCloseCodes || __webpack_require__(73);
  27381. const Subscriber = deps.Subscriber || __webpack_require__(289)();
  27382. const systemRequirements = deps.systemRequirements || __webpack_require__(148);
  27383. const uuid = deps.uuid || __webpack_require__(15);
  27384. const validateIceConfig = validateIceConfigFactory({
  27385. otError
  27386. });
  27387. const windowMock = deps.global || (typeof window !== undefined ? window : global);
  27388. const getSessionInfo = deps.getSessionInfo || __webpack_require__(679)();
  27389. const initPublisher = deps.initPublisher || __webpack_require__(295)({
  27390. Publisher
  27391. });
  27392. /**
  27393. * The Session object returned by the <code>OT.initSession()</code> method provides access to
  27394. * much of the OpenTok functionality.
  27395. *
  27396. * @class Session
  27397. * @augments EventDispatcher
  27398. *
  27399. * @property {Capabilities} capabilities A {@link Capabilities} object that includes information
  27400. * about the capabilities of the client. All properties of the <code>capabilities</code> object
  27401. * are undefined until you have connected to a session and the completion handler for the
  27402. * <code>Session.connect()</code> method has been called without error.
  27403. * @property {Connection} connection The {@link Connection} object for this session. The
  27404. * connection property is only available once the completion handler for the
  27405. * <code>Session.connect()</code> method has been called successfully. See the
  27406. * <a href="#connect">Session.connect()</a> method and the {@link Connection} class.
  27407. * @property {String} sessionId The session ID for this session. You pass this value into the
  27408. * <code>OT.initSession()</code> method when you create the Session object. (Note: a Session
  27409. * object is not connected to the OpenTok server until you call the connect() method of the
  27410. * object and its completion handler is called without error. See the
  27411. * <a href="OT.html#initSession">OT.initSession()</a> and
  27412. * the <a href="#connect">Session.connect()</a>
  27413. * methods.) For more information on sessions and session IDs, see
  27414. * <a href="https://tokbox.com/opentok/tutorials/create-session/">Session creation</a>.
  27415. */
  27416. const Session = function Session(apiKey, sessionId, _temp) {
  27417. var _this = this;
  27418. let _ref = _temp === void 0 ? {} : _temp,
  27419. _ref$allowPeerRegener = _ref.allowPeerRegeneration,
  27420. allowPeerRegeneration = _ref$allowPeerRegener === void 0 ? true : _ref$allowPeerRegener,
  27421. iceConfig = _ref.iceConfig,
  27422. connectionEventsSuppressed = _ref.connectionEventsSuppressed,
  27423. _ref$ipWhitelist = _ref.ipWhitelist,
  27424. ipWhitelist = _ref$ipWhitelist === void 0 ? false : _ref$ipWhitelist,
  27425. proxyUrl = _ref.proxyUrl;
  27426. /** @type AnalyticsHelperDefault */
  27427. if (proxyUrl) {
  27428. // @TODO WILL NEED TO CONVERT TO EXCEPTION IN 2.18.0
  27429. console.warn(ProxyUrlWarnings.DEPRECATED_METHOD);
  27430. }
  27431. proxyUrl = getProxyUrl() || proxyUrl;
  27432. const analytics = new AnalyticsHelper({
  27433. proxyUrl
  27434. });
  27435. const getStream = stream => typeof stream === 'string' ? this.streams.get(stream) || {
  27436. id: stream
  27437. } : stream;
  27438. eventing(this);
  27439. this._tag = sessionTag; // Check that the client meets the minimum requirements, if they don't the upgrade
  27440. // flow will be triggered.
  27441. if (!systemRequirements.check()) {
  27442. systemRequirements.upgrade();
  27443. }
  27444. if (sessionId == null) {
  27445. sessionId = apiKey;
  27446. apiKey = null;
  27447. }
  27448. validateIceConfig(iceConfig);
  27449. this.id = sessionId;
  27450. this.sessionId = sessionId;
  27451. let _socket;
  27452. /** @type IntervalRunner | undefined */
  27453. let _connectivityAttemptPinger;
  27454. let _token;
  27455. let _p2p;
  27456. let _messagingServer;
  27457. let _attemptStartTime;
  27458. let _configurationAttemptStartTime;
  27459. let _iceServerDetails;
  27460. let _initialConnection = true;
  27461. let _apiKey = apiKey;
  27462. const _session = this;
  27463. let _sessionId = sessionId;
  27464. let _widgetId = uuid();
  27465. let _connectionId = uuid();
  27466. let _logging = logging;
  27467. let disconnectComponents;
  27468. let reset;
  27469. let destroyPublishers;
  27470. let destroySubscribers;
  27471. const setState = OTHelpers.statable(this, ['disconnected', 'connecting', 'connected', 'disconnecting'], 'disconnected');
  27472. this.connection = null;
  27473. this.connections = new OTHelpers.Collection();
  27474. this.streams = new OTHelpers.Collection();
  27475. this.archives = new OTHelpers.Collection(); //--------------------------------------
  27476. // MESSAGE HANDLERS
  27477. //--------------------------------------
  27478. /*
  27479. * The sessionConnectFailed event handler
  27480. * @param {Error}
  27481. */
  27482. const sessionConnectFailed = function sessionConnectFailed(error) {
  27483. setState('disconnected');
  27484. if (!error.code) {
  27485. error.code = ExceptionCodes.CONNECT_FAILED;
  27486. }
  27487. _logging.error((error.name || 'Unknown Error') + ": " + error.message);
  27488. OTErrorClass.handleJsException({
  27489. error,
  27490. target: this,
  27491. analytics
  27492. });
  27493. this.trigger('sessionConnectFailed', error);
  27494. };
  27495. const sessionDisconnectedHandler = function sessionDisconnectedHandler(event) {
  27496. const reason = event.reason;
  27497. this.logEvent('Connect', 'Disconnected', {
  27498. reason: event.reason
  27499. });
  27500. const publicEvent = new Events.SessionDisconnectEvent('sessionDisconnected', reason.replace('networkTimedout', 'networkDisconnected'));
  27501. if (this.isConnected()) {
  27502. this.disconnect();
  27503. }
  27504. reset();
  27505. disconnectComponents.call(this, reason);
  27506. setTimeout(() => {
  27507. this.dispatchEvent(publicEvent); // Although part of the defaultAction for sessionDisconnected we have
  27508. // chosen to still destroy Publishers within the session as there is
  27509. // another mechanism to stop a Publisher from being destroyed.
  27510. // Publishers use preventDefault on the Publisher streamDestroyed event
  27511. destroyPublishers.call(this, publicEvent.reason);
  27512. if (!publicEvent.isDefaultPrevented()) {
  27513. destroySubscribers.call(this, publicEvent.reason);
  27514. }
  27515. });
  27516. };
  27517. const connectionCreatedHandler = function connectionCreatedHandler(connection) {
  27518. // With connectionEventsSuppressed, connections objects are still added internally, but they
  27519. // don't come from rumor messages, and can't have corresponding delete events, so we don't
  27520. // emit created events.
  27521. if (connectionEventsSuppressed) {
  27522. return;
  27523. } // We don't broadcast events for the symphony connection
  27524. if (connection.id.match(/^symphony\./)) {
  27525. return;
  27526. }
  27527. this.dispatchEvent(new Events.ConnectionEvent(eventNames.CONNECTION_CREATED, connection));
  27528. };
  27529. const connectionDestroyedHandler = function connectionDestroyedHandler(connection, reason) {
  27530. // We don't broadcast events for the symphony connection
  27531. if (connection.id.match(/^symphony\./)) {
  27532. return;
  27533. } // Don't delete the connection if it's ours. This only happens when
  27534. // we're about to receive a session disconnected and session disconnected
  27535. // will also clean up our connection.
  27536. if (_socket && connection.id === _socket.id()) {
  27537. return;
  27538. }
  27539. this.dispatchEvent(new Events.ConnectionEvent(eventNames.CONNECTION_DESTROYED, connection, reason));
  27540. };
  27541. const streamCreatedHandler = function streamCreatedHandler(stream) {
  27542. if (stream && stream.connection && (!this.connection || stream.connection.id !== this.connection.id)) {
  27543. this.dispatchEvent(new Events.StreamEvent(eventNames.STREAM_CREATED, stream, null, false));
  27544. }
  27545. };
  27546. const streamPropertyModifiedHandler = function streamPropertyModifiedHandler(event) {
  27547. const stream = event.target;
  27548. const propertyName = event.changedProperty;
  27549. let newValue = event.newValue;
  27550. if (propertyName === 'videoDisableWarning' || propertyName === 'audioDisableWarning') {
  27551. return; // These are not public properties, skip top level event for them.
  27552. }
  27553. if (propertyName === 'videoDimensions') {
  27554. newValue = {
  27555. width: newValue.width,
  27556. height: newValue.height
  27557. };
  27558. }
  27559. this.dispatchEvent(new Events.StreamPropertyChangedEvent(eventNames.STREAM_PROPERTY_CHANGED, stream, propertyName, event.oldValue, newValue));
  27560. };
  27561. const streamDestroyedHandler = function streamDestroyedHandler(stream, reason) {
  27562. if (reason === void 0) {
  27563. reason = 'clientDisconnected';
  27564. }
  27565. // if the stream is one of ours we delegate handling to the publisher itself.
  27566. if (stream.connection.id === this.connection.id) {
  27567. sessionObjects.publishers.where({
  27568. streamId: stream.id
  27569. }).forEach(function (publisher) {
  27570. publisher._.unpublishStreamFromSession(stream, this, reason);
  27571. }, this);
  27572. return;
  27573. }
  27574. const event = new Events.StreamEvent('streamDestroyed', stream, reason, true);
  27575. this.dispatchEvent(event); // If we are subscribed to any of the streams we should unsubscribe
  27576. sessionObjects.subscribers.where({
  27577. streamId: stream.id
  27578. }).filter(subscriber => subscriber.session.id === this.id && subscriber.stream).forEach(subscriber => {
  27579. subscriber._disconnect({
  27580. reason
  27581. });
  27582. if (!event.isDefaultPrevented()) {
  27583. subscriber._destroy({
  27584. reason,
  27585. noStateTransition: true
  27586. });
  27587. }
  27588. }); // @TODO Add a else with a one time warning that this no longer cleans up the publisher
  27589. };
  27590. const archiveCreatedHandler = function archiveCreatedHandler(archive) {
  27591. this.dispatchEvent(new Events.ArchiveEvent('archiveStarted', archive));
  27592. };
  27593. const archiveDestroyedHandler = function archiveDestroyedHandler(archive) {
  27594. this.dispatchEvent(new Events.ArchiveEvent('archiveDestroyed', archive));
  27595. };
  27596. const archiveUpdatedHandler = function archiveUpdatedHandler(event) {
  27597. const archive = event.target;
  27598. const propertyName = event.changedProperty;
  27599. const newValue = event.newValue;
  27600. if (propertyName === 'status' && newValue === 'stopped') {
  27601. this.dispatchEvent(new Events.ArchiveEvent('archiveStopped', archive));
  27602. } else {
  27603. this.dispatchEvent(new Events.ArchiveEvent('archiveUpdated', archive));
  27604. }
  27605. };
  27606. const init = function init() {
  27607. _session.token = null;
  27608. _token = null;
  27609. setState('disconnected');
  27610. _socket = null;
  27611. if (_connectivityAttemptPinger) {
  27612. _connectivityAttemptPinger.stop();
  27613. _connectivityAttemptPinger = null;
  27614. }
  27615. _session.connection = null;
  27616. _session.capabilities = new Capabilities([]);
  27617. _session.connections.destroy();
  27618. _session.streams.destroy();
  27619. _session.archives.destroy();
  27620. }; // Put ourselves into a pristine state
  27621. reset = function reset() {
  27622. // reset connection id now so that following calls to testNetwork and connect will share
  27623. // the same new session id. We need to reset here because testNetwork might be call after
  27624. // and it is always called before the session is connected
  27625. // on initial connection we don't reset
  27626. _connectionId = uuid();
  27627. init();
  27628. };
  27629. disconnectComponents = function disconnectComponents(reason) {
  27630. sessionObjects.publishers.where({
  27631. session: this
  27632. }).forEach(publisher => {
  27633. publisher.disconnect(reason);
  27634. });
  27635. sessionObjects.subscribers.where({
  27636. session: this
  27637. }).forEach(subscriber => {
  27638. subscriber._disconnect();
  27639. });
  27640. };
  27641. destroyPublishers = function destroyPublishers(reason) {
  27642. sessionObjects.publishers.where({
  27643. session: this
  27644. }).forEach(publisher => {
  27645. publisher._.streamDestroyed(reason);
  27646. });
  27647. };
  27648. destroySubscribers = function destroySubscribers(reason) {
  27649. sessionObjects.subscribers.where({
  27650. session: this
  27651. }).forEach(subscriber => {
  27652. subscriber._destroy({
  27653. reason
  27654. });
  27655. });
  27656. };
  27657. const connectMessenger = function connectMessenger() {
  27658. _logging.debug('OT.Session: connecting to Raptor');
  27659. const messagingUrl = prependProxyToUrlIfNeeded(this.sessionInfo.messagingURL, proxyUrl);
  27660. const capabilities = []; // basically we support it if:
  27661. if (allowPeerRegeneration && this.sessionInfo.peerRegeneration === true) {
  27662. capabilities.push('peerRegeneration');
  27663. }
  27664. _socket = new RaptorSocket(_connectionId, _widgetId, messagingUrl, this.sessionInfo.symphonyAddress, SessionDispatcher(this, {
  27665. connectionEventsSuppressed
  27666. }), analytics, capabilities);
  27667. /**
  27668. * Maps an error from RaptorSocket.connect to its corresponding name
  27669. * @param {string} reason - Failure reason
  27670. * @param {number} code - Error code
  27671. * @return {string|undefined} Error name
  27672. */
  27673. function getErrorNameFromCode(reason, code) {
  27674. let name;
  27675. switch (reason) {
  27676. case 'WebSocketConnection':
  27677. name = findKey(socketCloseCodes.codes, x => x === code);
  27678. if (name) {
  27679. return errors["SOCKET_" + name];
  27680. }
  27681. break;
  27682. case 'ConnectToSession':
  27683. case 'GetSessionState':
  27684. switch (code) {
  27685. case ExceptionCodes.CONNECT_FAILED:
  27686. return errors.CONNECT_FAILED;
  27687. case ExceptionCodes.UNEXPECTED_SERVER_RESPONSE:
  27688. return errors.UNEXPECTED_SERVER_RESPONSE;
  27689. case ExceptionCodes.CONNECTION_LIMIT_EXCEEDED:
  27690. return errors.CONNECTION_LIMIT_EXCEEDED;
  27691. default:
  27692. break;
  27693. }
  27694. break;
  27695. default:
  27696. break;
  27697. }
  27698. return undefined;
  27699. }
  27700. _socket.connect(_token, this.sessionInfo, {
  27701. connectionEventsSuppressed
  27702. }, (error, sessionState) => {
  27703. if (error) {
  27704. const payload = {};
  27705. let options;
  27706. if (error.reason === 'ConnectToSession' || error.reason === 'GetSessionState') {
  27707. const converted = convertRumorError(error);
  27708. assign(payload, {
  27709. originalMessage: error.message,
  27710. originalCode: error.code
  27711. });
  27712. error.code = converted.code;
  27713. error.message = converted.message;
  27714. }
  27715. if (error.code || error.message || error.reason) {
  27716. options = {
  27717. failureCode: error.code,
  27718. failureMessage: error.message,
  27719. failureReason: error.reason,
  27720. socketId: _socket.socketId
  27721. };
  27722. }
  27723. _socket = null;
  27724. this.logConnectivityEvent('Failure', payload, options);
  27725. const errorName = getErrorNameFromCode(error.reason, error.code);
  27726. if (errorName) {
  27727. error = otError(errorName, new Error(error.message), error.code);
  27728. }
  27729. sessionConnectFailed.call(this, error);
  27730. return;
  27731. }
  27732. _logging.debug('OT.Session: Received session state from Raptor', sessionState);
  27733. this.connection = this.connections.get(_socket.id());
  27734. if (this.connection) {
  27735. this.capabilities = this.connection.permissions;
  27736. }
  27737. setState('connected');
  27738. this.logConnectivityEvent('Success', {
  27739. connectionId: this.connection.id
  27740. }); // Listen for our own connection's destroyed event so we know when we've been disconnected.
  27741. this.connection.on('destroyed', sessionDisconnectedHandler, this);
  27742. this.dispatchEvent(new Events.SessionConnectEvent(eventNames.SESSION_CONNECTED)); // Listen for connection updates
  27743. this.connections.on({
  27744. add: connectionCreatedHandler,
  27745. remove: connectionDestroyedHandler
  27746. }, this); // Listen for stream updates
  27747. this.streams.on({
  27748. add: streamCreatedHandler,
  27749. remove: streamDestroyedHandler,
  27750. update: streamPropertyModifiedHandler
  27751. }, this);
  27752. this.archives.on({
  27753. add: archiveCreatedHandler,
  27754. remove: archiveDestroyedHandler,
  27755. update: archiveUpdatedHandler
  27756. }, this);
  27757. this.connections._triggerAddEvents(); // { id: this.connection.id }
  27758. this.streams._triggerAddEvents(); // { id: this.stream.id }
  27759. this.archives._triggerAddEvents();
  27760. });
  27761. }; // Check whether we have permissions to perform the action.
  27762. const permittedTo = action => this.capabilities.permittedTo(action);
  27763. const dispatchOTError = (error, completionHandler) => {
  27764. logging.error(error.name + ": " + error.message);
  27765. completionHandler(error);
  27766. OTErrorClass.handleJsException({
  27767. error,
  27768. target: this,
  27769. analytics
  27770. });
  27771. };
  27772. this.reportIssue = (_ref2) => {
  27773. let id = _ref2.id;
  27774. return promisify(analytics.logEvent.bind(analytics))({
  27775. action: 'ReportIssue',
  27776. variation: 'Event',
  27777. connectionId: _connectionId,
  27778. payload: {
  27779. reportIssueId: id
  27780. }
  27781. }, null);
  27782. };
  27783. this.logEvent = function (action, variation, payload, options) {
  27784. let event = {
  27785. action,
  27786. variation,
  27787. payload,
  27788. sessionId: _sessionId,
  27789. messagingServer: _messagingServer,
  27790. p2p: _p2p,
  27791. partnerId: _apiKey,
  27792. connectionId: _connectionId
  27793. };
  27794. if (options) {
  27795. event = assign(options, event);
  27796. }
  27797. analytics.logEvent(event);
  27798. };
  27799. this.logConfigurationFileEvent = function (variation, payload, options) {
  27800. if (payload === void 0) {
  27801. payload = null;
  27802. }
  27803. if (options === void 0) {
  27804. options = {};
  27805. }
  27806. if (variation === 'Attempt') {
  27807. _configurationAttemptStartTime = new Date().getTime();
  27808. } else if (variation === 'Failure' || variation === 'Success') {
  27809. const attemptDuration = new Date().getTime() - _configurationAttemptStartTime;
  27810. assign({
  27811. attemptDuration
  27812. }, options);
  27813. }
  27814. if (proxyUrl) {
  27815. options.proxyUrl = proxyUrl;
  27816. }
  27817. this.logEvent('ConfigurationFile', variation, payload, (0, _extends2.default)({}, options));
  27818. };
  27819. this.logConnectivityEvent = function (variation, payload, options) {
  27820. if (payload === void 0) {
  27821. payload = null;
  27822. }
  27823. if (options === void 0) {
  27824. options = {};
  27825. }
  27826. if (proxyUrl) {
  27827. options.proxyUrl = proxyUrl;
  27828. }
  27829. if (variation === 'Attempt') {
  27830. if (_connectivityAttemptPinger) {
  27831. _connectivityAttemptPinger.stop();
  27832. logging.error('_connectivityAttemptPinger should have been cleaned up');
  27833. }
  27834. _attemptStartTime = new Date().getTime();
  27835. _connectivityAttemptPinger = new IntervalRunner(() => {
  27836. this.logEvent('Connect', 'Attempting', payload, (0, _extends2.default)({}, options));
  27837. }, 1 / 5, 6);
  27838. _connectivityAttemptPinger.start();
  27839. }
  27840. if (variation === 'Failure' || variation === 'Success' || variation === 'Cancel') {
  27841. const logConnect = _iceConfig => {
  27842. if (_connectivityAttemptPinger) {
  27843. _connectivityAttemptPinger.stop();
  27844. _connectivityAttemptPinger = undefined;
  27845. }
  27846. this.logEvent('Connect', variation, payload, (0, _extends2.default)({}, options, {
  27847. attemptDuration: new Date().getTime() - _attemptStartTime,
  27848. iceConfig: _iceConfig,
  27849. ipWhitelist
  27850. }));
  27851. };
  27852. if (variation === 'Success') {
  27853. this._.getIceConfig().then(config => {
  27854. const _iceConfig = {
  27855. includeServers: iceConfig && iceConfig.includeServers || 'all',
  27856. transportPolicy: config.transportPolicy
  27857. };
  27858. _iceConfig.servers = config.servers ? config.servers.map(server => ({
  27859. url: server.urls
  27860. })) : [];
  27861. logConnect(_iceConfig);
  27862. });
  27863. } else {
  27864. logConnect();
  27865. }
  27866. } else {
  27867. this.logEvent('Connect', variation, payload, options);
  27868. }
  27869. };
  27870. /**
  27871. * Connects to an OpenTok session.
  27872. * <p>
  27873. * Upon a successful connection, the completion handler (the second parameter of the method) is
  27874. * invoked without an error object passed in. (If there is an error connecting, the completion
  27875. * handler is invoked with an error object.) Make sure that you have successfully connected to the
  27876. * session before calling other methods of the Session object.
  27877. * </p>
  27878. * <p>
  27879. * The Session object dispatches a <code>connectionCreated</code> event when any client
  27880. * (including your own) connects to the session.
  27881. * </p>
  27882. *
  27883. * <h5>
  27884. * Example
  27885. * </h5>
  27886. * <p>
  27887. * The following code initializes a session and sets up an event listener for when the session
  27888. * connects:
  27889. * </p>
  27890. * <pre>
  27891. * var apiKey = ""; // Replace with your API key. See https://tokbox.com/account
  27892. * var sessionID = ""; // Replace with your own session ID.
  27893. * // See https://tokbox.com/developer/guides/create-session/.
  27894. * var token = ""; // Replace with a generated token.
  27895. * // See https://tokbox.com/developer/guides/create-token/.
  27896. *
  27897. * var session = OT.initSession(apiKey, sessionID);
  27898. * session.connect(token, function(error) {
  27899. * if (error) {
  27900. * console.log(error.message);
  27901. * } else {
  27902. * // You have connected to the session. You could publish a stream now.
  27903. * }
  27904. * });
  27905. * </pre>
  27906. * <p>
  27907. *
  27908. * <h5>
  27909. * Events dispatched:
  27910. * </h5>
  27911. *
  27912. * <p>
  27913. * <code>exception</code> (<a href="ExceptionEvent.html">ExceptionEvent</a>) &#151; Dispatched
  27914. * by the OT class locally in the event of an error.
  27915. * </p>
  27916. * <p>
  27917. * <code>connectionCreated</code> (<a href="ConnectionEvent.html">ConnectionEvent</a>) &#151;
  27918. * Dispatched by the Session object on all clients connected to the session.
  27919. * </p>
  27920. * <p>
  27921. * <code>sessionConnected</code> (<a href="SessionConnectEvent.html">SessionConnectEvent</a>)
  27922. * &#151; Dispatched locally by the Session object when the connection is established. However,
  27923. * you can pass a completion handler function in as the second parameter of the
  27924. * <code>connect()</code> and use this function instead of a listener for the
  27925. * <code>sessionConnected</code> event.
  27926. * </p>
  27927. *
  27928. * @param {String} token The session token. You generate a session token using our
  27929. * <a href="https://tokbox.com/opentok/libraries/server/">server-side libraries</a> or at your
  27930. * <a href="https://tokbox.com/account">TokBox account</a> page. For more information, see
  27931. * <a href="https://tokbox.com/opentok/tutorials/create-token/">Connection token creation</a>.
  27932. *
  27933. * @param {Function} completionHandler (Optional) A function to be called when the call to the
  27934. * <code>connect()</code> method succeeds or fails. This function takes one parameter &mdash;
  27935. * <code>error</code> (see the <a href="Error.html">Error</a> object).
  27936. * On success, the <code>completionHandler</code> function is not passed any
  27937. * arguments. On error, the function is passed an <code>error</code> object parameter
  27938. * (see the <a href="Error.html">Error</a> object). The
  27939. * <code>error</code> object has two properties: <code>code</code> (an integer) and
  27940. * <code>message</code> (a string), which identify the cause of the failure. The following
  27941. * code adds a <code>completionHandler</code> when calling the <code>connect()</code> method:
  27942. * <pre>
  27943. * session.connect(token, function (error) {
  27944. * if (error) {
  27945. * console.log(error.message);
  27946. * } else {
  27947. * console.log("Connected to session.");
  27948. * }
  27949. * });
  27950. * </pre>
  27951. * <p>
  27952. * Note that upon connecting to the session, the Session object dispatches a
  27953. * <code>sessionConnected</code> event in addition to calling the <code>completionHandler</code>.
  27954. * The SessionConnectEvent object, which defines the <code>sessionConnected</code> event,
  27955. * includes <code>connections</code> and <code>streams</code> properties, which
  27956. * list the connections and streams in the session when you connect.
  27957. * </p>
  27958. *
  27959. * @see SessionConnectEvent
  27960. * @method #connect
  27961. * @memberOf Session
  27962. */
  27963. this.connect = function () {
  27964. let token;
  27965. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  27966. args[_key] = arguments[_key];
  27967. }
  27968. if (args.length > 1 && (typeof args[0] === 'string' || typeof args[0] === 'number') && typeof args[1] === 'string') {
  27969. if (apiKey == null) {
  27970. _apiKey = args[0].toString();
  27971. }
  27972. token = args[1];
  27973. } else {
  27974. token = args[0];
  27975. } // The completion handler is always the last argument.
  27976. const completionHandler = args[args.length - 1];
  27977. if (_this.is('connecting', 'connected')) {
  27978. _logging.warn("OT.Session: Cannot connect, the session is already " + _this.state);
  27979. return _this;
  27980. }
  27981. init();
  27982. setState('connecting');
  27983. const currentConnectionId = _connectionId;
  27984. function checkInterrupted() {
  27985. const interrupted = _connectionId !== currentConnectionId;
  27986. if (interrupted) {
  27987. logging.debug('Connection was interrupted');
  27988. }
  27989. return interrupted;
  27990. }
  27991. _this.token = !isFunction(token) && token;
  27992. _token = !isFunction(token) && token; // Get a new widget ID when reconnecting.
  27993. if (_initialConnection) {
  27994. _initialConnection = false;
  27995. } else {
  27996. _widgetId = uuid();
  27997. }
  27998. if (completionHandler && isFunction(completionHandler)) {
  27999. let cleanup;
  28000. const onCompleteSuccess = function onCompleteSuccess() {
  28001. cleanup();
  28002. for (var _len2 = arguments.length, cbArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  28003. cbArgs[_key2] = arguments[_key2];
  28004. }
  28005. completionHandler(undefined, ...cbArgs);
  28006. };
  28007. const onCompleteFailure = function onCompleteFailure() {
  28008. cleanup();
  28009. completionHandler(...arguments);
  28010. };
  28011. cleanup = () => {
  28012. _this.off('sessionConnected', onCompleteSuccess);
  28013. _this.off('sessionConnectFailed', onCompleteFailure);
  28014. };
  28015. _this.once('sessionConnected', onCompleteSuccess);
  28016. _this.once('sessionConnectFailed', onCompleteFailure);
  28017. }
  28018. if (_apiKey == null || isFunction(_apiKey)) {
  28019. setTimeout(sessionConnectFailed.bind(_this, otError(errors.AUTHENTICATION_ERROR, new Error('API Key is undefined. You must pass an API Key to initSession.'), ExceptionCodes.AUTHENTICATION_ERROR)));
  28020. return _this;
  28021. }
  28022. if (!_sessionId || isObject(_sessionId) || Array.isArray(_sessionId)) {
  28023. let errorMsg;
  28024. if (!_sessionId) {
  28025. errorMsg = 'SessionID is undefined. You must pass a sessionID to initSession.';
  28026. } else {
  28027. errorMsg = 'SessionID is not a string. You must use string as the session ID passed into ' + 'OT.initSession().';
  28028. _sessionId = _sessionId.toString();
  28029. }
  28030. setTimeout(sessionConnectFailed.bind(_this, otError(errors.INVALID_SESSION_ID, new Error(errorMsg), ExceptionCodes.INVALID_SESSION_ID)));
  28031. _this.logConnectivityEvent('Attempt');
  28032. _this.logConnectivityEvent('Failure', null, {
  28033. failureReason: 'ConnectToSession',
  28034. failureCode: ExceptionCodes.INVALID_SESSION_ID,
  28035. failureMessage: errorMsg
  28036. });
  28037. return _this;
  28038. }
  28039. _this.apiKey = _apiKey.toString();
  28040. _apiKey = _apiKey.toString(); // TODO: Ugly hack, make sure APIKEY is set
  28041. if (APIKEY.value.length === 0) {
  28042. APIKEY.value = _apiKey;
  28043. }
  28044. const hasStaticConfigUrl = Boolean(StaticConfig.onlyLocal().configUrl);
  28045. const useIpWhitelistConfigUrl = ipWhitelist === true && Boolean(StaticConfig.onlyLocal().ipWhitelistConfigUrl);
  28046. if (!hasStaticConfigUrl && !useIpWhitelistConfigUrl) {
  28047. _this.logConfigurationFileEvent('Event', {
  28048. message: 'No configUrl, using local config only'
  28049. });
  28050. } else {
  28051. _this.logConfigurationFileEvent('Attempt');
  28052. }
  28053. const futureStaticConfig = hasStaticConfigUrl || useIpWhitelistConfigUrl ? StaticConfig.get({
  28054. partnerId: _apiKey,
  28055. token,
  28056. useIpWhitelistConfigUrl,
  28057. proxyUrl
  28058. }) : Promise.resolve(StaticConfig.onlyLocal());
  28059. futureStaticConfig.then(staticConfig => {
  28060. if (hasStaticConfigUrl || useIpWhitelistConfigUrl) {
  28061. _this.logConfigurationFileEvent('Success');
  28062. }
  28063. return staticConfig;
  28064. }, err => {
  28065. if (hasStaticConfigUrl || useIpWhitelistConfigUrl) {
  28066. _this.logConfigurationFileEvent('Failure', {
  28067. failureMessage: err.message,
  28068. failureStack: err.stack
  28069. });
  28070. }
  28071. return StaticConfig.onlyLocal();
  28072. }).then(staticConfig => {
  28073. _this.staticConfig = staticConfig;
  28074. analytics.staticConfig = staticConfig;
  28075. if (staticConfig.apiEnabled === false) {
  28076. throw otError(errors.API_KEY_DISABLED, new Error('The API KEY has been disabled. Access to the service is currently being ' + 'restricted. Please contact support.'));
  28077. }
  28078. if (checkInterrupted()) {
  28079. return undefined;
  28080. }
  28081. _this.logConnectivityEvent('Attempt');
  28082. if (proxyUrl) {
  28083. _this.logEvent('SessionInfo', 'Attempt', null, {
  28084. proxyUrl
  28085. });
  28086. } else {
  28087. _this.logEvent('SessionInfo', 'Attempt');
  28088. }
  28089. const onSessionInfoError = error => {
  28090. // @todo I think we should move convertAnvilErrorCode to after we log the Failure. It's
  28091. // a lossy process, and the more information we have in our logged failure, the better
  28092. // we can understand the failures.
  28093. error.code = convertAnvilErrorCode(error.code);
  28094. _this.logConnectivityEvent('Failure', null, {
  28095. failureReason: 'GetSessionInfo',
  28096. failureCode: error.code || 'No code',
  28097. failureMessage: error.message,
  28098. failureName: error.name
  28099. });
  28100. if (error.name) {
  28101. error = otError(error.name, new Error("" + error.message + (error.code ? " (" + error.code + ")" : '')), error.code);
  28102. }
  28103. sessionConnectFailed.call(_this, error);
  28104. };
  28105. const onSessionInfoSuccess = sessionInfo => {
  28106. if (checkInterrupted()) {
  28107. return;
  28108. }
  28109. if (sessionInfo.partnerId && sessionInfo.partnerId !== _apiKey) {
  28110. // The apiKey does not match, this is an error
  28111. const reason = 'Authentication Error: The API key does not match the token or session.';
  28112. onSessionInfoError(otError(errors.AUTHENTICATION_ERROR, new Error(reason), ExceptionCodes.AUTHENTICATION_ERROR));
  28113. return;
  28114. }
  28115. analytics.sessionInfo = sessionInfo;
  28116. const sessionInfoSuccessLogPayload = {
  28117. features: {
  28118. reconnection: sessionInfo.reconnection,
  28119. renegotiation: hasIceRestartsCapability() && sessionInfo.renegotiation,
  28120. simulcast: sessionInfo.simulcast === undefined ? false : sessionInfo.simulcast && OTHelpers.env.name === 'Chrome'
  28121. }
  28122. };
  28123. if (proxyUrl) {
  28124. sessionInfoSuccessLogPayload.proxyUrl = proxyUrl;
  28125. }
  28126. if (_this.is('connecting')) {
  28127. _this.sessionInfo = sessionInfo;
  28128. _this._.setIceServers(_this.sessionInfo.iceServers);
  28129. _p2p = sessionInfo.p2pEnabled;
  28130. _messagingServer = sessionInfo.messagingServer;
  28131. _this.logEvent('SessionInfo', 'Success', null, sessionInfoSuccessLogPayload, {
  28132. messagingServer: sessionInfo.messagingServer
  28133. });
  28134. /**
  28135. * The only sessionInfo overrides that was being used is
  28136. */
  28137. const overrides = staticConfig.sessionInfoOverrides;
  28138. if (overrides != null && typeof overrides === 'object') {
  28139. Object.keys(overrides).forEach(key => {
  28140. Object.defineProperty(_this.sessionInfo, key, {
  28141. value: overrides[key]
  28142. });
  28143. });
  28144. }
  28145. connectMessenger.call(_this);
  28146. }
  28147. };
  28148. const targetUrl = prependProxyToUrlIfNeeded(staticConfig.apiUrl, proxyUrl);
  28149. return getSessionInfo({
  28150. anvilUrl: targetUrl,
  28151. sessionId,
  28152. token: _token,
  28153. connectionId: _connectionId,
  28154. clientVersion: staticConfig.clientVersion
  28155. }).then(onSessionInfoSuccess, onSessionInfoError);
  28156. }).catch(err => {
  28157. sessionConnectFailed.call(_this, err);
  28158. });
  28159. return _this;
  28160. };
  28161. /**
  28162. * Disconnects from the OpenTok session.
  28163. *
  28164. * <p>
  28165. * Calling the <code>disconnect()</code> method ends your connection with the session. In the
  28166. * course of terminating your connection, it also ceases publishing any stream(s) you were
  28167. * publishing.
  28168. * </p>
  28169. * <p>
  28170. * Session objects on remote clients dispatch <code>streamDestroyed</code> events for any
  28171. * stream you were publishing. The Session object dispatches a <code>sessionDisconnected</code>
  28172. * event locally. The Session objects on remote clients dispatch <code>connectionDestroyed</code>
  28173. * events, letting other connections know you have left the session. The
  28174. * {@link SessionDisconnectEvent} and {@link StreamEvent} objects that define the
  28175. * <code>sessionDisconnect</code> and <code>connectionDestroyed</code> events each have a
  28176. * <code>reason</code> property. The <code>reason</code> property lets the developer determine
  28177. * whether the connection is being terminated voluntarily and whether any streams are being
  28178. * destroyed as a byproduct of the underlying connection's voluntary destruction.
  28179. * </p>
  28180. * <p>
  28181. * If the session is not currently connected, calling this method causes a warning to be logged.
  28182. * See <a href="OT.html#setLogLevel">OT.setLogLevel()</a>.
  28183. * </p>
  28184. *
  28185. * <p>
  28186. * <i>Note:</i> If you intend to reuse a Publisher object created using
  28187. * <code>OT.initPublisher()</code> to publish to different sessions sequentially, call either
  28188. * <code>Session.disconnect()</code> or <code>Session.unpublish()</code>. Do not call both.
  28189. * Then call the <code>preventDefault()</code> method of the Publisher's <code>streamDestroyed</code>
  28190. * event object to prevent the Publisher object from being removed from the page. Be sure to
  28191. * call <code>preventDefault()</code> only if the <code>connection.connectionId</code> property
  28192. * of the Stream object in the event matches the <code>connection.connectionId</code> property of
  28193. * your Session object (to ensure that you are preventing the default behavior for your published
  28194. * streams, not for other streams that you subscribe to).
  28195. * </p>
  28196. *
  28197. * <h5>
  28198. * Events dispatched:
  28199. * </h5>
  28200. * <p>
  28201. * <code>sessionDisconnected</code>
  28202. * (<a href="SessionDisconnectEvent.html">SessionDisconnectEvent</a>)
  28203. * &#151; Dispatched locally when the connection is disconnected.
  28204. * </p>
  28205. * <p>
  28206. * <code>connectionDestroyed</code> (<a href="ConnectionEvent.html">ConnectionEvent</a>) &#151;
  28207. * Dispatched on other clients, along with the <code>streamDestroyed</code> event (as warranted).
  28208. * </p>
  28209. *
  28210. * <p>
  28211. * <code>streamDestroyed</code> (<a href="StreamEvent.html">StreamEvent</a>) &#151;
  28212. * Dispatched on other clients if streams are lost as a result of the session disconnecting.
  28213. * </p>
  28214. *
  28215. * @method #disconnect
  28216. * @memberOf Session
  28217. */
  28218. this.disconnect = function () {
  28219. if (_socket && _socket.isNot('disconnected')) {
  28220. if (_socket.isNot('disconnecting')) {
  28221. if (!_socket.isNot('connecting')) {
  28222. this.logConnectivityEvent('Cancel');
  28223. }
  28224. setState('disconnecting');
  28225. _socket.disconnect();
  28226. }
  28227. } else {
  28228. reset();
  28229. }
  28230. };
  28231. this.destroy = function () {
  28232. this.streams.destroy();
  28233. this.connections.destroy();
  28234. this.archives.destroy();
  28235. this.disconnect();
  28236. };
  28237. /**
  28238. * The <code>publish()</code> method starts publishing an audio-video stream to the session.
  28239. * The audio-video stream is captured from a local microphone and webcam. Upon successful
  28240. * publishing, the Session objects on all connected clients dispatch the
  28241. * <code>streamCreated</code> event.
  28242. * </p>
  28243. *
  28244. * <!--JS-ONLY-->
  28245. * <p>You pass a Publisher object as the one parameter of the method. You can initialize a
  28246. * Publisher object by calling the <a href="OT.html#initPublisher">OT.initPublisher()</a>
  28247. * method. Before calling <code>Session.publish()</code>.
  28248. * </p>
  28249. *
  28250. * <p>This method takes an alternate form: <code>publish([targetElement:String,
  28251. * properties:Object]):Publisher</code> &#151; In this form, you do <i>not</i> pass a Publisher
  28252. * object into the function. Instead, you pass in a <code>targetElement</code> (the ID of the
  28253. * DOM element that the Publisher will replace) and a <code>properties</code> object that
  28254. * defines options for the Publisher (see <a href="OT.html#initPublisher">OT.initPublisher()</a>.)
  28255. * The method returns a new Publisher object, which starts sending an audio-video stream to the
  28256. * session. The remainder of this documentation describes the form that takes a single Publisher
  28257. * object as a parameter.
  28258. *
  28259. * <p>
  28260. * A local display of the published stream is created on the web page by replacing
  28261. * the specified element in the DOM with a streaming video display. The video stream
  28262. * is automatically mirrored horizontally so that users see themselves and movement
  28263. * in their stream in a natural way. If the width and height of the display do not match
  28264. * the 4:3 aspect ratio of the video signal, the video stream is cropped to fit the
  28265. * display.
  28266. * </p>
  28267. *
  28268. * <p>
  28269. * If calling this method creates a new Publisher object and the OpenTok library does not
  28270. * have access to the camera or microphone, the web page alerts the user to grant access
  28271. * to the camera and microphone.
  28272. * </p>
  28273. *
  28274. * <p>
  28275. * The OT object dispatches an <code>exception</code> event if the user's role does not
  28276. * include permissions required to publish. For example, if the user's role is set to subscriber,
  28277. * then they cannot publish. You define a user's role when you create the user token
  28278. * (see <a href="https://tokbox.com/developer/guides/create-token/">Token creation overview</a>).
  28279. * You pass the token string as a parameter of the <code>connect()</code> method of the Session
  28280. * object. See <a href="ExceptionEvent.html">ExceptionEvent</a> and
  28281. * <a href="OT.html#on">OT.on()</a>.
  28282. * </p>
  28283. * <p>
  28284. * The application throws an error if the session is not connected.
  28285. * </p>
  28286. *
  28287. * <h5>Events dispatched:</h5>
  28288. * <p>
  28289. * <code>exception</code> (<a href="ExceptionEvent.html">ExceptionEvent</a>) &#151; Dispatched
  28290. * by the OT object. This can occur when user's role does not allow publishing (the
  28291. * <code>code</code> property of event object is set to 1500); it can also occur if the
  28292. * connection fails to connect (the <code>code</code> property of event object is set to 1013).
  28293. * WebRTC is a peer-to-peer protocol, and it is possible that connections will fail to connect.
  28294. * The most common cause for failure is a firewall that the protocol cannot traverse.</li>
  28295. * </p>
  28296. * <p>
  28297. * <code>streamCreated</code> (<a href="StreamEvent.html">StreamEvent</a>) &#151;
  28298. * The stream has been published. The Session object dispatches this on all clients
  28299. * subscribed to the stream, as well as on the publisher's client.
  28300. * </p>
  28301. *
  28302. * <h5>Example</h5>
  28303. *
  28304. * <p>
  28305. * The following example publishes a video once the session connects:
  28306. * </p>
  28307. * <pre>
  28308. * var apiKey = ""; // Replace with your API key. See https://tokbox.com/account
  28309. * var sessionId = ""; // Replace with your own session ID.
  28310. * // https://tokbox.com/developer/guides/create-session/.
  28311. * var token = ""; // Replace with a generated token that has been assigned the publish role.
  28312. * // See https://tokbox.com/developer/guides/create-token/.
  28313. * var session = OT.initSession(apiKey, sessionID);
  28314. * session.connect(token, function(error) {
  28315. * if (error) {
  28316. * console.log(error.message);
  28317. * } else {
  28318. * var publisherOptions = {width: 400, height:300, name:"Bob's stream"};
  28319. * // This assumes that there is a DOM element with the ID 'publisher':
  28320. * publisher = OT.initPublisher('publisher', publisherOptions);
  28321. * session.publish(publisher);
  28322. * }
  28323. * });
  28324. * </pre>
  28325. *
  28326. * @param {Publisher} publisher A Publisher object, which you initialize by calling the
  28327. * <a href="OT.html#initPublisher">OT.initPublisher()</a> method.
  28328. *
  28329. * @param {Function} completionHandler (Optional) A function to be called when the call to the
  28330. * <code>publish()</code> method succeeds or fails. This function takes one parameter &mdash;
  28331. * <code>error</code>. On success, the <code>completionHandler</code> function is not passed any
  28332. * arguments. On error, the function is passed an <code>error</code> object parameter
  28333. * (see the <a href="Error.html">Error</a> object). The
  28334. * <code>error</code> object has two properties: <code>code</code> (an integer) and
  28335. * <code>message</code> (a string), which identify the cause of the failure. Calling
  28336. * <code>publish()</code> fails if the role assigned to your token is not "publisher" or
  28337. * "moderator"; in this case the <code>error.name</code> property is set to
  28338. * <code>"OT_PERMISSION_DENIED"</code>. Calling <code>publish()</code> also fails if the
  28339. * client fails to connect; in this case the <code>error.name</code> property is set to
  28340. * <code>"OT_NOT_CONNECTED"</code>. The following code adds a completion handler when
  28341. * calling the <code>publish()</code> method:
  28342. * <pre>
  28343. * session.publish(publisher, null, function (error) {
  28344. * if (error) {
  28345. * console.log(error.message);
  28346. * } else {
  28347. * console.log("Publishing a stream.");
  28348. * }
  28349. * });
  28350. * </pre>
  28351. *
  28352. * @returns The Publisher object for this stream.
  28353. *
  28354. * @method #publish
  28355. * @memberOf Session
  28356. */
  28357. this.publish = function (publisher, properties, completionHandler) {
  28358. if (typeof publisher === 'function') {
  28359. completionHandler = publisher;
  28360. publisher = undefined;
  28361. }
  28362. if (typeof properties === 'function') {
  28363. completionHandler = properties;
  28364. properties = undefined;
  28365. }
  28366. completionHandler = completionHandler || function () {};
  28367. if (this.isNot('connected')) {
  28368. analytics.logError(1010, 'OT.exception', 'We need to be connected before you can publish', null, {
  28369. action: 'Publish',
  28370. variation: 'Failure',
  28371. failureReason: 'unconnected',
  28372. failureCode: ExceptionCodes.NOT_CONNECTED,
  28373. failureMessage: 'We need to be connected before you can publish',
  28374. sessionId: _sessionId,
  28375. streamId: publisher && publisher.stream ? publisher.stream.id : null,
  28376. p2p: this.sessionInfo ? this.sessionInfo.p2pEnabled : undefined,
  28377. messagingServer: this.sessionInfo ? this.sessionInfo.messagingServer : null,
  28378. partnerId: _apiKey
  28379. });
  28380. dispatchOTError(otError(errors.NOT_CONNECTED, new Error('We need to be connected before you can publish'), ExceptionCodes.NOT_CONNECTED), completionHandler);
  28381. return null;
  28382. }
  28383. if (!permittedTo('publish')) {
  28384. const errorMessage = 'This token does not allow publishing. The role must be at least ' + '`publisher` to enable this functionality';
  28385. const options = {
  28386. failureReason: 'Permission',
  28387. failureCode: ExceptionCodes.UNABLE_TO_PUBLISH,
  28388. failureMessage: errorMessage
  28389. };
  28390. this.logEvent('Publish', 'Failure', null, options);
  28391. dispatchOTError(otError(errors.PERMISSION_DENIED, new Error(errorMessage), ExceptionCodes.UNABLE_TO_PUBLISH), completionHandler);
  28392. return null;
  28393. } // If the user has passed in an ID of a element then we create a new publisher.
  28394. if (!publisher || typeof publisher === 'string' || OTHelpers.isElementNode(publisher)) {
  28395. // Initiate a new Publisher with the new session credentials
  28396. publisher = initPublisher(publisher, properties);
  28397. } else if (publisher instanceof Publisher) {
  28398. // If the publisher already has a session attached to it we can
  28399. if ('session' in publisher && publisher.session && 'sessionId' in publisher.session) {
  28400. // send a warning message that we can't publish again.
  28401. if (publisher.session.sessionId === this.sessionId) {
  28402. _logging.warn("Cannot publish " + publisher.guid() + " again to " + this.sessionId + ". Please call session.unpublish(publisher) first.");
  28403. } else {
  28404. _logging.warn("Cannot publish " + publisher.guid() + " publisher already attached to " + publisher.session.sessionId + ". Please call session.unpublish(publisher) first.");
  28405. }
  28406. }
  28407. } else {
  28408. dispatchOTError(otError(errors.INVALID_PARAMETER, new Error('Session.publish :: First parameter passed in is neither a ' + 'string nor an instance of the Publisher'), ExceptionCodes.UNABLE_TO_PUBLISH), completionHandler);
  28409. return undefined;
  28410. } // Add publisher reference to the session
  28411. publisher._.publishToSession(this, analytics).catch(err => {
  28412. err.message = "Session.publish :: " + err.message;
  28413. _logging.error(err.code, err.message);
  28414. throw err;
  28415. }).then(() => publisher).then(function () {
  28416. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  28417. args[_key3] = arguments[_key3];
  28418. }
  28419. return completionHandler(null, ...args);
  28420. }, err => completionHandler(err)); // return the embed publisher
  28421. return publisher;
  28422. };
  28423. /**
  28424. * Ceases publishing the specified publisher's audio-video stream
  28425. * to the session. By default, the local representation of the audio-video stream is
  28426. * removed from the web page. Upon successful termination, the Session object on every
  28427. * connected web page dispatches
  28428. * a <code>streamDestroyed</code> event.
  28429. * </p>
  28430. *
  28431. * <p>
  28432. * To prevent the Publisher from being removed from the DOM, add an event listener for the
  28433. * <code>streamDestroyed</code> event dispatched by the Publisher object and call the
  28434. * <code>preventDefault()</code> method of the event object.
  28435. * </p>
  28436. *
  28437. * <p>
  28438. * <i>Note:</i> If you intend to reuse a Publisher object created using
  28439. * <code>OT.initPublisher()</code> to publish to different sessions sequentially, call
  28440. * either <code>Session.disconnect()</code> or <code>Session.unpublish()</code>. Do not call
  28441. * both. Then call the <code>preventDefault()</code> method of the <code>streamDestroyed</code>
  28442. * or <code>sessionDisconnected</code> event object to prevent the Publisher object from being
  28443. * removed from the page. Be sure to call <code>preventDefault()</code> only if the
  28444. * <code>connection.connectionId</code> property of the Stream object in the event matches the
  28445. * <code>connection.connectionId</code> property of your Session object (to ensure that you are
  28446. * preventing the default behavior for your published streams, not for other streams that you
  28447. * subscribe to).
  28448. * </p>
  28449. *
  28450. * <h5>Events dispatched:</h5>
  28451. *
  28452. * <p>
  28453. * <code>streamDestroyed</code> (<a href="StreamEvent.html">StreamEvent</a>) &#151;
  28454. * The stream associated with the Publisher has been destroyed. Dispatched on by the
  28455. * Publisher on on the Publisher's browser. Dispatched by the Session object on
  28456. * all other connections subscribing to the publisher's stream.
  28457. * </p>
  28458. *
  28459. * <h5>Example</h5>
  28460. *
  28461. * The following example publishes a stream to a session and adds a Disconnect link to the
  28462. * web page. Clicking this link causes the stream to stop being published.
  28463. *
  28464. * <pre>
  28465. * &lt;script&gt;
  28466. * var apiKey = ""; // Replace with your API key. See https://tokbox.com/account
  28467. * var sessionID = ""; // Replace with your own session ID.
  28468. * // See https://tokbox.com/developer/guides/create-session/.
  28469. * var token = ""; // Replace with a generated token.
  28470. * // See https://tokbox.com/developer/guides/create-token/.
  28471. * var publisher;
  28472. * var session = OT.initSession(apiKey, sessionID);
  28473. * session.connect(token, function(error) {
  28474. * if (error) {
  28475. * console.log(error.message);
  28476. * } else {
  28477. * // This assumes that there is a DOM element with the ID 'publisher':
  28478. * publisher = OT.initPublisher('publisher');
  28479. * session.publish(publisher);
  28480. * }
  28481. * });
  28482. *
  28483. * function unpublish() {
  28484. * session.unpublish(publisher);
  28485. * }
  28486. * &lt;/script&gt;
  28487. *
  28488. * &lt;body&gt;
  28489. *
  28490. * &lt;div id="publisherContainer/&gt;
  28491. * &lt;br/&gt;
  28492. *
  28493. * &lt;a href="javascript:unpublish()"&gt;Stop Publishing&lt;/a&gt;
  28494. *
  28495. * &lt;/body&gt;
  28496. *
  28497. * </pre>
  28498. *
  28499. * @see <a href="#publish">publish()</a>
  28500. *
  28501. * @see <a href="StreamEvent.html">streamDestroyed event</a>
  28502. *
  28503. * @param {Publisher} publisher</span> The Publisher object to stop streaming.
  28504. *
  28505. * @method #unpublish
  28506. * @memberOf Session
  28507. */
  28508. this.unpublish = function (publisher) {
  28509. if (!publisher) {
  28510. _logging.error('OT.Session.unpublish: publisher parameter missing.');
  28511. return;
  28512. } // Unpublish the localMedia publisher
  28513. publisher._.unpublishFromSession(this, 'unpublished');
  28514. };
  28515. /**
  28516. * Subscribes to a stream that is available to the session. You can get an array of
  28517. * available streams from the <code>streams</code> property of the <code>sessionConnected</code>
  28518. * and <code>streamCreated</code> events (see
  28519. * <a href="SessionConnectEvent.html">SessionConnectEvent</a> and
  28520. * <a href="StreamEvent.html">StreamEvent</a>).
  28521. * </p>
  28522. * <p>
  28523. * The subscribed stream is displayed on the local web page by replacing the specified element
  28524. * in the DOM with a streaming video display. If the width and height of the display do not
  28525. * match the 4:3 aspect ratio of the video signal, the video stream is cropped to fit
  28526. * the display. If the stream lacks a video component, a blank screen with an audio indicator
  28527. * is displayed in place of the video stream.
  28528. * </p>
  28529. *
  28530. * <p>
  28531. * The application throws an error if the session is not connected<!--JS-ONLY--> or if the
  28532. * <code>targetElement</code> does not exist in the HTML DOM<!--/JS-ONLY-->.
  28533. * </p>
  28534. *
  28535. * <h5>Example</h5>
  28536. *
  28537. * The following code subscribes to other clients' streams:
  28538. *
  28539. * <pre>
  28540. * var apiKey = ""; // Replace with your API key. See https://tokbox.com/account
  28541. * var sessionID = ""; // Replace with your own session ID.
  28542. * // See https://tokbox.com/developer/guides/create-session/.
  28543. * var token = ""; // Replace with a generated token.
  28544. * // See https://tokbox.com/developer/guides/create-token/.
  28545. *
  28546. * var session = OT.initSession(apiKey, sessionID);
  28547. * session.on("streamCreated", function(event) {
  28548. * subscriber = session.subscribe(event.stream, targetElement);
  28549. * });
  28550. * session.connect(token);
  28551. * </pre>
  28552. *
  28553. * @param {Stream} stream The Stream object representing the stream to which we are trying to
  28554. * subscribe.
  28555. *
  28556. * @param {Object} targetElement (Optional) The DOM element or the <code>id</code> attribute of
  28557. * the existing DOM element used to determine the location of the Subscriber video in the HTML
  28558. * DOM. See the <code>insertMode</code> property of the <code>properties</code> parameter. If
  28559. * you do not specify a <code>targetElement</code>, the application appends a new DOM element
  28560. * to the HTML <code>body</code>.
  28561. *
  28562. * @param {Object} properties This is an object that contains the following properties:
  28563. * <ul>
  28564. * <li><code>audioVolume</code> (Number) &#151; The desired audio volume, between 0 and
  28565. * 100, when the Subscriber is first opened (default: 50). After you subscribe to the
  28566. * stream, you can adjust the volume by calling the
  28567. * <a href="Subscriber.html#setAudioVolume"><code>setAudioVolume()</code> method</a> of the
  28568. * Subscriber object. This volume setting affects local playback only; it does not affect
  28569. * the stream's volume on other clients.</li>
  28570. *
  28571. * <li>
  28572. * <code>fitMode</code> (String) &#151; Determines how the video is displayed if the its
  28573. * dimensions do not match those of the DOM element. You can set this property to one of
  28574. * the following values:
  28575. * <p>
  28576. * <ul>
  28577. * <li>
  28578. * <code>"cover"</code> &mdash; The video is cropped if its dimensions do not match
  28579. * those of the DOM element. This is the default setting for videos that have a
  28580. * camera as the source (for Stream objects with the <code>videoType</code> property
  28581. * set to <code>"camera"</code>).
  28582. * </li>
  28583. * <li>
  28584. * <code>"contain"</code> &mdash; The video is letterboxed if its dimensions do not
  28585. * match those of the DOM element. This is the default setting for screen-sharing
  28586. * videos (for Stream objects with the <code>videoType</code> property set to
  28587. * <code>"screen"</code>).
  28588. * </li>
  28589. * </ul>
  28590. * </li>
  28591. *
  28592. * <li>
  28593. * <code>height</code> (Number or String) &#151; The desired initial height of the displayed
  28594. * video in the HTML page (default: 198 pixels). You can specify the number of pixels as
  28595. * either a number (such as 300) or a string ending in "px" (such as "300px"). Or you can
  28596. * specify a percentage of the size of the parent element, with a string ending in "%"
  28597. * (such as "100%"). <i>Note:</i> To resize the video, adjust the CSS of the subscriber's
  28598. * DOM element (the <code>element</code> property of the Subscriber object) or (if the
  28599. * height is specified as a percentage) its parent DOM element (see
  28600. * <a href="https://tokbox.com/developer/guides/customize-ui/js/#video_resize_reposition">
  28601. * Resizing or repositioning a video</a>).
  28602. * </li>
  28603. * <li>
  28604. * <strong>insertDefaultUI</strong> (Boolean) &#151; Whether to use the default OpenTok UI
  28605. * (<code>true</code>, the default) or not (<code>false</code>). The default UI element
  28606. * contains user interface controls, a video loading indicator, and automatic video cropping
  28607. * or letterboxing, in addition to the video. (If you leave <code>insertDefaultUI</code>
  28608. * set to <code>true</code>, you can control individual UI settings using the
  28609. * <code>fitMode</code>, <code>showControls</code>, and <code>style</code> options.)
  28610. * <p>
  28611. * If you set this option to <code>false</code>, OpenTok.js does not insert a default UI
  28612. * element in the HTML DOM, and the <code>element</code> property of the Subscriber object is
  28613. * undefined. The Subscriber object dispatches a
  28614. * <a href="Subscriber.html#event:videoElementCreated">videoElementCreated</a> event when
  28615. * the <code>video</code> element (or in Internet Explorer the <code>object</code> element
  28616. * containing the video) is created. The <code>element</code> property of the event object
  28617. * is a reference to the Subscriber's <code>video</code> (or <code>object</code>) element.
  28618. * Add it to the HTML DOM to display the video.
  28619. * <p>
  28620. * Set this option to <code>false</code> if you want to move the Publisher's
  28621. * <code>video</code> element (or its <code>object</code> element in Internet Explorer) in
  28622. * the HTML DOM.
  28623. * <p>
  28624. * If you set this to <code>false</code>, do not set the <code>targetElement</code>
  28625. * parameter. (This results in an error passed into to the <code>OT.initPublisher()</code>
  28626. * callback function.) To add the video to the HTML DOM, add an event listener for the
  28627. * <code>videoElementCreated</code> event, and then add the <code>element</code> property of
  28628. * the event object into the HTML DOM.
  28629. * </li>
  28630. * <li>
  28631. * <code>insertMode</code> (String) &#151; Specifies how the Subscriber object will
  28632. * be inserted in the HTML DOM. See the <code>targetElement</code> parameter. This
  28633. * string can have the following values:
  28634. * <p>
  28635. * <ul>
  28636. * <li><code>"replace"</code> &#151; The Subscriber object replaces contents of the
  28637. * targetElement. This is the default.</li>
  28638. * <li><code>"after"</code> &#151; The Subscriber object is a new element inserted
  28639. * after the targetElement in the HTML DOM. (Both the Subscriber and targetElement
  28640. * have the same parent element.)</li>
  28641. * <li><code>"before"</code> &#151; The Subscriber object is a new element inserted
  28642. * before the targetElement in the HTML DOM. (Both the Subscriber and targetElement
  28643. * have the same parent element.)</li>
  28644. * <li><code>"append"</code> &#151; The Subscriber object is a new element added as a
  28645. * child of the targetElement. If there are other child elements, the Subscriber is
  28646. * appended as the last child element of the targetElement.</li>
  28647. * </ul></p>
  28648. * <li>
  28649. * <code>preferredFrameRate</code> (Number) &#151; The preferred frame rate of the subscriber's
  28650. * video. Lowering the preferred frame rate lowers video quality on the subscribing client,
  28651. * but it also reduces network and CPU usage. You may want to use a lower frame rate for
  28652. * subscribers to a stream that is less important than other streams.
  28653. * <p>
  28654. * This property only applies when subscribing to a stream that uses the
  28655. * <a href="https://tokbox.com/developer/guides/scalable-video">
  28656. * scalable video feature</a>. Scalable video is available:
  28657. * <ul>
  28658. * <li>
  28659. * Only in sessions that use the OpenTok Media Router (sessions with the
  28660. * <a href="https://tokbox.com/developer/guides/create-session/#media-mode">media
  28661. * mode</a> set to routed).
  28662. * </li>
  28663. * <li>
  28664. * Only for streams published by clients that support scalable video:
  28665. * clients that use the OpenTok iOS SDK (on certain devices), the OpenTok
  28666. * Android SDK (on certain devices), or OpenTok.js in Chrome and Safari.
  28667. * </li>
  28668. * </ul>
  28669. * <p>
  28670. * In streams that do not use scalable video, setting this property has no effect.
  28671. * <p>
  28672. * <b>Note:</b> The frame rate for scalable video streams automatically adjusts for each
  28673. * subscriber, based on network conditions and CPU usage, even if you do not call this method.
  28674. * Call this method if you want to set a maximum frame rate for this subscriber.
  28675. * <p>
  28676. * <p>
  28677. * Not every frame rate is available to a subscriber. When you set the preferred frame rate for
  28678. * the subscriber, OpenTok.js picks the best frame rate available that matches your setting.
  28679. * The frame rates available are based on the value of the Subscriber object's
  28680. * <code>stream.frameRate</code> property, which represents the maximum value available for the
  28681. * stream. The actual frame rates available depend, dynamically, on network and CPU resources
  28682. * available to the publisher and subscriber.
  28683. * <p>
  28684. * You can dynamically change the preferred frame rate used by calling the
  28685. * <code>setPreferredFrameRate()</code> method of the Subscriber object.
  28686. * </li>
  28687. * <li>
  28688. * <code>preferredResolution</code> (Object) &#151; The preferred resolution of the subscriber's
  28689. * video. Set this to an object with two properties: <code>width</code> and <code>height</code>
  28690. * (both numbers), such as <code>{width: 320, height: 240}</code>. Lowering the preferred video
  28691. * resolution lowers video quality on the subscribing client, but it also reduces network and CPU
  28692. * usage. You may want to use a lower resolution based on the dimensions of subscriber's video on
  28693. * the web page. You may want to use a resolution for subscribers to a stream that is less
  28694. * important (and smaller) than other streams.
  28695. * <p>
  28696. * This property only applies when subscribing to a stream that uses the
  28697. * <a href="https://tokbox.com/developer/guides/scalable-video">
  28698. * scalable video feature</a>. Scalable video is available:
  28699. * <ul>
  28700. * <li>
  28701. * Only in sessions that use the OpenTok Media Router (sessions with the
  28702. * <a href="https://tokbox.com/developer/guides/create-session/#media-mode">media
  28703. * mode</a> set to routed).
  28704. * </li>
  28705. * <li>
  28706. * Only for streams published by clients that support scalable video:
  28707. * clients that use the OpenTok iOS SDK (on certain devices), the OpenTok
  28708. * Android SDK (on certain devices), or OpenTok.js in Chrome and Safari.
  28709. * </li>
  28710. * </ul>
  28711. * <p>
  28712. * In streams that do not use scalable video, setting this property has no effect.
  28713. * <p>
  28714. * Not every resolution is available to a subscriber. When you set the preferred resolution,
  28715. * OpenTok.js and the video encoder pick the best resolution available that matches your
  28716. * setting. The resolutions available depend on the resolution of the published stream.
  28717. * The Subscriber object's <code>stream.resolution</code> property represents the highest
  28718. * resolution available for the stream. Each of the resolutions available for a stream will use
  28719. * the same aspect ratio. The actual resolutions available depend, dynamically, on network
  28720. * and CPU resources available to the publisher and subscriber.
  28721. * <p>
  28722. * You can dynamically change the preferred video resolution used by calling the
  28723. * <code>setPreferredResolution()</code> method of the Subscriber object.
  28724. * </li>
  28725. * <li>
  28726. * <code>showControls</code> (Boolean) &#151; Whether to display the built-in user interface
  28727. * controls for the Subscriber (default: <code>true</code>). These controls include the name
  28728. * display, the audio level indicator, the speaker control button, the video disabled indicator,
  28729. * and the video disabled warning icon. You can turn off all user interface controls by setting
  28730. * this property to <code>false</code>. You can control the display of individual user interface
  28731. * controls by leaving this property set to <code>true</code> (the default) and setting
  28732. * individual properties of the <code>style</code> property.
  28733. * </li>
  28734. * <li>
  28735. * <code>style</code> (Object) &#151; An object containing properties that define the initial
  28736. * appearance of user interface controls of the Subscriber. The <code>style</code> object
  28737. * includes the following properties:
  28738. * <ul>
  28739. * <li><code>audioBlockedDisplayMode</code> (String) &mdash; Whether to display
  28740. * the default audio blocked icon in Subscribers (in browsers where audio
  28741. * autoplay is blocked). Possible values are: <code>"auto"</code> (the default,
  28742. * icon is displayed when the audio is disabled) and <code>"off"</code> (the icon
  28743. * is not displayed). Set this to <code>"off"</code> if you want to display
  28744. * your own UI element showing that the audio is blocked. In response to an
  28745. * HTML element dispatching a <code>click</code> event, you can call the
  28746. * <a href="OT.html#unblockAudio">OT.unblockAudio()</a> method to start audio
  28747. * playback in this and all other blocked subscribers.</li>
  28748. *
  28749. * <li><code>audioLevelDisplayMode</code> (String) &mdash; How to display the audio level
  28750. * indicator. Possible values are: <code>"auto"</code> (the indicator is displayed when the
  28751. * video is disabled), <code>"off"</code> (the indicator is not displayed), and
  28752. * <code>"on"</code> (the indicator is always displayed).</li>
  28753. *
  28754. * <li><code>backgroundImageURI</code> (String) &mdash; A URI for an image to display as
  28755. * the background image when a video is not displayed. (A video may not be displayed if
  28756. * you call <code>subscribeToVideo(false)</code> on the Subscriber object). You can pass an
  28757. * http or https URI to a PNG, JPEG, or non-animated GIF file location. You can also use the
  28758. * <code>data</code> URI scheme (instead of http or https) and pass in base-64-encrypted
  28759. * PNG data, such as that obtained from the
  28760. * <a href="Subscriber.html#getImgData">Subscriber.getImgData()</a> method. (For example,
  28761. * you could set the property to a value returned by calling <code>getImgData()</code> on
  28762. * a previous Subscriber object.) If the URL or the image data is invalid, the
  28763. * property is ignored (the attempt to set the image fails silently).</li>
  28764. *
  28765. * <li><code>buttonDisplayMode</code> (String) &mdash; How to display the speaker controls
  28766. * Possible values are: <code>"auto"</code> (controls are displayed when the stream is first
  28767. * displayed and when the user mouses over the display), <code>"off"</code> (controls are not
  28768. * displayed), and <code>"on"</code> (controls are always displayed).</li>
  28769. *
  28770. * <li><code>nameDisplayMode</code> (String) &#151; Whether to display the stream name.
  28771. * Possible values are: <code>"auto"</code> (the name is displayed when the stream is first
  28772. * displayed and when the user mouses over the display), <code>"off"</code> (the name is not
  28773. * displayed), and <code>"on"</code> (the name is always displayed).</li>
  28774. *
  28775. * <li><code>videoDisabledDisplayMode</code> (String) &#151; Whether to display the video
  28776. * disabled indicator and video disabled warning icons for a Subscriber. These icons
  28777. * indicate that the video has been disabled (or is in risk of being disabled for
  28778. * the warning icon) due to poor stream quality. This style only applies to the Subscriber
  28779. * object. Possible values are: <code>"auto"</code> (the icons are automatically when the
  28780. * displayed video is disabled or in risk of being disabled due to poor stream quality),
  28781. * <code>"off"</code> (do not display the icons), and <code>"on"</code> (display the
  28782. * icons). The default setting is <code>"auto"</code></li>
  28783. * </ul>
  28784. * </li>
  28785. *
  28786. * <li><code>subscribeToAudio</code> (Boolean) &#151; Whether to initially subscribe to audio
  28787. * (if available) for the stream (default: <code>true</code>).</li>
  28788. *
  28789. * <li><code>subscribeToVideo</code> (Boolean) &#151; Whether to initially subscribe to video
  28790. * (if available) for the stream (default: <code>true</code>).</li>
  28791. *
  28792. * <li><code>testNetwork</code> (Boolean) &#151; Whether, when subscribing to a stream
  28793. * published by the local client, you want to have the stream come from the OpenTok Media
  28794. * Router (<code>true</code>) or if you want the DOM to simply to display the local camera's
  28795. * video (<code>false</code>). Set this to <code>true</code> when you want to use the
  28796. * <a href="Subscriber.html#getStats">Subscriber.getStats()</a> method to check statistics
  28797. * for a stream you publish. This setting only applies to streams published by the local
  28798. * client in a session that uses the OpenTok Media Router (sessions with the
  28799. * <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
  28800. * set to routed), not in sessions with the media mode set to relayed. The default value is
  28801. * <code>false</code>.</li>
  28802. *
  28803. * <li>
  28804. * <code>width</code> (Number or String) &#151; The desired initial width of the displayed
  28805. * video in the HTML page (default: 264 pixels). You can specify the number of pixels as
  28806. * either a number (such as 400) or a string ending in "px" (such as "400px"). Or you can
  28807. * specify a percentage of the size of the parent element, with a string ending in "%"
  28808. * (such as "100%"). <i>Note:</i> To resize the video, adjust the CSS of the subscriber's
  28809. * DOM element (the <code>element</code> property of the Subscriber object) or (if the
  28810. * width is specified as a percentage) its parent DOM element (see
  28811. * <a href="https://tokbox.com/developer/guides/customize-ui/js/#video_resize_reposition">
  28812. * Resizing or repositioning a video</a>).
  28813. * </li>
  28814. *
  28815. * </ul>
  28816. *
  28817. * @param {Function} completionHandler (Optional) A function to be called when the call to the
  28818. * <code>subscribe()</code> method succeeds or fails. This function takes one parameter &mdash;
  28819. * <code>error</code>. On success, the <code>completionHandler</code> function is not passed any
  28820. * arguments. On error, the function is passed an <code>error</code> object, defined by the
  28821. * <a href="Error.html">Error</a> class, has two properties: <code>code</code> (an integer) and
  28822. * <code>message</code> (a string), which identify the cause of the failure. The following
  28823. * code adds a <code>completionHandler</code> when calling the <code>subscribe()</code> method:
  28824. * <pre>
  28825. * session.subscribe(stream, "subscriber", null, function (error) {
  28826. * if (error) {
  28827. * console.log(error.message);
  28828. * } else {
  28829. * console.log("Subscribed to stream: " + stream.id);
  28830. * }
  28831. * });
  28832. * </pre>
  28833. *
  28834. * @signature subscribe(stream, targetElement, properties, completionHandler)
  28835. * @returns {Subscriber} The Subscriber object for this stream. Stream control functions
  28836. * are exposed through the Subscriber object.
  28837. * @method #subscribe
  28838. * @memberOf Session
  28839. */
  28840. this.subscribe = function (stream, targetElement, properties, completionHandler) {
  28841. if (typeof targetElement === 'function') {
  28842. completionHandler = targetElement;
  28843. targetElement = undefined;
  28844. properties = undefined;
  28845. }
  28846. if (typeof properties === 'function') {
  28847. completionHandler = properties;
  28848. properties = undefined;
  28849. }
  28850. completionHandler = completionHandler || function () {};
  28851. if (!this.connection || !this.connection.connectionId) {
  28852. dispatchOTError(otError(errors.NOT_CONNECTED, new Error('Session.subscribe :: Connection required to subscribe'), ExceptionCodes.UNABLE_TO_SUBSCRIBE), completionHandler);
  28853. return undefined;
  28854. }
  28855. if (!stream) {
  28856. dispatchOTError(otError(errors.INVALID_PARAMETER, new Error('Session.subscribe :: stream cannot be null'), ExceptionCodes.UNABLE_TO_SUBSCRIBE), completionHandler);
  28857. return undefined;
  28858. }
  28859. if (!Object.prototype.hasOwnProperty.call(stream, 'streamId')) {
  28860. dispatchOTError(otError(errors.INVALID_PARAMETER, new Error('Session.subscribe :: invalid stream object'), ExceptionCodes.UNABLE_TO_SUBSCRIBE), completionHandler);
  28861. return undefined;
  28862. }
  28863. if (properties && properties.insertDefaultUI === false && targetElement) {
  28864. dispatchOTError(otError(errors.INVALID_PARAMETER, new Error('You cannot specify a target element if insertDefaultUI is false'), ExceptionCodes.INVALID_PARAMETER), completionHandler);
  28865. return undefined;
  28866. }
  28867. if (targetElement && targetElement.insertDefaultUI === false) {
  28868. // You can omit the targetElement property if you set insertDefaultUI to false
  28869. properties = targetElement;
  28870. targetElement = undefined;
  28871. }
  28872. const subscriber = new Subscriber(targetElement, assign(properties || {}, {
  28873. stream,
  28874. session: this,
  28875. // @todo this needs to go.
  28876. analytics
  28877. }), err => {
  28878. if (err) {
  28879. dispatchOTError(err, completionHandler);
  28880. return;
  28881. }
  28882. completionHandler(null, subscriber);
  28883. });
  28884. sessionObjects.subscribers.add(subscriber);
  28885. return subscriber;
  28886. };
  28887. /**
  28888. * Stops subscribing to a stream in the session. the display of the audio-video stream is
  28889. * removed from the local web page.
  28890. *
  28891. * <h5>Example</h5>
  28892. * <p>
  28893. * The following code subscribes to other clients' streams. For each stream, the code also
  28894. * adds an Unsubscribe link.
  28895. * </p>
  28896. * <pre>
  28897. * var apiKey = ""; // Replace with your API key. See See https://tokbox.com/account
  28898. * var sessionID = ""; // Replace with your own session ID.
  28899. * // See https://tokbox.com/developer/guides/create-session/.
  28900. * var token = ""; // Replace with a generated token.
  28901. * // See https://tokbox.com/developer/guides/create-token/.
  28902. * var streams = [];
  28903. *
  28904. * var session = OT.initSession(apiKey, sessionID);
  28905. * session.on("streamCreated", function(event) {
  28906. * var stream = event.stream;
  28907. * displayStream(stream);
  28908. * });
  28909. * session.connect(token);
  28910. *
  28911. * function displayStream(stream) {
  28912. * var div = document.createElement('div');
  28913. * div.setAttribute('id', 'stream' + stream.streamId);
  28914. *
  28915. * var subscriber = session.subscribe(stream, div);
  28916. * subscribers.push(subscriber);
  28917. *
  28918. * var aLink = document.createElement('a');
  28919. * aLink.setAttribute('href', 'javascript: unsubscribe("' + subscriber.id + '")');
  28920. * aLink.innerHTML = "Unsubscribe";
  28921. *
  28922. * var streamsContainer = document.getElementById('streamsContainer');
  28923. * streamsContainer.appendChild(div);
  28924. * streamsContainer.appendChild(aLink);
  28925. *
  28926. * streams = event.streams;
  28927. * }
  28928. *
  28929. * function unsubscribe(subscriberId) {
  28930. * console.log("unsubscribe called");
  28931. * for (var i = 0; i &lt; subscribers.length; i++) {
  28932. * var subscriber = subscribers[i];
  28933. * if (subscriber.id == subscriberId) {
  28934. * session.unsubscribe(subscriber);
  28935. * }
  28936. * }
  28937. * }
  28938. * </pre>
  28939. *
  28940. * @param {Subscriber} subscriber The Subscriber object to unsubcribe.
  28941. *
  28942. * @see <a href="#subscribe">subscribe()</a>
  28943. *
  28944. * @method #unsubscribe
  28945. * @memberOf Session
  28946. */
  28947. this.unsubscribe = function (subscriber) {
  28948. if (!subscriber) {
  28949. const errorMsg = 'OT.Session.unsubscribe: subscriber cannot be null';
  28950. _logging.error(errorMsg);
  28951. throw new Error(errorMsg);
  28952. }
  28953. if (!subscriber.stream) {
  28954. _logging.warn('OT.Session.unsubscribe:: tried to unsubscribe a subscriber that had no stream');
  28955. return false;
  28956. }
  28957. _logging.debug("OT.Session.unsubscribe: subscriber " + subscriber.id);
  28958. subscriber._destroy({
  28959. reason: 'Unsubscribe'
  28960. });
  28961. return true;
  28962. };
  28963. /**
  28964. * Returns an array of local Subscriber objects for a given stream.
  28965. *
  28966. * @param {Stream} stream The stream for which you want to find subscribers.
  28967. *
  28968. * @returns {Array} An array of {@link Subscriber} objects for the specified stream.
  28969. *
  28970. * @see <a href="#unsubscribe">unsubscribe()</a>
  28971. * @see <a href="Subscriber.html">Subscriber</a>
  28972. * @see <a href="StreamEvent.html">StreamEvent</a>
  28973. * @method #getSubscribersForStream
  28974. * @memberOf Session
  28975. */
  28976. this.getSubscribersForStream = function (stream) {
  28977. return sessionObjects.subscribers.where({
  28978. streamId: stream.id
  28979. });
  28980. };
  28981. /**
  28982. * Returns the local Publisher object for a given stream.
  28983. *
  28984. * @param { Stream } stream The stream for which you want to find the Publisher.
  28985. *
  28986. * @returns { Publisher } A Publisher object for the specified stream. Returns
  28987. * <code>null</code> if there is no local Publisher object
  28988. * for the specified stream.
  28989. *
  28990. * @see <a href="#forceUnpublish">forceUnpublish()</a>
  28991. * @see <a href="Subscriber.html">Subscriber</a>
  28992. * @see <a href="StreamEvent.html">StreamEvent</a>
  28993. *
  28994. * @method #getPublisherForStream
  28995. * @memberOf Session
  28996. */
  28997. this.getPublisherForStream = function (stream) {
  28998. let streamId;
  28999. let errorMsg;
  29000. if (typeof stream === 'string') {
  29001. streamId = stream;
  29002. } else if (typeof stream === 'object' && stream && Object.hasOwnProperty.call(stream, 'id')) {
  29003. streamId = stream.id;
  29004. } else {
  29005. errorMsg = 'Session.getPublisherForStream :: Invalid stream type';
  29006. _logging.error(errorMsg);
  29007. throw new Error(errorMsg);
  29008. }
  29009. return sessionObjects.publishers.where({
  29010. streamId
  29011. })[0];
  29012. }; // Private Session API: for internal OT use only
  29013. this._ = {
  29014. getProxyUrl() {
  29015. return proxyUrl;
  29016. },
  29017. getSocket() {
  29018. return _socket;
  29019. },
  29020. reconnecting: function () {
  29021. this.dispatchEvent(new Events.SessionReconnectingEvent());
  29022. }.bind(this),
  29023. reconnected: function () {
  29024. this.dispatchEvent(new Events.SessionReconnectedEvent());
  29025. if (this.sessionInfo.renegotiation) {
  29026. sessionObjects.publishers.where({
  29027. session: this
  29028. }).forEach(publisher => {
  29029. publisher._.iceRestart();
  29030. });
  29031. sessionObjects.subscribers.where({
  29032. session: this
  29033. }).forEach(subscriber => {
  29034. subscriber._.iceRestart();
  29035. });
  29036. }
  29037. }.bind(this),
  29038. // session.on("signal", function(SignalEvent))
  29039. // session.on("signal:{type}", function(SignalEvent))
  29040. dispatchSignal: function (fromConnection, type, data) {
  29041. const event = new Events.SignalEvent(type, data, fromConnection);
  29042. event.target = this; // signal a "signal" event
  29043. // NOTE: trigger doesn't support defaultAction, and therefore preventDefault.
  29044. this.trigger(eventNames.SIGNAL, event); // signal an "signal:{type}" event" if there was a custom type
  29045. if (type) {
  29046. this.dispatchEvent(event);
  29047. }
  29048. }.bind(this),
  29049. subscriberChannelUpdate(stream, subscriber, channel, attributes) {
  29050. if (!_socket) {
  29051. _logging.warn('You are disconnected, cannot update subscriber properties ', attributes);
  29052. return null;
  29053. }
  29054. return _socket.subscriberChannelUpdate(stream.id, subscriber.widgetId, channel.id, attributes);
  29055. },
  29056. streamCreate(name, streamId, audioFallbackEnabled, channels, minBitrate, completion) {
  29057. if (!_socket) {
  29058. _logging.warn('You are disconnected, cannot create stream ', streamId);
  29059. return;
  29060. }
  29061. _socket.streamCreate(name, streamId, audioFallbackEnabled, channels, minBitrate, undefined, // Do not expose maxBitrate to the end user
  29062. completion);
  29063. },
  29064. streamDestroy(streamId) {
  29065. if (!_socket) {
  29066. _logging.warn('You are disconnected, cannot destroy stream ', streamId);
  29067. return;
  29068. }
  29069. _socket.streamDestroy(streamId);
  29070. },
  29071. streamChannelUpdate(stream, channel, attributes) {
  29072. if (!_socket) {
  29073. _logging.warn('You are disconnected, cannot update stream properties ', attributes);
  29074. return;
  29075. }
  29076. _socket.streamChannelUpdate(stream.id, channel.id, attributes);
  29077. },
  29078. // allow these variables to be overridden in unit tests
  29079. // it's dirty, but I figure it can be cleaned up when we implement proper DI for our unit tests
  29080. setSocket(newSocket) {
  29081. _socket = newSocket;
  29082. },
  29083. setLogging(newLogging) {
  29084. _logging = newLogging;
  29085. },
  29086. setState,
  29087. setIceServers(iceServers) {
  29088. if (!iceServers) {
  29089. return;
  29090. }
  29091. _iceServerDetails = {
  29092. iceServers: adaptIceServers(iceServers),
  29093. timestamp: Date.now()
  29094. };
  29095. },
  29096. getOtIceServerInfo() {
  29097. const timeElapsed = !_iceServerDetails ? Infinity : Date.now() - _iceServerDetails.timestamp;
  29098. const validDuration = 24 * 60 * 60 * 1000; // 24 hours
  29099. const validTimeRemaining = validDuration - timeElapsed;
  29100. const fiveMinutes = 5 * 60 * 1000;
  29101. if (validTimeRemaining > fiveMinutes) {
  29102. return Promise.resolve({
  29103. transportPolicy: _session && _session.sessionInfo && _session.sessionInfo.clientCandidates,
  29104. servers: _iceServerDetails && _iceServerDetails.iceServers
  29105. });
  29106. }
  29107. if (!_token) {
  29108. // @todo why would this happen before connect() where a token is set?
  29109. // Need a token for getting ice servers from gsi
  29110. return Promise.resolve({
  29111. transportPolicy: _session && _session.sessionInfo && _session.sessionInfo.clientCandidates,
  29112. servers: [],
  29113. needRumorIceServersFallback: true
  29114. });
  29115. }
  29116. const clientVersion = localStaticConfig.clientVersion;
  29117. return getSessionInfo({
  29118. anvilUrl: (this.staticConfig || localStaticConfig).apiUrl,
  29119. sessionId,
  29120. token: _token,
  29121. connectionId: _connectionId,
  29122. clientVersion
  29123. }).then(sessionInfo => {
  29124. _session._.setIceServers(sessionInfo.iceServers);
  29125. if (!_iceServerDetails) {
  29126. // No ice servers provided by gsi
  29127. return {
  29128. transportPolicy: _session.sessionInfo.clientCandidates,
  29129. servers: [],
  29130. needRumorIceServersFallback: true
  29131. };
  29132. }
  29133. return {
  29134. transportPolicy: _session && _session.sessionInfo && _session.sessionInfo.clientCandidates,
  29135. servers: _iceServerDetails && _iceServerDetails.iceServers
  29136. };
  29137. });
  29138. },
  29139. getCodecFlags: () => ({
  29140. h264: _session.sessionInfo.h264,
  29141. vp9: _session.sessionInfo.vp9,
  29142. vp8: _session.sessionInfo.vp8
  29143. }),
  29144. getVideoCodecsCompatible: webRTCStream => testRemovingVideoCodecs({
  29145. RTCPeerConnection: windowMock.RTCPeerConnection,
  29146. env: OTHelpers.env,
  29147. stream: webRTCStream,
  29148. codecFlags: _session._.getCodecFlags()
  29149. }),
  29150. getIceConfig: () => {
  29151. if (!iceConfig) {
  29152. return _session._.getOtIceServerInfo();
  29153. }
  29154. const transportPolicy = (() => {
  29155. if (iceConfig && iceConfig.transportPolicy === 'relay') {
  29156. return 'relay';
  29157. }
  29158. return _session.sessionInfo.clientCandidates;
  29159. })();
  29160. const otIceServersInfoPromise = iceConfig.includeServers === 'custom' ? Promise.resolve({
  29161. servers: []
  29162. }) : _session._.getOtIceServerInfo();
  29163. return otIceServersInfoPromise.then(otIceServerInfo => assign(otIceServerInfo, {
  29164. transportPolicy,
  29165. servers: [...otIceServerInfo.servers, ...iceConfig.customServers]
  29166. }));
  29167. },
  29168. privateEvents: new EventEmitter()
  29169. };
  29170. /**
  29171. * Sends a signal to each client or a specified client in the session. Specify a
  29172. * <code>to</code> property of the <code>signal</code> parameter to limit the signal to
  29173. * be sent to a specific client; otherwise the signal is sent to each client connected to
  29174. * the session.
  29175. * <p>
  29176. * The following example sends a signal of type "foo" with a specified data payload ("hello")
  29177. * to all clients connected to the session:
  29178. * <pre>
  29179. * session.signal({
  29180. * type: "foo",
  29181. * data: "hello"
  29182. * },
  29183. * function(error) {
  29184. * if (error) {
  29185. * console.log("signal error: " + error.message);
  29186. * } else {
  29187. * console.log("signal sent");
  29188. * }
  29189. * }
  29190. * );
  29191. * </pre>
  29192. * <p>
  29193. * Calling this method without specifying a recipient client (by setting the <code>to</code>
  29194. * property of the <code>signal</code> parameter) results in multiple signals sent (one to each
  29195. * client in the session). For information on charges for signaling, see the
  29196. * <a href="http://tokbox.com/pricing">OpenTok pricing</a> page.
  29197. * <p>
  29198. * The following example sends a signal of type "foo" with a data payload ("hello") to a
  29199. * specific client connected to the session:
  29200. * <pre>
  29201. * session.signal({
  29202. * type: "foo",
  29203. * to: recipientConnection; // a Connection object
  29204. * data: "hello"
  29205. * },
  29206. * function(error) {
  29207. * if (error) {
  29208. * console.log("signal error: " + error.message);
  29209. * } else {
  29210. * console.log("signal sent");
  29211. * }
  29212. * }
  29213. * );
  29214. * </pre>
  29215. * <p>
  29216. * Add an event handler for the <code>signal</code> event to listen for all signals sent in
  29217. * the session. Add an event handler for the <code>signal:type</code> event to listen for
  29218. * signals of a specified type only (replace <code>type</code>, in <code>signal:type</code>,
  29219. * with the type of signal to listen for). The Session object dispatches these events. (See
  29220. * <a href="#events">events</a>.)
  29221. *
  29222. * @param {Object} signal An object that contains the following properties defining the signal:
  29223. * <ul>
  29224. * <li><code>data</code> &mdash; (String) The data to send. The limit to the length of data
  29225. * string is 8kB. Do not set the data string to <code>null</code> or
  29226. * <code>undefined</code>.</li>
  29227. * <li><code>retryAfterReconnect</code>&mdash; (Boolean) Upon reconnecting to the session,
  29228. * whether to send any signals that were initiated while disconnected. If your client loses its
  29229. * connection to the OpenTok session, due to a drop in network connectivity, the client
  29230. * attempts to reconnect to the session, and the Session object dispatches a
  29231. * <code>reconnecting</code> event. By default, signals initiated while disconnected are
  29232. * sent when (and if) the client reconnects to the OpenTok session. You can prevent this by
  29233. * setting the <code>retryAfterReconnect</code> property to <code>false</code>. (The default
  29234. * value is <code>true</code>.)
  29235. * <li><code>to</code> &mdash; (Connection) A <a href="Connection.html">Connection</a>
  29236. * object corresponding to the client that the message is to be sent to. If you do not
  29237. * specify this property, the signal is sent to all clients connected to the session.</li>
  29238. * <li><code>type</code> &mdash; (String) The type of the signal. You can use the type to
  29239. * filter signals when setting an event handler for the <code>signal:type</code> event
  29240. * (where you replace <code>type</code> with the type string). The maximum length of the
  29241. * <code>type</code> string is 128 characters, and it must contain only letters (A-Z and a-z),
  29242. * numbers (0-9), '-', '_', and '~'.</li>
  29243. * </li>
  29244. * </ul>
  29245. *
  29246. * <p>Each property is optional. If you set none of the properties, you will send a signal
  29247. * with no data or type to each client connected to the session.</p>
  29248. *
  29249. * @param {Function} completionHandler (Optional) A function that is called when sending the signal
  29250. * succeeds or fails. This function takes one parameter &mdash; <code>error</code>.
  29251. * On success, the <code>completionHandler</code> function is not passed any
  29252. * arguments. On error, the function is passed an <code>error</code> object, defined by the
  29253. * <a href="Error.html">Error</a> class. The <code>error</code> object has the following
  29254. * properties:
  29255. *
  29256. * <ul>
  29257. * <li><code>code</code> &mdash; (Number) An error code, which can be one of the following:
  29258. * <table class="docs_table">
  29259. * <tr>
  29260. * <td>400</td> <td>One of the signal properties is invalid.</td>
  29261. * </tr>
  29262. * <tr>
  29263. * <td>404</td> <td>The client specified by the <code>to</code> property is not connected
  29264. * to the session.</td>
  29265. * </tr>
  29266. * <tr>
  29267. * <td>413</td> <td>The <code>type</code> string exceeds the maximum length (128 bytes),
  29268. * or the <code>data</code> string exceeds the maximum size (8 kB).</td>
  29269. * </tr>
  29270. * <tr>
  29271. * <td>500</td> <td>You are not connected to the OpenTok session.</td>
  29272. * </tr>
  29273. * </table>
  29274. * </li>
  29275. * <li><code>message</code> &mdash; (String) A description of the error.</li>
  29276. * </ul>
  29277. *
  29278. * <p>Note that the <code>completionHandler</code> success result (<code>error == null</code>)
  29279. * indicates that the options passed into the <code>Session.signal()</code> method are valid
  29280. * and the signal was sent. It does <i>not</i> indicate that the signal was successfully
  29281. * received by any of the intended recipients.
  29282. *
  29283. * @method #signal
  29284. * @memberOf Session
  29285. * @see <a href="#event:signal">signal</a> and <a href="#event:signal:type">signal:type</a> events
  29286. */
  29287. this.signal = function (options, completion) {
  29288. let _options = options;
  29289. let _completion = completion || function () {};
  29290. if (isFunction(_options)) {
  29291. _completion = _options;
  29292. _options = null;
  29293. }
  29294. if (this.isNot('connected')) {
  29295. const notConnectedErrorMsg = 'Unable to send signal - you are not connected to the session.';
  29296. dispatchOTError(otError(errors.NOT_CONNECTED, new Error(notConnectedErrorMsg), 500), _completion);
  29297. return;
  29298. }
  29299. function getErrorNameFromCode(code) {
  29300. switch (code) {
  29301. case 400:
  29302. case 413:
  29303. return errors.INVALID_PARAMETER;
  29304. case 429:
  29305. return errors.RATE_LIMIT_EXCEEDED;
  29306. case 404:
  29307. return errors.NOT_FOUND;
  29308. case 500:
  29309. return errors.NOT_CONNECTED;
  29310. case 403:
  29311. return errors.PERMISSION_DENIED;
  29312. case 2001:
  29313. return errors.UNEXPECTED_SERVER_RESPONSE;
  29314. default:
  29315. return undefined;
  29316. }
  29317. }
  29318. _socket.signal(_options, function (error) {
  29319. if (error) {
  29320. const errorName = getErrorNameFromCode(error.code);
  29321. if (errorName) {
  29322. error = otError(errorName, new Error(error.message), error.code);
  29323. }
  29324. _completion(error);
  29325. return;
  29326. }
  29327. for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  29328. args[_key4 - 1] = arguments[_key4];
  29329. }
  29330. _completion(error, ...args);
  29331. }, this.logEvent);
  29332. if (options && options.data && typeof options.data !== 'string') {
  29333. _logging.warn('Signaling of anything other than Strings is deprecated. ' + 'Please update the data property to be a string.');
  29334. }
  29335. };
  29336. /**
  29337. * Forces a remote connection to leave the session.
  29338. *
  29339. * <p>
  29340. * The <code>forceDisconnect()</code> method is normally used as a moderation tool
  29341. * to remove users from an ongoing session.
  29342. * </p>
  29343. * <p>
  29344. * When a connection is terminated using the <code>forceDisconnect()</code>,
  29345. * <code>sessionDisconnected</code>, <code>connectionDestroyed</code> and
  29346. * <code>streamDestroyed</code> events are dispatched in the same way as they
  29347. * would be if the connection had terminated itself using the <code>disconnect()</code>
  29348. * method. However, the <code>reason</code> property of a {@link ConnectionEvent} or
  29349. * {@link StreamEvent} object specifies <code>"forceDisconnected"</code> as the reason
  29350. * for the destruction of the connection and stream(s).
  29351. * </p>
  29352. * <p>
  29353. * While you can use the <code>forceDisconnect()</code> method to terminate your own connection,
  29354. * calling the <code>disconnect()</code> method is simpler.
  29355. * </p>
  29356. * <p>
  29357. * The OT object dispatches an <code>exception</code> event if the user's role
  29358. * does not include permissions required to force other users to disconnect.
  29359. * You define a user's role when you create the user token (see the
  29360. * <a href="https://tokbox.com/developer/guides/create-token/">Token creation overview</a>).
  29361. * See <a href="ExceptionEvent.html">ExceptionEvent</a> and <a href="OT.html#on">OT.on()</a>.
  29362. * </p>
  29363. * <p>
  29364. * The application throws an error if the session is not connected.
  29365. * </p>
  29366. *
  29367. * <h5>Events dispatched:</h5>
  29368. *
  29369. * <p>
  29370. * <code>connectionDestroyed</code> (<a href="ConnectionEvent.html">ConnectionEvent</a>) &#151;
  29371. * On clients other than which had the connection terminated.
  29372. * </p>
  29373. * <p>
  29374. * <code>exception</code> (<a href="ExceptionEvent.html">ExceptionEvent</a>) &#151;
  29375. * The user's role does not allow forcing other user's to disconnect (<code>event.code =
  29376. * 1530</code>),
  29377. * or the specified stream is not publishing to the session (<code>event.code = 1535</code>).
  29378. * </p>
  29379. * <p>
  29380. * <code>sessionDisconnected</code>
  29381. * (<a href="SessionDisconnectEvent.html">SessionDisconnectEvent</a>) &#151;
  29382. * On the client which has the connection terminated.
  29383. * </p>
  29384. * <p>
  29385. * <code>streamDestroyed</code> (<a href="StreamEvent.html">StreamEvent</a>) &#151;
  29386. * If streams are stopped as a result of the connection ending.
  29387. * </p>
  29388. *
  29389. * @param {Connection} connection The connection to be disconnected from the session.
  29390. * This value can either be a <a href="Connection.html">Connection</a> object or a connection
  29391. * ID (which can be obtained from the <code>connectionId</code> property of the Connection object).
  29392. *
  29393. * @param {Function} completionHandler (Optional) A function to be called when the call to the
  29394. * <code>forceDiscononnect()</code> method succeeds or fails. This function takes one parameter
  29395. * &mdash; <code>error</code>. On success, the <code>completionHandler</code> function is
  29396. * not passed any arguments. On error, the function is passed an <code>error</code> object
  29397. * parameter. The <code>error</code> object, defined by the <a href="Error.html">Error</a>
  29398. * class, has two properties: <code>code</code> (an integer)
  29399. * and <code>message</code> (a string), which identify the cause of the failure.
  29400. * Calling <code>forceDisconnect()</code> fails if the role assigned to your
  29401. * token is not "moderator"; in this case the <code>error.name</code> property is set to
  29402. * <code>"OT_PERMISSION_DENIED"</code>. The following code adds a <code>completionHandler</code>
  29403. * when calling the <code>forceDisconnect()</code> method:
  29404. * <pre>
  29405. * session.forceDisconnect(connection, function (error) {
  29406. * if (error) {
  29407. * console.log(error);
  29408. * } else {
  29409. * console.log("Connection forced to disconnect: " + connection.id);
  29410. * }
  29411. * });
  29412. * </pre>
  29413. *
  29414. * @method #forceDisconnect
  29415. * @memberOf Session
  29416. */
  29417. this.forceDisconnect = function (connectionOrConnectionId, completionHandler) {
  29418. if (this.isNot('connected')) {
  29419. const notConnectedErrorMsg = 'Cannot call forceDisconnect(). You are not ' + 'connected to the session.';
  29420. dispatchOTError(otError(errors.NOT_CONNECTED, new Error(notConnectedErrorMsg), ExceptionCodes.NOT_CONNECTED), completionHandler);
  29421. return;
  29422. }
  29423. const connectionId = typeof connectionOrConnectionId === 'string' ? connectionOrConnectionId : connectionOrConnectionId.id;
  29424. const invalidParameterErrorMsg = 'Invalid Parameter. Check that you have passed valid parameter values into the method call.';
  29425. if (!connectionId) {
  29426. dispatchOTError(otError(errors.INVALID_PARAMETER, new Error(invalidParameterErrorMsg), ExceptionCodes.INVALID_PARAMETER), completionHandler);
  29427. return;
  29428. }
  29429. const notPermittedErrorMsg = 'This token does not allow forceDisconnect. ' + 'The role must be at least `moderator` to enable this functionality';
  29430. if (!permittedTo('forceDisconnect')) {
  29431. dispatchOTError(otError(errors.PERMISSION_DENIED, new Error(notPermittedErrorMsg), ExceptionCodes.UNABLE_TO_FORCE_DISCONNECT), completionHandler);
  29432. return;
  29433. }
  29434. _socket.forceDisconnect(connectionId, function (err) {
  29435. if (err) {
  29436. dispatchOTError(otError(errors.INVALID_PARAMETER, new Error(invalidParameterErrorMsg), ExceptionCodes.INVALID_PARAMETER), completionHandler);
  29437. } else if (completionHandler && isFunction(completionHandler)) {
  29438. for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
  29439. args[_key5 - 1] = arguments[_key5];
  29440. }
  29441. completionHandler(err, ...args);
  29442. }
  29443. });
  29444. };
  29445. /**
  29446. * Forces the publisher of the specified stream to stop publishing the stream.
  29447. *
  29448. * <p>
  29449. * Calling this method causes the Session object to dispatch a <code>streamDestroyed</code>
  29450. * event on all clients that are subscribed to the stream (including the client that is
  29451. * publishing the stream). The <code>reason</code> property of the StreamEvent object is
  29452. * set to <code>"forceUnpublished"</code>.
  29453. * </p>
  29454. * <p>
  29455. * The OT object dispatches an <code>exception</code> event if the user's role
  29456. * does not include permissions required to force other users to unpublish.
  29457. * You define a user's role when you create the user token (see the
  29458. * <a href="https://tokbox.com/developer/guides/create-token/">Token creation overview</a>).
  29459. * You pass the token string as a parameter of the <code>connect()</code> method of the Session
  29460. * object. See <a href="ExceptionEvent.html">ExceptionEvent</a> and
  29461. * <a href="OT.html#on">OT.on()</a>.
  29462. * </p>
  29463. *
  29464. * <h5>Events dispatched:</h5>
  29465. *
  29466. * <p>
  29467. * <code>exception</code> (<a href="ExceptionEvent.html">ExceptionEvent</a>) &#151;
  29468. * The user's role does not allow forcing other users to unpublish.
  29469. * </p>
  29470. * <p>
  29471. * <code>streamDestroyed</code> (<a href="StreamEvent.html">StreamEvent</a>) &#151;
  29472. * The stream has been unpublished. The Session object dispatches this on all clients
  29473. * subscribed to the stream, as well as on the publisher's client.
  29474. * </p>
  29475. *
  29476. * @param {Stream} stream The stream to be unpublished.
  29477. *
  29478. * @param {Function} completionHandler (Optional) A function to be called when the call to the
  29479. * <code>forceUnpublish()</code> method succeeds or fails. This function takes one parameter
  29480. * &mdash; <code>error</code>. On success, the <code>completionHandler</code> function is
  29481. * not passed any arguments. On error, the function is passed an <code>error</code> object
  29482. * parameter. The <code>error</code> object, defined by the <a href="Error.html">Error</a>
  29483. * class, has two properties: <code>code</code> (an integer)
  29484. * and <code>message</code> (a string), which identify the cause of the failure. Calling
  29485. * <code>forceUnpublish()</code> fails if the role assigned to your token is not "moderator";
  29486. * in this case the <code>error.name</code> property is set to <code>"OT_PERMISSION_DENIED"</code>.
  29487. * The following code adds a completion handler when calling the <code>forceUnpublish()</code>
  29488. * method:
  29489. * <pre>
  29490. * session.forceUnpublish(stream, function (error) {
  29491. * if (error) {
  29492. * console.log(error);
  29493. * } else {
  29494. * console.log("Connection forced to disconnect: " + connection.id);
  29495. * }
  29496. * });
  29497. * </pre>
  29498. *
  29499. * @method #forceUnpublish
  29500. * @memberOf Session
  29501. */
  29502. this.forceUnpublish = function (streamOrStreamId, completionHandler) {
  29503. if (completionHandler === void 0) {
  29504. completionHandler = () => {};
  29505. }
  29506. const dispatchError = err => dispatchOTError(otError(err.name, new Error(err.msg), err.code), completionHandler);
  29507. const invalidParameterError = {
  29508. msg: 'Invalid Parameter. Check that you have passed valid parameter values into the method call.',
  29509. code: ExceptionCodes.INVALID_PARAMETER,
  29510. name: errors.INVALID_PARAMETER
  29511. };
  29512. const notConnectedError = {
  29513. msg: 'Cannot call forceUnpublish(). You are not connected to the session.',
  29514. code: ExceptionCodes.NOT_CONNECTED,
  29515. name: errors.NOT_CONNECTED
  29516. };
  29517. const notPermittedError = {
  29518. msg: 'This token does not allow forceUnpublish. The role must be at least `moderator` to enable this ' + 'functionality',
  29519. code: ExceptionCodes.UNABLE_TO_FORCE_UNPUBLISH,
  29520. name: errors.PERMISSION_DENIED
  29521. };
  29522. const notFoundError = {
  29523. msg: 'The stream does not exist.',
  29524. name: errors.NOT_FOUND
  29525. };
  29526. const unexpectedError = {
  29527. msg: 'An unexpected error occurred.',
  29528. name: errors.UNEXPECTED_SERVER_RESPONSE,
  29529. code: ExceptionCodes.UNEXPECTED_SERVER_RESPONSE
  29530. };
  29531. if (!streamOrStreamId) {
  29532. dispatchError(invalidParameterError);
  29533. return;
  29534. }
  29535. if (_this.isNot('connected')) {
  29536. dispatchError(notConnectedError);
  29537. return;
  29538. }
  29539. const stream = getStream(streamOrStreamId);
  29540. if (!permittedTo('forceUnpublish')) {
  29541. // if this throws an error the handleJsException won't occur
  29542. dispatchError(notPermittedError);
  29543. return;
  29544. }
  29545. _socket.forceUnpublish(stream.id, err => {
  29546. if (!err) {
  29547. completionHandler(null);
  29548. return;
  29549. }
  29550. if (err.code === '404') {
  29551. dispatchError(notFoundError);
  29552. } else if (err.code === '403') {
  29553. dispatchError(notPermittedError);
  29554. } else {
  29555. dispatchError(unexpectedError);
  29556. }
  29557. });
  29558. };
  29559. this.isConnected = () => this.is('connected');
  29560. this.capabilities = new Capabilities([]);
  29561. };
  29562. /**
  29563. * Dispatched when an archive recording of the session starts.
  29564. *
  29565. * @name archiveStarted
  29566. * @event
  29567. * @memberof Session
  29568. * @see ArchiveEvent
  29569. * @see <a href="http://www.tokbox.com/opentok/tutorials/archiving">Archiving overview</a>
  29570. */
  29571. /**
  29572. * Dispatched when an archive recording of the session stops.
  29573. *
  29574. * @name archiveStopped
  29575. * @event
  29576. * @memberof Session
  29577. * @see ArchiveEvent
  29578. * @see <a href="http://www.tokbox.com/opentok/tutorials/archiving">Archiving overview</a>
  29579. */
  29580. /**
  29581. * Dispatched when a new client (including your own) has connected to the session, and for
  29582. * every client in the session when you first connect. (The Session object also dispatches
  29583. * a <code>sessionConnected</code> event when your local client connects.)
  29584. *
  29585. * @name connectionCreated
  29586. * @event
  29587. * @memberof Session
  29588. * @see ConnectionEvent
  29589. * @see <a href="OT.html#initSession">OT.initSession()</a>
  29590. */
  29591. /**
  29592. * A client, other than your own, has disconnected from the session.
  29593. * @name connectionDestroyed
  29594. * @event
  29595. * @memberof Session
  29596. * @see ConnectionEvent
  29597. */
  29598. /**
  29599. * The client has connected to an OpenTok session. This event is dispatched asynchronously
  29600. * in response to a successful call to the <code>connect()</code> method of a Session
  29601. * object. Before calling the <code>connect()</code> method, initialize the session by
  29602. * calling the <code>OT.initSession()</code> method. For a code example and more details,
  29603. * see <a href="#connect">Session.connect()</a>.
  29604. * @name sessionConnected
  29605. * @event
  29606. * @memberof Session
  29607. * @see SessionConnectEvent
  29608. * @see <a href="#connect">Session.connect()</a>
  29609. * @see <a href="OT.html#initSession">OT.initSession()</a>
  29610. */
  29611. /**
  29612. * The client has disconnected from the session. This event may be dispatched asynchronously
  29613. * in response to a successful call to the <code>disconnect()</code> method of the Session object.
  29614. * The event may also be disptached if a session connection is lost inadvertantly, as in the case
  29615. * of a lost network connection.
  29616. * <p>
  29617. * The default behavior is that all Subscriber objects are unsubscribed and removed from the
  29618. * HTML DOM. Each Subscriber object dispatches a <code>destroyed</code> event when the element is
  29619. * removed from the HTML DOM. If you call the <code>preventDefault()</code> method in the event
  29620. * listener for the <code>sessionDisconnect</code> event, the default behavior is prevented, and
  29621. * you can, optionally, clean up Subscriber objects using your own code.
  29622. * <p> The <code>reason</code> property of the event object indicates the reason for the client
  29623. * being disconnected.
  29624. * @name sessionDisconnected
  29625. * @event
  29626. * @memberof Session
  29627. * @see <a href="#disconnect">Session.disconnect()</a>
  29628. * @see <a href="#forceDisconnect">Session.forceDisconnect()</a>
  29629. * @see SessionDisconnectEvent
  29630. */
  29631. /**
  29632. * The local client has lost its connection to an OpenTok session and is trying to reconnect.
  29633. * This results from a loss in network connectivity. If the client can reconnect to the session,
  29634. * the Session object dispatches a <code>sessionReconnected</code> event. Otherwise, if the client
  29635. * cannot reconnect, the Session object dispatches a <code>sessionDisconnected</code> event.
  29636. * <p>
  29637. * In response to this event, you may want to provide a user interface notification, to let
  29638. * the user know that the app is trying to reconnect to the session and that audio-video streams
  29639. * are temporarily disconnected.
  29640. *
  29641. * @name sessionReconnecting
  29642. * @event
  29643. * @memberof Session
  29644. * @see Event
  29645. * @see <a href="#event:sessionReconnected">sessionReconnected event</a>
  29646. * @see <a href="#event:sessionDisconnected">sessionDisconnected event</a>
  29647. */
  29648. /**
  29649. * The local client has reconnected to the OpenTok session after its connection was lost
  29650. * temporarily. When the connection is lost, the Session object dispatches a
  29651. * <code>sessionReconnecting</code> event, prior to the <code>sessionReconnected</code>
  29652. * event. If the client cannot reconnect to the session, the Session object dispatches a
  29653. * <code>sessionDisconnected</code> event instead of this event.
  29654. * <p>
  29655. * Any existing publishers and subscribers are automatically reconnected when client reconnects
  29656. * and the Session object dispatches this event.
  29657. * <p>
  29658. * Any signals sent by other clients while your client was disconnected are received upon
  29659. * reconnecting. By default, signals initiated by the local client while disconnected
  29660. * (by calling the <code>Session.signal()</code> method) are sent when the client reconnects
  29661. * to the OpenTok session. You can prevent this by setting the <code>retryAfterReconnect</code>
  29662. * property to <code>false</code> in the <code>signal</code> object you pass into the
  29663. * <a href="#signal">Session.signal()</a> method.
  29664. *
  29665. * @name sessionReconnected
  29666. * @event
  29667. * @memberof Session
  29668. * @see Event
  29669. * @see <a href="#event:sessionReconnecting">sessionReconnecting event</a>
  29670. * @see <a href="#event:sessionDisconnected">sessionDisconnected event</a>
  29671. */
  29672. /**
  29673. * A new stream, published by another client, has been created on this session. For streams
  29674. * published by your own client, the Publisher object dispatches a <code>streamCreated</code>
  29675. * event. For a code example and more details, see {@link StreamEvent}.
  29676. * @name streamCreated
  29677. * @event
  29678. * @memberof Session
  29679. * @see StreamEvent
  29680. * @see <a href="Session.html#publish">Session.publish()</a>
  29681. */
  29682. /**
  29683. * A stream from another client has stopped publishing to the session.
  29684. * <p>
  29685. * The default behavior is that all Subscriber objects that are subscribed to the stream are
  29686. * unsubscribed and removed from the HTML DOM. Each Subscriber object dispatches a
  29687. * <code>destroyed</code> event when the element is removed from the HTML DOM. If you call the
  29688. * <code>preventDefault()</code> method in the event listener for the
  29689. * <code>streamDestroyed</code> event, the default behavior is prevented and you can clean up
  29690. * a Subscriber object for the stream by calling its <code>destroy()</code> method. See
  29691. * <a href="Session.html#getSubscribersForStream">Session.getSubscribersForStream()</a>.
  29692. * <p>
  29693. * For streams published by your own client, the Publisher object dispatches a
  29694. * <code>streamDestroyed</code> event.
  29695. * <p>
  29696. * For a code example and more details, see {@link StreamEvent}.
  29697. * @name streamDestroyed
  29698. * @event
  29699. * @memberof Session
  29700. * @see StreamEvent
  29701. */
  29702. /**
  29703. * Defines an event dispatched when property of a stream has changed. This can happen in
  29704. * in the following conditions:
  29705. * <p>
  29706. * <ul>
  29707. * <li> A stream has started or stopped publishing audio or video (see
  29708. * <a href="Publisher.html#publishAudio">Publisher.publishAudio()</a> and
  29709. * <a href="Publisher.html#publishVideo">Publisher.publishVideo()</a>). Note
  29710. * that a subscriber's video can be disabled or enabled for reasons other than
  29711. * the publisher disabling or enabling it. A Subscriber object dispatches
  29712. * <code>videoDisabled</code> and <code>videoEnabled</code> events in all
  29713. * conditions that cause the subscriber's stream to be disabled or enabled.
  29714. * </li>
  29715. * <li> The <code>videoDimensions</code> property of the Stream object has
  29716. * changed (see <a href="Stream.html#properties">Stream.videoDimensions</a>).
  29717. * </li>
  29718. * <li> The <code>videoType</code> property of the Stream object has changed.
  29719. * This can happen in a stream published by a mobile device. (See
  29720. * <a href="Stream.html#properties">Stream.videoType</a>.)
  29721. * </li>
  29722. * </ul>
  29723. *
  29724. * @name streamPropertyChanged
  29725. * @event
  29726. * @memberof Session
  29727. * @see StreamPropertyChangedEvent
  29728. * @see <a href="Publisher.html#publishAudio">Publisher.publishAudio()</a>
  29729. * @see <a href="Publisher.html#publishVideo">Publisher.publishVideo()</a>
  29730. * @see <a href="Stream.html#hasAudio">Stream.hasAudio</a>
  29731. * @see <a href="Stream.html#hasVideo">Stream.hasVideo</a>
  29732. * @see <a href="Stream.html#videoDimensions">Stream.videoDimensions</a>
  29733. * @see <a href="Subscriber.html#event:videoDisabled">Subscriber videoDisabled event</a>
  29734. * @see <a href="Subscriber.html#event:videoEnabled">Subscriber videoEnabled event</a>
  29735. */
  29736. /**
  29737. * A signal was received from the session. The <a href="SignalEvent.html">SignalEvent</a>
  29738. * class defines this event object. It includes the following properties:
  29739. * <ul>
  29740. * <li><code>data</code> &mdash; (String) The data string sent with the signal (if there
  29741. * is one).</li>
  29742. * <li><code>from</code> &mdash; (<a href="Connection.html">Connection</a>) The Connection
  29743. * corresponding to the client that sent the signal.</li>
  29744. * <li><code>type</code> &mdash; (String) The type assigned to the signal (if there is
  29745. * one).</li>
  29746. * </ul>
  29747. * <p>
  29748. * You can register to receive all signals sent in the session, by adding an event handler
  29749. * for the <code>signal</code> event. For example, the following code adds an event handler
  29750. * to process all signals sent in the session:
  29751. * <pre>
  29752. * session.on("signal", function(event) {
  29753. * console.log("Signal sent from connection: " + event.from.id);
  29754. * console.log("Signal data: " + event.data);
  29755. * });
  29756. * </pre>
  29757. * <p>You can register for signals of a specfied type by adding an event handler for the
  29758. * <code>signal:type</code> event (replacing <code>type</code> with the actual type string
  29759. * to filter on).
  29760. *
  29761. * @name signal
  29762. * @event
  29763. * @memberof Session
  29764. * @see <a href="Session.html#signal">Session.signal()</a>
  29765. * @see SignalEvent
  29766. * @see <a href="#event:signal:type">signal:type</a> event
  29767. */
  29768. /**
  29769. * A signal of the specified type was received from the session. The
  29770. * <a href="SignalEvent.html">SignalEvent</a> class defines this event object.
  29771. * It includes the following properties:
  29772. * <ul>
  29773. * <li><code>data</code> &mdash; (String) The data string sent with the signal.</li>
  29774. * <li><code>from</code> &mdash; (<a href="Connection.html">Connection</a>) The Connection
  29775. * corresponding to the client that sent the signal.</li>
  29776. * <li><code>type</code> &mdash; (String) The type assigned to the signal (if there is one).
  29777. * </li>
  29778. * </ul>
  29779. * <p>
  29780. * You can register for signals of a specfied type by adding an event handler for the
  29781. * <code>signal:type</code> event (replacing <code>type</code> with the actual type string
  29782. * to filter on). For example, the following code adds an event handler for signals of
  29783. * type "foo":
  29784. * <pre>
  29785. * session.on("signal:foo", function(event) {
  29786. * console.log("foo signal sent from connection " + event.from.id);
  29787. * console.log("Signal data: " + event.data);
  29788. * });
  29789. * </pre>
  29790. * <p>
  29791. * You can register to receive <i>all</i> signals sent in the session, by adding an event
  29792. * handler for the <code>signal</code> event.
  29793. *
  29794. * @name signal:type
  29795. * @event
  29796. * @memberof Session
  29797. * @see <a href="Session.html#signal">Session.signal()</a>
  29798. * @see SignalEvent
  29799. * @see <a href="#event:signal">signal</a> event
  29800. */
  29801. return Session;
  29802. };
  29803. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  29804. /***/ }),
  29805. /* 297 */
  29806. /***/ (function(module, exports, __webpack_require__) {
  29807. "use strict";
  29808. const ExceptionCodes = __webpack_require__(11);
  29809. const OTErrorClass = __webpack_require__(33);
  29810. const knownErrorCodes = [400, 403, 409, ExceptionCodes.CONNECTION_LIMIT_EXCEEDED];
  29811. const reasons = {
  29812. CONNECT: 'ConnectToSession',
  29813. SESSION_STATE: 'GetSessionState'
  29814. };
  29815. /*
  29816. * Converts an error from RumorSocket to use generic exception codes
  29817. * @param {Error} error - Error object with reason property
  29818. * @return {Object} The converted error code and message
  29819. * @property {number} code
  29820. * @property {string} message
  29821. */
  29822. module.exports = function convertRumorError(error) {
  29823. let code;
  29824. let message;
  29825. if (error.reason === reasons.CONNECT && error.code === ExceptionCodes.CONNECT_FAILED) {
  29826. code = error.code;
  29827. message = OTErrorClass.getTitleByCode(error.code);
  29828. } else if (error.code && knownErrorCodes.indexOf(Number(error.code)) > -1) {
  29829. code = ExceptionCodes.CONNECT_FAILED;
  29830. switch (error.reason) {
  29831. case reasons.CONNECT:
  29832. switch (error.code) {
  29833. case ExceptionCodes.CONNECTION_LIMIT_EXCEEDED:
  29834. code = error.code;
  29835. message = 'Cannot connect -- the limit for concurrent connections to the session ' + 'has been reached';
  29836. break;
  29837. default:
  29838. message = 'Received error response to connection create message.';
  29839. break;
  29840. }
  29841. break;
  29842. case reasons.SESSION_STATE:
  29843. message = 'Received error response to session read';
  29844. break;
  29845. default:
  29846. message = '';
  29847. break;
  29848. }
  29849. } else {
  29850. code = ExceptionCodes.UNEXPECTED_SERVER_RESPONSE;
  29851. message = 'Unexpected server response. Try this operation again later.';
  29852. }
  29853. return {
  29854. code,
  29855. message
  29856. };
  29857. };
  29858. /***/ }),
  29859. /* 298 */
  29860. /***/ (function(module, exports, __webpack_require__) {
  29861. "use strict";
  29862. const env = __webpack_require__(3);
  29863. const hasOpenTokSupport = __webpack_require__(56).once;
  29864. module.exports = () => hasOpenTokSupport() && ['Chrome', 'Safari'].indexOf(env.name) !== -1;
  29865. /***/ }),
  29866. /* 299 */
  29867. /***/ (function(module, exports, __webpack_require__) {
  29868. "use strict";
  29869. module.exports = function serializeMessage(message) {
  29870. return JSON.stringify(message);
  29871. };
  29872. /***/ }),
  29873. /* 300 */
  29874. /***/ (function(module, exports, __webpack_require__) {
  29875. "use strict";
  29876. exports.__esModule = true;
  29877. exports.default = void 0;
  29878. var _default = (_ref) => {
  29879. let logger = _ref.logger,
  29880. obj = _ref.obj,
  29881. eventNames = _ref.eventNames;
  29882. eventNames.forEach(eventName => {
  29883. obj.on(eventName, function () {
  29884. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  29885. args[_key] = arguments[_key];
  29886. }
  29887. return logger.spam('emitted', eventName, args);
  29888. });
  29889. });
  29890. };
  29891. exports.default = _default;
  29892. /***/ }),
  29893. /* 301 */
  29894. /***/ (function(module, exports, __webpack_require__) {
  29895. "use strict";
  29896. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  29897. /* eslint-disable prefer-rest-params */
  29898. const isFunction = __webpack_require__(13);
  29899. const OTErrorClass = __webpack_require__(33);
  29900. const eventing = __webpack_require__(5);
  29901. const logging = __webpack_require__(1)('Dispatcher');
  29902. const RumorMessageTypes = __webpack_require__(166);
  29903. const unboxFromRumorMessage = __webpack_require__(670);
  29904. const Dispatcher = function Dispatcher() {
  29905. eventing(this);
  29906. this.callbacks = {};
  29907. };
  29908. module.exports = Dispatcher;
  29909. Dispatcher.prototype.registerCallback = function (transactionId, completion) {
  29910. this.callbacks[transactionId] = completion;
  29911. };
  29912. Dispatcher.prototype.triggerCallback = function (transactionId) {
  29913. /* , arg1, arg2, argN-1, argN */
  29914. if (!transactionId) {
  29915. return;
  29916. }
  29917. const completion = this.callbacks[transactionId];
  29918. if (completion && isFunction(completion)) {
  29919. const args = Array.prototype.slice.call(arguments);
  29920. args.shift();
  29921. completion(...args);
  29922. }
  29923. delete this.callbacks[transactionId];
  29924. };
  29925. Dispatcher.prototype.onClose = function (reason) {
  29926. this.emit('close', reason);
  29927. };
  29928. Dispatcher.prototype.onReconnected = function () {
  29929. this.emit('reconnected');
  29930. };
  29931. Dispatcher.prototype.onReconnecting = function () {
  29932. this.emit('reconnecting');
  29933. };
  29934. Dispatcher.prototype.dispatch = function (rumorMessage) {
  29935. // The special casing of STATUS messages is ugly. Need to think about
  29936. // how to better integrate this.
  29937. if (rumorMessage.type === RumorMessageTypes.STATUS) {
  29938. logging.debug(rumorMessage);
  29939. let error;
  29940. if (rumorMessage.isError) {
  29941. let message;
  29942. if (typeof rumorMessage.data === 'string') {
  29943. try {
  29944. const data = JSON.parse(rumorMessage.data);
  29945. if (data && typeof data === 'object') {
  29946. message = data.reason;
  29947. }
  29948. } catch (e) {
  29949. logging.warn('Failed to parse rumorMessage.data', e);
  29950. }
  29951. }
  29952. error = new OTErrorClass(rumorMessage.status, message);
  29953. }
  29954. this.triggerCallback(rumorMessage.transactionId, error, rumorMessage);
  29955. return;
  29956. }
  29957. const message = unboxFromRumorMessage(rumorMessage);
  29958. logging.debug(message.signature + ":", message);
  29959. switch (message.resource) {
  29960. case 'session':
  29961. this.dispatchSession(message);
  29962. break;
  29963. case 'connection':
  29964. this.dispatchConnection(message);
  29965. break;
  29966. case 'stream':
  29967. this.dispatchStream(message);
  29968. break;
  29969. case 'stream_channel':
  29970. this.dispatchStreamChannel(message);
  29971. break;
  29972. case 'subscriber':
  29973. this.dispatchSubscriber(message);
  29974. break;
  29975. case 'subscriber_channel':
  29976. this.dispatchSubscriberChannel(message);
  29977. break;
  29978. case 'signal':
  29979. this.dispatchSignal(message);
  29980. break;
  29981. case 'archive':
  29982. this.dispatchArchive(message);
  29983. break;
  29984. default:
  29985. logging.debug("Type " + message.resource + " is not currently implemented");
  29986. }
  29987. };
  29988. Dispatcher.prototype.dispatchSession = function (message) {
  29989. switch (message.method) {
  29990. case 'read':
  29991. this.emit('session#read', message.content, message.transactionId);
  29992. break;
  29993. default:
  29994. logging.debug(message.signature + " is not currently implemented");
  29995. }
  29996. };
  29997. Dispatcher.prototype.dispatchConnection = function (message) {
  29998. switch (message.method) {
  29999. case 'created':
  30000. this.emit('connection#created', message.content);
  30001. break;
  30002. case 'deleted':
  30003. this.emit('connection#deleted', message.params.connection, message.reason);
  30004. break;
  30005. default:
  30006. logging.debug(message.signature + " is not currently implemented");
  30007. }
  30008. };
  30009. Dispatcher.prototype.dispatchStream = function (message) {
  30010. switch (message.method) {
  30011. case 'created':
  30012. this.emit('stream#created', message.content, message.transactionId);
  30013. break;
  30014. case 'deleted':
  30015. this.emit('stream#deleted', message.params.stream, message.reason);
  30016. break;
  30017. case 'updated':
  30018. this.emit('stream#updated', message.params.stream, message.content);
  30019. break;
  30020. // The JSEP process
  30021. case 'generateoffer':
  30022. case 'answer':
  30023. case 'pranswer':
  30024. case 'offer':
  30025. case 'candidate':
  30026. this.dispatchJsep(message.method, message);
  30027. break;
  30028. default:
  30029. logging.debug(message.signature + " is not currently implemented");
  30030. }
  30031. };
  30032. Dispatcher.prototype.dispatchStreamChannel = function (message) {
  30033. switch (message.method) {
  30034. case 'updated':
  30035. this.emit('streamChannel#updated', message.params.stream, message.params.channel, message.content);
  30036. break;
  30037. default:
  30038. logging.debug(message.signature + " is not currently implemented");
  30039. }
  30040. }; // Dispatch JSEP messages
  30041. //
  30042. // generateoffer:
  30043. // Request to generate a offer for another Peer (or Prism). This kicks
  30044. // off the JSEP process.
  30045. //
  30046. // answer:
  30047. // generate a response to another peers offer, this contains our constraints
  30048. // and requirements.
  30049. //
  30050. // pranswer:
  30051. // a provisional answer, i.e. not the final one.
  30052. //
  30053. // candidate
  30054. //
  30055. //
  30056. Dispatcher.prototype.dispatchJsep = function (method, message) {
  30057. this.emit("jsep#" + method, message.params.stream, message.fromAddress, message);
  30058. };
  30059. Dispatcher.prototype.dispatchSubscriberChannel = function (message) {
  30060. switch (message.method) {
  30061. case 'updated':
  30062. this.emit('subscriberChannel#updated', message.params.stream, message.params.channel, message.content);
  30063. break;
  30064. case 'update':
  30065. // subscriberId, streamId, content
  30066. this.emit('subscriberChannel#update', message.params.subscriber, message.params.stream, message.content);
  30067. break;
  30068. default:
  30069. logging.debug(message.signature + " is not currently implemented");
  30070. }
  30071. };
  30072. Dispatcher.prototype.dispatchSubscriber = function (message) {
  30073. switch (message.method) {
  30074. case 'created':
  30075. this.emit('subscriber#created', message.params.stream, message.fromAddress, message.content.id);
  30076. break;
  30077. case 'deleted':
  30078. this.dispatchJsep('unsubscribe', message);
  30079. this.emit('subscriber#deleted', message.params.stream, message.fromAddress);
  30080. break;
  30081. // The JSEP process
  30082. case 'generateoffer':
  30083. case 'answer':
  30084. case 'pranswer':
  30085. case 'offer':
  30086. case 'candidate':
  30087. this.dispatchJsep(message.method, message);
  30088. break;
  30089. default:
  30090. logging.debug(message.signature + " is not currently implemented");
  30091. }
  30092. };
  30093. Dispatcher.prototype.dispatchSignal = function (message) {
  30094. if (message.method !== 'signal') {
  30095. logging.debug(message.signature + " is not currently implemented");
  30096. return;
  30097. }
  30098. this.emit('signal', message.fromAddress, message.content);
  30099. };
  30100. Dispatcher.prototype.dispatchArchive = function (message) {
  30101. switch (message.method) {
  30102. case 'created':
  30103. this.emit('archive#created', message.content);
  30104. break;
  30105. case 'updated':
  30106. this.emit('archive#updated', message.params.archive, message.content);
  30107. break;
  30108. default:
  30109. }
  30110. };
  30111. /***/ }),
  30112. /* 302 */
  30113. /***/ (function(module, exports, __webpack_require__) {
  30114. "use strict";
  30115. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  30116. /* eslint-disable no-void */
  30117. const uuid = __webpack_require__(15);
  30118. const OTHelpers = __webpack_require__(4);
  30119. const hasBundleCapability = __webpack_require__(673);
  30120. const hasRTCPMuxCapability = __webpack_require__(674);
  30121. const serializeMessage = __webpack_require__(299);
  30122. const supportedCryptoScheme = __webpack_require__(675);
  30123. const staticConfig = __webpack_require__(28)().onlyLocal();
  30124. const Message = {};
  30125. module.exports = Message;
  30126. Message.connections = {};
  30127. Message.connections.create = function (opt) {
  30128. const apiKey = opt.apiKey;
  30129. const sessionId = opt.sessionId;
  30130. const connectionId = opt.connectionId;
  30131. const connectionEventsSuppressed = opt.connectionEventsSuppressed;
  30132. const capabilities = opt.capabilities;
  30133. return serializeMessage({
  30134. method: 'create',
  30135. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/connection/" + connectionId,
  30136. content: {
  30137. userAgent: OTHelpers.env.userAgent,
  30138. clientVersion: staticConfig.clientVersion,
  30139. capabilities: capabilities || [],
  30140. connectionEventsSuppressed
  30141. }
  30142. });
  30143. };
  30144. Message.connections.destroy = function (opt) {
  30145. const apiKey = opt.apiKey;
  30146. const sessionId = opt.sessionId;
  30147. const connectionId = opt.connectionId;
  30148. return serializeMessage({
  30149. method: 'delete',
  30150. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/connection/" + connectionId,
  30151. content: {}
  30152. });
  30153. };
  30154. Message.sessions = {};
  30155. Message.sessions.get = function (apiKey, sessionId) {
  30156. return serializeMessage({
  30157. method: 'read',
  30158. uri: "/v2/partner/" + apiKey + "/session/" + sessionId,
  30159. content: {}
  30160. });
  30161. };
  30162. Message.streams = {};
  30163. Message.streams.get = function (apiKey, sessionId, streamId) {
  30164. return serializeMessage({
  30165. method: 'read',
  30166. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/stream/" + streamId,
  30167. content: {}
  30168. });
  30169. };
  30170. Message.streams.channelFromOTChannel = function (channel) {
  30171. const raptorChannel = {
  30172. id: channel.id,
  30173. type: channel.type,
  30174. active: channel.active
  30175. };
  30176. if (channel.type === 'video') {
  30177. raptorChannel.width = channel.width;
  30178. raptorChannel.height = channel.height;
  30179. raptorChannel.orientation = channel.orientation;
  30180. raptorChannel.frameRate = channel.frameRate;
  30181. if (channel.source !== 'default') {
  30182. raptorChannel.source = channel.source;
  30183. }
  30184. raptorChannel.fitMode = channel.fitMode;
  30185. }
  30186. return raptorChannel;
  30187. };
  30188. Message.streams.create = function (apiKey, sessionId, streamId, name, audioFallbackEnabled, channels, minBitrate, maxBitrate) {
  30189. const messageContent = {
  30190. id: streamId,
  30191. name,
  30192. audioFallbackEnabled,
  30193. channel: channels.map(channel => Message.streams.channelFromOTChannel(channel))
  30194. };
  30195. if (minBitrate) {
  30196. messageContent.minBitrate = Math.round(minBitrate);
  30197. }
  30198. if (maxBitrate) {
  30199. messageContent.maxBitrate = Math.round(maxBitrate);
  30200. }
  30201. return serializeMessage({
  30202. method: 'create',
  30203. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/stream/" + streamId,
  30204. content: messageContent
  30205. });
  30206. };
  30207. Message.streams.destroy = function (apiKey, sessionId, streamId) {
  30208. return serializeMessage({
  30209. method: 'delete',
  30210. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/stream/" + streamId,
  30211. content: {}
  30212. });
  30213. };
  30214. Message.streamChannels = {};
  30215. Message.streamChannels.update = function (apiKey, sessionId, streamId, channelId, attributes) {
  30216. return serializeMessage({
  30217. method: 'update',
  30218. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/stream/" + streamId + "/channel/" + channelId,
  30219. content: attributes
  30220. });
  30221. };
  30222. Message.subscribers = {};
  30223. Message.subscribers.create = function (apiKey, sessionId, streamId, subscriberId, connectionId, channelsToSubscribeTo) {
  30224. const content = {
  30225. id: subscriberId,
  30226. connection: connectionId,
  30227. keyManagementMethod: supportedCryptoScheme(),
  30228. bundleSupport: hasBundleCapability(),
  30229. rtcpMuxSupport: hasRTCPMuxCapability()
  30230. };
  30231. if (channelsToSubscribeTo) {
  30232. content.channel = channelsToSubscribeTo;
  30233. }
  30234. return serializeMessage({
  30235. method: 'create',
  30236. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/stream/" + streamId + "/subscriber/" + subscriberId,
  30237. content
  30238. });
  30239. };
  30240. Message.subscribers.destroy = function (apiKey, sessionId, streamId, subscriberId) {
  30241. return serializeMessage({
  30242. method: 'delete',
  30243. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/stream/" + streamId + "/subscriber/" + subscriberId,
  30244. content: {}
  30245. });
  30246. };
  30247. Message.subscribers.update = function (apiKey, sessionId, streamId, subscriberId, attributes) {
  30248. return serializeMessage({
  30249. method: 'update',
  30250. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/stream/" + streamId + "/subscriber/" + subscriberId,
  30251. content: attributes
  30252. });
  30253. };
  30254. Message.subscriberChannels = {};
  30255. Message.subscriberChannels.update = function (apiKey, sessionId, streamId, subscriberId, channelId, attributes) {
  30256. return serializeMessage({
  30257. method: 'update',
  30258. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + "/stream/" + streamId + "/subscriber/" + subscriberId + "/channel/" + channelId,
  30259. content: attributes
  30260. });
  30261. };
  30262. Message.signals = {};
  30263. Message.signals.create = function (apiKey, sessionId, toAddress, type, data) {
  30264. const content = {};
  30265. if (type !== void 0) {
  30266. content.type = type;
  30267. }
  30268. if (data !== void 0) {
  30269. content.data = data;
  30270. }
  30271. return serializeMessage({
  30272. method: 'signal',
  30273. uri: "/v2/partner/" + apiKey + "/session/" + sessionId + (toAddress !== void 0 ? "/connection/" + toAddress : '') + "/signal/" + uuid(),
  30274. content
  30275. });
  30276. };
  30277. /***/ }),
  30278. /* 303 */
  30279. /***/ (function(module, exports, __webpack_require__) {
  30280. "use strict";
  30281. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  30282. /* eslint-disable no-useless-escape, no-underscore-dangle, no-void, no-prototype-builtins */
  30283. const clone = __webpack_require__(35);
  30284. const APIKEY = __webpack_require__(69);
  30285. const Connection = __webpack_require__(167);
  30286. const RaptorMessage = __webpack_require__(302);
  30287. const sessionTag = __webpack_require__(304);
  30288. const MAX_SIGNAL_DATA_LENGTH = 8192;
  30289. const MAX_SIGNAL_TYPE_LENGTH = 128; //
  30290. // Error Codes:
  30291. // 413 - Type too long
  30292. // 400 - Type is invalid
  30293. // 413 - Data too long
  30294. // 400 - Data is invalid (can't be parsed as JSON)
  30295. // 429 - Rate limit exceeded
  30296. // 500 - Websocket connection is down
  30297. // 404 - To connection does not exist
  30298. // 400 - To is invalid
  30299. //
  30300. module.exports = function Signal(sessionId, fromConnectionId, options) {
  30301. const isInvalidType = function isInvalidType(type) {
  30302. // Our format matches the unreserved characters from the URI RFC:
  30303. // http://www.ietf.org/rfc/rfc3986
  30304. return !/^[a-zA-Z0-9\-\._~]+$/.exec(type);
  30305. };
  30306. const validateTo = function validateTo(toAddress) {
  30307. if (!toAddress) {
  30308. return {
  30309. code: 400,
  30310. reason: 'The signal to field was invalid. Either set it to a OT.Connection, ' + 'OT.Session, or omit it entirely'
  30311. };
  30312. }
  30313. if (!(toAddress instanceof Connection || toAddress._tag === sessionTag)) {
  30314. return {
  30315. code: 400,
  30316. reason: 'The To field was invalid'
  30317. };
  30318. }
  30319. return null;
  30320. };
  30321. const validateType = function validateType(type) {
  30322. let error = null;
  30323. if (type === null || type === void 0) {
  30324. error = {
  30325. code: 400,
  30326. reason: 'The signal type was null or undefined. Either set it to a String value or ' + 'omit it'
  30327. };
  30328. } else if (type.length > MAX_SIGNAL_TYPE_LENGTH) {
  30329. error = {
  30330. code: 413,
  30331. reason: "The signal type was too long, the maximum length of it is " + MAX_SIGNAL_TYPE_LENGTH + " characters"
  30332. };
  30333. } else if (isInvalidType(type)) {
  30334. error = {
  30335. code: 400,
  30336. reason: 'The signal type was invalid, it can only contain letters, ' + 'numbers, \'-\', \'_\', and \'~\'.'
  30337. };
  30338. }
  30339. return error;
  30340. };
  30341. const validateData = function validateData(data) {
  30342. let error = null;
  30343. if (data === null || data === void 0) {
  30344. error = {
  30345. code: 400,
  30346. reason: 'The signal data was null or undefined. Either set it to a String value or ' + 'omit it'
  30347. };
  30348. } else {
  30349. try {
  30350. if (JSON.stringify(data).length > MAX_SIGNAL_DATA_LENGTH) {
  30351. error = {
  30352. code: 413,
  30353. reason: "The data field was too long, the maximum size of it is " + MAX_SIGNAL_DATA_LENGTH + " characters"
  30354. };
  30355. }
  30356. } catch (e) {
  30357. error = {
  30358. code: 400,
  30359. reason: 'The data field was not valid JSON'
  30360. };
  30361. }
  30362. }
  30363. return error;
  30364. };
  30365. const validateRetryAfterReconnect = function validateRetryAfterReconnect(retryAfterReconnect) {
  30366. let error = null;
  30367. if (!(retryAfterReconnect === true || retryAfterReconnect === false)) {
  30368. error = {
  30369. code: 400,
  30370. reason: 'The signal retryAfterReconnect was not true or false. Either set it to a Boolean ' + 'value or omit it'
  30371. };
  30372. }
  30373. return error;
  30374. };
  30375. this.toRaptorMessage = function () {
  30376. let to = this.to;
  30377. if (to && typeof to !== 'string') {
  30378. to = to.id;
  30379. }
  30380. return RaptorMessage.signals.create(APIKEY.value, sessionId, to, this.type, this.data);
  30381. };
  30382. this.toHash = function () {
  30383. return options;
  30384. };
  30385. this.error = null;
  30386. this.retryAfterReconnect = true;
  30387. if (options) {
  30388. if (options.hasOwnProperty('data')) {
  30389. this.data = clone(options.data);
  30390. this.error = validateData(this.data);
  30391. }
  30392. if (options.hasOwnProperty('to')) {
  30393. this.to = options.to;
  30394. if (!this.error) {
  30395. this.error = validateTo(this.to);
  30396. }
  30397. }
  30398. if (options.hasOwnProperty('type')) {
  30399. if (!this.error) {
  30400. this.error = validateType(options.type);
  30401. }
  30402. this.type = options.type;
  30403. }
  30404. if (options.hasOwnProperty('retryAfterReconnect')) {
  30405. if (!this.error) {
  30406. this.error = validateRetryAfterReconnect(options.retryAfterReconnect);
  30407. }
  30408. this.retryAfterReconnect = options.retryAfterReconnect;
  30409. }
  30410. }
  30411. this.valid = this.error === null;
  30412. };
  30413. /***/ }),
  30414. /* 304 */
  30415. /***/ (function(module, exports, __webpack_require__) {
  30416. "use strict";
  30417. // This is used to break the dependency Raptor had on Session. It only needs to be able to know
  30418. // whether an object is an instanceof a Session. The dependency was an issue for node because
  30419. // Session depends on get_user_media.js which doesn't work in node.
  30420. module.exports = {};
  30421. /***/ }),
  30422. /* 305 */
  30423. /***/ (function(module, exports, __webpack_require__) {
  30424. "use strict";
  30425. var _interopRequireDefault = __webpack_require__(2);
  30426. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  30427. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  30428. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  30429. /* eslint-disable no-shadow, prefer-rest-params, prefer-spread, no-param-reassign */
  30430. /* eslint-disable no-mixed-operators, no-cond-assign, one-var */
  30431. const Archive = __webpack_require__(306);
  30432. const now = __webpack_require__(46);
  30433. const Connection = __webpack_require__(167);
  30434. const DelayedEventQueue = __webpack_require__(678);
  30435. const Dispatcher = __webpack_require__(301);
  30436. const logging = __webpack_require__(1)('SessionDispatcher');
  30437. const sessionObjects = __webpack_require__(22);
  30438. const Stream = __webpack_require__(307);
  30439. const StreamChannel = __webpack_require__(145);
  30440. function constructBareConnection(fromAddress) {
  30441. return {
  30442. id: fromAddress,
  30443. creationTime: new Date().getTime(),
  30444. data: {},
  30445. capablities: {},
  30446. permissions: []
  30447. };
  30448. }
  30449. function parseStream(dict, session) {
  30450. const channel = dict.channel.map(channel => new StreamChannel(channel));
  30451. const connectionId = dict.connectionId ? dict.connectionId : dict.connection.id;
  30452. return new Stream(dict.id, dict.name, dict.creationTime, session.connections.get(connectionId), session, channel);
  30453. }
  30454. function parseAndAddStreamToSession(dict, session) {
  30455. if (session.streams.has(dict.id)) {
  30456. return undefined;
  30457. }
  30458. const stream = parseStream(dict, session);
  30459. session.streams.add(stream);
  30460. return stream;
  30461. }
  30462. function parseArchive(dict) {
  30463. return new Archive(dict.id, dict.name, dict.status);
  30464. }
  30465. function parseAndAddArchiveToSession(dict, session) {
  30466. if (session.archives.has(dict.id)) {
  30467. return undefined;
  30468. }
  30469. const archive = parseArchive(dict);
  30470. session.archives.add(archive);
  30471. return archive;
  30472. }
  30473. const DelayedSessionEvents = function DelayedSessionEvents(dispatcher) {
  30474. const eventQueues = {};
  30475. this.enqueue = function enqueue()
  30476. /* key, arg1, arg2, ..., argN */
  30477. {
  30478. const key = arguments[0];
  30479. const eventArgs = Array.prototype.slice.call(arguments, 1);
  30480. if (!eventQueues[key]) {
  30481. eventQueues[key] = new DelayedEventQueue(dispatcher);
  30482. }
  30483. eventQueues[key].enqueue.apply(eventQueues[key], eventArgs);
  30484. };
  30485. this.triggerConnectionCreated = function triggerConnectionCreated(connection) {
  30486. if (eventQueues["connectionCreated" + connection.id]) {
  30487. eventQueues["connectionCreated" + connection.id].triggerAll();
  30488. }
  30489. };
  30490. this.triggerSessionConnected = function triggerSessionConnected(connections) {
  30491. if (eventQueues.sessionConnected) {
  30492. eventQueues.sessionConnected.triggerAll();
  30493. }
  30494. connections.forEach(function (connection) {
  30495. this.triggerConnectionCreated(connection);
  30496. }, this);
  30497. };
  30498. };
  30499. const unconnectedStreams = {};
  30500. module.exports = function SessionDispatcher(session, _temp) {
  30501. let _ref = _temp === void 0 ? {} : _temp,
  30502. connectionEventsSuppressed = _ref.connectionEventsSuppressed;
  30503. const dispatcher = new Dispatcher();
  30504. let sessionStateReceived = false;
  30505. const delayedSessionEvents = new DelayedSessionEvents(dispatcher);
  30506. dispatcher.on('reconnecting', () => {
  30507. session._.reconnecting();
  30508. });
  30509. dispatcher.on('reconnected', () => {
  30510. session._.reconnected();
  30511. });
  30512. dispatcher.on('close', reason => {
  30513. const connection = session.connection;
  30514. if (!connection) {
  30515. return;
  30516. }
  30517. if (connection.destroyedReason()) {
  30518. logging.debug("" + ('Socket was closed but the connection had already ' + 'been destroyed. Reason: ') + connection.destroyedReason());
  30519. return;
  30520. }
  30521. connection.destroy(reason);
  30522. }); // This method adds connections to the session both on a connection#created and
  30523. // on a session#read. In the case of session#read sessionRead is set to true and
  30524. // we include our own connection.
  30525. const addConnection = function addConnection(connection, sessionRead) {
  30526. if (session.connections.has(connection.id)) {
  30527. // Don't add a duplicate connection, since we add them not only on connection#created, but
  30528. // also when stream#created or signal has an associated connection.
  30529. return session.connections.get(connection.id);
  30530. }
  30531. connection = Connection.fromHash(connection);
  30532. if (sessionRead || session.connection && connection.id !== session.connection.id) {
  30533. session.connections.add(connection);
  30534. delayedSessionEvents.triggerConnectionCreated(connection);
  30535. }
  30536. Object.keys(unconnectedStreams).forEach(streamId => {
  30537. const stream = unconnectedStreams[streamId];
  30538. if (stream && connection.id === stream.connection.id) {
  30539. // dispatch streamCreated event now that the connectionCreated has been dispatched
  30540. parseAndAddStreamToSession(stream, session);
  30541. delete unconnectedStreams[stream.id];
  30542. const payload = {
  30543. debug: sessionRead ? 'connection came in session#read' : 'connection came in connection#created',
  30544. streamId: stream.id,
  30545. connectionId: connection.id
  30546. };
  30547. session.logEvent('streamCreated', 'warning', payload);
  30548. }
  30549. });
  30550. return connection;
  30551. };
  30552. dispatcher.on('session#read', (content, transactionId) => {
  30553. let connection;
  30554. const state = {};
  30555. state.streams = [];
  30556. state.connections = [];
  30557. state.archives = [];
  30558. content.connection.forEach(connectionParams => {
  30559. connection = addConnection(connectionParams, true);
  30560. state.connections.push(connection);
  30561. });
  30562. content.stream.forEach(streamParams => {
  30563. state.streams.push(parseAndAddStreamToSession(streamParams, session));
  30564. });
  30565. (content.archive || content.archives).forEach(archiveParams => {
  30566. state.archives.push(parseAndAddArchiveToSession(archiveParams, session));
  30567. });
  30568. dispatcher.triggerCallback(transactionId, null, state);
  30569. sessionStateReceived = true;
  30570. delayedSessionEvents.triggerSessionConnected(session.connections);
  30571. });
  30572. dispatcher.on('connection#created', connection => {
  30573. addConnection(connection);
  30574. });
  30575. dispatcher.on('connection#deleted', (connection, reason) => {
  30576. connection = session.connections.get(connection);
  30577. if (!connection) {
  30578. logging.warn('A connection was deleted that we do not know about');
  30579. return;
  30580. }
  30581. connection.destroy(reason);
  30582. });
  30583. dispatcher.on('stream#created', (stream, transactionId) => {
  30584. if (connectionEventsSuppressed) {
  30585. if (stream.connection == null || stream.connection.id == null) {
  30586. session.logEvent('SessionDispatcher:stream#created', 'Event', {
  30587. connection: stream.connection,
  30588. info: 'Stream did not contain a connection object. Event ignored'
  30589. });
  30590. return;
  30591. }
  30592. addConnection(stream.connection);
  30593. }
  30594. const connectionId = stream.connectionId ? stream.connectionId : stream.connection.id;
  30595. if (session.connections.has(connectionId)) {
  30596. stream = parseAndAddStreamToSession(stream, session);
  30597. } else {
  30598. unconnectedStreams[stream.id] = stream;
  30599. const payload = {
  30600. debug: 'eventOrderError -- streamCreated event before connectionCreated',
  30601. streamId: stream.id
  30602. };
  30603. session.logEvent('streamCreated', 'warning', payload);
  30604. }
  30605. if (stream) {
  30606. if (stream.publisher) {
  30607. stream.publisher.setStream(stream);
  30608. }
  30609. dispatcher.triggerCallback(transactionId, null, stream);
  30610. }
  30611. });
  30612. dispatcher.on('stream#deleted', (streamId, reason) => {
  30613. const stream = session.streams.get(streamId);
  30614. if (!stream) {
  30615. logging.error("A stream does not exist with the id of " + streamId + ", for stream#deleted message!"); // @todo error
  30616. return;
  30617. }
  30618. stream.destroy(reason);
  30619. });
  30620. dispatcher.on('stream#updated', (streamId, content) => {
  30621. const stream = session.streams.get(streamId);
  30622. if (!stream) {
  30623. logging.error("A stream does not exist with the id of " + streamId + ", for stream#updated message!"); // @todo error
  30624. return;
  30625. }
  30626. stream._.update(content);
  30627. });
  30628. dispatcher.on('streamChannel#updated', (streamId, channelId, content) => {
  30629. let stream;
  30630. if (!(streamId && (stream = session.streams.get(streamId)))) {
  30631. logging.error('Unable to determine streamId, or the stream does not ' + 'exist, for streamChannel message!'); // @todo error
  30632. return;
  30633. }
  30634. stream._.updateChannel(channelId, content);
  30635. }); // Dispatch JSEP messages
  30636. //
  30637. // generateoffer:
  30638. // Request to generate a offer for another Peer (or Prism). This kicks
  30639. // off the JSEP process.
  30640. //
  30641. // answer:
  30642. // generate a response to another peers offer, this contains our constraints
  30643. // and requirements.
  30644. //
  30645. // pranswer:
  30646. // a provisional answer, i.e. not the final one.
  30647. //
  30648. // candidate
  30649. //
  30650. //
  30651. const jsepHandler = (method, streamId, fromAddress, message) => {
  30652. let subscriberFilter;
  30653. let actors;
  30654. const hasStreamId = {
  30655. streamId
  30656. };
  30657. const subscribers = sessionObjects.subscribers;
  30658. const publishers = sessionObjects.publishers;
  30659. if (message.params.subscriber) {
  30660. subscriberFilter = {
  30661. widgetId: message.params.subscriber
  30662. };
  30663. } else {
  30664. // if we don't know the subscriber, we will just match the stream id
  30665. subscriberFilter = hasStreamId;
  30666. } // Determine which subscriber/publisher objects should receive this message.
  30667. switch (method) {
  30668. case 'offer':
  30669. actors = [].concat(subscribers.where(subscriberFilter), publishers.where(hasStreamId)).slice(0, 1);
  30670. break;
  30671. case 'answer':
  30672. case 'pranswer':
  30673. actors = [].concat(publishers.where(hasStreamId), subscribers.where(subscriberFilter)).slice(0, 1);
  30674. break;
  30675. case 'generateoffer':
  30676. case 'unsubscribe':
  30677. actors = publishers.where(hasStreamId);
  30678. break;
  30679. case 'candidate':
  30680. actors = [].concat(subscribers.where(subscriberFilter), publishers.where(hasStreamId));
  30681. break;
  30682. default:
  30683. logging.debug("jsep#" + method + " is not currently implemented");
  30684. return;
  30685. }
  30686. if (actors.length === 0) {
  30687. return;
  30688. }
  30689. let fromConnection = session.connections.get(fromAddress);
  30690. if (!fromConnection && fromAddress.match(/^symphony\./)) {
  30691. fromConnection = Connection.fromHash({
  30692. id: fromAddress,
  30693. creationTime: Math.floor(now())
  30694. });
  30695. session.connections.add(fromConnection);
  30696. }
  30697. actors.forEach( /*#__PURE__*/function () {
  30698. var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(actor) {
  30699. return _regenerator.default.wrap(function _callee$(_context) {
  30700. while (1) switch (_context.prev = _context.next) {
  30701. case 0:
  30702. _context.prev = 0;
  30703. _context.next = 3;
  30704. return actor.processMessage(method, fromAddress, message);
  30705. case 3:
  30706. _context.next = 8;
  30707. break;
  30708. case 5:
  30709. _context.prev = 5;
  30710. _context.t0 = _context["catch"](0);
  30711. logging.error('Error occurred during processMessage', _context.t0);
  30712. case 8:
  30713. case "end":
  30714. return _context.stop();
  30715. }
  30716. }, _callee, null, [[0, 5]]);
  30717. }));
  30718. return function (_x) {
  30719. return _ref2.apply(this, arguments);
  30720. };
  30721. }());
  30722. };
  30723. dispatcher.on('jsep#offer', jsepHandler.bind(null, 'offer'));
  30724. dispatcher.on('jsep#answer', jsepHandler.bind(null, 'answer'));
  30725. dispatcher.on('jsep#pranswer', jsepHandler.bind(null, 'pranswer'));
  30726. dispatcher.on('jsep#generateoffer', jsepHandler.bind(null, 'generateoffer'));
  30727. dispatcher.on('jsep#unsubscribe', jsepHandler.bind(null, 'unsubscribe'));
  30728. dispatcher.on('jsep#candidate', jsepHandler.bind(null, 'candidate'));
  30729. dispatcher.on('subscriberChannel#updated', (streamId, channelId, content) => {
  30730. if (!streamId || !session.streams.has(streamId)) {
  30731. logging.error('Unable to determine streamId, or the stream does not ' + 'exist, for subscriberChannel#updated message!'); // @todo error
  30732. return;
  30733. }
  30734. session.streams.get(streamId)._.updateChannel(channelId, content);
  30735. });
  30736. dispatcher.on('subscriberChannel#update', (subscriberId, streamId, content) => {
  30737. if (!streamId || !session.streams.has(streamId)) {
  30738. logging.error('Unable to determine streamId, or the stream does not ' + 'exist, for subscriberChannel#update message!'); // @todo error
  30739. return;
  30740. } // Hint to update for congestion control from the Media Server
  30741. if (!sessionObjects.subscribers.has(subscriberId)) {
  30742. logging.error('Unable to determine subscriberId, or the subscriber ' + 'does not exist, for subscriberChannel#update message!'); // @todo error
  30743. return;
  30744. } // We assume that an update on a Subscriber channel is to disableVideo
  30745. // we may need to be more specific in the future
  30746. sessionObjects.subscribers.get(subscriberId).disableVideo(content.active);
  30747. }); // Note: subscriber#created and subscriber#deleted messages are available but we currently
  30748. // don't have a use for them.
  30749. dispatcher.on('signal', (fromAddress, content) => {
  30750. if (connectionEventsSuppressed) {
  30751. let connection = content.connection || content.fromConnection;
  30752. if (connection == null || connection.id == null) {
  30753. connection = constructBareConnection(fromAddress);
  30754. session.logEvent('SessionDispatcher:Signal', 'Event', {
  30755. fromAddress,
  30756. connection: content.connection,
  30757. fromConnection: content.fromConnection,
  30758. info: 'Signal did not contain a connection object. One has been constructed',
  30759. constructedConnection: connection
  30760. });
  30761. }
  30762. addConnection(connection);
  30763. }
  30764. const signalType = content.type;
  30765. const data = content.data;
  30766. const fromConnection = session.connections.get(fromAddress);
  30767. if (session.connection && fromAddress === session.connection.connectionId) {
  30768. if (sessionStateReceived) {
  30769. session._.dispatchSignal(fromConnection, signalType, data);
  30770. } else {
  30771. delayedSessionEvents.enqueue('sessionConnected', 'signal', fromAddress, signalType, data);
  30772. }
  30773. } else if (session.connections.get(fromAddress)) {
  30774. session._.dispatchSignal(fromConnection, signalType, data);
  30775. } else if (fromAddress === '') {
  30776. // Server originated signal
  30777. session._.dispatchSignal(null, signalType, data);
  30778. } else {
  30779. delayedSessionEvents.enqueue("connectionCreated" + fromAddress, 'signal', fromAddress, signalType, data);
  30780. }
  30781. });
  30782. dispatcher.on('archive#created', archive => {
  30783. parseAndAddArchiveToSession(archive, session);
  30784. });
  30785. dispatcher.on('archive#updated', (archiveId, update) => {
  30786. const archive = session.archives.get(archiveId);
  30787. if (!archive) {
  30788. logging.error("An archive does not exist with the id of " + archiveId + ", for archive#updated message!"); // @todo error
  30789. return;
  30790. }
  30791. archive._.update(update);
  30792. });
  30793. return dispatcher;
  30794. };
  30795. /***/ }),
  30796. /* 306 */
  30797. /***/ (function(module, exports, __webpack_require__) {
  30798. "use strict";
  30799. const Events = __webpack_require__(20)();
  30800. const eventing = __webpack_require__(5);
  30801. module.exports = function Archive(id, name, status) {
  30802. this.id = id;
  30803. this.name = name;
  30804. this.status = status;
  30805. this._ = {};
  30806. eventing(this); // Mass update, called by Raptor.Dispatcher
  30807. this._.update = attributes => {
  30808. Object.keys(attributes).forEach(key => {
  30809. const oldValue = this[key];
  30810. this[key] = attributes[key];
  30811. const event = new Events.ArchiveUpdatedEvent(this, key, oldValue, this[key]);
  30812. this.dispatchEvent(event);
  30813. });
  30814. };
  30815. this.destroy = () => {};
  30816. };
  30817. /***/ }),
  30818. /* 307 */
  30819. /***/ (function(module, exports, __webpack_require__) {
  30820. "use strict";
  30821. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  30822. /* eslint-disable no-shadow, no-underscore-dangle, max-len, no-use-before-define */
  30823. /* eslint-disable no-void, vars-on-top, no-var, no-restricted-syntax, no-prototype-builtins */
  30824. /* eslint-disable no-continue */
  30825. const logging = __webpack_require__(1)('Stream');
  30826. const OTHelpers = __webpack_require__(4);
  30827. const sessionObjects = __webpack_require__(22);
  30828. const eventing = __webpack_require__(5);
  30829. const Events = __webpack_require__(20)();
  30830. const validPropertyNames = ['name', 'archiving'];
  30831. /**
  30832. * Specifies a stream. A stream is a representation of a published stream in a session. When a
  30833. * client calls the <a href="Session.html#publish">Session.publish() method</a>, a new stream is
  30834. * created. Properties of the Stream object provide information about the stream.
  30835. *
  30836. * <p>When a stream is added to a session, the Session object dispatches a
  30837. * <code>streamCreatedEvent</code>. When a stream is destroyed, the Session object dispatches a
  30838. * <code>streamDestroyed</code> event. The StreamEvent object, which defines these event objects,
  30839. * has a <code>stream</code> property, which is an array of Stream object. For details and a code
  30840. * example, see {@link StreamEvent}.</p>
  30841. *
  30842. * <p>When a connection to a session is made, the Session object dispatches a
  30843. * <code>sessionConnected</code> event, defined by the SessionConnectEvent object. The
  30844. * SessionConnectEvent object has a <code>streams</code> property, which is an array of Stream
  30845. * objects pertaining to the streams in the session at that time. For details and a code example,
  30846. * see {@link SessionConnectEvent}.</p>
  30847. *
  30848. * @class Stream
  30849. * @property {Connection} connection The Connection object corresponding
  30850. * to the connection that is publishing the stream. You can compare this to the
  30851. * <code>connection</code> property of the Session object to see if the stream is being published
  30852. * by the local web page.
  30853. *
  30854. * @property {Number} creationTime The timestamp for the creation
  30855. * of the stream. This value is calculated in milliseconds. You can convert this value to a
  30856. * Date object by calling <code>new Date(creationTime)</code>, where <code>creationTime</code> is
  30857. * the <code>creationTime</code> property of the Stream object.
  30858. *
  30859. * @property {Number} frameRate The frame rate of the video stream. This property is only set if
  30860. * the publisher of the stream specifies a frame rate when calling the
  30861. * <code>OT.initPublisher()</code> method; otherwise, this property is undefined.
  30862. *
  30863. * @property {Boolean} hasAudio Whether the stream has audio. This property can change if the
  30864. * publisher turns on or off audio (by calling
  30865. * <a href="Publisher.html#publishAudio">Publisher.publishAudio()</a>). When this occurs, the
  30866. * {@link Session} object dispatches a <code>streamPropertyChanged</code> event (see
  30867. * {@link StreamPropertyChangedEvent}).
  30868. *
  30869. * @property {Boolean} hasVideo Whether the stream has video. This property can change if the
  30870. * publisher turns on or off video (by calling
  30871. * <a href="Publisher.html#publishVideo">Publisher.publishVideo()</a>). When this occurs, the
  30872. * {@link Session} object dispatches a <code>streamPropertyChanged</code> event (see
  30873. * {@link StreamPropertyChangedEvent}).
  30874. *
  30875. * @property {String} name The name of the stream. Publishers can specify a name when publishing
  30876. * a stream (using the <code>publish()</code> method of the publisher's Session object).
  30877. *
  30878. * @property {String} streamId The unique ID of the stream.
  30879. *
  30880. * @property {Object} videoDimensions This object has two properties: <code>width</code> and
  30881. * <code>height</code>. Both are numbers. The <code>width</code> property is the width of the
  30882. * encoded stream; the <code>height</code> property is the height of the encoded stream. (These
  30883. * are independent of the actual width of Publisher and Subscriber objects corresponding to the
  30884. * stream.) This property can change if a stream published from a mobile device resizes, based on
  30885. * a change in the device orientation. When the video dimensions change,
  30886. * the {@link Session} object dispatches a <code>streamPropertyChanged</code> event
  30887. * (see {@link StreamPropertyChangedEvent}).
  30888. *
  30889. * @property {String} videoType The type of video &mdash; either <code>"camera"</code>,
  30890. * <code>"screen"</code>, or <code>"custom"</code>.
  30891. * A <code>"screen"</code> video uses screen sharing on the publisher
  30892. * as the video source; for other videos, this property is set to <code>"camera"</code>.
  30893. * A <code>"custom"</code> video uses a VideoTrack element as the video source on the publisher.
  30894. * (See the <code>videoSource</code> property of the <code>options</code> parameter passed
  30895. * into the <a href="OT.html#initPublisher">OT.initPublisher()</a> method.)
  30896. * This property can change if a stream published from a mobile device changes from a
  30897. * camera to a screen-sharing video type. When the video type changes, the {@link Session} object
  30898. * dispatches a <code>streamPropertyChanged</code> event (see {@link StreamPropertyChangedEvent}).
  30899. */
  30900. module.exports = function Stream(id, name, creationTime, connection, session, channel) {
  30901. const self = this;
  30902. let destroyedReason;
  30903. this.id = id;
  30904. this.streamId = id;
  30905. this.name = name;
  30906. this.creationTime = Number(creationTime);
  30907. this.connection = connection;
  30908. this.channel = channel;
  30909. this.publisher = sessionObjects.publishers.find({
  30910. streamId: this.id
  30911. });
  30912. eventing(this);
  30913. const onChannelUpdate = function onChannelUpdate(channel, key, oldValue, newValue) {
  30914. let _key = key;
  30915. switch (_key) {
  30916. case 'active':
  30917. _key = channel.type === 'audio' ? 'hasAudio' : 'hasVideo';
  30918. self[_key] = newValue;
  30919. break;
  30920. case 'disableWarning':
  30921. _key = channel.type === 'audio' ? 'audioDisableWarning' : 'videoDisableWarning';
  30922. self[_key] = newValue;
  30923. if (!self[channel.type === 'audio' ? 'hasAudio' : 'hasVideo']) {
  30924. return; // Do NOT event in this case.
  30925. }
  30926. break;
  30927. case 'fitMode':
  30928. _key = 'defaultFitMode';
  30929. self[_key] = newValue;
  30930. break;
  30931. case 'source':
  30932. _key = channel.type === 'audio' ? 'audioType' : 'videoType';
  30933. self[_key] = newValue;
  30934. break;
  30935. case 'videoDimensions':
  30936. self.videoDimensions = newValue;
  30937. break;
  30938. case 'orientation':
  30939. case 'width':
  30940. case 'height':
  30941. // We dispatch this via the videoDimensions key instead so do not
  30942. // trigger an event for them.
  30943. return;
  30944. default:
  30945. }
  30946. if (self.videoType === 'screen' && _key === 'hasVideo' && newValue === false) {
  30947. // if this stream is from a screen ignore hasVideo=false events from rumor
  30948. return;
  30949. }
  30950. self.dispatchEvent(new Events.StreamUpdatedEvent(self, _key, oldValue, newValue));
  30951. };
  30952. const associatedWidget = function associatedWidget() {
  30953. if (self.publisher) {
  30954. return self.publisher;
  30955. }
  30956. return sessionObjects.subscribers.find(subscriber => subscriber.stream && subscriber.stream.id === self.id && subscriber.session.id === session.id);
  30957. }; // Returns true if this stream is subscribe to.
  30958. const isBeingSubscribedTo = function isBeingSubscribedTo() {
  30959. // @fixme This is not strictly speaking the right test as a stream
  30960. // can be published and subscribed by the same connection. But the
  30961. // update features don't handle this case properly right now anyway.
  30962. //
  30963. // The issue is that the stream needs to know whether the stream is
  30964. // 'owned' by a publisher or a subscriber. The reason for that is that
  30965. // when a Publisher updates a stream channel then we need to send the
  30966. // `streamChannelUpdate` message, whereas if a Subscriber does then we
  30967. // need to send `subscriberChannelUpdate`. The current code will always
  30968. // send `streamChannelUpdate`.
  30969. return !self.publisher;
  30970. }; // Returns all channels that have a type of +type+.
  30971. this.getChannelsOfType = function getChannelsOfType(type) {
  30972. return self.channel.filter(channel => channel.type === type);
  30973. };
  30974. this.getChannel = function getChannel(id) {
  30975. for (let i = 0; i < self.channel.length; ++i) {
  30976. if (self.channel[i].id === id) {
  30977. return self.channel[i];
  30978. }
  30979. }
  30980. return null;
  30981. }; // implement the following using the channels
  30982. // * hasAudio
  30983. // * hasVideo
  30984. // * videoDimensions
  30985. const audioChannel = this.getChannelsOfType('audio')[0];
  30986. const videoChannel = this.getChannelsOfType('video')[0]; // @todo this should really be: "has at least one video/audio track" instead of
  30987. // "the first video/audio track"
  30988. this.hasAudio = audioChannel != null && audioChannel.active;
  30989. this.hasVideo = videoChannel != null && videoChannel.active;
  30990. this.videoType = videoChannel && videoChannel.source;
  30991. this.defaultFitMode = videoChannel && videoChannel.fitMode;
  30992. this.videoDimensions = {};
  30993. if (videoChannel) {
  30994. this.videoDimensions.width = videoChannel.width;
  30995. this.videoDimensions.height = videoChannel.height;
  30996. this.videoDimensions.orientation = videoChannel.orientation;
  30997. videoChannel.on('update', onChannelUpdate);
  30998. this.frameRate = videoChannel.frameRate;
  30999. }
  31000. if (audioChannel) {
  31001. audioChannel.on('update', onChannelUpdate);
  31002. }
  31003. this.setChannelActiveState = function setChannelActiveState(channelType, activeState, activeReason) {
  31004. const attributes = {
  31005. active: activeState
  31006. };
  31007. if (activeReason) {
  31008. attributes.activeReason = activeReason;
  31009. }
  31010. updateChannelsOfType(channelType, attributes);
  31011. };
  31012. this.setVideoDimensions = function setVideoDimensions(width, height) {
  31013. updateChannelsOfType('video', {
  31014. width,
  31015. height,
  31016. orientation: 0
  31017. });
  31018. };
  31019. this.setRestrictFrameRate = function setRestrictFrameRate(restrict) {
  31020. updateChannelsOfType('video', {
  31021. restrictFrameRate: restrict
  31022. });
  31023. };
  31024. this.setPreferredResolution = function setPreferredResolution(resolution) {
  31025. if (!isBeingSubscribedTo()) {
  31026. logging.warn('setPreferredResolution has no affect when called by a publisher');
  31027. return;
  31028. }
  31029. if (session.sessionInfo.p2pEnabled) {
  31030. logging.warn('Stream.setPreferredResolution will not work in a P2P Session');
  31031. return;
  31032. }
  31033. if (resolution && resolution.width === void 0 && resolution.height === void 0) {
  31034. return;
  31035. } // This duplicates some of the code in updateChannelsOfType. We do this for a
  31036. // couple of reasons:
  31037. // 1. Because most of the work that updateChannelsOfType does is in calling
  31038. // getChannelsOfType, which we need to do here anyway so that we can update
  31039. // the value of maxResolution in the Video Channel.
  31040. // 2. updateChannelsOfType on only sends a message to update the channel in
  31041. // Rumor. The client then expects to receive a subsequent channel update
  31042. // indicating that the update was successful. We don't receive those updates
  31043. // for preferredFrameRate/maxResolution so we need to complete both tasks and it's
  31044. // neater to do the related tasks right next to each other.
  31045. // 3. This code shouldn't be in Stream anyway. There is way too much coupling
  31046. // between Stream, Session, Publisher, and Subscriber. This will eventually be
  31047. // fixed, and when it is then it will be easier to exact the code if it's a
  31048. // single piece.
  31049. //
  31050. const video = self.getChannelsOfType('video')[0];
  31051. if (!video) {
  31052. return;
  31053. }
  31054. if (resolution && resolution.width) {
  31055. if (isNaN(parseInt(resolution.width, 10))) {
  31056. throw new OTHelpers.Error('stream preferred width must be an integer', 'Subscriber');
  31057. }
  31058. video.preferredWidth = parseInt(resolution.width, 10);
  31059. } else {
  31060. video.preferredWidth = void 0;
  31061. }
  31062. if (resolution && resolution.height) {
  31063. if (isNaN(parseInt(resolution.height, 10))) {
  31064. throw new OTHelpers.Error('stream preferred height must be an integer', 'Subscriber');
  31065. }
  31066. video.preferredHeight = parseInt(resolution.height, 10);
  31067. } else {
  31068. video.preferredHeight = void 0;
  31069. }
  31070. session._.subscriberChannelUpdate(self, associatedWidget(), video, {
  31071. preferredWidth: video.preferredWidth || 0,
  31072. preferredHeight: video.preferredHeight || 0
  31073. });
  31074. };
  31075. this.getPreferredResolution = function getPreferredResolution() {
  31076. const videoChannel = self.getChannelsOfType('video')[0];
  31077. if (!videoChannel || !videoChannel.preferredWidth && !videoChannel.preferredHeight) {
  31078. return void 0;
  31079. }
  31080. return {
  31081. width: videoChannel.preferredWidth,
  31082. height: videoChannel.preferredHeight
  31083. };
  31084. };
  31085. this.setPreferredFrameRate = function setPreferredFrameRate(preferredFrameRate) {
  31086. if (!isBeingSubscribedTo()) {
  31087. logging.warn('setPreferredFrameRate has no affect when called by a publisher');
  31088. return;
  31089. }
  31090. if (session.sessionInfo.p2pEnabled) {
  31091. logging.warn('Stream.setPreferredFrameRate will not work in a P2P Session');
  31092. return;
  31093. }
  31094. if (preferredFrameRate && isNaN(parseFloat(preferredFrameRate))) {
  31095. throw new OTHelpers.Error('stream preferred frameRate must be a number', 'Subscriber');
  31096. } // This duplicates some of the code in updateChannelsOfType. We do this for a
  31097. // couple of reasons:
  31098. // 1. Because most of the work that updateChannelsOfType does is in calling
  31099. // getChannelsOfType, which we need to do here anyway so that we can update
  31100. // the value of preferredFrameRate in the Video Channel.
  31101. // 2. updateChannelsOfType on only sends a message to update the channel in
  31102. // Rumor. The client then expects to receive a subsequent channel update
  31103. // indicating that the update was successful. We don't receive those updates
  31104. // for preferredFrameRate/maxResolution so we need to complete both tasks and it's
  31105. // neater to do the related tasks right next to each other.
  31106. // 3. This code shouldn't be in Stream anyway. There is way too much coupling
  31107. // between Stream, Session, Publisher, and Subscriber. This will eventually be
  31108. // fixed, and when it is then it will be easier to exact the code if it's a
  31109. // single piece.
  31110. //
  31111. const video = self.getChannelsOfType('video')[0];
  31112. if (video) {
  31113. video.preferredFrameRate = preferredFrameRate ? parseFloat(preferredFrameRate) : null;
  31114. session._.subscriberChannelUpdate(self, associatedWidget(), video, {
  31115. preferredFrameRate: video.preferredFrameRate || 0
  31116. });
  31117. }
  31118. };
  31119. this.getPreferredFrameRate = function getPreferredFrameRate() {
  31120. const videoChannel = self.getChannelsOfType('video')[0];
  31121. return videoChannel ? videoChannel.preferredFrameRate : null;
  31122. };
  31123. let updateChannelsOfType = function updateChannelsOfType(channelType, attributes) {
  31124. let setChannelActiveState;
  31125. if (!self.publisher) {
  31126. const subscriber = associatedWidget();
  31127. setChannelActiveState = channel => session._.subscriberChannelUpdate(self, subscriber, channel, attributes);
  31128. } else {
  31129. setChannelActiveState = channel => session._.streamChannelUpdate(self, channel, attributes);
  31130. }
  31131. self.getChannelsOfType(channelType).forEach(setChannelActiveState);
  31132. };
  31133. this.destroyed = false;
  31134. this.destroyedReason = void 0;
  31135. this.destroy = function destroy(reason, quiet) {
  31136. if (reason === void 0) {
  31137. reason = 'clientDisconnected';
  31138. }
  31139. destroyedReason = reason;
  31140. self.destroyed = true;
  31141. self.destroyedReason = destroyedReason;
  31142. if (quiet !== true) {
  31143. self.dispatchEvent(new Events.DestroyedEvent('destroyed', // This should be eventNames.STREAM_DESTROYED, but
  31144. // the value of that is currently shared with Session
  31145. self, destroyedReason));
  31146. }
  31147. }; // PRIVATE STUFF CALLED BY Raptor.Dispatcher
  31148. //
  31149. // Confusingly, this should not be called when you want to change
  31150. // the stream properties. This is used by Raptor dispatch to notify
  31151. // the stream that it's properties have been successfully updated
  31152. //
  31153. // @todo make this sane. Perhaps use setters for the properties that can
  31154. // send the appropriate Raptor message. This would require that Streams
  31155. // have access to their session.
  31156. this._ = {};
  31157. this._.updateProperty = function privateUpdateProperty(key, value) {
  31158. if (validPropertyNames.indexOf(key) === -1) {
  31159. logging.warn("Unknown stream property \"" + key + "\" was modified to \"" + value + "\".");
  31160. return;
  31161. }
  31162. const oldValue = self[key];
  31163. const newValue = value;
  31164. switch (key) {
  31165. case 'name':
  31166. self[key] = newValue;
  31167. break;
  31168. case 'archiving':
  31169. var widget = associatedWidget();
  31170. if (self.publisher && widget) {
  31171. widget._.archivingStatus(newValue);
  31172. }
  31173. self[key] = newValue;
  31174. break;
  31175. default:
  31176. }
  31177. const event = new Events.StreamUpdatedEvent(self, key, oldValue, newValue);
  31178. self.dispatchEvent(event);
  31179. }; // Mass update, called by Raptor.Dispatcher
  31180. this._.update = function privateUpdate(attributes) {
  31181. for (const key in attributes) {
  31182. if (!attributes.hasOwnProperty(key)) {
  31183. continue;
  31184. }
  31185. self._.updateProperty(key, attributes[key]);
  31186. }
  31187. };
  31188. this._.updateChannel = function privateUpdateChannel(channelId, attributes) {
  31189. const channel = self.getChannel(channelId);
  31190. if (channel) {
  31191. channel.update(attributes);
  31192. }
  31193. };
  31194. };
  31195. /***/ }),
  31196. /* 308 */
  31197. /***/ (function(module, exports, __webpack_require__) {
  31198. "use strict";
  31199. const _require = __webpack_require__(103)(),
  31200. getMediaDevices = _require.getMediaDevices;
  31201. /**
  31202. * Enumerates the audio input devices (such as microphones) and video input devices
  31203. * (cameras) available to the browser.
  31204. * <p>
  31205. * The array of devices is passed in as the <code>devices</code> parameter of
  31206. * the <code>callback</code> function passed into the method.
  31207. *
  31208. * @param callback {Function} The callback function invoked when the list of devices
  31209. * devices is available. This function takes two parameters:
  31210. * <ul>
  31211. * <li><code>error</code> &mdash; This is set to an error object when
  31212. * there is an error in calling this method; it is set to <code>null</code>
  31213. * when the call succeeds.</li>
  31214. *
  31215. * <li><p><code>devices</code> &mdash; An array of objects corresponding to
  31216. * available microphones and cameras. Each object has three properties: <code>kind</code>,
  31217. * <code>deviceId</code>, and <code>label</code>, each of which are strings.
  31218. * <p>
  31219. * The <code>kind</code> property is set to <code>"audioInput"</code> for audio input
  31220. * devices or <code>"videoInput"</code> for video input devices.
  31221. * <p>
  31222. * The <code>deviceId</code> property is a unique ID for the device. You can pass
  31223. * the <code>deviceId</code> in as the <code>audioSource</code> or <code>videoSource</code>
  31224. * property of the <code>options</code> parameter of the
  31225. * <a href="#initPublisher">OT.initPublisher()</a> method.
  31226. * <p>
  31227. * The <code>label</code> property identifies the device. The <code>label</code>
  31228. * property is set to an empty string if the user has not previously granted access to
  31229. * a camera and microphone. In HTTP, the user must have granted access to a camera and
  31230. * microphone in the current page (for example, in response to a call to
  31231. * <code>OT.initPublisher()</code>). In HTTPS, the user must have previously granted access
  31232. * to the camera and microphone in the current page or in a page previously loaded from the
  31233. * domain.</li>
  31234. * </ul>
  31235. *
  31236. * @see <a href="#initPublisher">OT.initPublisher()</a>
  31237. * @method OT.getDevices
  31238. * @memberof OT
  31239. */
  31240. module.exports = function getDevices(callback) {
  31241. getMediaDevices().then(devices => callback(undefined, devices), callback);
  31242. };
  31243. /***/ }),
  31244. /* 309 */
  31245. /***/ (function(module, exports, __webpack_require__) {
  31246. "use strict";
  31247. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  31248. /* eslint-disable import/newline-after-import, no-param-reassign */
  31249. __webpack_require__(310);
  31250. const clone = __webpack_require__(35);
  31251. const errorReporting = __webpack_require__(185)();
  31252. const eventNames = __webpack_require__(24);
  31253. const eventing = __webpack_require__(5);
  31254. const Event = __webpack_require__(135);
  31255. const StaticConfig = __webpack_require__(28)();
  31256. const AnalyticsHelper = __webpack_require__(54);
  31257. const setDeprecatedProperty = __webpack_require__(223);
  31258. const runtimeProperties = __webpack_require__(529);
  31259. const mutableRuntimeProperties = __webpack_require__(530);
  31260. const staticConfig = StaticConfig.onlyLocal(); // We need to do this first because of circular dependency issues with otplugin.js. @TODO: fix this.
  31261. const OT = {}; // noConflict is constructed before we override global.OT so we keep the original value
  31262. OT.noConflict = __webpack_require__(531)();
  31263. (typeof window !== undefined ? window : global).OT = OT;
  31264. module.exports = OT;
  31265. (() => {
  31266. let TB = OT;
  31267. Object.defineProperty((typeof window !== undefined ? window : global), 'TB', {
  31268. get: () => {
  31269. if (TB === OT) {
  31270. console.warn('window.TB is deprecated, and will be removed in the future. Please access via window.OT');
  31271. }
  31272. return TB;
  31273. },
  31274. set: _TB => {
  31275. TB = _TB;
  31276. },
  31277. // We provide a setter so noConflict works
  31278. configurable: true
  31279. });
  31280. })();
  31281. const windowMock = __webpack_require__(138)((typeof window !== undefined ? window : global));
  31282. const OTHelpers = __webpack_require__(4);
  31283. const APIKEY = __webpack_require__(69);
  31284. const AudioLevelTransformer = __webpack_require__(139);
  31285. const calculateCapableSimulcastStreams = __webpack_require__(248);
  31286. const Chrome = __webpack_require__(140);
  31287. const WebAudioAudioLevelSampler = __webpack_require__(141);
  31288. const GetStatsAudioOutputLevelSampler = __webpack_require__(249);
  31289. const EnvironmentLoader = __webpack_require__(142);
  31290. const Errors = __webpack_require__(8);
  31291. const ExceptionCodes = __webpack_require__(11);
  31292. const generateConstraintInfo = __webpack_require__(250);
  31293. const guidStorage = __webpack_require__(245);
  31294. const logging = __webpack_require__(1)('OT');
  31295. const logLevels = __webpack_require__(127);
  31296. const setLogLevel = __webpack_require__(559);
  31297. const OTErrorClass = __webpack_require__(33);
  31298. const _require = __webpack_require__(98),
  31299. parseIceServers = _require.parseIceServers;
  31300. const PUBLISH_MAX_DELAY = __webpack_require__(260);
  31301. const sessionObjects = __webpack_require__(22);
  31302. const StreamChannel = __webpack_require__(145);
  31303. const StylableComponent = __webpack_require__(147);
  31304. const systemRequirements = __webpack_require__(148);
  31305. const PeerConnection = __webpack_require__(99)({
  31306. global: windowMock
  31307. });
  31308. const otError = __webpack_require__(12)({
  31309. errorReporting
  31310. });
  31311. const audioContext = __webpack_require__(153)();
  31312. const chromeExtensionHelper = __webpack_require__(270)({
  31313. otError
  31314. });
  31315. const createChromeMixin = __webpack_require__(271)();
  31316. const getNativeEnumerateDevices = __webpack_require__(276)({
  31317. global: windowMock
  31318. });
  31319. const deviceHelpers = __webpack_require__(103)({
  31320. getNativeEnumerateDevices
  31321. });
  31322. const Events = __webpack_require__(20)();
  31323. const generateSimpleStateMachine = __webpack_require__(155)();
  31324. const getUserMediaHelper = __webpack_require__(606)({
  31325. otError,
  31326. global: windowMock
  31327. });
  31328. const screenSharing = __webpack_require__(156)({
  31329. chromeExtensionHelper,
  31330. otError
  31331. });
  31332. const processPubOptions = __webpack_require__(612)({
  31333. deviceHelpers,
  31334. generateConstraintInfo,
  31335. getUserMediaHelper,
  31336. global: windowMock,
  31337. OTHelpers,
  31338. screenSharing
  31339. });
  31340. const getUserMedia = __webpack_require__(615)({
  31341. otError,
  31342. processPubOptions
  31343. });
  31344. const interpretPeerConnectionError = __webpack_require__(158)({
  31345. otError
  31346. });
  31347. const IntervalRunner = __webpack_require__(71);
  31348. const Microphone = __webpack_require__(281)();
  31349. const videoElementErrorMap = __webpack_require__(282)({
  31350. otError
  31351. });
  31352. const NativeVideoElementWrapper = __webpack_require__(283)({
  31353. global: windowMock,
  31354. videoElementErrorMap
  31355. });
  31356. const setCertificates = __webpack_require__(159)({
  31357. global: windowMock
  31358. });
  31359. const PublisherPeerConnection = __webpack_require__(284)({
  31360. PeerConnection,
  31361. setCertificates
  31362. });
  31363. const SubscriberPeerConnection = __webpack_require__(285)({
  31364. PeerConnection,
  31365. setCertificates
  31366. });
  31367. const PublishingState = __webpack_require__(286)();
  31368. const reportIssue = __webpack_require__(622)({
  31369. otError
  31370. });
  31371. const VideoElementFacade = __webpack_require__(104)({
  31372. NativeVideoElementWrapper
  31373. });
  31374. const VideoOrientation = __webpack_require__(146)();
  31375. const WidgetView = __webpack_require__(160)({
  31376. VideoElementFacade
  31377. });
  31378. const Subscriber = __webpack_require__(289)({
  31379. interpretPeerConnectionError,
  31380. otError,
  31381. SubscriberPeerConnection,
  31382. WidgetView
  31383. });
  31384. const Publisher = __webpack_require__(163)({
  31385. APIKEY,
  31386. createChromeMixin,
  31387. deviceHelpers,
  31388. EnvironmentLoader,
  31389. Errors,
  31390. Events,
  31391. ExceptionCodes,
  31392. calculateCapableSimulcastStreams,
  31393. global: windowMock,
  31394. interpretPeerConnectionError,
  31395. IntervalRunner,
  31396. Microphone,
  31397. otError,
  31398. OTErrorClass,
  31399. OTHelpers,
  31400. parseIceServers,
  31401. processPubOptions,
  31402. PUBLISH_MAX_DELAY,
  31403. PublisherPeerConnection,
  31404. PublishingState,
  31405. StreamChannel,
  31406. systemRequirements,
  31407. VideoOrientation,
  31408. WidgetView
  31409. });
  31410. const initPublisher = __webpack_require__(295)({
  31411. otError,
  31412. Publisher
  31413. });
  31414. const Session = __webpack_require__(296)({
  31415. global: windowMock,
  31416. initPublisher,
  31417. otError,
  31418. Publisher,
  31419. Subscriber
  31420. });
  31421. const initSession = __webpack_require__(682)({
  31422. Session
  31423. }); // Allow events to be bound on OT
  31424. eventing(OT);
  31425. const getSupportedCodecs = __webpack_require__(683);
  31426. setDeprecatedProperty(OT, '$', {
  31427. name: 'OT.$',
  31428. getMessage: 'Please use an external library like jQuery to select elements from the page.',
  31429. value: OTHelpers
  31430. }); // Define the APIKEY this is a global parameter which should not change
  31431. OT.APIKEY = APIKEY.value;
  31432. OT.AnalyserAudioLevelSampler = WebAudioAudioLevelSampler;
  31433. OT.Archive = __webpack_require__(306);
  31434. OT.ArchiveEvent = Events.ArchiveEvent;
  31435. OT.ArchiveUpdatedEvent = Events.ArchiveUpdatedEvent;
  31436. OT.AudioLevelTransformer = AudioLevelTransformer;
  31437. OT.AudioLevelUpdatedEvent = Events.AudioLevelUpdatedEvent;
  31438. OT.Capabilities = __webpack_require__(165);
  31439. OT.Chrome = Chrome;
  31440. OT.Connection = __webpack_require__(167);
  31441. OT.ConnectionCapabilities = OT.Connection.Capabilities;
  31442. OT.ConnectionEvent = Events.ConnectionEvent;
  31443. Object.keys(logLevels).forEach(name => {
  31444. OT[name.toUpperCase()] = logLevels[name].priority;
  31445. });
  31446. OT.NONE = 0;
  31447. OT.debug = logging.debug;
  31448. OT.error = logging.error;
  31449. OT.info = logging.info;
  31450. OT.log = logging.log;
  31451. OT.warn = logging.warn;
  31452. OT.DestroyedEvent = Events.DestroyedEvent;
  31453. OT.EnvLoadedEvent = Events.EnvLoadedEvent; // TODO: re-expose old screenSharing api
  31454. OT.Error = OTErrorClass;
  31455. OT.Error.on(eventNames.EXCEPTION, exceptionEvent => {
  31456. if (exceptionEvent.target === OT.Error) {
  31457. // Rebind target to OT if it's set to OT.Error to preserve old behaviour.
  31458. const exceptionEventClone = clone(exceptionEvent);
  31459. exceptionEventClone.target = OT;
  31460. OT.dispatchEvent(exceptionEventClone);
  31461. } else {
  31462. OT.dispatchEvent(exceptionEvent);
  31463. }
  31464. });
  31465. OT.Event = Event;
  31466. OT.ExceptionCodes = ExceptionCodes;
  31467. OT.ExceptionEvent = Events.ExceptionEvent;
  31468. OT.getDevices = __webpack_require__(308);
  31469. OT.GetStatsAudioLevelSampler = GetStatsAudioOutputLevelSampler;
  31470. OT.HAS_REQUIREMENTS = 1;
  31471. OT.IntervalRunner = IntervalRunner;
  31472. OT.IssueReportedEvent = Events.IssueReportedEvent;
  31473. OT.MediaStoppedEvent = Events.MediaStoppedEvent;
  31474. OT.Microphone = Microphone;
  31475. OT.NOT_HAS_REQUIREMENTS = 0;
  31476. OT.PeerConnection = PeerConnection; // TODO: this is here for repel, but it doesn't belong here
  31477. OT.PeerConnection.QOS = __webpack_require__(268).default;
  31478. OT.Publisher = Publisher;
  31479. OT.PublisherPeerConnection = PublisherPeerConnection;
  31480. OT.PublishingState = PublishingState;
  31481. OT.Session = Session;
  31482. OT.SessionConnectEvent = Events.SessionConnectEvent;
  31483. OT.SessionDisconnectEvent = Events.SessionDisconnectEvent;
  31484. OT.SessionDispatcher = __webpack_require__(305);
  31485. OT.Signal = __webpack_require__(303);
  31486. OT.SignalEvent = Events.SignalEvent;
  31487. OT.Stream = __webpack_require__(307);
  31488. OT.StreamChannel = StreamChannel;
  31489. OT.StreamEvent = Events.StreamEvent;
  31490. OT.StreamPropertyChangedEvent = Events.StreamPropertyChangedEvent;
  31491. OT.StreamUpdatedEvent = Events.StreamUpdatedEvent;
  31492. OT.StylableComponent = StylableComponent;
  31493. OT.Subscriber = Subscriber;
  31494. OT.SubscriberPeerConnection = SubscriberPeerConnection;
  31495. OT.SubscribingState = __webpack_require__(290);
  31496. OT.VideoDimensionsChangedEvent = Events.VideoDimensionsChangedEvent;
  31497. OT.VideoDisableWarningEvent = Events.VideoDisableWarningEvent;
  31498. OT.VideoElement = VideoElementFacade;
  31499. OT.VideoEnabledChangedEvent = Events.VideoEnabledChangedEvent;
  31500. OT.VideoOrientation = VideoOrientation;
  31501. OT.WidgetView = WidgetView;
  31502. OT.getSupportedCodecs = getSupportedCodecs;
  31503. OT._ = {
  31504. AnalyticsHelper,
  31505. getClientGuid: guidStorage.get,
  31506. StaticConfig
  31507. };
  31508. /**
  31509. *
  31510. * The currently loaded version of OpenTok.js.
  31511. *
  31512. * @property {string} version
  31513. * @readonly
  31514. * @memberof OT
  31515. */
  31516. Object.defineProperty(OT, 'version', {
  31517. value: staticConfig.version
  31518. });
  31519. const properties = {};
  31520. const canPropertyBeMutated = property => mutableRuntimeProperties.includes(property);
  31521. setDeprecatedProperty(properties, 'version', {
  31522. value: staticConfig.version,
  31523. name: 'OT.properties.version',
  31524. getWarning: 'Please use OT.version instead',
  31525. warnOnSet: true,
  31526. setWarning: 'Mutating version has no effect'
  31527. });
  31528. runtimeProperties.forEach(keyMap => {
  31529. let value;
  31530. let key;
  31531. if (Array.isArray(keyMap)) {
  31532. const propKey = keyMap[0],
  31533. staticConfigKey = keyMap[1];
  31534. key = propKey;
  31535. value = staticConfig[staticConfigKey] || staticConfigKey;
  31536. } else {
  31537. value = staticConfig[keyMap];
  31538. key = keyMap;
  31539. }
  31540. const isPropertyMutable = canPropertyBeMutated(key);
  31541. setDeprecatedProperty(properties, key, {
  31542. value,
  31543. name: "OT.properties." + key,
  31544. warnOnSet: true,
  31545. canSet: isPropertyMutable,
  31546. setWarning: isPropertyMutable ? "Mutating " + key + " can cause side effects" : "Mutating " + key + " has no effect"
  31547. });
  31548. });
  31549. OT.properties = properties; // OT.addEventListener comes from eventing(OT)
  31550. OT.audioContext = audioContext;
  31551. OT.checkScreenSharingCapability = screenSharing.checkCapability;
  31552. OT.checkSystemRequirements = systemRequirements.check;
  31553. OT.components = {}; // OT.dispatchEvent comes from eventing(OT)
  31554. // OT.emit comes from eventing(OT)
  31555. OT.generateSimpleStateMachine = generateSimpleStateMachine;
  31556. OT.getDevices = __webpack_require__(308);
  31557. OT.getErrorTitleByCode = OTErrorClass.getTitleByCode;
  31558. OT.getLogs = logging.getLogs; // This is misspelled in production too, being compatible here.
  31559. OT.getStatsAdpater = __webpack_require__(266);
  31560. OT.getStatsHelpers = __webpack_require__(72);
  31561. OT.getUserMedia = getUserMedia;
  31562. OT.handleJsException = OTErrorClass.handleJsException;
  31563. OT.initPublisher = initPublisher;
  31564. OT.setProxyUrl = __webpack_require__(164).setProxyUrl;
  31565. OT.initSession = function (apiKey, sessionId, opt) {
  31566. if (sessionId == null) {
  31567. sessionId = apiKey;
  31568. apiKey = null;
  31569. } // Ugly hack, make sure OT.APIKEY is set
  31570. // TODO: Yep, sure is ugly. It appears to be needed by raptor. We should fix this situation.
  31571. // UPDATE: This hack is the only reason why we need to wrap the actual initSession.
  31572. if (APIKEY.value.length === 0 && apiKey) {
  31573. APIKEY.value = apiKey;
  31574. OT.APIKEY = apiKey;
  31575. }
  31576. return initSession(apiKey, sessionId, opt);
  31577. };
  31578. const deprecatedMessage = key => key + " is deprecated and will be removed in a future version of OpenTok";
  31579. const warnAndReturn = (name, value) => () => {
  31580. console.warn(deprecatedMessage(name));
  31581. return value;
  31582. }; // discourage us and others from using these OT methods
  31583. Object.defineProperties(OT, {
  31584. isUnloaded: {
  31585. get: warnAndReturn('OT.isUnloaded', EnvironmentLoader.isUnloaded)
  31586. },
  31587. onLoad: {
  31588. get: warnAndReturn('OT.onLoad', EnvironmentLoader.onLoad)
  31589. },
  31590. onUnload: {
  31591. get: warnAndReturn('OT.onUnload', EnvironmentLoader.onUnload)
  31592. },
  31593. overrideGuidStorage: {
  31594. get: warnAndReturn('OT.overrideGuidStorage', guidStorage.override)
  31595. }
  31596. }); // OT.off comes from eventing(OT)
  31597. // OT.on comes from eventing(OT)
  31598. // OT.once comes from eventing(OT)
  31599. // OT.removeEventListener comes from eventing(OT)
  31600. // OT.trigger comes from eventing(OT)
  31601. // Exposed here for partner usage.
  31602. OT.pickScreenSharingHelper = screenSharing.pickHelper;
  31603. OT.publishers = sessionObjects.publishers;
  31604. OT.registerScreenSharingExtension = screenSharing.registerExtension;
  31605. OT.registerScreenSharingExtensionHelper = screenSharing.registerExtensionHelper;
  31606. OT.reportIssue = reportIssue;
  31607. OT.sessions = sessionObjects.sessions;
  31608. OT.setLogLevel = setLogLevel;
  31609. OT.shouldLog = logging.shouldLog;
  31610. OT.subscribers = sessionObjects.subscribers;
  31611. OT.unblockAudio = __webpack_require__(162);
  31612. OT.upgradeSystemRequirements = systemRequirements.upgrade; // Tidy up everything on unload
  31613. EnvironmentLoader.onUnload(() => {
  31614. sessionObjects.publishers.destroy();
  31615. sessionObjects.subscribers.destroy();
  31616. sessionObjects.sessions.destroy('unloaded');
  31617. });
  31618. /**
  31619. * This method is deprecated. Use <a href="#on">on()</a> or <a href="#once">once()</a> instead.
  31620. *
  31621. * <p>
  31622. * Registers a method as an event listener for a specific event.
  31623. * </p>
  31624. *
  31625. * <p>
  31626. * The OT object dispatches one type of event &#151; an <code>exception</code> event. The
  31627. * following code adds an event listener for the <code>exception</code> event:
  31628. * </p>
  31629. *
  31630. * <pre>
  31631. * OT.addEventListener("exception", exceptionHandler);
  31632. *
  31633. * function exceptionHandler(event) {
  31634. * alert("exception event. \n code == " + event.code + "\n message == " + event.message);
  31635. * }
  31636. * </pre>
  31637. *
  31638. * <p>
  31639. * If a handler is not registered for an event, the event is ignored locally. If the event
  31640. * listener function does not exist, the event is ignored locally.
  31641. * </p>
  31642. * <p>
  31643. * Throws an exception if the <code>listener</code> name is invalid.
  31644. * </p>
  31645. *
  31646. * @param {String} type The string identifying the type of event.
  31647. *
  31648. * @param {Function} listener The function to be invoked when the OT object dispatches the event.
  31649. * @see <a href="#on">on()</a>
  31650. * @see <a href="#once">once()</a>
  31651. * @memberof OT
  31652. * @method addEventListener
  31653. *
  31654. */
  31655. /**
  31656. * This method is deprecated. Use <a href="#off">off()</a> instead.
  31657. *
  31658. * <p>
  31659. * Removes an event listener for a specific event.
  31660. * </p>
  31661. *
  31662. * <p>
  31663. * Throws an exception if the <code>listener</code> name is invalid.
  31664. * </p>
  31665. *
  31666. * @param {String} type The string identifying the type of event.
  31667. *
  31668. * @param {Function} listener The event listener function to remove.
  31669. *
  31670. * @see <a href="#off">off()</a>
  31671. * @memberof OT
  31672. * @method removeEventListener
  31673. */
  31674. /**
  31675. * Adds an event handler function for one or more events.
  31676. *
  31677. * <p>
  31678. * The OT object dispatches one type of event &#151; an <code>exception</code> event. The following
  31679. * code adds an event
  31680. * listener for the <code>exception</code> event:
  31681. * </p>
  31682. *
  31683. * <pre>
  31684. * OT.on("exception", function (event) {
  31685. * // This is the event handler.
  31686. * });
  31687. * </pre>
  31688. *
  31689. * <p>You can also pass in a third <code>context</code> parameter (which is optional) to define the
  31690. * value of
  31691. * <code>this</code> in the handler method:</p>
  31692. *
  31693. * <pre>
  31694. * OT.on("exception",
  31695. * function (event) {
  31696. * // This is the event handler.
  31697. * }),
  31698. * session
  31699. * );
  31700. * </pre>
  31701. *
  31702. * <p>
  31703. * If you do not add a handler for an event, the event is ignored locally.
  31704. * </p>
  31705. *
  31706. * @param {String} type The string identifying the type of event.
  31707. * @param {Function} handler The handler function to process the event. This function takes the event
  31708. * object as a parameter.
  31709. * @param {Object} context (Optional) Defines the value of <code>this</code> in the event handler
  31710. * function.
  31711. *
  31712. * @memberof OT
  31713. * @method on
  31714. * @see <a href="#off">off()</a>
  31715. * @see <a href="#once">once()</a>
  31716. * @see <a href="#events">Events</a>
  31717. */
  31718. /**
  31719. * Adds an event handler function for an event. Once the handler is called, the specified handler
  31720. * method is
  31721. * removed as a handler for this event. (When you use the <code>OT.on()</code> method to add an event
  31722. * handler, the handler
  31723. * is <i>not</i> removed when it is called.) The <code>OT.once()</code> method is the equivilent of
  31724. * calling the <code>OT.on()</code>
  31725. * method and calling <code>OT.off()</code> the first time the handler is invoked.
  31726. *
  31727. * <p>
  31728. * The following code adds a one-time event handler for the <code>exception</code> event:
  31729. * </p>
  31730. *
  31731. * <pre>
  31732. * OT.once("exception", function (event) {
  31733. * console.log(event);
  31734. * }
  31735. * </pre>
  31736. *
  31737. * <p>You can also pass in a third <code>context</code> parameter (which is optional) to define the
  31738. * value of
  31739. * <code>this</code> in the handler method:</p>
  31740. *
  31741. * <pre>
  31742. * OT.once("exception",
  31743. * function (event) {
  31744. * // This is the event handler.
  31745. * },
  31746. * session
  31747. * );
  31748. * </pre>
  31749. *
  31750. * <p>
  31751. * The method also supports an alternate syntax, in which the first parameter is an object that is a
  31752. * hash map of
  31753. * event names and handler functions and the second parameter (optional) is the context for this in
  31754. * each handler:
  31755. * </p>
  31756. * <pre>
  31757. * OT.once(
  31758. * {exeption: function (event) {
  31759. * // This is the event handler.
  31760. * }
  31761. * },
  31762. * session
  31763. * );
  31764. * </pre>
  31765. *
  31766. * @param {String} type The string identifying the type of event. You can specify multiple event
  31767. * names in this string,
  31768. * separating them with a space. The event handler will process the first occurence of the events.
  31769. * After the first event,
  31770. * the handler is removed (for all specified events).
  31771. * @param {Function} handler The handler function to process the event. This function takes the event
  31772. * object as a parameter.
  31773. * @param {Object} context (Optional) Defines the value of <code>this</code> in the event handler
  31774. * function.
  31775. *
  31776. * @memberof OT
  31777. * @method once
  31778. * @see <a href="#on">on()</a>
  31779. * @see <a href="#once">once()</a>
  31780. * @see <a href="#events">Events</a>
  31781. */
  31782. /**
  31783. * Removes an event handler.
  31784. *
  31785. * <p>Pass in an event name and a handler method, the handler is removed for that event:</p>
  31786. *
  31787. * <pre>OT.off("exceptionEvent", exceptionEventHandler);</pre>
  31788. *
  31789. * <p>If you pass in an event name and <i>no</i> handler method, all handlers are removed for that
  31790. * events:</p>
  31791. *
  31792. * <pre>OT.off("exceptionEvent");</pre>
  31793. *
  31794. * <p>
  31795. * The method also supports an alternate syntax, in which the first parameter is an object that is a
  31796. * hash map of
  31797. * event names and handler functions and the second parameter (optional) is the context for matching
  31798. * handlers:
  31799. * </p>
  31800. * <pre>
  31801. * OT.off(
  31802. * {
  31803. * exceptionEvent: exceptionEventHandler
  31804. * },
  31805. * this
  31806. * );
  31807. * </pre>
  31808. *
  31809. * @param {String} type (Optional) The string identifying the type of event. You can use a space to
  31810. * specify multiple events, as in "eventName1 eventName2 eventName3". If you pass in no
  31811. * <code>type</code> value (or other arguments), all event handlers are removed for the object.
  31812. * @param {Function} handler (Optional) The event handler function to remove. If you pass in no
  31813. * <code>handler</code>, all event handlers are removed for the specified event <code>type</code>.
  31814. * @param {Object} context (Optional) If you specify a <code>context</code>, the event handler is
  31815. * removed for all specified events and handlers that use the specified context.
  31816. *
  31817. * @memberof OT
  31818. * @method off
  31819. * @see <a href="#on">on()</a>
  31820. * @see <a href="#once">once()</a>
  31821. * @see <a href="#events">Events</a>
  31822. */
  31823. /**
  31824. * Dispatched by the OT class when the app encounters an exception.
  31825. * Note that you set up an event handler for the <code>exception</code> event by calling the
  31826. * <code>OT.on()</code> method.
  31827. *
  31828. * @name exception
  31829. * @event
  31830. * @borrows ExceptionEvent#message as this.message
  31831. * @memberof OT
  31832. * @see ExceptionEvent
  31833. */
  31834. /***/ }),
  31835. /* 310 */
  31836. /***/ (function(module, exports, __webpack_require__) {
  31837. var content = __webpack_require__(311);
  31838. if(typeof content === 'string') content = [[module.i, content, '']];
  31839. var transform;
  31840. var insertInto;
  31841. var options = {"hmr":true}
  31842. options.transform = transform
  31843. options.insertInto = undefined;
  31844. var update = __webpack_require__(325)(content, options);
  31845. if(content.locals) module.exports = content.locals;
  31846. if(false) {}
  31847. /***/ }),
  31848. /* 311 */
  31849. /***/ (function(module, exports, __webpack_require__) {
  31850. exports = module.exports = __webpack_require__(312)(false);
  31851. // Imports
  31852. var urlEscape = __webpack_require__(313);
  31853. var ___CSS_LOADER_URL___0___ = urlEscape(__webpack_require__(314));
  31854. var ___CSS_LOADER_URL___1___ = urlEscape(__webpack_require__(315));
  31855. var ___CSS_LOADER_URL___2___ = urlEscape(__webpack_require__(316));
  31856. var ___CSS_LOADER_URL___3___ = urlEscape(__webpack_require__(317));
  31857. var ___CSS_LOADER_URL___4___ = urlEscape(__webpack_require__(318));
  31858. var ___CSS_LOADER_URL___5___ = urlEscape(__webpack_require__(319));
  31859. var ___CSS_LOADER_URL___6___ = urlEscape(__webpack_require__(320));
  31860. var ___CSS_LOADER_URL___7___ = urlEscape(__webpack_require__(321));
  31861. var ___CSS_LOADER_URL___8___ = urlEscape(__webpack_require__(322));
  31862. var ___CSS_LOADER_URL___9___ = urlEscape(__webpack_require__(323));
  31863. var ___CSS_LOADER_URL___10___ = urlEscape(__webpack_require__(324));
  31864. // Module
  31865. exports.push([module.i, "/*!\n * Copyright (c) 2017 TokBox, Inc.\n * Released under the MIT license\n * http://opensource.org/licenses/MIT\n */\n\n/**\n * OT Base styles\n */\n\n/* Root OT object, this is where our CSS reset happens */\n.OT_root,\n.OT_root * {\n color: #ffffff;\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font-family: Arial, Helvetica, sans-serif;\n vertical-align: baseline;\n}\n\n/**\n * Specific Element Reset\n */\n\n.OT_root h1,\n.OT_root h2,\n.OT_root h3,\n.OT_root h4,\n.OT_root h5,\n.OT_root h6 {\n color: #ffffff;\n font-family: Arial, Helvetica, sans-serif;\n font-size: 100%;\n font-weight: bold;\n}\n\n.OT_root header {\n\n}\n\n.OT_root footer {\n\n}\n\n.OT_root div {\n\n}\n\n.OT_root section {\n\n}\n\n.OT_root video {\n\n}\n\n.OT_root button {\n\n}\n\n.OT_root strong {\n font-weight: bold;\n}\n\n.OT_root em {\n font-style: italic;\n}\n\n.OT_root a,\n.OT_root a:link,\n.OT_root a:visited,\n.OT_root a:hover,\n.OT_root a:active {\n font-family: Arial, Helvetica, sans-serif;\n}\n\n.OT_root ul, .OT_root ol {\n margin: 1em 1em 1em 2em;\n}\n\n.OT_root ol {\n list-style: decimal outside;\n}\n\n.OT_root ul {\n list-style: disc outside;\n}\n\n.OT_root dl {\n margin: 4px;\n}\n\n.OT_root dl dt,\n.OT_root dl dd {\n float: left;\n margin: 0;\n padding: 0;\n}\n\n.OT_root dl dt {\n clear: left;\n text-align: right;\n width: 50px;\n}\n\n.OT_root dl dd {\n margin-left: 10px;\n}\n\n.OT_root img {\n border: 0 none;\n}\n\n/* Modal dialog styles */\n\n/* Modal dialog styles */\n\n.OT_dialog-centering {\n display: table;\n width: 100%;\n height: 100%;\n}\n\n.OT_dialog-centering-child {\n display: table-cell;\n vertical-align: middle;\n}\n\n.OT_dialog {\n position: relative;\n\n box-sizing: border-box;\n max-width: 576px;\n margin-right: auto;\n margin-left: auto;\n padding: 36px;\n text-align: center; /* centers all the inline content */\n\n background-color: #363636;\n color: #fff;\n box-shadow: 2px 4px 6px #999;\n font-family: 'Didact Gothic', sans-serif;\n font-size: 13px;\n line-height: 1.4;\n}\n\n.OT_dialog * {\n font-family: inherit;\n box-sizing: inherit;\n}\n\n.OT_closeButton {\n color: #999999;\n cursor: pointer;\n font-size: 32px;\n line-height: 36px;\n position: absolute;\n right: 18px;\n top: 0;\n}\n\n.OT_dialog-messages {\n text-align: center;\n}\n\n.OT_dialog-messages-main {\n margin-bottom: 36px;\n line-height: 36px;\n\n font-weight: 300;\n font-size: 24px;\n}\n\n.OT_dialog-messages-minor {\n margin-bottom: 18px;\n\n font-size: 13px;\n line-height: 18px;\n color: #A4A4A4;\n}\n\n.OT_dialog-messages-minor strong {\n color: #ffffff;\n}\n\n.OT_dialog-actions-card {\n display: inline-block;\n}\n\n.OT_dialog-button-title {\n margin-bottom: 18px;\n line-height: 18px;\n\n font-weight: 300;\n text-align: center;\n font-size: 14px;\n color: #999999;\n}\n.OT_dialog-button-title label {\n color: #999999;\n}\n\n.OT_dialog-button-title a,\n.OT_dialog-button-title a:link,\n.OT_dialog-button-title a:active {\n color: #02A1DE;\n}\n\n.OT_dialog-button-title strong {\n color: #ffffff;\n font-weight: 100;\n display: block;\n}\n\n.OT_dialog-button {\n display: inline-block;\n\n margin-bottom: 18px;\n padding: 0 1em;\n\n background-color: #1CA3DC;\n text-align: center;\n cursor: pointer;\n}\n\n.OT_dialog-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.OT_dialog-button-large {\n line-height: 36px;\n padding-top: 9px;\n padding-bottom: 9px;\n\n font-weight: 100;\n font-size: 24px;\n}\n\n.OT_dialog-button-small {\n line-height: 18px;\n padding-top: 9px;\n padding-bottom: 9px;\n\n background-color: #444444;\n color: #999999;\n font-size: 16px;\n}\n\n.OT_dialog-progress-bar {\n display: inline-block; /* prevents margin collapse */\n width: 100%;\n margin-top: 5px;\n margin-bottom: 41px;\n\n border: 1px solid #4E4E4E;\n height: 8px;\n}\n\n.OT_dialog-progress-bar-fill {\n height: 100%;\n\n background-color: #29A4DA;\n}\n\n/* Helpers */\n\n.OT_centered {\n position: fixed;\n left: 50%;\n top: 50%;\n margin: 0;\n}\n\n.OT_dialog-hidden {\n display: none;\n}\n\n.OT_dialog-button-block {\n display: block;\n}\n\n.OT_dialog-no-natural-margin {\n margin-bottom: 0;\n}\n\n/* Publisher and Subscriber styles */\n\n.OT_publisher, .OT_subscriber {\n position: relative;\n min-width: 48px;\n min-height: 48px;\n}\n\n.OT_publisher .OT_video-element,\n.OT_subscriber .OT_video-element {\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n\n transform-origin: 0 0;\n}\n\n/* Styles that are applied when the video element should be mirrored */\n.OT_publisher.OT_mirrored .OT_video-element {\n transform: scale(-1, 1);\n transform-origin: 50% 50%;\n}\n\n.OT_subscriber_error {\n background-color: #000;\n color: #fff;\n text-align: center;\n}\n\n.OT_subscriber_error > p {\n padding: 20px;\n}\n\n/* The publisher/subscriber name/mute background */\n.OT_publisher .OT_bar,\n.OT_subscriber .OT_bar,\n.OT_publisher .OT_name,\n.OT_subscriber .OT_name,\n.OT_publisher .OT_archiving,\n.OT_subscriber .OT_archiving,\n.OT_publisher .OT_archiving-status,\n.OT_subscriber .OT_archiving-status,\n.OT_publisher .OT_archiving-light-box,\n.OT_subscriber .OT_archiving-light-box {\n -ms-box-sizing: border-box;\n box-sizing: border-box;\n top: 0;\n left: 0;\n right: 0;\n display: block;\n height: 34px;\n position: absolute;\n}\n\n.OT_publisher .OT_bar,\n.OT_subscriber .OT_bar {\n background: rgba(0, 0, 0, 0.4);\n}\n\n.OT_publisher .OT_edge-bar-item,\n.OT_subscriber .OT_edge-bar-item {\n z-index: 1; /* required to get audio level meter underneath */\n}\n\n/* The publisher/subscriber name panel/archiving status bar */\n.OT_publisher .OT_name,\n.OT_subscriber .OT_name {\n background-color: transparent;\n color: #ffffff;\n font-size: 15px;\n line-height: 34px;\n font-weight: normal;\n padding: 0 4px 0 36px;\n}\n\n.OT_publisher .OT_archiving-status,\n.OT_subscriber .OT_archiving-status {\n background: rgba(0, 0, 0, 0.4);\n top: auto;\n bottom: 0;\n left: 34px;\n padding: 0 4px;\n color: rgba(255, 255, 255, 0.8);\n font-size: 15px;\n line-height: 34px;\n font-weight: normal;\n}\n\n.OT_micro .OT_archiving-status,\n.OT_micro:hover .OT_archiving-status,\n.OT_mini .OT_archiving-status,\n.OT_mini:hover .OT_archiving-status {\n display: none;\n}\n\n.OT_publisher .OT_archiving-light-box,\n.OT_subscriber .OT_archiving-light-box {\n background: rgba(0, 0, 0, 0.4);\n top: auto;\n bottom: 0;\n right: auto;\n width: 34px;\n height: 34px;\n}\n\n.OT_archiving-light {\n width: 7px;\n height: 7px;\n border-radius: 30px;\n position: absolute;\n top: 14px;\n left: 14px;\n background-color: #575757;\n box-shadow: 0 0 5px 1px #575757;\n}\n\n.OT_archiving-light.OT_active {\n background-color: #970d13;\n -webkit-animation: OT_pulse 1.3s ease-in;\n -moz-animation: OT_pulse 1.3s ease-in;\n -webkit-animation: OT_pulse 1.3s ease-in;\n -webkit-animation-iteration-count: infinite;\n -moz-animation-iteration-count: infinite;\n -webkit-animation-iteration-count: infinite;\n}\n\n.OT_mini .OT_bar,\n.OT_bar.OT_mode-mini,\n.OT_bar.OT_mode-mini-auto {\n bottom: 0;\n height: auto;\n}\n\n.OT_mini .OT_name.OT_mode-off,\n.OT_mini .OT_name.OT_mode-on,\n.OT_mini .OT_name.OT_mode-auto,\n.OT_mini:hover .OT_name.OT_mode-auto {\n display: none;\n}\n\n.OT_publisher .OT_name,\n.OT_subscriber .OT_name {\n left: 10px;\n right: 37px;\n height: 34px;\n padding-left: 0;\n}\n\n.OT_publisher .OT_mute,\n.OT_subscriber .OT_mute {\n border: none;\n cursor: pointer;\n display: block;\n position: absolute;\n text-align: center;\n text-indent: -9999em;\n background-color: transparent;\n background-repeat: no-repeat;\n}\n\n.OT_publisher .OT_mute,\n.OT_subscriber .OT_mute {\n right: 0;\n top: 0;\n border-left: 1px solid rgba(255, 255, 255, 0.2);\n height: 36px;\n width: 37px;\n}\n\n.OT_mini .OT_mute,\n.OT_publisher.OT_mini .OT_mute.OT_mode-auto.OT_mode-on-hold,\n.OT_subscriber.OT_mini .OT_mute.OT_mode-auto.OT_mode-on-hold {\n top: 50%;\n left: 50%;\n right: auto;\n margin-top: -18px;\n margin-left: -18.5px;\n border-left: none;\n}\n\n.OT_publisher .OT_mute {\n background-image: url(" + ___CSS_LOADER_URL___0___ + ");\n background-position: 9px 5px;\n}\n\n.OT_publisher .OT_mute.OT_active {\n background-image: url(" + ___CSS_LOADER_URL___1___ + ");\n background-position: 9px 4px;\n}\n\n.OT_subscriber .OT_mute {\n background-image: url(" + ___CSS_LOADER_URL___2___ + ");\n background-position: 8px 7px;\n}\n\n.OT_subscriber .OT_mute.OT_active {\n background-image: url(" + ___CSS_LOADER_URL___3___ + ");\n background-position: 7px 7px;\n}\n\n/**\n * Styles for display modes\n *\n * Note: It's important that these completely control the display and opacity\n * attributes, no other selectors should atempt to change them.\n */\n\n/* Default display mode transitions for various chrome elements */\n.OT_publisher .OT_edge-bar-item,\n.OT_subscriber .OT_edge-bar-item {\n transition-property: top, bottom, opacity;\n transition-duration: 0.5s;\n transition-timing-function: ease-in;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_mode-off,\n.OT_subscriber .OT_edge-bar-item.OT_mode-off,\n.OT_publisher .OT_edge-bar-item.OT_mode-auto,\n.OT_subscriber .OT_edge-bar-item.OT_mode-auto,\n.OT_publisher .OT_edge-bar-item.OT_mode-mini-auto,\n.OT_subscriber .OT_edge-bar-item.OT_mode-mini-auto {\n top: -25px;\n opacity: 0;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_mode-off,\n.OT_subscriber .OT_edge-bar-item.OT_mode-off {\n display: none;\n}\n\n.OT_mini .OT_mute.OT_mode-auto,\n.OT_publisher .OT_mute.OT_mode-mini-auto,\n.OT_subscriber .OT_mute.OT_mode-mini-auto {\n top: 50%;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-off,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-off,\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto,\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-mini-auto,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-mini-auto {\n top: auto;\n bottom: -25px;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_mode-on,\n.OT_subscriber .OT_edge-bar-item.OT_mode-on,\n.OT_publisher .OT_edge-bar-item.OT_mode-auto.OT_mode-on-hold,\n.OT_subscriber .OT_edge-bar-item.OT_mode-auto.OT_mode-on-hold,\n.OT_publisher:hover .OT_edge-bar-item.OT_mode-auto,\n.OT_subscriber:hover .OT_edge-bar-item.OT_mode-auto,\n.OT_publisher:hover .OT_edge-bar-item.OT_mode-mini-auto,\n.OT_subscriber:hover .OT_edge-bar-item.OT_mode-mini-auto {\n top: 0;\n opacity: 1;\n}\n\n.OT_mini .OT_mute.OT_mode-on,\n.OT_mini:hover .OT_mute.OT_mode-auto,\n.OT_mute.OT_mode-mini,\n.OT_root:hover .OT_mute.OT_mode-mini-auto {\n top: 50%;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-on,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-on,\n.OT_publisher:hover .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto,\n.OT_subscriber:hover .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto {\n top: auto;\n bottom: 0;\n opacity: 1;\n}\n\n\n/* Contains the video element, used to fix video letter-boxing */\n.OT_widget-container {\n position: absolute;\n background-color: #000000;\n overflow: hidden;\n}\n\n.OT_hidden-audio {\n position: absolute !important;\n height: 1px !important;\n width: 1px !important;\n}\n\n/* Load animation */\n.OT_root .OT_video-loading {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n display: none;\n\n background-color: rgba(0, 0, 0, .75);\n}\n\n.OT_root .OT_video-loading .OT_video-loading-spinner {\n background: url(" + ___CSS_LOADER_URL___4___ + ") no-repeat;\n position: absolute;\n width: 32px;\n height: 32px;\n left: 50%;\n top: 50%;\n margin-left: -16px;\n margin-top: -16px;\n animation: OT_spin 2s linear infinite;\n}\n@keyframes OT_spin {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.OT_publisher.OT_loading .OT_video-loading,\n.OT_subscriber.OT_loading .OT_video-loading {\n display: block;\n}\n\n.OT_publisher.OT_loading .OT_video-element,\n.OT_subscriber.OT_loading .OT_video-element {\n /*display: none;*/\n}\n\n.OT_video-centering {\n display: table;\n width: 100%;\n height: 100%;\n}\n\n.OT_video-container {\n display: table-cell;\n vertical-align: middle;\n}\n\n.OT_video-poster {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n display: none;\n\n opacity: .25;\n\n background-repeat: no-repeat;\n background-image: url(" + ___CSS_LOADER_URL___5___ + ");\n background-size: auto 76%;\n}\n\n.OT_fit-mode-cover .OT_video-element {\n object-fit: cover;\n}\n\n/* Workaround for iOS freezing issue when cropping videos */\n/* https://bugs.webkit.org/show_bug.cgi?id=176439 */\n@media only screen\n and (orientation: portrait) {\n .OT_subscriber.OT_ForceContain.OT_fit-mode-cover .OT_video-element {\n object-fit: contain !important;\n }\n}\n\n.OT_fit-mode-contain .OT_video-element {\n object-fit: contain;\n}\n\n.OT_fit-mode-cover .OT_video-poster {\n background-position: center bottom;\n}\n\n.OT_fit-mode-contain .OT_video-poster {\n background-position: center;\n}\n\n.OT_audio-level-meter {\n position: absolute;\n width: 25%;\n max-width: 224px;\n min-width: 21px;\n top: 0;\n right: 0;\n overflow: hidden;\n}\n\n.OT_audio-level-meter:before {\n /* makes the height of the container equals its width */\n content: '';\n display: block;\n padding-top: 100%;\n}\n\n.OT_audio-level-meter__audio-only-img {\n position: absolute;\n top: 22%;\n right: 15%;\n width: 40%;\n\n opacity: .7;\n\n background: url(" + ___CSS_LOADER_URL___6___ + ") no-repeat center;\n}\n\n.OT_audio-level-meter__audio-only-img:before {\n /* makes the height of the container equals its width */\n content: '';\n display: block;\n padding-top: 100%;\n}\n\n.OT_audio-level-meter__value {\n will-change: transform;\n position: absolute;\n top: -100%;\n right: -100%;\n width: 200%;\n height: 200%;\n transform: scale(0);\n border-radius: 50%;\n background-image: radial-gradient(circle, rgba(151, 206, 0, 1) 0%, rgba(151, 206, 0, 0) 100%);\n}\n\n.OT_audio-level-meter.OT_mode-off {\n display: none;\n}\n\n.OT_audio-level-meter.OT_mode-on,\n.OT_audio-only .OT_audio-level-meter.OT_mode-auto {\n display: block;\n}\n\n.OT_audio-only.OT_publisher .OT_video-element,\n.OT_audio-only.OT_subscriber .OT_video-element {\n display: none;\n}\n\n\n.OT_video-disabled-indicator {\n opacity: 1;\n border: none;\n display: none;\n position: absolute;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: bottom right;\n pointer-events: none;\n top: 0;\n left: 0;\n bottom: 3px;\n right: 3px;\n}\n\n.OT_video-disabled {\n background-image: url(" + ___CSS_LOADER_URL___7___ + ");\n background-size: 33px auto;\n}\n\n.OT_video-disabled-warning {\n background-image: url(" + ___CSS_LOADER_URL___8___ + ");\n background-size: 33px auto;\n}\n\n.OT_video-disabled-indicator.OT_active {\n display: block;\n}\n\n.OT_audio-blocked-indicator {\n opacity: 1;\n border: none;\n display: none;\n position: absolute;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n}\n\n.OT_audio-blocked {\n background-image: url(" + ___CSS_LOADER_URL___9___ + ");\n background-size: 90px auto;\n}\n\n.OT_container-audio-blocked {\n cursor: pointer;\n}\n\n.OT_container-audio-blocked.OT_mini .OT_edge-bar-item {\n display: none;\n}\n\n.OT_container-audio-blocked .OT_mute {\n display: none;\n}\n\n.OT_audio-blocked-indicator.OT_active {\n display: block;\n}\n\n.OT_video-unsupported {\n opacity: 1;\n border: none;\n display: none;\n position: absolute;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url(" + ___CSS_LOADER_URL___10___ + ");\n background-size: 58px auto;\n pointer-events: none;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n margin-top: -30px;\n}\n\n.OT_video-unsupported-bar {\n display: none;\n position: absolute;\n width: 192%; /* copy the size of the audio meter bar for symmetry */\n height: 192%;\n top: -96% /* half of the size */;\n left: -96%;\n border-radius: 50%;\n\n background-color: rgba(0, 0, 0, .8);\n}\n\n.OT_video-unsupported-img {\n display: none;\n position: absolute;\n top: 11%;\n left: 15%;\n width: 70%;\n opacity: .7;\n background-image: url(" + ___CSS_LOADER_URL___10___ + ");\n background-repeat: no-repeat;\n background-position: center;\n background-size: 100% auto;\n}\n\n.OT_video-unsupported-img:before {\n /* makes the height of the container 93% of its width (90/97 px) */\n content: '';\n display: block;\n padding-top: 93%;\n}\n\n.OT_video-unsupported-text {\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n height: 100%;\n margin-top: 40px;\n}\n\n.OT_video-unsupported.OT_active {\n display: block;\n}\n\n.OT_mini .OT_video-unsupported,\n.OT_micro .OT_video-unsupported {\n position: absolute;\n width: 25%;\n max-width: 224px;\n min-width: 21px;\n top: 0;\n left: 0;\n overflow: hidden;\n background: none;\n bottom: auto;\n right: auto;\n margin: auto;\n}\n\n.OT_mini .OT_video-unsupported:before,\n.OT_micro .OT_video-unsupported:before {\n /* makes the height of the container equals its width */\n content: '';\n display: block;\n padding-top: 100%;\n}\n\n.OT_mini .OT_video-unsupported-bar,\n.OT_micro .OT_video-unsupported-bar,\n.OT_mini .OT_video-unsupported-img,\n.OT_micro .OT_video-unsupported-img {\n display: block;\n}\n\n.OT_mini .OT_video-unsupported-text,\n.OT_micro .OT_video-unsupported-text {\n display: none;\n}\n\n.OT_hide-forced {\n display: none;\n}\n\n.OT_ModalDialog {\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.2);\n}\n\n#tb_alert {\n position: fixed;\n width: 570px;\n font-family: \"Lucida Grande\", Arial;\n top: 50%;\n left: 50%;\n margin-top: -75px;\n margin-left: -285px;\n}\n\n#tb_alert * {\n box-sizing: border-box;\n}\n\n#tb_alert>div,\n#tb_alert>div>div {\n box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid rgba(255, 255, 255, 0.3);\n}\n\n#tb_alert>div {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n background-color: gray;\n position: relative;\n padding: 30px;\n overflow: visible;\n margin-left: 70px;\n color: #c8c5c5;\n border-bottom-color: rgba(255, 255, 255, 0.1);\n border-left-color: rgba(255, 255, 255, 0.1);\n\n\n background-color: #333;\n\n background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2)), linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2));\n\n background-image: -ms-linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2)), -ms-linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2));\n\n background-size: 4px 4px;\n background-position: 0 0, 2px 2px;\n}\n\n#tb_alert>div>div {\n background-color: #9c1408;\n background-image: linear-gradient(0deg, #dd0c0a 0%, #9c1408 100%);\n\n margin: -1px 0;\n\n font-family: MS Trebuchet;\n font-weight: bold;\n font-size: 60px;\n text-shadow: -1px -1px 2px rgba(0, 0, 0, 0.5);\n\n color: white;\n width: 65px;\n position: absolute;\n padding: 42px 0;\n text-align: center;\n left: -70px;\n top: 0;\n bottom: 0;\n border-top-left-radius: 5px;\n border-bottom-left-radius: 5px;\n\n border-bottom-color: transparent;\n border-left: none;\n border-right: none;\n}\n\n#tb_alert>div>div:after,\n#tb_alert>div>div:before {\n content: \" \";\n position: absolute;\n right: -24px;\n top: 40%;\n border: 12px solid transparent;\n border-left-color: #9c1408;\n}\n\n#tb_alert>div>div:before {\n border-left-color: #bc3428;\n top: 39%;\n}\n\n#tb_alert>div>h1 {\n font-size: 24px;\n padding-bottom: 5px;\n color: #aaa;\n font-weight: bold;\n position: relative;\n text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);\n margin: 0;\n}\n\n#tb_alert>div>p {\n margin: 0;\n text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);\n font-size: 14px;\n line-height: 1.3em;\n}\n\n#tb_alert>div>.continue-text {\n margin-top: 12px\n}\n\n#tb_alert>div a {\n color: #a7d8df;\n text-decoration: none;\n}\n\n#tb_alert>div>ul {\n margin-bottom: 0;\n}\n\n#tb_alert>div>h1::before {\n content: attr(data-text);\n position: absolute;\n left: 0;\n color: white;\n -webkit-mask-image: -webkit-gradient(\n linear,\n left top, left bottom,\n from(rgba(0, 0, 0, 1)),\n color-stop(60%, rgba(0, 0, 0, 0)),\n to(rgba(0, 0, 0, 0))\n );\n}\n\n#tb_alert button {\n position: absolute;\n right: 8px;\n top: 5px;\n background-color: #000;\n color: #666;\n border: none;\n font-size: 20px;\n /** Hack to bring it up to the proper line top */\n line-height: 14px;\n padding: 0;\n padding-bottom: 3px;\n cursor: pointer;\n}\n\n#tb_alert #section-mobile-browser,\n#tb_alert #section-supported-mobile-browser {\n width: 200px;\n top: 0px;\n left: 25%;\n margin-top: 0;\n margin-left: 0;\n}\n\n@media all and (max-height: 300px) {\n #tb_alert {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n margin-left: 0;\n margin-top: 0;\n }\n #tb_alert #section-mobile-browser,\n #tb_alert #section-supported-mobile-browser {\n margin-left: 0;\n margin-top: 10px;\n left: 0;\n }\n}\n\n#tb_alert #section-normal-install,\n#tb_alert #section-upgrade-install,\n#tb_alert #section-mobile-browser,\n#tb_alert #section-supported-mobile-browser {\n display: none;\n}\n", ""]);
  31866. /***/ }),
  31867. /* 312 */
  31868. /***/ (function(module, exports, __webpack_require__) {
  31869. "use strict";
  31870. /*
  31871. MIT License http://www.opensource.org/licenses/mit-license.php
  31872. Author Tobias Koppers @sokra
  31873. */
  31874. // css base code, injected by the css-loader
  31875. module.exports = function (useSourceMap) {
  31876. var list = []; // return the list of modules as css string
  31877. list.toString = function toString() {
  31878. return this.map(function (item) {
  31879. var content = cssWithMappingToString(item, useSourceMap);
  31880. if (item[2]) {
  31881. return '@media ' + item[2] + '{' + content + '}';
  31882. } else {
  31883. return content;
  31884. }
  31885. }).join('');
  31886. }; // import a list of modules into the list
  31887. list.i = function (modules, mediaQuery) {
  31888. if (typeof modules === 'string') {
  31889. modules = [[null, modules, '']];
  31890. }
  31891. var alreadyImportedModules = {};
  31892. for (var i = 0; i < this.length; i++) {
  31893. var id = this[i][0];
  31894. if (id != null) {
  31895. alreadyImportedModules[id] = true;
  31896. }
  31897. }
  31898. for (i = 0; i < modules.length; i++) {
  31899. var item = modules[i]; // skip already imported module
  31900. // this implementation is not 100% perfect for weird media query combinations
  31901. // when a module is imported multiple times with different media queries.
  31902. // I hope this will never occur (Hey this way we have smaller bundles)
  31903. if (item[0] == null || !alreadyImportedModules[item[0]]) {
  31904. if (mediaQuery && !item[2]) {
  31905. item[2] = mediaQuery;
  31906. } else if (mediaQuery) {
  31907. item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
  31908. }
  31909. list.push(item);
  31910. }
  31911. }
  31912. };
  31913. return list;
  31914. };
  31915. function cssWithMappingToString(item, useSourceMap) {
  31916. var content = item[1] || '';
  31917. var cssMapping = item[3];
  31918. if (!cssMapping) {
  31919. return content;
  31920. }
  31921. if (useSourceMap && typeof btoa === 'function') {
  31922. var sourceMapping = toComment(cssMapping);
  31923. var sourceURLs = cssMapping.sources.map(function (source) {
  31924. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
  31925. });
  31926. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  31927. }
  31928. return [content].join('\n');
  31929. } // Adapted from convert-source-map (MIT)
  31930. function toComment(sourceMap) {
  31931. // eslint-disable-next-line no-undef
  31932. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  31933. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  31934. return '/*# ' + data + ' */';
  31935. }
  31936. /***/ }),
  31937. /* 313 */
  31938. /***/ (function(module, exports, __webpack_require__) {
  31939. "use strict";
  31940. module.exports = function escape(url, needQuotes) {
  31941. if (typeof url !== 'string') {
  31942. return url;
  31943. } // If url is already wrapped in quotes, remove them
  31944. if (/^['"].*['"]$/.test(url)) {
  31945. url = url.slice(1, -1);
  31946. } // Should url be wrapped?
  31947. // See https://drafts.csswg.org/css-values-3/#urls
  31948. if (/["'() \t\n]/.test(url) || needQuotes) {
  31949. return '"' + url.replace(/"/g, '\\"').replace(/\n/g, '\\n') + '"';
  31950. }
  31951. return url;
  31952. };
  31953. /***/ }),
  31954. /* 314 */
  31955. /***/ (function(module, exports) {
  31956. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAcCAMAAAC02HQrAAAA1VBMVEUAAAD3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pn3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pn3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj39/j3+Pj3+Pn4+Pk/JRMlAAAAQ3RSTlMABAUHCQoLDhAQERwdHiAjLjAxOD9ASFBRVl1mbnZ6fH2LjI+QkaWqrrC1uLzAwcXJycrL1NXj5Ofo6u3w9fr7/P3+d4M3+QAAAQBJREFUGBlVwYdCglAABdCLlr5Unijm3hMUtBzlBLSr//9JgUToOQgVJgceJgU8aHgMeA38K50ZOpcQmTPwcyXn+JM8M3JJIqQypiIkeXelTyIkGZPwKS1NMia1lgKTVkaE3oQQGYsmHNqSMWnTgUFbMiZtGlD2dpaxrL1XgM0i4ZK8MeAmFhsAs29MGZniawagS63oMOQUNXYB5D0D1RMDpyoMLw/fiE2og/V+PVDR5AiBl0/2Uwik+vx4xV3a5G5Ye68Nd1czjUjZckm6VhmPciRzeCZICjwTJAViQq+3e+St167rAoHK8sLYZVkBYPCZAZ/eGa+2R5LH7Wrc0YFf/O9J3yBDFaoAAAAASUVORK5CYII="
  31957. /***/ }),
  31958. /* 315 */
  31959. /***/ (function(module, exports) {
  31960. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAdCAYAAABFRCf7AAADcElEQVRIiaWVXWhcRRTHf7NNd2aDtUKMIjTpg4ufFIuiUOmDEWm0Vi3VYhXRqIggQh4sWJFSig9+oOhTKSpIRUWMIBIr2kptoTbgU6ooxCiIjR+14kcJmf9sNceHnd3ebnc3Uv9wuXfOzPzmnDMz5zozGwdWAbc65w5RUJQ8cC2wDJgFJioh/MJCMrNxq2vOzK4HmIvRRemxKP0RJWt53o7S+d2Yzsx6gQ+AIUDAnUqpBLzXZd4RYFUlhB/bdZacc3PAOmAcCMC7wfvFwLNdoAPAyx09bXyYWRl4E7gDmAdGlNKFwLYu8GolhO9O87RJd64GbMrgEvB68P4osMWdXLtVV7czlooNpVRWSs8DO7NpR/B+3rBHsvetCgtCMTxwQCm9BbyQrc8F7/uBex3uRCeXO0PrUZ4NfKyUPgWeyj3bg/crDNsIRGwBaJQGorQ3Svdn2wHgc2BUKb0DPJHtjwfvbwRucc7tz+N+i9LFUdoXpfVN36I0CVwBTFI/q9e1LPxT8P4qYEdu70q12mYzWw1MYQzjeJF6zq+shHC4B7jklOBPP/TzSunh4P0DwKvAfb5c9krpe+CcwsEoZdbhEvBM9wxRAl5RShcA9wAngE3B+8tLpdLuwrhp4MNmK0pfRWkySr7NXS8+L5nZbWZWy/Vin1IaitJnUTqvwevJ71lgSSWEFKUfHG7Q2m/xqFJaGry/GXgfGPLl8mJgrXPur2JoUC8Qy3OpG+sAbGhEKT0ErAWOA6uBPWbW1wr9BOgFbgKezot0kAPYqJQA1gC/A9cA+82svzksSn1R+jNKX0SpnM/e1x3yqig92JhrZivM7FjO8bSZLSuCR/Ok16K0KMNHojQWpYko7Y7S1igN5PE3ROl4lNaZ2UVmNpPBU01orvZvZPCeKFXbBR+lEKVtUapFaSZKg9njqpl9aWYTrmXCImA7sCWb9lK/jj9TrwkrgA1AH3AQuKsSwkzbrLfxpgpsBtYDxf/R3xm2ExirhNCuHHZXTsmRwiat+S/zSt06eysVA/4pmGr/G3qm6ik28v29FKgCg8BS6pvS0KNRGgZ+Bb4FpsxsOkfUlMuwDcBWYOUZOHYM2AU8WQmhBifDv70O7PjX7KZ+4G7g3FM8zd6uBIaBy4AqxnIcZwFLCovPAhE4Sj38b4BDwEeVEFKD9S94Khjn486v3QAAAABJRU5ErkJggg=="
  31961. /***/ }),
  31962. /* 316 */
  31963. /***/ (function(module, exports) {
  31964. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAATCAYAAAB7u5a2AAABx0lEQVQ4jaWUv48NURiGn3ONmCs32ZBd28ht1gqyZAkF21ylQkEiSp2ehpDlD1BoFGqqVdJohYKI7MaPxMoVNghCWMF+7ybLUewnOXfcMWO9yeQ857zne8+XmZOBGjJpr0kvTIomvTZpS526UCO4DUwD64FjwCFgqZnnR+oc8LfgzKQ73vGsr42ZtGjSQFV9o8KfBCacZwCaef4YmAf2rzjcpN3A2WSpm/AssKcqPDNpDBjs410CViXzTwk/A7b1C4wxDgOngAsZcAXY2buDfp/6S4F3lDS8DjgBzDWAjX/Y/e/QgYS/AhsKHa+OMQ6GEJ4Cj4BOAxgq6aCowyZtdf4OtAr+FHDO+R4wWnVbihr3cQnICt4boO38GWj9a/icjwOACt4m4K3zEPA+AxaAtTWCnwN3lzHkEL8V/OPAGud9wK2GF9XR1Wae/1zG2AI+pGYI4VUIoRtjHAc2A9cz4LRPevYCZ+i9/4sJt4GXJU10gaPAzdI2TTro/5Tfz8XEe2LSZGmxq/SDNvP8BnA5WRrx4BwYBe6vONx1EnjovGvBLAAd4Adwuyq8UiaNmDTvr+a8SQ9MuvbfwckBHZPe+QEfTdpep+4XZmPBHiHgz74AAAAASUVORK5CYII="
  31965. /***/ }),
  31966. /* 317 */
  31967. /***/ (function(module, exports) {
  31968. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAUCAYAAACXtf2DAAACtklEQVQ4jZ2VSYiURxTHf+/T9Nc9iRrBuYySmIsXUU9iFMEFERRBvAjJLUQi5ioiHvSScfTmgqC4XAT1ZIgLuJHkICaaQAgKI2hAUBT30bjUq7bbv4eukXK029F3+eqtv/fqK6qQdEnSNUmT6CDB/bvgfjO4N9zj2RD8007xg1IABkwEzkma0qb4PGAPMBZYLtSD8eNwAEjqTlNI0gNJM4YU7w7ut4O7gvuhZFsR3C8NC5BBLiTIY0mzM8AvqbiC++pk+zLpE95XuwAws3vAQuBPYDRwWtL84P4tsDSLv5oaug4EYOawAMF9jMdoLxqNZcDvQA04UVYqL4G/svj7AF21mhJscrvCksYBFO7xc2AAGGg2mrdjvf4rcAyomNn+slLZmUEGBgsYdh945xZJmgvckDSrEJpK6ySBgV6q12O8ABwGPjGzfWWlsjdN9rpjoSfA+DYDXARGAksK4Is3XC1Ub4z1f4CDQGFmu6tleQSYk0U+p7WVeefLJc00s4fAeWB6Qeunvj0m2ugx9gO7kmlrtSxvBfcy6fXUZS6rgG/S+jLQUwCVNmMC9HqM14EtSe+rluWazN8YEv8IqKZ1E1qnaIDO0ucx3gX6kv6TpM3AM+D/IbGjgP60/gq4WQA33gMA2OQxPgHWJX1ttSwL4FAeZGYLgB2SasBs4A8L7qOBf9M0uXQB3a+TMYSmVctyDrA9mfcBK82smSdKWgCcAaa1bTm4fxbc/8uuCQX3RanAD5Ka6Wo5IGnE0HxJPZ03pQX5Org3MsD3AO5xXLPZXJ9BjkrqdFg6QjZkgG3Jtsw93pG0VFI9QU5K6voYQBHcTydAfwheBI9HgvvPAJIWS3qeIL9JGvUxkO7gfi1BrqTvwkG/pPmSnibIqTzXPgAyEVgBjAEu1qrVPbk/PVTHgb/NbPGg/RVIzOQqzSTBaQAAAABJRU5ErkJggg=="
  31969. /***/ }),
  31970. /* 318 */
  31971. /***/ (function(module, exports) {
  31972. module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yMCAtMjAgMjQwIDI0MCI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJhIiB4Mj0iMCIgeTI9IjEiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIwIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9wYWNpdHk9IjAiLz48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBpZD0iYiIgeDE9IjEiIHgyPSIwIiB5Mj0iMSI+PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9wYWNpdHk9IjAiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0eT0iLjA4Ii8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgaWQ9ImMiIHgxPSIxIiB4Mj0iMCIgeTE9IjEiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIuMDgiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0eT0iLjE2Ii8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgaWQ9ImQiIHgyPSIwIiB5MT0iMSI+PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9wYWNpdHk9Ii4xNiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIuMzMiLz48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBpZD0iZSIgeDI9IjEiIHkxPSIxIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0eT0iLjMzIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9wYWNpdHk9Ii42NiIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJmIiB4Mj0iMSIgeTI9IjEiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIuNjYiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmZmYiLz48L2xpbmVhckdyYWRpZW50PjxtYXNrIGlkPSJnIj48ZyBmaWxsPSJub25lIiBzdHJva2Utd2lkdGg9IjQwIj48cGF0aCBzdHJva2U9InVybCgjYSkiIGQ9Ik04Ni42LTUwYTEwMCAxMDAgMCAwMTAgMTAwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMDAgMTAwKSIvPjxwYXRoIHN0cm9rZT0idXJsKCNiKSIgZD0iTTg2LjYgNTBBMTAwIDEwMCAwIDAxMCAxMDAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMCAxMDApIi8+PHBhdGggc3Ryb2tlPSJ1cmwoI2MpIiBkPSJNMCAxMDBhMTAwIDEwMCAwIDAxLTg2LjYtNTAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMCAxMDApIi8+PHBhdGggc3Ryb2tlPSJ1cmwoI2QpIiBkPSJNLTg2LjYgNTBhMTAwIDEwMCAwIDAxMC0xMDAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMCAxMDApIi8+PHBhdGggc3Ryb2tlPSJ1cmwoI2UpIiBkPSJNLTg2LjYtNTBBMTAwIDEwMCAwIDAxMC0xMDAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMCAxMDApIi8+PHBhdGggc3Ryb2tlPSJ1cmwoI2YpIiBkPSJNMC0xMDBhMTAwIDEwMCAwIDAxODYuNiA1MCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAwIDEwMCkiLz48L2c+PC9tYXNrPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4PSItMjAiIHk9Ii0yMCIgbWFzaz0idXJsKCNnKSIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg=="
  31973. /***/ }),
  31974. /* 319 */
  31975. /***/ (function(module, exports) {
  31976. module.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDcxIDQ2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSIwIiB4Mj0iMCIgeTE9IjAiIHkyPSIxIj48c3RvcCBvZmZzZXQ9IjY2LjY2JSIgc3RvcC1jb2xvcj0iI2ZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIwIi8+PC9saW5lYXJHcmFkaWVudD48cGF0aCBmaWxsPSJ1cmwoI2EpIiBkPSJNNzkgMzA4YzE0LjI1LTYuNSA1NC4yNS0xOS43NSA3MS0yOSA5LTMuMjUgMjUtMjEgMjUtMjFzMy43NS0xMyAzLTIyYy0xLjc1LTYuNzUtMTUtNDMtMTUtNDMtMi41IDMtNC43NDEgMy4yNTktNyAxLTMuMjUtNy41LTIwLjUtNDQuNS0xNi01NyAxLjI1LTcuNSAxMC02IDEwLTYtMTEuMjUtMzMuNzUtOC02Ny04LTY3cy4wNzMtNy4zNDYgNi0xNWMtMy40OC42MzctOSA0LTkgNCAyLjU2My0xMS43MjcgMTUtMjEgMTUtMjEgLjE0OC0uMzEyLTEuMzIxLTEuNDU0LTEwIDEgMS41LTIuNzggMTYuNjc1LTguNjU0IDMwLTExIDMuNzg3LTkuMzYxIDEyLjc4Mi0xNy4zOTggMjItMjItMi4zNjUgMy4xMzMtMyA2LTMgNnMxNS42NDctOC4wODggNDEtNmMtMTkuNzUgMi0yNCA2LTI0IDZzNzQuNS0xMC43NSAxMDQgMzdjNy41IDkuNSAyNC43NSA1NS43NSAxMCA4OSAzLjc1LTEuNSA0LjUtNC41IDkgMSAuMjUgMTQuNzUtMTEuNSA2My0xOSA2Mi0yLjc1IDEtNC0zLTQtMy0xMC43NSAyOS41LTE0IDM4LTE0IDM4LTIgNC4yNS0zLjc1IDE4LjUtMSAyMiAxLjI1IDQuNSAyMyAyMyAyMyAyM2wxMjcgNTNjMzcgMzUgMjMgMTM1IDIzIDEzNUwwIDQ2NHMtMy05Ni43NSAxNC0xMjBjNS4yNS02LjI1IDIxLjc1LTE5Ljc1IDY1LTM2eiIvPjwvc3ZnPg=="
  31977. /***/ }),
  31978. /* 320 */
  31979. /***/ (function(module, exports) {
  31980. module.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNzkgODYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI2ZmZiI+PHBhdGggZD0iTTkuNzU3IDQwLjkyNGMzLjczOC01LjE5MSAxMi43MTEtNC4zMDggMTIuNzExLTQuMzA4IDIuMjIzIDMuMDE0IDUuMTI2IDI0LjU4NiAzLjYyNCAyOC43MTgtMS40MDEgMS4zMDEtMTEuNjExIDEuNjI5LTEzLjM4LTEuNDM2LTEuMjI2LTguODA0LTIuOTU1LTIyLjk3NS0yLjk1NS0yMi45NzV6bTU4Ljc4NSAwYy0zLjczNy01LjE5MS0xMi43MTEtNC4zMDgtMTIuNzExLTQuMzA4LTIuMjIzIDMuMDE0LTUuMTI2IDI0LjU4Ni0zLjYyNCAyOC43MTggMS40MDEgMS4zMDEgMTEuNjExIDEuNjI5IDEzLjM4LTEuNDM2IDEuMjI2LTguODA0IDIuOTU1LTIyLjk3NSAyLjk1NS0yMi45NzV6Ii8+PHBhdGggZD0iTTY4LjY0NyA1OC42Yy43MjktNC43NTMgMi4zOC05LjU2MSAyLjM4LTE0LjgwNCAwLTIxLjQxMi0xNC4xMTUtMzguNzctMzEuNTI4LTM4Ljc3LTE3LjQxMiAwLTMxLjUyNyAxNy4zNTgtMzEuNTI3IDM4Ljc3IDAgNC41NDEuNTE1IDguOTM2IDEuODAyIDEyLjk1IDEuNjk4IDUuMjk1LTUuNTQyIDYuOTkxLTYuNjE2IDIuMDczQzIuNDEgNTUuMzk0IDAgNTEuNzg3IDAgNDguMTAzIDAgMjEuNTM2IDE3LjY4NSAwIDM5LjUgMCA2MS4zMTYgMCA3OSAyMS41MzYgNzkgNDguMTAzYzAgLjcxOC0yLjg5OSA5LjY5My0zLjI5MiAxMS40MDgtLjc1NCAzLjI5My03Ljc1MSAzLjU4OS03LjA2MS0uOTEyeiIvPjxwYXRoIGQ9Ik01LjA4NCA1MS4zODVjLS44MDQtMy43ODIuNTY5LTcuMzM1IDMuMTM0LTcuOTIxIDIuNjM2LS42MDMgNS40ODUgMi4xNSA2LjI4OSA2LjEzMi43OTcgMy45NDgtLjc1MiA3LjQ1Ny0zLjM4OCA3Ljg1OS0yLjU2Ni4zOTEtNS4yMzctMi4zMTgtNi4wMzQtNi4wN3ptNjguODM0IDBjLjgwNC0zLjc4Mi0uNTY4LTcuMzM1LTMuMTMzLTcuOTIxLTIuNjM2LS42MDMtNS40ODUgMi4xNS02LjI4OSA2LjEzMi0uNzk3IDMuOTQ4Ljc1MiA3LjQ1NyAzLjM4OSA3Ljg1OSAyLjU2NS4zOTEgNS4yMzctMi4zMTggNi4wMzQtNi4wN3ptLTIuMDM4IDguMjg4Yy0uOTI2IDE5LjY1OS0xNS4xMTIgMjQuNzU5LTI1Ljg1OSAyMC40NzUtNS40MDUtLjYwNi0zLjAzNCAxLjI2Mi0zLjAzNCAxLjI2MiAxMy42NjEgMy41NjIgMjYuMTY4IDMuNDk3IDMxLjI3My0yMC41NDktLjU4NS00LjUxMS0yLjM3OS0xLjE4Ny0yLjM3OS0xLjE4N3oiLz48cGF0aCBkPSJNNDEuNjYyIDc4LjQyMmw3LjU1My41NWMxLjE5Mi4xMDcgMi4xMiAxLjE1MyAyLjA3MiAyLjMzNWwtLjEwOSAyLjczOGMtLjA0NyAxLjE4Mi0xLjA1MSAyLjA1NC0yLjI0MyAxLjk0NmwtNy41NTMtLjU1Yy0xLjE5MS0uMTA3LTIuMTE5LTEuMTUzLTIuMDcyLTIuMzM1bC4xMDktMi43MzdjLjA0Ny0xLjE4MiAxLjA1Mi0yLjA1NCAyLjI0My0xLjk0N3oiLz48L2c+PC9zdmc+"
  31981. /***/ }),
  31982. /* 321 */
  31983. /***/ (function(module, exports) {
  31984. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAAAoCAYAAABtla08AAAINUlEQVR42u2aaUxUVxTHcRBmAAEBRVTK4sKwDIsg+wCK7CqIw1CN1YobbbS2qYlJ06Qx1UpdqMbYWq2pSzWmH6ytNbXWJY1Lq7VuqBERtW64V0XFLYae0/xvcp3MMAMzDz6IyT/ge2ce5/7ucpY3Ts3NzZ1ygF57AJ0gO0G2jyZPmdbFyclJSAV1EeoEaUUSLGdSV5KLLFxzFmA7QVqGqDqjixhWkxCVeyRVl38wM6bwj6yYItYK47BAuu9B0gCqs6Ng2r494KQtkj/Dz2jHraw6qw2fdSE4rNmcCPCvZONP8iF1I6kdBdMaQJWZLeJqRWa2kPJAxXY+GxE+zxLI03GRh8lGSwoi9WCY8FWlCEh+8JOnT7MfPGjMuXX7Tt61hoaCi/9cKmKdv3BxeEtim/UbNpnbQiqF4MmT7kqrbr4lkMcTo46TTSpJB5g+8NHuVWnWuaampvhmO/7duHmrGluoO4C6OsJZGRrkDIld43ZqUOTnlkDSmXmabAoBU0vqBf+6KgFSxQ9++uzZ8rZApM81TJ8xM5me0Z/UF7PuBmdVdkGEb5gYDeQmyZNW3SJLIP9Kj64lGyMpmxRN6sOfIbkoAhKOdnv2/PmB1kB88eLFo+olyyrps3rSINIAzLonnqlqK8R9w+L86vtrt5L2nhug3Vc3ULu/Liz8AOuXESlZZONH6kmr7gtLIA9lRNeRzVukAvj3BslLnJNKgfScO69K+/Lly0ZbQW7e8tNK+pwBjqaSIjDrXgJkW1ciAZvbQjQ+RDahpBBKd5ZZsqN758hmImk4KQHnpDd8UwSkCyJarx07d4+3BeKJmlMHyX4qaRxpBCmNFE4KENvHDpAutVERn1kCVBMfeRRgYvZnx62wZPdnZkw92VQA5GClQXYRBze2S+iJmpPVVoJLA9l9QKokjcWKTCT1R5rhLg70NuSsziT16diIKkuAjibrTpJNDkn/e17CahtAjlAWJAYkb29Sb1LE9Rs391kILk8mVkyuIpuZcLKUlEmKkra1WuSTNuesEPzwoEploSVAh9Oiz+BIyd9dOHhtx4OEpFpVg6gbNK3yXX1j48N6U5Dz5i/gc/FDrMY3sTLiSMEkXxGxzUEUAGnbxlPaksMlHUXWAlHS8URCPseSohZbCSLjSSU7ixLXdzhIWVKq4Y7t2a/2bN0qGeKly1fYsVmk6RgIDz4J0bonyUOcjeYqm/8hRoYbWkigV2NH9CHAS60EkUkkw47hSRs6FqT1LR5AVcsrueXlK1d5AO+RpmBrZZEiefByytPCanRGNLZY0uF52gNDYr9sCRB8MHY0SJu2OJWKS2WQV65e4y31DmkCImEi0hBfufRime0RIhpbKen0/Ny9OYNW2ghyYytABjNIaxNuKttAWk6HPLn0k0FevdZwFinPWFIuKZbUV16NVko6jbWSDoPO3pOf8K0jQWLSQ0S9bdpkYck+m7vfWpAiHfKgBsZiGSSt0FqcTeU8WETqAHE2CgcAVd3Gkm4MD3xXYeI6B4NMItvKbcUpQ9gP+KMWnSsW+TaYJtoo+avBWLoKoK0CCSDud+7eXWQGZAXqV3YoQjQCfixJ8+fzj9ta3JHhlUeJ8wJOY2ws6eRKpPS3oqTvHAESEz9ya0naXL5WH6pt3FqSOhTHkTcKEXc6k1POh4Q9YJu/03TT4a8PoGMFI4i2EqSbOZAYaBkpCyD92RkG6KCSbjI/H0HEISBnlOZPFdcEzI2GTO4KBZICGKyAKLTEmJOB2txf5MbgohBINCl4FTqmpJMB2W+HiRn1Q2l6lXyPmiEP6VVE2TfGoaMYrHyPdtAnyI0jEOn9RLWmNEhvBBE7SjpFQZaShtLK+1S+T12lRwxUvrZlVPp8jE1PikeO7C/nyEqBDCB1t7+kUx4kKUWclea0yZC5BIGpiJSNSD9QgFR0RQKkL6KxHSWdsiARHJNYewoGrzG1/bk4dTPSunL2EyDjcbb7MQ+lQfZmkKiN7SjpFAM5CWAyGcwyY84YsZ1lUcbRNNtQMAdtQWGvQ0DyVjzYAKQfQFodeAeC1C8vzymXIZqD+ZEh/2OyLSalS/3VbnJZ+VqDXGjMrTCFuK4s66vVZUNfqaDolcbjOcb899sLpEE+I20GifywXe2QR3KElu99PzqjGufhREqB1pjCnG3IL3fY1v733r2FMsiGhutn0LAoJWWIGbPxjKwgjUbF0m52mPhigrpdXOecEq9pR6MkHbu2LOtrcZ9y3d0ODTb15y9MePz48aF79+8fvXnr9sljx2u2I7KNxDuaMPGVECoRs7mC4eT7SIruFNfNHK15MKuM2evwNq+4qjxvGnd5CHwNNynawW4cOlUZdG8b55IIJHmkItwrZHH6QxB3OSL9kTtAGpIvZiQB3Z4SKBfXQtEE9sashWAW87Bt3sYZNR6zn4uzJwWDKUKXfaKCdqUoBpLxSjYe9nqGiwWRBGipuGZ3Qm76itYLbbJI/PEhUApfw73uOIy9xfse3M9F9BuFJHcYrseSouGkHtCVtkuGTTikI8XgZzhg9SeF4VqcvSWiaSvNHQ8JwkNjIfEHemCmNLD1RaEfLs18mlgNuN6PFALHo7CyU5W2g00gFAQF4ozvibH04muwDbWraSFAyt/AAMzewgGR8uCeWn77xzBxPxgzPRCDDMZ14bQ/3jqGKGoHf2Hjgx3kw5LbaJDYWb52t9FMgw4AuWNWukNeuOYqOsmQi2jgws4PA/DD/z0B2x0/veCs4naw0cgybezid7X9jV3rX2RSs0wfLkll4pBGcgifg+NYxe1kJ2ycTaRq66uG/wBOl0vjcw70xwAAAABJRU5ErkJggg=="
  31985. /***/ }),
  31986. /* 322 */
  31987. /***/ (function(module, exports) {
  31988. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAAAoCAYAAABtla08AAAGMElEQVR4Ae2aA7D0yBaAc7oH12vbRmlLaxYWb23btm3btm2899a2bWuYtPZ01cmtU9lJrib315yqr9I3Oem/5/s7acwEnehEJzoxCcX2O+wEeIgRBDDaGjAZOgQ6ihRpLklHZDJIXK1WWymMIhGGkVBKCWMM+Iv/f/b5t7faYtM/sGgIS7j8RNLjceUVl41GvGN1BFiHy9sgtRWaYbhvuVQ6o1VOvV5/tLe3dyssKoZuh8xClkDEi2MMS6ZjR0cScxdK/+HgnJsmLccYOx0e/PUGUqfTJDEHkV5go9lcMQoj4R8RpSIRRUr4a9baTJFCCNfqESKJ7RYJibK0xoi05EhFRTxMi1Rit6xHAuLaKRLwEVi6q1x+EhlVpd3d3Wfh4VQkQhRhxthYLg7SRGqdLlIp7UVOHf+JhEhEMscUolVje3p63saeeOFoKsT7fjj++BNuw2I/0ouUENmGaQcQEilQvUU6xuWC0kqmVWCt8df6kG7WLoFA20VSCOyNh0RKPT+SyrTWtQsvuvTYCy84z3+oAdbgAiLGIvHjTz6bFuu/B3lKKfVkFKknwih6EnnipZdfXQZzepAupXSGSCfwUGZtkrx3t/0dSQGnnXbmdocdetArQoj+4VR23wMP3bj/vnv9Sv/rBmkish09ca655thHSrlWq4TFF1vkNDxsgjiUnPqZnHPABIq47jx7pPMcecShfz7x1DO7D6eit99576X1113nVd8rqLGAuDaNitJonTGIqHgQGQjDsJglMrUH5iDSEQbRa6y2yrNvv/PuWVmV/PTzLz8steTit1B9FtGJeZrJksmWdBzBMcami4xUkaY1A1Qe94WIaPGBApJhaERrLrXkElf8+NPPz6YMLs1DDjn0Wn9PnI/UiQadM4jNEkhzVsEGE8nIHESM1j5/KqRX+/IEiOQ/yifNBlEkpnb00cccesbpp13T3983H88/48xzrrvm6it/8U5JXgX5G6nSvSq1R5LATR7aYGkwMG1RSwkWABH+4jUb3vT/uJ1Z0xpjraTBRltrxUQhksIRmgTJyy69+Pv99tv3qYX6FxgU+fU33352xGEHf5wisU7nNWJpZRMkAjZ6aIN1mwV7h29Jo2wCHlveu/GV169z65E+T6koexCh6c+EEiky3lnxQKFjUeVyOeI5AOBzIiayRhJryd7YYnkIHgvB0qk9Tdql6N3XH4bRUIOIIIKJSiRb0hkSEpZKRd1CpEq8GxtIyCVmDSgFl94GacTgaJw1rUlYhYng0c4ewaUsmKRIJjpiqMSOCh9QeI+UYECmtQIsxEu6OorEcv6Rl0gu0woh8MhFkmSCTXVI4pC704WCFRJvSRNJSzrMMEZO2iKZTCHAZYnmvXCny7ed5vfZK3viHSBdIFCKEFj2+nt+73nw8m2uedcLJlktA++VNMEPaR45aYukcKnnCfY3/DFbZS8t7eHxNgsPM0N1hXhJJwwM1QbpoQFlog2R13a/zBxEYHAQEUYUM6qiVwEyBYoM6JFNF2kFLelI5KQf+fVI4dJFCguDS7oAyx2R6SFQJKRedSDj/cMg/RXQ6ZE05GSIDAaXdCi1I3L021SQWNJ1RLY5OiIdL4/yvuw8ADfWPFrSciaMyH8tEQPwf1uGG54g5+KlJGTmsrxsQdl5PKidnPFe2QS///7Hu+VS6WX/HYnf0sevGL7lXydwod2/9DykZq0s5yff0sgSWCigNOH7TPHL7ufj+/TH8P/+qYpL4HkBDiRYpEXeM8/89/9zzjn7EtY64dfd1nqccM7Bs8+9MKy8555/8TnKS+5MufH6EZVASkgPzf+mJXroet17JirU0ALST3nT0y5ONyLpeo1y64ih+vuQfsoTOeRFSJXa+SvyB90TUmdw49EjLaKpMQ0mzEeTzkWsd/oI6fzfiKM8gWg6X6OjpXstu5ZHnmIb0GFiu29MIUfUewkmVrEN3RqVQ/bY8FzNcquMBv/pCNUZ5pHHem01KdN/I/DG66/lLhKSvTO5M84kav5C5z2ZfyAivi9i9VGd45RH7UWJbjwGG/7NYsRECt7jiOToHedKAui8SW4CsxyRc54mKH/8f7ELhCCACyNcIl/wI+FaAJyc8yzRtinQPzWzuFZrFHq/AAAAAElFTkSuQmCC"
  31989. /***/ }),
  31990. /* 323 */
  31991. /***/ (function(module, exports) {
  31992. module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTUwIiBoZWlnaHQ9IjkwIj48ZGVmcz48cGF0aCBkPSJNNjcgMTJMNi40NDggNzIuNTUyIDAgMzFWMThMMjYgMGw0MSAxMnptMyA3bDYgNDctMjkgMTgtMzUuNTAyLTYuNDk4TDcwIDE5eiIgaWQ9ImEiLz48L2RlZnM+PHJlY3Qgd2lkdGg9IjE1MCIgaGVpZ2h0PSI5MCIgcng9IjM1IiByeT0iNDUiIG9wYWNpdHk9Ii41Ii8+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzNikiPjxtYXNrIGlkPSJiIiBmaWxsPSIjZmZmIj48dXNlIHhsaW5rOmhyZWY9IiNhIi8+PC9tYXNrPjxwYXRoIGQ9Ik0zOS4yNDkgNTEuMzEyYy42OTcgMTAuMzcgMi43ODUgMTcuODk3IDUuMjUxIDE3Ljg5NyAzLjAzOCAwIDUuNS0xMS40MTcgNS41LTI1LjVzLTIuNDYyLTI1LjUtNS41LTI1LjVjLTIuNTEgMC00LjYyOCA3Ljc5Ny01LjI4NyAxOC40NTNBOC45ODkgOC45ODkgMCAwMTQzIDQ0YTguOTg4IDguOTg4IDAgMDEtMy43NTEgNy4zMTJ6TTIwLjk4NSAzMi4yMjRsMTUuNzQ2LTE2Ljg3N2E3LjM4NSA3LjM4NSAwIDAxMTAuMzc0LS40MkM1MS43MDIgMTkuMTE0IDU0IDI5LjIwOCA1NCA0NS4yMDhjMCAxNC41MjctMi4zNDMgMjMuODgtNy4wMyAyOC4wNThhNy4yOCA3LjI4IDAgMDEtMTAuMTY4LS40NjhMMjAuNDA1IDU1LjIyNEgxMmE1IDUgMCAwMS01LTV2LTEzYTUgNSAwIDAxNS01aDguOTg1eiIgZmlsbD0iI0ZGRiIgbWFzaz0idXJsKCNiKSIvPjwvZz48cGF0aCBkPSJNMTA2LjUgMTMuNUw0NC45OTggNzUuMDAyIiBzdHJva2U9IiNGRkYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PC9nPjwvc3ZnPg=="
  31993. /***/ }),
  31994. /* 324 */
  31995. /***/ (function(module, exports) {
  31996. module.exports = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTciIGhlaWdodD0iOTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGQ9Ik03MCAxMkw5LjQ0OCA3Mi41NTIgMCA2MmwzLTQ0TDI5IDBsNDEgMTJ6bTggMmwxIDUyLTI5IDE4LTM1LjUwMi02LjQ5OEw3OCAxNHoiIGlkPSJhIi8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOCAzKSI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHBhdGggZD0iTTkuMTEgMjAuOTY4SDQ4LjFhNSA1IDAgMDE1IDVWNTguMThhNSA1IDAgMDEtNSA1SDkuMTFhNSA1IDAgMDEtNS01VjI1Ljk3YTUgNSAwIDAxNS01em00Ny4wOCAxMy4zOTRjMC0uMzQ1IDUuNDcyLTMuMTU5IDE2LjQxNS04LjQ0M2EzIDMgMCAwMTQuMzA0IDIuNzAydjI2LjgzNWEzIDMgMCAwMS00LjMwNSAyLjcwMWMtMTAuOTQyLTUuMjg2LTE2LjQxMy04LjEtMTYuNDEzLTguNDQ2VjM0LjM2MnoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48L2c+PHBhdGggZD0iTTgxLjUgMTYuNUwxOS45OTggNzguMDAyIiBzdHJva2U9IiNGRkYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PC9nPjwvc3ZnPg=="
  31997. /***/ }),
  31998. /* 325 */
  31999. /***/ (function(module, exports, __webpack_require__) {
  32000. /*
  32001. MIT License http://www.opensource.org/licenses/mit-license.php
  32002. Author Tobias Koppers @sokra
  32003. */
  32004. var stylesInDom = {};
  32005. var memoize = function (fn) {
  32006. var memo;
  32007. return function () {
  32008. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  32009. return memo;
  32010. };
  32011. };
  32012. var isOldIE = memoize(function () {
  32013. // Test for IE <= 9 as proposed by Browserhacks
  32014. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  32015. // Tests for existence of standard globals is to allow style-loader
  32016. // to operate correctly into non-standard environments
  32017. // @see https://github.com/webpack-contrib/style-loader/issues/177
  32018. return window && document && document.all && !window.atob;
  32019. });
  32020. var getTarget = function (target, parent) {
  32021. if (parent){
  32022. return parent.querySelector(target);
  32023. }
  32024. return document.querySelector(target);
  32025. };
  32026. var getElement = (function (fn) {
  32027. var memo = {};
  32028. return function(target, parent) {
  32029. // If passing function in options, then use it for resolve "head" element.
  32030. // Useful for Shadow Root style i.e
  32031. // {
  32032. // insertInto: function () { return document.querySelector("#foo").shadowRoot }
  32033. // }
  32034. if (typeof target === 'function') {
  32035. return target();
  32036. }
  32037. if (typeof memo[target] === "undefined") {
  32038. var styleTarget = getTarget.call(this, target, parent);
  32039. // Special case to return head of iframe instead of iframe itself
  32040. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  32041. try {
  32042. // This will throw an exception if access to iframe is blocked
  32043. // due to cross-origin restrictions
  32044. styleTarget = styleTarget.contentDocument.head;
  32045. } catch(e) {
  32046. styleTarget = null;
  32047. }
  32048. }
  32049. memo[target] = styleTarget;
  32050. }
  32051. return memo[target]
  32052. };
  32053. })();
  32054. var singleton = null;
  32055. var singletonCounter = 0;
  32056. var stylesInsertedAtTop = [];
  32057. var fixUrls = __webpack_require__(326);
  32058. module.exports = function(list, options) {
  32059. if (typeof DEBUG !== "undefined" && DEBUG) {
  32060. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  32061. }
  32062. options = options || {};
  32063. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  32064. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  32065. // tags it will allow on a page
  32066. if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
  32067. // By default, add <style> tags to the <head> element
  32068. if (!options.insertInto) options.insertInto = "head";
  32069. // By default, add <style> tags to the bottom of the target
  32070. if (!options.insertAt) options.insertAt = "bottom";
  32071. var styles = listToStyles(list, options);
  32072. addStylesToDom(styles, options);
  32073. return function update (newList) {
  32074. var mayRemove = [];
  32075. for (var i = 0; i < styles.length; i++) {
  32076. var item = styles[i];
  32077. var domStyle = stylesInDom[item.id];
  32078. domStyle.refs--;
  32079. mayRemove.push(domStyle);
  32080. }
  32081. if(newList) {
  32082. var newStyles = listToStyles(newList, options);
  32083. addStylesToDom(newStyles, options);
  32084. }
  32085. for (var i = 0; i < mayRemove.length; i++) {
  32086. var domStyle = mayRemove[i];
  32087. if(domStyle.refs === 0) {
  32088. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  32089. delete stylesInDom[domStyle.id];
  32090. }
  32091. }
  32092. };
  32093. };
  32094. function addStylesToDom (styles, options) {
  32095. for (var i = 0; i < styles.length; i++) {
  32096. var item = styles[i];
  32097. var domStyle = stylesInDom[item.id];
  32098. if(domStyle) {
  32099. domStyle.refs++;
  32100. for(var j = 0; j < domStyle.parts.length; j++) {
  32101. domStyle.parts[j](item.parts[j]);
  32102. }
  32103. for(; j < item.parts.length; j++) {
  32104. domStyle.parts.push(addStyle(item.parts[j], options));
  32105. }
  32106. } else {
  32107. var parts = [];
  32108. for(var j = 0; j < item.parts.length; j++) {
  32109. parts.push(addStyle(item.parts[j], options));
  32110. }
  32111. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  32112. }
  32113. }
  32114. }
  32115. function listToStyles (list, options) {
  32116. var styles = [];
  32117. var newStyles = {};
  32118. for (var i = 0; i < list.length; i++) {
  32119. var item = list[i];
  32120. var id = options.base ? item[0] + options.base : item[0];
  32121. var css = item[1];
  32122. var media = item[2];
  32123. var sourceMap = item[3];
  32124. var part = {css: css, media: media, sourceMap: sourceMap};
  32125. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  32126. else newStyles[id].parts.push(part);
  32127. }
  32128. return styles;
  32129. }
  32130. function insertStyleElement (options, style) {
  32131. var target = getElement(options.insertInto)
  32132. if (!target) {
  32133. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  32134. }
  32135. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  32136. if (options.insertAt === "top") {
  32137. if (!lastStyleElementInsertedAtTop) {
  32138. target.insertBefore(style, target.firstChild);
  32139. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  32140. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  32141. } else {
  32142. target.appendChild(style);
  32143. }
  32144. stylesInsertedAtTop.push(style);
  32145. } else if (options.insertAt === "bottom") {
  32146. target.appendChild(style);
  32147. } else if (typeof options.insertAt === "object" && options.insertAt.before) {
  32148. var nextSibling = getElement(options.insertAt.before, target);
  32149. target.insertBefore(style, nextSibling);
  32150. } else {
  32151. throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
  32152. }
  32153. }
  32154. function removeStyleElement (style) {
  32155. if (style.parentNode === null) return false;
  32156. style.parentNode.removeChild(style);
  32157. var idx = stylesInsertedAtTop.indexOf(style);
  32158. if(idx >= 0) {
  32159. stylesInsertedAtTop.splice(idx, 1);
  32160. }
  32161. }
  32162. function createStyleElement (options) {
  32163. var style = document.createElement("style");
  32164. if(options.attrs.type === undefined) {
  32165. options.attrs.type = "text/css";
  32166. }
  32167. if(options.attrs.nonce === undefined) {
  32168. var nonce = getNonce();
  32169. if (nonce) {
  32170. options.attrs.nonce = nonce;
  32171. }
  32172. }
  32173. addAttrs(style, options.attrs);
  32174. insertStyleElement(options, style);
  32175. return style;
  32176. }
  32177. function createLinkElement (options) {
  32178. var link = document.createElement("link");
  32179. if(options.attrs.type === undefined) {
  32180. options.attrs.type = "text/css";
  32181. }
  32182. options.attrs.rel = "stylesheet";
  32183. addAttrs(link, options.attrs);
  32184. insertStyleElement(options, link);
  32185. return link;
  32186. }
  32187. function addAttrs (el, attrs) {
  32188. Object.keys(attrs).forEach(function (key) {
  32189. el.setAttribute(key, attrs[key]);
  32190. });
  32191. }
  32192. function getNonce() {
  32193. if (false) {}
  32194. return __webpack_require__.nc;
  32195. }
  32196. function addStyle (obj, options) {
  32197. var style, update, remove, result;
  32198. // If a transform function was defined, run it on the css
  32199. if (options.transform && obj.css) {
  32200. result = typeof options.transform === 'function'
  32201. ? options.transform(obj.css)
  32202. : options.transform.default(obj.css);
  32203. if (result) {
  32204. // If transform returns a value, use that instead of the original css.
  32205. // This allows running runtime transformations on the css.
  32206. obj.css = result;
  32207. } else {
  32208. // If the transform function returns a falsy value, don't add this css.
  32209. // This allows conditional loading of css
  32210. return function() {
  32211. // noop
  32212. };
  32213. }
  32214. }
  32215. if (options.singleton) {
  32216. var styleIndex = singletonCounter++;
  32217. style = singleton || (singleton = createStyleElement(options));
  32218. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  32219. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  32220. } else if (
  32221. obj.sourceMap &&
  32222. typeof URL === "function" &&
  32223. typeof URL.createObjectURL === "function" &&
  32224. typeof URL.revokeObjectURL === "function" &&
  32225. typeof Blob === "function" &&
  32226. typeof btoa === "function"
  32227. ) {
  32228. style = createLinkElement(options);
  32229. update = updateLink.bind(null, style, options);
  32230. remove = function () {
  32231. removeStyleElement(style);
  32232. if(style.href) URL.revokeObjectURL(style.href);
  32233. };
  32234. } else {
  32235. style = createStyleElement(options);
  32236. update = applyToTag.bind(null, style);
  32237. remove = function () {
  32238. removeStyleElement(style);
  32239. };
  32240. }
  32241. update(obj);
  32242. return function updateStyle (newObj) {
  32243. if (newObj) {
  32244. if (
  32245. newObj.css === obj.css &&
  32246. newObj.media === obj.media &&
  32247. newObj.sourceMap === obj.sourceMap
  32248. ) {
  32249. return;
  32250. }
  32251. update(obj = newObj);
  32252. } else {
  32253. remove();
  32254. }
  32255. };
  32256. }
  32257. var replaceText = (function () {
  32258. var textStore = [];
  32259. return function (index, replacement) {
  32260. textStore[index] = replacement;
  32261. return textStore.filter(Boolean).join('\n');
  32262. };
  32263. })();
  32264. function applyToSingletonTag (style, index, remove, obj) {
  32265. var css = remove ? "" : obj.css;
  32266. if (style.styleSheet) {
  32267. style.styleSheet.cssText = replaceText(index, css);
  32268. } else {
  32269. var cssNode = document.createTextNode(css);
  32270. var childNodes = style.childNodes;
  32271. if (childNodes[index]) style.removeChild(childNodes[index]);
  32272. if (childNodes.length) {
  32273. style.insertBefore(cssNode, childNodes[index]);
  32274. } else {
  32275. style.appendChild(cssNode);
  32276. }
  32277. }
  32278. }
  32279. function applyToTag (style, obj) {
  32280. var css = obj.css;
  32281. var media = obj.media;
  32282. if(media) {
  32283. style.setAttribute("media", media)
  32284. }
  32285. if(style.styleSheet) {
  32286. style.styleSheet.cssText = css;
  32287. } else {
  32288. while(style.firstChild) {
  32289. style.removeChild(style.firstChild);
  32290. }
  32291. style.appendChild(document.createTextNode(css));
  32292. }
  32293. }
  32294. function updateLink (link, options, obj) {
  32295. var css = obj.css;
  32296. var sourceMap = obj.sourceMap;
  32297. /*
  32298. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  32299. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  32300. on by default. Otherwise default to the convertToAbsoluteUrls option
  32301. directly
  32302. */
  32303. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  32304. if (options.convertToAbsoluteUrls || autoFixUrls) {
  32305. css = fixUrls(css);
  32306. }
  32307. if (sourceMap) {
  32308. // http://stackoverflow.com/a/26603875
  32309. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  32310. }
  32311. var blob = new Blob([css], { type: "text/css" });
  32312. var oldSrc = link.href;
  32313. link.href = URL.createObjectURL(blob);
  32314. if(oldSrc) URL.revokeObjectURL(oldSrc);
  32315. }
  32316. /***/ }),
  32317. /* 326 */
  32318. /***/ (function(module, exports) {
  32319. /**
  32320. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  32321. * embed the css on the page. This breaks all relative urls because now they are relative to a
  32322. * bundle instead of the current page.
  32323. *
  32324. * One solution is to only use full urls, but that may be impossible.
  32325. *
  32326. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  32327. *
  32328. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  32329. *
  32330. */
  32331. module.exports = function (css) {
  32332. // get current location
  32333. var location = typeof window !== "undefined" && window.location;
  32334. if (!location) {
  32335. throw new Error("fixUrls requires window.location");
  32336. }
  32337. // blank or null?
  32338. if (!css || typeof css !== "string") {
  32339. return css;
  32340. }
  32341. var baseUrl = location.protocol + "//" + location.host;
  32342. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  32343. // convert each url(...)
  32344. /*
  32345. This regular expression is just a way to recursively match brackets within
  32346. a string.
  32347. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  32348. ( = Start a capturing group
  32349. (?: = Start a non-capturing group
  32350. [^)(] = Match anything that isn't a parentheses
  32351. | = OR
  32352. \( = Match a start parentheses
  32353. (?: = Start another non-capturing groups
  32354. [^)(]+ = Match anything that isn't a parentheses
  32355. | = OR
  32356. \( = Match a start parentheses
  32357. [^)(]* = Match anything that isn't a parentheses
  32358. \) = Match a end parentheses
  32359. ) = End Group
  32360. *\) = Match anything and then a close parens
  32361. ) = Close non-capturing group
  32362. * = Match anything
  32363. ) = Close capturing group
  32364. \) = Match a close parens
  32365. /gi = Get all matches, not the first. Be case insensitive.
  32366. */
  32367. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  32368. // strip quotes (if they exist)
  32369. var unquotedOrigUrl = origUrl
  32370. .trim()
  32371. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  32372. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  32373. // already a full url? no change
  32374. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
  32375. return fullMatch;
  32376. }
  32377. // convert the url to a full url
  32378. var newUrl;
  32379. if (unquotedOrigUrl.indexOf("//") === 0) {
  32380. //TODO: should we add protocol?
  32381. newUrl = unquotedOrigUrl;
  32382. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  32383. // path should be relative to the base url
  32384. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  32385. } else {
  32386. // path should be relative to current directory
  32387. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  32388. }
  32389. // send back the fixed url(...)
  32390. return "url(" + JSON.stringify(newUrl) + ")";
  32391. });
  32392. // send back the fixed css
  32393. return fixedCss;
  32394. };
  32395. /***/ }),
  32396. /* 327 */
  32397. /***/ (function(module, exports) {
  32398. /**
  32399. * Removes all key-value entries from the list cache.
  32400. *
  32401. * @private
  32402. * @name clear
  32403. * @memberOf ListCache
  32404. */
  32405. function listCacheClear() {
  32406. this.__data__ = [];
  32407. this.size = 0;
  32408. }
  32409. module.exports = listCacheClear;
  32410. /***/ }),
  32411. /* 328 */
  32412. /***/ (function(module, exports, __webpack_require__) {
  32413. var assocIndexOf = __webpack_require__(77);
  32414. /** Used for built-in method references. */
  32415. var arrayProto = Array.prototype;
  32416. /** Built-in value references. */
  32417. var splice = arrayProto.splice;
  32418. /**
  32419. * Removes `key` and its value from the list cache.
  32420. *
  32421. * @private
  32422. * @name delete
  32423. * @memberOf ListCache
  32424. * @param {string} key The key of the value to remove.
  32425. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  32426. */
  32427. function listCacheDelete(key) {
  32428. var data = this.__data__,
  32429. index = assocIndexOf(data, key);
  32430. if (index < 0) {
  32431. return false;
  32432. }
  32433. var lastIndex = data.length - 1;
  32434. if (index == lastIndex) {
  32435. data.pop();
  32436. } else {
  32437. splice.call(data, index, 1);
  32438. }
  32439. --this.size;
  32440. return true;
  32441. }
  32442. module.exports = listCacheDelete;
  32443. /***/ }),
  32444. /* 329 */
  32445. /***/ (function(module, exports, __webpack_require__) {
  32446. var assocIndexOf = __webpack_require__(77);
  32447. /**
  32448. * Gets the list cache value for `key`.
  32449. *
  32450. * @private
  32451. * @name get
  32452. * @memberOf ListCache
  32453. * @param {string} key The key of the value to get.
  32454. * @returns {*} Returns the entry value.
  32455. */
  32456. function listCacheGet(key) {
  32457. var data = this.__data__,
  32458. index = assocIndexOf(data, key);
  32459. return index < 0 ? undefined : data[index][1];
  32460. }
  32461. module.exports = listCacheGet;
  32462. /***/ }),
  32463. /* 330 */
  32464. /***/ (function(module, exports, __webpack_require__) {
  32465. var assocIndexOf = __webpack_require__(77);
  32466. /**
  32467. * Checks if a list cache value for `key` exists.
  32468. *
  32469. * @private
  32470. * @name has
  32471. * @memberOf ListCache
  32472. * @param {string} key The key of the entry to check.
  32473. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  32474. */
  32475. function listCacheHas(key) {
  32476. return assocIndexOf(this.__data__, key) > -1;
  32477. }
  32478. module.exports = listCacheHas;
  32479. /***/ }),
  32480. /* 331 */
  32481. /***/ (function(module, exports, __webpack_require__) {
  32482. var assocIndexOf = __webpack_require__(77);
  32483. /**
  32484. * Sets the list cache `key` to `value`.
  32485. *
  32486. * @private
  32487. * @name set
  32488. * @memberOf ListCache
  32489. * @param {string} key The key of the value to set.
  32490. * @param {*} value The value to set.
  32491. * @returns {Object} Returns the list cache instance.
  32492. */
  32493. function listCacheSet(key, value) {
  32494. var data = this.__data__,
  32495. index = assocIndexOf(data, key);
  32496. if (index < 0) {
  32497. ++this.size;
  32498. data.push([key, value]);
  32499. } else {
  32500. data[index][1] = value;
  32501. }
  32502. return this;
  32503. }
  32504. module.exports = listCacheSet;
  32505. /***/ }),
  32506. /* 332 */
  32507. /***/ (function(module, exports, __webpack_require__) {
  32508. var ListCache = __webpack_require__(76);
  32509. /**
  32510. * Removes all key-value entries from the stack.
  32511. *
  32512. * @private
  32513. * @name clear
  32514. * @memberOf Stack
  32515. */
  32516. function stackClear() {
  32517. this.__data__ = new ListCache;
  32518. this.size = 0;
  32519. }
  32520. module.exports = stackClear;
  32521. /***/ }),
  32522. /* 333 */
  32523. /***/ (function(module, exports) {
  32524. /**
  32525. * Removes `key` and its value from the stack.
  32526. *
  32527. * @private
  32528. * @name delete
  32529. * @memberOf Stack
  32530. * @param {string} key The key of the value to remove.
  32531. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  32532. */
  32533. function stackDelete(key) {
  32534. var data = this.__data__,
  32535. result = data['delete'](key);
  32536. this.size = data.size;
  32537. return result;
  32538. }
  32539. module.exports = stackDelete;
  32540. /***/ }),
  32541. /* 334 */
  32542. /***/ (function(module, exports) {
  32543. /**
  32544. * Gets the stack value for `key`.
  32545. *
  32546. * @private
  32547. * @name get
  32548. * @memberOf Stack
  32549. * @param {string} key The key of the value to get.
  32550. * @returns {*} Returns the entry value.
  32551. */
  32552. function stackGet(key) {
  32553. return this.__data__.get(key);
  32554. }
  32555. module.exports = stackGet;
  32556. /***/ }),
  32557. /* 335 */
  32558. /***/ (function(module, exports) {
  32559. /**
  32560. * Checks if a stack value for `key` exists.
  32561. *
  32562. * @private
  32563. * @name has
  32564. * @memberOf Stack
  32565. * @param {string} key The key of the entry to check.
  32566. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  32567. */
  32568. function stackHas(key) {
  32569. return this.__data__.has(key);
  32570. }
  32571. module.exports = stackHas;
  32572. /***/ }),
  32573. /* 336 */
  32574. /***/ (function(module, exports, __webpack_require__) {
  32575. var ListCache = __webpack_require__(76),
  32576. Map = __webpack_require__(106),
  32577. MapCache = __webpack_require__(107);
  32578. /** Used as the size to enable large array optimizations. */
  32579. var LARGE_ARRAY_SIZE = 200;
  32580. /**
  32581. * Sets the stack `key` to `value`.
  32582. *
  32583. * @private
  32584. * @name set
  32585. * @memberOf Stack
  32586. * @param {string} key The key of the value to set.
  32587. * @param {*} value The value to set.
  32588. * @returns {Object} Returns the stack cache instance.
  32589. */
  32590. function stackSet(key, value) {
  32591. var data = this.__data__;
  32592. if (data instanceof ListCache) {
  32593. var pairs = data.__data__;
  32594. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  32595. pairs.push([key, value]);
  32596. this.size = ++data.size;
  32597. return this;
  32598. }
  32599. data = this.__data__ = new MapCache(pairs);
  32600. }
  32601. data.set(key, value);
  32602. this.size = data.size;
  32603. return this;
  32604. }
  32605. module.exports = stackSet;
  32606. /***/ }),
  32607. /* 337 */
  32608. /***/ (function(module, exports, __webpack_require__) {
  32609. var isFunction = __webpack_require__(13),
  32610. isMasked = __webpack_require__(340),
  32611. isObject = __webpack_require__(7),
  32612. toSource = __webpack_require__(169);
  32613. /**
  32614. * Used to match `RegExp`
  32615. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  32616. */
  32617. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  32618. /** Used to detect host constructors (Safari). */
  32619. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  32620. /** Used for built-in method references. */
  32621. var funcProto = Function.prototype,
  32622. objectProto = Object.prototype;
  32623. /** Used to resolve the decompiled source of functions. */
  32624. var funcToString = funcProto.toString;
  32625. /** Used to check objects for own properties. */
  32626. var hasOwnProperty = objectProto.hasOwnProperty;
  32627. /** Used to detect if a method is native. */
  32628. var reIsNative = RegExp('^' +
  32629. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  32630. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  32631. );
  32632. /**
  32633. * The base implementation of `_.isNative` without bad shim checks.
  32634. *
  32635. * @private
  32636. * @param {*} value The value to check.
  32637. * @returns {boolean} Returns `true` if `value` is a native function,
  32638. * else `false`.
  32639. */
  32640. function baseIsNative(value) {
  32641. if (!isObject(value) || isMasked(value)) {
  32642. return false;
  32643. }
  32644. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  32645. return pattern.test(toSource(value));
  32646. }
  32647. module.exports = baseIsNative;
  32648. /***/ }),
  32649. /* 338 */
  32650. /***/ (function(module, exports, __webpack_require__) {
  32651. var Symbol = __webpack_require__(37);
  32652. /** Used for built-in method references. */
  32653. var objectProto = Object.prototype;
  32654. /** Used to check objects for own properties. */
  32655. var hasOwnProperty = objectProto.hasOwnProperty;
  32656. /**
  32657. * Used to resolve the
  32658. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  32659. * of values.
  32660. */
  32661. var nativeObjectToString = objectProto.toString;
  32662. /** Built-in value references. */
  32663. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  32664. /**
  32665. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  32666. *
  32667. * @private
  32668. * @param {*} value The value to query.
  32669. * @returns {string} Returns the raw `toStringTag`.
  32670. */
  32671. function getRawTag(value) {
  32672. var isOwn = hasOwnProperty.call(value, symToStringTag),
  32673. tag = value[symToStringTag];
  32674. try {
  32675. value[symToStringTag] = undefined;
  32676. var unmasked = true;
  32677. } catch (e) {}
  32678. var result = nativeObjectToString.call(value);
  32679. if (unmasked) {
  32680. if (isOwn) {
  32681. value[symToStringTag] = tag;
  32682. } else {
  32683. delete value[symToStringTag];
  32684. }
  32685. }
  32686. return result;
  32687. }
  32688. module.exports = getRawTag;
  32689. /***/ }),
  32690. /* 339 */
  32691. /***/ (function(module, exports) {
  32692. /** Used for built-in method references. */
  32693. var objectProto = Object.prototype;
  32694. /**
  32695. * Used to resolve the
  32696. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  32697. * of values.
  32698. */
  32699. var nativeObjectToString = objectProto.toString;
  32700. /**
  32701. * Converts `value` to a string using `Object.prototype.toString`.
  32702. *
  32703. * @private
  32704. * @param {*} value The value to convert.
  32705. * @returns {string} Returns the converted string.
  32706. */
  32707. function objectToString(value) {
  32708. return nativeObjectToString.call(value);
  32709. }
  32710. module.exports = objectToString;
  32711. /***/ }),
  32712. /* 340 */
  32713. /***/ (function(module, exports, __webpack_require__) {
  32714. var coreJsData = __webpack_require__(341);
  32715. /** Used to detect methods masquerading as native. */
  32716. var maskSrcKey = (function() {
  32717. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  32718. return uid ? ('Symbol(src)_1.' + uid) : '';
  32719. }());
  32720. /**
  32721. * Checks if `func` has its source masked.
  32722. *
  32723. * @private
  32724. * @param {Function} func The function to check.
  32725. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  32726. */
  32727. function isMasked(func) {
  32728. return !!maskSrcKey && (maskSrcKey in func);
  32729. }
  32730. module.exports = isMasked;
  32731. /***/ }),
  32732. /* 341 */
  32733. /***/ (function(module, exports, __webpack_require__) {
  32734. var root = __webpack_require__(10);
  32735. /** Used to detect overreaching core-js shims. */
  32736. var coreJsData = root['__core-js_shared__'];
  32737. module.exports = coreJsData;
  32738. /***/ }),
  32739. /* 342 */
  32740. /***/ (function(module, exports) {
  32741. /**
  32742. * Gets the value at `key` of `object`.
  32743. *
  32744. * @private
  32745. * @param {Object} [object] The object to query.
  32746. * @param {string} key The key of the property to get.
  32747. * @returns {*} Returns the property value.
  32748. */
  32749. function getValue(object, key) {
  32750. return object == null ? undefined : object[key];
  32751. }
  32752. module.exports = getValue;
  32753. /***/ }),
  32754. /* 343 */
  32755. /***/ (function(module, exports, __webpack_require__) {
  32756. var Hash = __webpack_require__(344),
  32757. ListCache = __webpack_require__(76),
  32758. Map = __webpack_require__(106);
  32759. /**
  32760. * Removes all key-value entries from the map.
  32761. *
  32762. * @private
  32763. * @name clear
  32764. * @memberOf MapCache
  32765. */
  32766. function mapCacheClear() {
  32767. this.size = 0;
  32768. this.__data__ = {
  32769. 'hash': new Hash,
  32770. 'map': new (Map || ListCache),
  32771. 'string': new Hash
  32772. };
  32773. }
  32774. module.exports = mapCacheClear;
  32775. /***/ }),
  32776. /* 344 */
  32777. /***/ (function(module, exports, __webpack_require__) {
  32778. var hashClear = __webpack_require__(345),
  32779. hashDelete = __webpack_require__(346),
  32780. hashGet = __webpack_require__(347),
  32781. hashHas = __webpack_require__(348),
  32782. hashSet = __webpack_require__(349);
  32783. /**
  32784. * Creates a hash object.
  32785. *
  32786. * @private
  32787. * @constructor
  32788. * @param {Array} [entries] The key-value pairs to cache.
  32789. */
  32790. function Hash(entries) {
  32791. var index = -1,
  32792. length = entries == null ? 0 : entries.length;
  32793. this.clear();
  32794. while (++index < length) {
  32795. var entry = entries[index];
  32796. this.set(entry[0], entry[1]);
  32797. }
  32798. }
  32799. // Add methods to `Hash`.
  32800. Hash.prototype.clear = hashClear;
  32801. Hash.prototype['delete'] = hashDelete;
  32802. Hash.prototype.get = hashGet;
  32803. Hash.prototype.has = hashHas;
  32804. Hash.prototype.set = hashSet;
  32805. module.exports = Hash;
  32806. /***/ }),
  32807. /* 345 */
  32808. /***/ (function(module, exports, __webpack_require__) {
  32809. var nativeCreate = __webpack_require__(78);
  32810. /**
  32811. * Removes all key-value entries from the hash.
  32812. *
  32813. * @private
  32814. * @name clear
  32815. * @memberOf Hash
  32816. */
  32817. function hashClear() {
  32818. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  32819. this.size = 0;
  32820. }
  32821. module.exports = hashClear;
  32822. /***/ }),
  32823. /* 346 */
  32824. /***/ (function(module, exports) {
  32825. /**
  32826. * Removes `key` and its value from the hash.
  32827. *
  32828. * @private
  32829. * @name delete
  32830. * @memberOf Hash
  32831. * @param {Object} hash The hash to modify.
  32832. * @param {string} key The key of the value to remove.
  32833. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  32834. */
  32835. function hashDelete(key) {
  32836. var result = this.has(key) && delete this.__data__[key];
  32837. this.size -= result ? 1 : 0;
  32838. return result;
  32839. }
  32840. module.exports = hashDelete;
  32841. /***/ }),
  32842. /* 347 */
  32843. /***/ (function(module, exports, __webpack_require__) {
  32844. var nativeCreate = __webpack_require__(78);
  32845. /** Used to stand-in for `undefined` hash values. */
  32846. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  32847. /** Used for built-in method references. */
  32848. var objectProto = Object.prototype;
  32849. /** Used to check objects for own properties. */
  32850. var hasOwnProperty = objectProto.hasOwnProperty;
  32851. /**
  32852. * Gets the hash value for `key`.
  32853. *
  32854. * @private
  32855. * @name get
  32856. * @memberOf Hash
  32857. * @param {string} key The key of the value to get.
  32858. * @returns {*} Returns the entry value.
  32859. */
  32860. function hashGet(key) {
  32861. var data = this.__data__;
  32862. if (nativeCreate) {
  32863. var result = data[key];
  32864. return result === HASH_UNDEFINED ? undefined : result;
  32865. }
  32866. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  32867. }
  32868. module.exports = hashGet;
  32869. /***/ }),
  32870. /* 348 */
  32871. /***/ (function(module, exports, __webpack_require__) {
  32872. var nativeCreate = __webpack_require__(78);
  32873. /** Used for built-in method references. */
  32874. var objectProto = Object.prototype;
  32875. /** Used to check objects for own properties. */
  32876. var hasOwnProperty = objectProto.hasOwnProperty;
  32877. /**
  32878. * Checks if a hash value for `key` exists.
  32879. *
  32880. * @private
  32881. * @name has
  32882. * @memberOf Hash
  32883. * @param {string} key The key of the entry to check.
  32884. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  32885. */
  32886. function hashHas(key) {
  32887. var data = this.__data__;
  32888. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  32889. }
  32890. module.exports = hashHas;
  32891. /***/ }),
  32892. /* 349 */
  32893. /***/ (function(module, exports, __webpack_require__) {
  32894. var nativeCreate = __webpack_require__(78);
  32895. /** Used to stand-in for `undefined` hash values. */
  32896. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  32897. /**
  32898. * Sets the hash `key` to `value`.
  32899. *
  32900. * @private
  32901. * @name set
  32902. * @memberOf Hash
  32903. * @param {string} key The key of the value to set.
  32904. * @param {*} value The value to set.
  32905. * @returns {Object} Returns the hash instance.
  32906. */
  32907. function hashSet(key, value) {
  32908. var data = this.__data__;
  32909. this.size += this.has(key) ? 0 : 1;
  32910. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  32911. return this;
  32912. }
  32913. module.exports = hashSet;
  32914. /***/ }),
  32915. /* 350 */
  32916. /***/ (function(module, exports, __webpack_require__) {
  32917. var getMapData = __webpack_require__(79);
  32918. /**
  32919. * Removes `key` and its value from the map.
  32920. *
  32921. * @private
  32922. * @name delete
  32923. * @memberOf MapCache
  32924. * @param {string} key The key of the value to remove.
  32925. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  32926. */
  32927. function mapCacheDelete(key) {
  32928. var result = getMapData(this, key)['delete'](key);
  32929. this.size -= result ? 1 : 0;
  32930. return result;
  32931. }
  32932. module.exports = mapCacheDelete;
  32933. /***/ }),
  32934. /* 351 */
  32935. /***/ (function(module, exports) {
  32936. /**
  32937. * Checks if `value` is suitable for use as unique object key.
  32938. *
  32939. * @private
  32940. * @param {*} value The value to check.
  32941. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  32942. */
  32943. function isKeyable(value) {
  32944. var type = typeof value;
  32945. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  32946. ? (value !== '__proto__')
  32947. : (value === null);
  32948. }
  32949. module.exports = isKeyable;
  32950. /***/ }),
  32951. /* 352 */
  32952. /***/ (function(module, exports, __webpack_require__) {
  32953. var getMapData = __webpack_require__(79);
  32954. /**
  32955. * Gets the map value for `key`.
  32956. *
  32957. * @private
  32958. * @name get
  32959. * @memberOf MapCache
  32960. * @param {string} key The key of the value to get.
  32961. * @returns {*} Returns the entry value.
  32962. */
  32963. function mapCacheGet(key) {
  32964. return getMapData(this, key).get(key);
  32965. }
  32966. module.exports = mapCacheGet;
  32967. /***/ }),
  32968. /* 353 */
  32969. /***/ (function(module, exports, __webpack_require__) {
  32970. var getMapData = __webpack_require__(79);
  32971. /**
  32972. * Checks if a map value for `key` exists.
  32973. *
  32974. * @private
  32975. * @name has
  32976. * @memberOf MapCache
  32977. * @param {string} key The key of the entry to check.
  32978. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  32979. */
  32980. function mapCacheHas(key) {
  32981. return getMapData(this, key).has(key);
  32982. }
  32983. module.exports = mapCacheHas;
  32984. /***/ }),
  32985. /* 354 */
  32986. /***/ (function(module, exports, __webpack_require__) {
  32987. var getMapData = __webpack_require__(79);
  32988. /**
  32989. * Sets the map `key` to `value`.
  32990. *
  32991. * @private
  32992. * @name set
  32993. * @memberOf MapCache
  32994. * @param {string} key The key of the value to set.
  32995. * @param {*} value The value to set.
  32996. * @returns {Object} Returns the map cache instance.
  32997. */
  32998. function mapCacheSet(key, value) {
  32999. var data = getMapData(this, key),
  33000. size = data.size;
  33001. data.set(key, value);
  33002. this.size += data.size == size ? 0 : 1;
  33003. return this;
  33004. }
  33005. module.exports = mapCacheSet;
  33006. /***/ }),
  33007. /* 355 */
  33008. /***/ (function(module, exports) {
  33009. /**
  33010. * The base implementation of `_.times` without support for iteratee shorthands
  33011. * or max array length checks.
  33012. *
  33013. * @private
  33014. * @param {number} n The number of times to invoke `iteratee`.
  33015. * @param {Function} iteratee The function invoked per iteration.
  33016. * @returns {Array} Returns the array of results.
  33017. */
  33018. function baseTimes(n, iteratee) {
  33019. var index = -1,
  33020. result = Array(n);
  33021. while (++index < n) {
  33022. result[index] = iteratee(index);
  33023. }
  33024. return result;
  33025. }
  33026. module.exports = baseTimes;
  33027. /***/ }),
  33028. /* 356 */
  33029. /***/ (function(module, exports, __webpack_require__) {
  33030. var baseGetTag = __webpack_require__(26),
  33031. isObjectLike = __webpack_require__(14);
  33032. /** `Object#toString` result references. */
  33033. var argsTag = '[object Arguments]';
  33034. /**
  33035. * The base implementation of `_.isArguments`.
  33036. *
  33037. * @private
  33038. * @param {*} value The value to check.
  33039. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  33040. */
  33041. function baseIsArguments(value) {
  33042. return isObjectLike(value) && baseGetTag(value) == argsTag;
  33043. }
  33044. module.exports = baseIsArguments;
  33045. /***/ }),
  33046. /* 357 */
  33047. /***/ (function(module, exports) {
  33048. /**
  33049. * This method returns `false`.
  33050. *
  33051. * @static
  33052. * @memberOf _
  33053. * @since 4.13.0
  33054. * @category Util
  33055. * @returns {boolean} Returns `false`.
  33056. * @example
  33057. *
  33058. * _.times(2, _.stubFalse);
  33059. * // => [false, false]
  33060. */
  33061. function stubFalse() {
  33062. return false;
  33063. }
  33064. module.exports = stubFalse;
  33065. /***/ }),
  33066. /* 358 */
  33067. /***/ (function(module, exports, __webpack_require__) {
  33068. var baseGetTag = __webpack_require__(26),
  33069. isLength = __webpack_require__(109),
  33070. isObjectLike = __webpack_require__(14);
  33071. /** `Object#toString` result references. */
  33072. var argsTag = '[object Arguments]',
  33073. arrayTag = '[object Array]',
  33074. boolTag = '[object Boolean]',
  33075. dateTag = '[object Date]',
  33076. errorTag = '[object Error]',
  33077. funcTag = '[object Function]',
  33078. mapTag = '[object Map]',
  33079. numberTag = '[object Number]',
  33080. objectTag = '[object Object]',
  33081. regexpTag = '[object RegExp]',
  33082. setTag = '[object Set]',
  33083. stringTag = '[object String]',
  33084. weakMapTag = '[object WeakMap]';
  33085. var arrayBufferTag = '[object ArrayBuffer]',
  33086. dataViewTag = '[object DataView]',
  33087. float32Tag = '[object Float32Array]',
  33088. float64Tag = '[object Float64Array]',
  33089. int8Tag = '[object Int8Array]',
  33090. int16Tag = '[object Int16Array]',
  33091. int32Tag = '[object Int32Array]',
  33092. uint8Tag = '[object Uint8Array]',
  33093. uint8ClampedTag = '[object Uint8ClampedArray]',
  33094. uint16Tag = '[object Uint16Array]',
  33095. uint32Tag = '[object Uint32Array]';
  33096. /** Used to identify `toStringTag` values of typed arrays. */
  33097. var typedArrayTags = {};
  33098. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  33099. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  33100. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  33101. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  33102. typedArrayTags[uint32Tag] = true;
  33103. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  33104. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  33105. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  33106. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  33107. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  33108. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  33109. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  33110. typedArrayTags[weakMapTag] = false;
  33111. /**
  33112. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  33113. *
  33114. * @private
  33115. * @param {*} value The value to check.
  33116. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  33117. */
  33118. function baseIsTypedArray(value) {
  33119. return isObjectLike(value) &&
  33120. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  33121. }
  33122. module.exports = baseIsTypedArray;
  33123. /***/ }),
  33124. /* 359 */
  33125. /***/ (function(module, exports, __webpack_require__) {
  33126. var overArg = __webpack_require__(173);
  33127. /* Built-in method references for those with the same name as other `lodash` methods. */
  33128. var nativeKeys = overArg(Object.keys, Object);
  33129. module.exports = nativeKeys;
  33130. /***/ }),
  33131. /* 360 */
  33132. /***/ (function(module, exports, __webpack_require__) {
  33133. var copyObject = __webpack_require__(38),
  33134. keysIn = __webpack_require__(66);
  33135. /**
  33136. * The base implementation of `_.assignIn` without support for multiple sources
  33137. * or `customizer` functions.
  33138. *
  33139. * @private
  33140. * @param {Object} object The destination object.
  33141. * @param {Object} source The source object.
  33142. * @returns {Object} Returns `object`.
  33143. */
  33144. function baseAssignIn(object, source) {
  33145. return object && copyObject(source, keysIn(source), object);
  33146. }
  33147. module.exports = baseAssignIn;
  33148. /***/ }),
  33149. /* 361 */
  33150. /***/ (function(module, exports, __webpack_require__) {
  33151. var isObject = __webpack_require__(7),
  33152. isPrototype = __webpack_require__(65),
  33153. nativeKeysIn = __webpack_require__(362);
  33154. /** Used for built-in method references. */
  33155. var objectProto = Object.prototype;
  33156. /** Used to check objects for own properties. */
  33157. var hasOwnProperty = objectProto.hasOwnProperty;
  33158. /**
  33159. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  33160. *
  33161. * @private
  33162. * @param {Object} object The object to query.
  33163. * @returns {Array} Returns the array of property names.
  33164. */
  33165. function baseKeysIn(object) {
  33166. if (!isObject(object)) {
  33167. return nativeKeysIn(object);
  33168. }
  33169. var isProto = isPrototype(object),
  33170. result = [];
  33171. for (var key in object) {
  33172. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  33173. result.push(key);
  33174. }
  33175. }
  33176. return result;
  33177. }
  33178. module.exports = baseKeysIn;
  33179. /***/ }),
  33180. /* 362 */
  33181. /***/ (function(module, exports) {
  33182. /**
  33183. * This function is like
  33184. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  33185. * except that it includes inherited enumerable properties.
  33186. *
  33187. * @private
  33188. * @param {Object} object The object to query.
  33189. * @returns {Array} Returns the array of property names.
  33190. */
  33191. function nativeKeysIn(object) {
  33192. var result = [];
  33193. if (object != null) {
  33194. for (var key in Object(object)) {
  33195. result.push(key);
  33196. }
  33197. }
  33198. return result;
  33199. }
  33200. module.exports = nativeKeysIn;
  33201. /***/ }),
  33202. /* 363 */
  33203. /***/ (function(module, exports, __webpack_require__) {
  33204. var copyObject = __webpack_require__(38),
  33205. getSymbols = __webpack_require__(112);
  33206. /**
  33207. * Copies own symbols of `source` to `object`.
  33208. *
  33209. * @private
  33210. * @param {Object} source The object to copy symbols from.
  33211. * @param {Object} [object={}] The object to copy symbols to.
  33212. * @returns {Object} Returns `object`.
  33213. */
  33214. function copySymbols(source, object) {
  33215. return copyObject(source, getSymbols(source), object);
  33216. }
  33217. module.exports = copySymbols;
  33218. /***/ }),
  33219. /* 364 */
  33220. /***/ (function(module, exports) {
  33221. /**
  33222. * A specialized version of `_.filter` for arrays without support for
  33223. * iteratee shorthands.
  33224. *
  33225. * @private
  33226. * @param {Array} [array] The array to iterate over.
  33227. * @param {Function} predicate The function invoked per iteration.
  33228. * @returns {Array} Returns the new filtered array.
  33229. */
  33230. function arrayFilter(array, predicate) {
  33231. var index = -1,
  33232. length = array == null ? 0 : array.length,
  33233. resIndex = 0,
  33234. result = [];
  33235. while (++index < length) {
  33236. var value = array[index];
  33237. if (predicate(value, index, array)) {
  33238. result[resIndex++] = value;
  33239. }
  33240. }
  33241. return result;
  33242. }
  33243. module.exports = arrayFilter;
  33244. /***/ }),
  33245. /* 365 */
  33246. /***/ (function(module, exports, __webpack_require__) {
  33247. var copyObject = __webpack_require__(38),
  33248. getSymbolsIn = __webpack_require__(176);
  33249. /**
  33250. * Copies own and inherited symbols of `source` to `object`.
  33251. *
  33252. * @private
  33253. * @param {Object} source The object to copy symbols from.
  33254. * @param {Object} [object={}] The object to copy symbols to.
  33255. * @returns {Object} Returns `object`.
  33256. */
  33257. function copySymbolsIn(source, object) {
  33258. return copyObject(source, getSymbolsIn(source), object);
  33259. }
  33260. module.exports = copySymbolsIn;
  33261. /***/ }),
  33262. /* 366 */
  33263. /***/ (function(module, exports, __webpack_require__) {
  33264. var getNative = __webpack_require__(36),
  33265. root = __webpack_require__(10);
  33266. /* Built-in method references that are verified to be native. */
  33267. var DataView = getNative(root, 'DataView');
  33268. module.exports = DataView;
  33269. /***/ }),
  33270. /* 367 */
  33271. /***/ (function(module, exports, __webpack_require__) {
  33272. var getNative = __webpack_require__(36),
  33273. root = __webpack_require__(10);
  33274. /* Built-in method references that are verified to be native. */
  33275. var Promise = getNative(root, 'Promise');
  33276. module.exports = Promise;
  33277. /***/ }),
  33278. /* 368 */
  33279. /***/ (function(module, exports) {
  33280. /** Used for built-in method references. */
  33281. var objectProto = Object.prototype;
  33282. /** Used to check objects for own properties. */
  33283. var hasOwnProperty = objectProto.hasOwnProperty;
  33284. /**
  33285. * Initializes an array clone.
  33286. *
  33287. * @private
  33288. * @param {Array} array The array to clone.
  33289. * @returns {Array} Returns the initialized clone.
  33290. */
  33291. function initCloneArray(array) {
  33292. var length = array.length,
  33293. result = new array.constructor(length);
  33294. // Add properties assigned by `RegExp#exec`.
  33295. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  33296. result.index = array.index;
  33297. result.input = array.input;
  33298. }
  33299. return result;
  33300. }
  33301. module.exports = initCloneArray;
  33302. /***/ }),
  33303. /* 369 */
  33304. /***/ (function(module, exports, __webpack_require__) {
  33305. var cloneArrayBuffer = __webpack_require__(115),
  33306. cloneDataView = __webpack_require__(370),
  33307. cloneRegExp = __webpack_require__(371),
  33308. cloneSymbol = __webpack_require__(372),
  33309. cloneTypedArray = __webpack_require__(183);
  33310. /** `Object#toString` result references. */
  33311. var boolTag = '[object Boolean]',
  33312. dateTag = '[object Date]',
  33313. mapTag = '[object Map]',
  33314. numberTag = '[object Number]',
  33315. regexpTag = '[object RegExp]',
  33316. setTag = '[object Set]',
  33317. stringTag = '[object String]',
  33318. symbolTag = '[object Symbol]';
  33319. var arrayBufferTag = '[object ArrayBuffer]',
  33320. dataViewTag = '[object DataView]',
  33321. float32Tag = '[object Float32Array]',
  33322. float64Tag = '[object Float64Array]',
  33323. int8Tag = '[object Int8Array]',
  33324. int16Tag = '[object Int16Array]',
  33325. int32Tag = '[object Int32Array]',
  33326. uint8Tag = '[object Uint8Array]',
  33327. uint8ClampedTag = '[object Uint8ClampedArray]',
  33328. uint16Tag = '[object Uint16Array]',
  33329. uint32Tag = '[object Uint32Array]';
  33330. /**
  33331. * Initializes an object clone based on its `toStringTag`.
  33332. *
  33333. * **Note:** This function only supports cloning values with tags of
  33334. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  33335. *
  33336. * @private
  33337. * @param {Object} object The object to clone.
  33338. * @param {string} tag The `toStringTag` of the object to clone.
  33339. * @param {boolean} [isDeep] Specify a deep clone.
  33340. * @returns {Object} Returns the initialized clone.
  33341. */
  33342. function initCloneByTag(object, tag, isDeep) {
  33343. var Ctor = object.constructor;
  33344. switch (tag) {
  33345. case arrayBufferTag:
  33346. return cloneArrayBuffer(object);
  33347. case boolTag:
  33348. case dateTag:
  33349. return new Ctor(+object);
  33350. case dataViewTag:
  33351. return cloneDataView(object, isDeep);
  33352. case float32Tag: case float64Tag:
  33353. case int8Tag: case int16Tag: case int32Tag:
  33354. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  33355. return cloneTypedArray(object, isDeep);
  33356. case mapTag:
  33357. return new Ctor;
  33358. case numberTag:
  33359. case stringTag:
  33360. return new Ctor(object);
  33361. case regexpTag:
  33362. return cloneRegExp(object);
  33363. case setTag:
  33364. return new Ctor;
  33365. case symbolTag:
  33366. return cloneSymbol(object);
  33367. }
  33368. }
  33369. module.exports = initCloneByTag;
  33370. /***/ }),
  33371. /* 370 */
  33372. /***/ (function(module, exports, __webpack_require__) {
  33373. var cloneArrayBuffer = __webpack_require__(115);
  33374. /**
  33375. * Creates a clone of `dataView`.
  33376. *
  33377. * @private
  33378. * @param {Object} dataView The data view to clone.
  33379. * @param {boolean} [isDeep] Specify a deep clone.
  33380. * @returns {Object} Returns the cloned data view.
  33381. */
  33382. function cloneDataView(dataView, isDeep) {
  33383. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  33384. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  33385. }
  33386. module.exports = cloneDataView;
  33387. /***/ }),
  33388. /* 371 */
  33389. /***/ (function(module, exports) {
  33390. /** Used to match `RegExp` flags from their coerced string values. */
  33391. var reFlags = /\w*$/;
  33392. /**
  33393. * Creates a clone of `regexp`.
  33394. *
  33395. * @private
  33396. * @param {Object} regexp The regexp to clone.
  33397. * @returns {Object} Returns the cloned regexp.
  33398. */
  33399. function cloneRegExp(regexp) {
  33400. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  33401. result.lastIndex = regexp.lastIndex;
  33402. return result;
  33403. }
  33404. module.exports = cloneRegExp;
  33405. /***/ }),
  33406. /* 372 */
  33407. /***/ (function(module, exports, __webpack_require__) {
  33408. var Symbol = __webpack_require__(37);
  33409. /** Used to convert symbols to primitives and strings. */
  33410. var symbolProto = Symbol ? Symbol.prototype : undefined,
  33411. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  33412. /**
  33413. * Creates a clone of the `symbol` object.
  33414. *
  33415. * @private
  33416. * @param {Object} symbol The symbol object to clone.
  33417. * @returns {Object} Returns the cloned symbol object.
  33418. */
  33419. function cloneSymbol(symbol) {
  33420. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  33421. }
  33422. module.exports = cloneSymbol;
  33423. /***/ }),
  33424. /* 373 */
  33425. /***/ (function(module, exports, __webpack_require__) {
  33426. var baseIsMap = __webpack_require__(374),
  33427. baseUnary = __webpack_require__(64),
  33428. nodeUtil = __webpack_require__(110);
  33429. /* Node.js helper references. */
  33430. var nodeIsMap = nodeUtil && nodeUtil.isMap;
  33431. /**
  33432. * Checks if `value` is classified as a `Map` object.
  33433. *
  33434. * @static
  33435. * @memberOf _
  33436. * @since 4.3.0
  33437. * @category Lang
  33438. * @param {*} value The value to check.
  33439. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  33440. * @example
  33441. *
  33442. * _.isMap(new Map);
  33443. * // => true
  33444. *
  33445. * _.isMap(new WeakMap);
  33446. * // => false
  33447. */
  33448. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  33449. module.exports = isMap;
  33450. /***/ }),
  33451. /* 374 */
  33452. /***/ (function(module, exports, __webpack_require__) {
  33453. var getTag = __webpack_require__(39),
  33454. isObjectLike = __webpack_require__(14);
  33455. /** `Object#toString` result references. */
  33456. var mapTag = '[object Map]';
  33457. /**
  33458. * The base implementation of `_.isMap` without Node.js optimizations.
  33459. *
  33460. * @private
  33461. * @param {*} value The value to check.
  33462. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  33463. */
  33464. function baseIsMap(value) {
  33465. return isObjectLike(value) && getTag(value) == mapTag;
  33466. }
  33467. module.exports = baseIsMap;
  33468. /***/ }),
  33469. /* 375 */
  33470. /***/ (function(module, exports, __webpack_require__) {
  33471. var baseIsSet = __webpack_require__(376),
  33472. baseUnary = __webpack_require__(64),
  33473. nodeUtil = __webpack_require__(110);
  33474. /* Node.js helper references. */
  33475. var nodeIsSet = nodeUtil && nodeUtil.isSet;
  33476. /**
  33477. * Checks if `value` is classified as a `Set` object.
  33478. *
  33479. * @static
  33480. * @memberOf _
  33481. * @since 4.3.0
  33482. * @category Lang
  33483. * @param {*} value The value to check.
  33484. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  33485. * @example
  33486. *
  33487. * _.isSet(new Set);
  33488. * // => true
  33489. *
  33490. * _.isSet(new WeakSet);
  33491. * // => false
  33492. */
  33493. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  33494. module.exports = isSet;
  33495. /***/ }),
  33496. /* 376 */
  33497. /***/ (function(module, exports, __webpack_require__) {
  33498. var getTag = __webpack_require__(39),
  33499. isObjectLike = __webpack_require__(14);
  33500. /** `Object#toString` result references. */
  33501. var setTag = '[object Set]';
  33502. /**
  33503. * The base implementation of `_.isSet` without Node.js optimizations.
  33504. *
  33505. * @private
  33506. * @param {*} value The value to check.
  33507. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  33508. */
  33509. function baseIsSet(value) {
  33510. return isObjectLike(value) && getTag(value) == setTag;
  33511. }
  33512. module.exports = baseIsSet;
  33513. /***/ }),
  33514. /* 377 */
  33515. /***/ (function(module, exports, __webpack_require__) {
  33516. "use strict";
  33517. /* WEBPACK VAR INJECTION */(function(Promise) {
  33518. var utils = __webpack_require__(16);
  33519. var bind = __webpack_require__(187);
  33520. var Axios = __webpack_require__(379);
  33521. var defaults = __webpack_require__(116);
  33522. /**
  33523. * Create an instance of Axios
  33524. *
  33525. * @param {Object} defaultConfig The default config for the instance
  33526. * @return {Axios} A new instance of Axios
  33527. */
  33528. function createInstance(defaultConfig) {
  33529. var context = new Axios(defaultConfig);
  33530. var instance = bind(Axios.prototype.request, context);
  33531. // Copy axios.prototype to instance
  33532. utils.extend(instance, Axios.prototype, context);
  33533. // Copy context to instance
  33534. utils.extend(instance, context);
  33535. return instance;
  33536. }
  33537. // Create the default instance to be exported
  33538. var axios = createInstance(defaults);
  33539. // Expose Axios class to allow class inheritance
  33540. axios.Axios = Axios;
  33541. // Factory for creating new instances
  33542. axios.create = function create(instanceConfig) {
  33543. return createInstance(utils.merge(defaults, instanceConfig));
  33544. };
  33545. // Expose Cancel & CancelToken
  33546. axios.Cancel = __webpack_require__(191);
  33547. axios.CancelToken = __webpack_require__(392);
  33548. axios.isCancel = __webpack_require__(190);
  33549. // Expose all/spread
  33550. axios.all = function all(promises) {
  33551. return Promise.all(promises);
  33552. };
  33553. axios.spread = __webpack_require__(393);
  33554. module.exports = axios;
  33555. // Allow use of default import syntax in TypeScript
  33556. module.exports.default = axios;
  33557. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  33558. /***/ }),
  33559. /* 378 */
  33560. /***/ (function(module, exports) {
  33561. /*!
  33562. * Determine if an object is a Buffer
  33563. *
  33564. * @author Feross Aboukhadijeh <https://feross.org>
  33565. * @license MIT
  33566. */
  33567. module.exports = function isBuffer (obj) {
  33568. return obj != null && obj.constructor != null &&
  33569. typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
  33570. }
  33571. /***/ }),
  33572. /* 379 */
  33573. /***/ (function(module, exports, __webpack_require__) {
  33574. "use strict";
  33575. /* WEBPACK VAR INJECTION */(function(Promise) {
  33576. var defaults = __webpack_require__(116);
  33577. var utils = __webpack_require__(16);
  33578. var InterceptorManager = __webpack_require__(387);
  33579. var dispatchRequest = __webpack_require__(388);
  33580. /**
  33581. * Create a new instance of Axios
  33582. *
  33583. * @param {Object} instanceConfig The default config for the instance
  33584. */
  33585. function Axios(instanceConfig) {
  33586. this.defaults = instanceConfig;
  33587. this.interceptors = {
  33588. request: new InterceptorManager(),
  33589. response: new InterceptorManager()
  33590. };
  33591. }
  33592. /**
  33593. * Dispatch a request
  33594. *
  33595. * @param {Object} config The config specific for this request (merged with this.defaults)
  33596. */
  33597. Axios.prototype.request = function request(config) {
  33598. /*eslint no-param-reassign:0*/
  33599. // Allow for axios('example/url'[, config]) a la fetch API
  33600. if (typeof config === 'string') {
  33601. config = utils.merge({
  33602. url: arguments[0]
  33603. }, arguments[1]);
  33604. }
  33605. config = utils.merge(defaults, {method: 'get'}, this.defaults, config);
  33606. config.method = config.method.toLowerCase();
  33607. // Hook up interceptors middleware
  33608. var chain = [dispatchRequest, undefined];
  33609. var promise = Promise.resolve(config);
  33610. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  33611. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  33612. });
  33613. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  33614. chain.push(interceptor.fulfilled, interceptor.rejected);
  33615. });
  33616. while (chain.length) {
  33617. promise = promise.then(chain.shift(), chain.shift());
  33618. }
  33619. return promise;
  33620. };
  33621. // Provide aliases for supported request methods
  33622. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  33623. /*eslint func-names:0*/
  33624. Axios.prototype[method] = function(url, config) {
  33625. return this.request(utils.merge(config || {}, {
  33626. method: method,
  33627. url: url
  33628. }));
  33629. };
  33630. });
  33631. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  33632. /*eslint func-names:0*/
  33633. Axios.prototype[method] = function(url, data, config) {
  33634. return this.request(utils.merge(config || {}, {
  33635. method: method,
  33636. url: url,
  33637. data: data
  33638. }));
  33639. };
  33640. });
  33641. module.exports = Axios;
  33642. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  33643. /***/ }),
  33644. /* 380 */
  33645. /***/ (function(module, exports, __webpack_require__) {
  33646. "use strict";
  33647. var utils = __webpack_require__(16);
  33648. module.exports = function normalizeHeaderName(headers, normalizedName) {
  33649. utils.forEach(headers, function processHeader(value, name) {
  33650. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  33651. headers[normalizedName] = value;
  33652. delete headers[name];
  33653. }
  33654. });
  33655. };
  33656. /***/ }),
  33657. /* 381 */
  33658. /***/ (function(module, exports, __webpack_require__) {
  33659. "use strict";
  33660. var createError = __webpack_require__(189);
  33661. /**
  33662. * Resolve or reject a Promise based on response status.
  33663. *
  33664. * @param {Function} resolve A function that resolves the promise.
  33665. * @param {Function} reject A function that rejects the promise.
  33666. * @param {object} response The response.
  33667. */
  33668. module.exports = function settle(resolve, reject, response) {
  33669. var validateStatus = response.config.validateStatus;
  33670. // Note: status is not exposed by XDomainRequest
  33671. if (!response.status || !validateStatus || validateStatus(response.status)) {
  33672. resolve(response);
  33673. } else {
  33674. reject(createError(
  33675. 'Request failed with status code ' + response.status,
  33676. response.config,
  33677. null,
  33678. response.request,
  33679. response
  33680. ));
  33681. }
  33682. };
  33683. /***/ }),
  33684. /* 382 */
  33685. /***/ (function(module, exports, __webpack_require__) {
  33686. "use strict";
  33687. /**
  33688. * Update an Error with the specified config, error code, and response.
  33689. *
  33690. * @param {Error} error The error to update.
  33691. * @param {Object} config The config.
  33692. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  33693. * @param {Object} [request] The request.
  33694. * @param {Object} [response] The response.
  33695. * @returns {Error} The error.
  33696. */
  33697. module.exports = function enhanceError(error, config, code, request, response) {
  33698. error.config = config;
  33699. if (code) {
  33700. error.code = code;
  33701. }
  33702. error.request = request;
  33703. error.response = response;
  33704. return error;
  33705. };
  33706. /***/ }),
  33707. /* 383 */
  33708. /***/ (function(module, exports, __webpack_require__) {
  33709. "use strict";
  33710. var utils = __webpack_require__(16);
  33711. function encode(val) {
  33712. return encodeURIComponent(val).
  33713. replace(/%40/gi, '@').
  33714. replace(/%3A/gi, ':').
  33715. replace(/%24/g, '$').
  33716. replace(/%2C/gi, ',').
  33717. replace(/%20/g, '+').
  33718. replace(/%5B/gi, '[').
  33719. replace(/%5D/gi, ']');
  33720. }
  33721. /**
  33722. * Build a URL by appending params to the end
  33723. *
  33724. * @param {string} url The base of the url (e.g., http://www.google.com)
  33725. * @param {object} [params] The params to be appended
  33726. * @returns {string} The formatted url
  33727. */
  33728. module.exports = function buildURL(url, params, paramsSerializer) {
  33729. /*eslint no-param-reassign:0*/
  33730. if (!params) {
  33731. return url;
  33732. }
  33733. var serializedParams;
  33734. if (paramsSerializer) {
  33735. serializedParams = paramsSerializer(params);
  33736. } else if (utils.isURLSearchParams(params)) {
  33737. serializedParams = params.toString();
  33738. } else {
  33739. var parts = [];
  33740. utils.forEach(params, function serialize(val, key) {
  33741. if (val === null || typeof val === 'undefined') {
  33742. return;
  33743. }
  33744. if (utils.isArray(val)) {
  33745. key = key + '[]';
  33746. } else {
  33747. val = [val];
  33748. }
  33749. utils.forEach(val, function parseValue(v) {
  33750. if (utils.isDate(v)) {
  33751. v = v.toISOString();
  33752. } else if (utils.isObject(v)) {
  33753. v = JSON.stringify(v);
  33754. }
  33755. parts.push(encode(key) + '=' + encode(v));
  33756. });
  33757. });
  33758. serializedParams = parts.join('&');
  33759. }
  33760. if (serializedParams) {
  33761. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  33762. }
  33763. return url;
  33764. };
  33765. /***/ }),
  33766. /* 384 */
  33767. /***/ (function(module, exports, __webpack_require__) {
  33768. "use strict";
  33769. var utils = __webpack_require__(16);
  33770. // Headers whose duplicates are ignored by node
  33771. // c.f. https://nodejs.org/api/http.html#http_message_headers
  33772. var ignoreDuplicateOf = [
  33773. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  33774. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  33775. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  33776. 'referer', 'retry-after', 'user-agent'
  33777. ];
  33778. /**
  33779. * Parse headers into an object
  33780. *
  33781. * ```
  33782. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  33783. * Content-Type: application/json
  33784. * Connection: keep-alive
  33785. * Transfer-Encoding: chunked
  33786. * ```
  33787. *
  33788. * @param {String} headers Headers needing to be parsed
  33789. * @returns {Object} Headers parsed into an object
  33790. */
  33791. module.exports = function parseHeaders(headers) {
  33792. var parsed = {};
  33793. var key;
  33794. var val;
  33795. var i;
  33796. if (!headers) { return parsed; }
  33797. utils.forEach(headers.split('\n'), function parser(line) {
  33798. i = line.indexOf(':');
  33799. key = utils.trim(line.substr(0, i)).toLowerCase();
  33800. val = utils.trim(line.substr(i + 1));
  33801. if (key) {
  33802. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  33803. return;
  33804. }
  33805. if (key === 'set-cookie') {
  33806. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  33807. } else {
  33808. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  33809. }
  33810. }
  33811. });
  33812. return parsed;
  33813. };
  33814. /***/ }),
  33815. /* 385 */
  33816. /***/ (function(module, exports, __webpack_require__) {
  33817. "use strict";
  33818. var utils = __webpack_require__(16);
  33819. module.exports = (
  33820. utils.isStandardBrowserEnv() ?
  33821. // Standard browser envs have full support of the APIs needed to test
  33822. // whether the request URL is of the same origin as current location.
  33823. (function standardBrowserEnv() {
  33824. var msie = /(msie|trident)/i.test(navigator.userAgent);
  33825. var urlParsingNode = document.createElement('a');
  33826. var originURL;
  33827. /**
  33828. * Parse a URL to discover it's components
  33829. *
  33830. * @param {String} url The URL to be parsed
  33831. * @returns {Object}
  33832. */
  33833. function resolveURL(url) {
  33834. var href = url;
  33835. if (msie) {
  33836. // IE needs attribute set twice to normalize properties
  33837. urlParsingNode.setAttribute('href', href);
  33838. href = urlParsingNode.href;
  33839. }
  33840. urlParsingNode.setAttribute('href', href);
  33841. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  33842. return {
  33843. href: urlParsingNode.href,
  33844. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  33845. host: urlParsingNode.host,
  33846. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  33847. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  33848. hostname: urlParsingNode.hostname,
  33849. port: urlParsingNode.port,
  33850. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  33851. urlParsingNode.pathname :
  33852. '/' + urlParsingNode.pathname
  33853. };
  33854. }
  33855. originURL = resolveURL(window.location.href);
  33856. /**
  33857. * Determine if a URL shares the same origin as the current location
  33858. *
  33859. * @param {String} requestURL The URL to test
  33860. * @returns {boolean} True if URL shares the same origin, otherwise false
  33861. */
  33862. return function isURLSameOrigin(requestURL) {
  33863. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  33864. return (parsed.protocol === originURL.protocol &&
  33865. parsed.host === originURL.host);
  33866. };
  33867. })() :
  33868. // Non standard browser envs (web workers, react-native) lack needed support.
  33869. (function nonStandardBrowserEnv() {
  33870. return function isURLSameOrigin() {
  33871. return true;
  33872. };
  33873. })()
  33874. );
  33875. /***/ }),
  33876. /* 386 */
  33877. /***/ (function(module, exports, __webpack_require__) {
  33878. "use strict";
  33879. var utils = __webpack_require__(16);
  33880. module.exports = (
  33881. utils.isStandardBrowserEnv() ?
  33882. // Standard browser envs support document.cookie
  33883. (function standardBrowserEnv() {
  33884. return {
  33885. write: function write(name, value, expires, path, domain, secure) {
  33886. var cookie = [];
  33887. cookie.push(name + '=' + encodeURIComponent(value));
  33888. if (utils.isNumber(expires)) {
  33889. cookie.push('expires=' + new Date(expires).toGMTString());
  33890. }
  33891. if (utils.isString(path)) {
  33892. cookie.push('path=' + path);
  33893. }
  33894. if (utils.isString(domain)) {
  33895. cookie.push('domain=' + domain);
  33896. }
  33897. if (secure === true) {
  33898. cookie.push('secure');
  33899. }
  33900. document.cookie = cookie.join('; ');
  33901. },
  33902. read: function read(name) {
  33903. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  33904. return (match ? decodeURIComponent(match[3]) : null);
  33905. },
  33906. remove: function remove(name) {
  33907. this.write(name, '', Date.now() - 86400000);
  33908. }
  33909. };
  33910. })() :
  33911. // Non standard browser env (web workers, react-native) lack needed support.
  33912. (function nonStandardBrowserEnv() {
  33913. return {
  33914. write: function write() {},
  33915. read: function read() { return null; },
  33916. remove: function remove() {}
  33917. };
  33918. })()
  33919. );
  33920. /***/ }),
  33921. /* 387 */
  33922. /***/ (function(module, exports, __webpack_require__) {
  33923. "use strict";
  33924. var utils = __webpack_require__(16);
  33925. function InterceptorManager() {
  33926. this.handlers = [];
  33927. }
  33928. /**
  33929. * Add a new interceptor to the stack
  33930. *
  33931. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  33932. * @param {Function} rejected The function to handle `reject` for a `Promise`
  33933. *
  33934. * @return {Number} An ID used to remove interceptor later
  33935. */
  33936. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  33937. this.handlers.push({
  33938. fulfilled: fulfilled,
  33939. rejected: rejected
  33940. });
  33941. return this.handlers.length - 1;
  33942. };
  33943. /**
  33944. * Remove an interceptor from the stack
  33945. *
  33946. * @param {Number} id The ID that was returned by `use`
  33947. */
  33948. InterceptorManager.prototype.eject = function eject(id) {
  33949. if (this.handlers[id]) {
  33950. this.handlers[id] = null;
  33951. }
  33952. };
  33953. /**
  33954. * Iterate over all the registered interceptors
  33955. *
  33956. * This method is particularly useful for skipping over any
  33957. * interceptors that may have become `null` calling `eject`.
  33958. *
  33959. * @param {Function} fn The function to call for each interceptor
  33960. */
  33961. InterceptorManager.prototype.forEach = function forEach(fn) {
  33962. utils.forEach(this.handlers, function forEachHandler(h) {
  33963. if (h !== null) {
  33964. fn(h);
  33965. }
  33966. });
  33967. };
  33968. module.exports = InterceptorManager;
  33969. /***/ }),
  33970. /* 388 */
  33971. /***/ (function(module, exports, __webpack_require__) {
  33972. "use strict";
  33973. /* WEBPACK VAR INJECTION */(function(Promise) {
  33974. var utils = __webpack_require__(16);
  33975. var transformData = __webpack_require__(389);
  33976. var isCancel = __webpack_require__(190);
  33977. var defaults = __webpack_require__(116);
  33978. var isAbsoluteURL = __webpack_require__(390);
  33979. var combineURLs = __webpack_require__(391);
  33980. /**
  33981. * Throws a `Cancel` if cancellation has been requested.
  33982. */
  33983. function throwIfCancellationRequested(config) {
  33984. if (config.cancelToken) {
  33985. config.cancelToken.throwIfRequested();
  33986. }
  33987. }
  33988. /**
  33989. * Dispatch a request to the server using the configured adapter.
  33990. *
  33991. * @param {object} config The config that is to be used for the request
  33992. * @returns {Promise} The Promise to be fulfilled
  33993. */
  33994. module.exports = function dispatchRequest(config) {
  33995. throwIfCancellationRequested(config);
  33996. // Support baseURL config
  33997. if (config.baseURL && !isAbsoluteURL(config.url)) {
  33998. config.url = combineURLs(config.baseURL, config.url);
  33999. }
  34000. // Ensure headers exist
  34001. config.headers = config.headers || {};
  34002. // Transform request data
  34003. config.data = transformData(
  34004. config.data,
  34005. config.headers,
  34006. config.transformRequest
  34007. );
  34008. // Flatten headers
  34009. config.headers = utils.merge(
  34010. config.headers.common || {},
  34011. config.headers[config.method] || {},
  34012. config.headers || {}
  34013. );
  34014. utils.forEach(
  34015. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  34016. function cleanHeaderConfig(method) {
  34017. delete config.headers[method];
  34018. }
  34019. );
  34020. var adapter = config.adapter || defaults.adapter;
  34021. return adapter(config).then(function onAdapterResolution(response) {
  34022. throwIfCancellationRequested(config);
  34023. // Transform response data
  34024. response.data = transformData(
  34025. response.data,
  34026. response.headers,
  34027. config.transformResponse
  34028. );
  34029. return response;
  34030. }, function onAdapterRejection(reason) {
  34031. if (!isCancel(reason)) {
  34032. throwIfCancellationRequested(config);
  34033. // Transform response data
  34034. if (reason && reason.response) {
  34035. reason.response.data = transformData(
  34036. reason.response.data,
  34037. reason.response.headers,
  34038. config.transformResponse
  34039. );
  34040. }
  34041. }
  34042. return Promise.reject(reason);
  34043. });
  34044. };
  34045. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  34046. /***/ }),
  34047. /* 389 */
  34048. /***/ (function(module, exports, __webpack_require__) {
  34049. "use strict";
  34050. var utils = __webpack_require__(16);
  34051. /**
  34052. * Transform the data for a request or a response
  34053. *
  34054. * @param {Object|String} data The data to be transformed
  34055. * @param {Array} headers The headers for the request or response
  34056. * @param {Array|Function} fns A single function or Array of functions
  34057. * @returns {*} The resulting transformed data
  34058. */
  34059. module.exports = function transformData(data, headers, fns) {
  34060. /*eslint no-param-reassign:0*/
  34061. utils.forEach(fns, function transform(fn) {
  34062. data = fn(data, headers);
  34063. });
  34064. return data;
  34065. };
  34066. /***/ }),
  34067. /* 390 */
  34068. /***/ (function(module, exports, __webpack_require__) {
  34069. "use strict";
  34070. /**
  34071. * Determines whether the specified URL is absolute
  34072. *
  34073. * @param {string} url The URL to test
  34074. * @returns {boolean} True if the specified URL is absolute, otherwise false
  34075. */
  34076. module.exports = function isAbsoluteURL(url) {
  34077. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  34078. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  34079. // by any combination of letters, digits, plus, period, or hyphen.
  34080. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  34081. };
  34082. /***/ }),
  34083. /* 391 */
  34084. /***/ (function(module, exports, __webpack_require__) {
  34085. "use strict";
  34086. /**
  34087. * Creates a new URL by combining the specified URLs
  34088. *
  34089. * @param {string} baseURL The base URL
  34090. * @param {string} relativeURL The relative URL
  34091. * @returns {string} The combined URL
  34092. */
  34093. module.exports = function combineURLs(baseURL, relativeURL) {
  34094. return relativeURL
  34095. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  34096. : baseURL;
  34097. };
  34098. /***/ }),
  34099. /* 392 */
  34100. /***/ (function(module, exports, __webpack_require__) {
  34101. "use strict";
  34102. /* WEBPACK VAR INJECTION */(function(Promise) {
  34103. var Cancel = __webpack_require__(191);
  34104. /**
  34105. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  34106. *
  34107. * @class
  34108. * @param {Function} executor The executor function.
  34109. */
  34110. function CancelToken(executor) {
  34111. if (typeof executor !== 'function') {
  34112. throw new TypeError('executor must be a function.');
  34113. }
  34114. var resolvePromise;
  34115. this.promise = new Promise(function promiseExecutor(resolve) {
  34116. resolvePromise = resolve;
  34117. });
  34118. var token = this;
  34119. executor(function cancel(message) {
  34120. if (token.reason) {
  34121. // Cancellation has already been requested
  34122. return;
  34123. }
  34124. token.reason = new Cancel(message);
  34125. resolvePromise(token.reason);
  34126. });
  34127. }
  34128. /**
  34129. * Throws a `Cancel` if cancellation has been requested.
  34130. */
  34131. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  34132. if (this.reason) {
  34133. throw this.reason;
  34134. }
  34135. };
  34136. /**
  34137. * Returns an object that contains a new `CancelToken` and a function that, when called,
  34138. * cancels the `CancelToken`.
  34139. */
  34140. CancelToken.source = function source() {
  34141. var cancel;
  34142. var token = new CancelToken(function executor(c) {
  34143. cancel = c;
  34144. });
  34145. return {
  34146. token: token,
  34147. cancel: cancel
  34148. };
  34149. };
  34150. module.exports = CancelToken;
  34151. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  34152. /***/ }),
  34153. /* 393 */
  34154. /***/ (function(module, exports, __webpack_require__) {
  34155. "use strict";
  34156. /**
  34157. * Syntactic sugar for invoking a function and expanding an array for arguments.
  34158. *
  34159. * Common use case would be to use `Function.prototype.apply`.
  34160. *
  34161. * ```js
  34162. * function f(x, y, z) {}
  34163. * var args = [1, 2, 3];
  34164. * f.apply(null, args);
  34165. * ```
  34166. *
  34167. * With `spread` this example can be re-written.
  34168. *
  34169. * ```js
  34170. * spread(function(x, y, z) {})([1, 2, 3]);
  34171. * ```
  34172. *
  34173. * @param {Function} callback
  34174. * @returns {Function}
  34175. */
  34176. module.exports = function spread(callback) {
  34177. return function wrap(arr) {
  34178. return callback.apply(null, arr);
  34179. };
  34180. };
  34181. /***/ }),
  34182. /* 394 */
  34183. /***/ (function(module, exports, __webpack_require__) {
  34184. var convert = __webpack_require__(192),
  34185. func = convert('pick', __webpack_require__(42));
  34186. func.placeholder = __webpack_require__(117);
  34187. module.exports = func;
  34188. /***/ }),
  34189. /* 395 */
  34190. /***/ (function(module, exports, __webpack_require__) {
  34191. var mapping = __webpack_require__(396),
  34192. fallbackHolder = __webpack_require__(117);
  34193. /** Built-in value reference. */
  34194. var push = Array.prototype.push;
  34195. /**
  34196. * Creates a function, with an arity of `n`, that invokes `func` with the
  34197. * arguments it receives.
  34198. *
  34199. * @private
  34200. * @param {Function} func The function to wrap.
  34201. * @param {number} n The arity of the new function.
  34202. * @returns {Function} Returns the new function.
  34203. */
  34204. function baseArity(func, n) {
  34205. return n == 2
  34206. ? function(a, b) { return func.apply(undefined, arguments); }
  34207. : function(a) { return func.apply(undefined, arguments); };
  34208. }
  34209. /**
  34210. * Creates a function that invokes `func`, with up to `n` arguments, ignoring
  34211. * any additional arguments.
  34212. *
  34213. * @private
  34214. * @param {Function} func The function to cap arguments for.
  34215. * @param {number} n The arity cap.
  34216. * @returns {Function} Returns the new function.
  34217. */
  34218. function baseAry(func, n) {
  34219. return n == 2
  34220. ? function(a, b) { return func(a, b); }
  34221. : function(a) { return func(a); };
  34222. }
  34223. /**
  34224. * Creates a clone of `array`.
  34225. *
  34226. * @private
  34227. * @param {Array} array The array to clone.
  34228. * @returns {Array} Returns the cloned array.
  34229. */
  34230. function cloneArray(array) {
  34231. var length = array ? array.length : 0,
  34232. result = Array(length);
  34233. while (length--) {
  34234. result[length] = array[length];
  34235. }
  34236. return result;
  34237. }
  34238. /**
  34239. * Creates a function that clones a given object using the assignment `func`.
  34240. *
  34241. * @private
  34242. * @param {Function} func The assignment function.
  34243. * @returns {Function} Returns the new cloner function.
  34244. */
  34245. function createCloner(func) {
  34246. return function(object) {
  34247. return func({}, object);
  34248. };
  34249. }
  34250. /**
  34251. * A specialized version of `_.spread` which flattens the spread array into
  34252. * the arguments of the invoked `func`.
  34253. *
  34254. * @private
  34255. * @param {Function} func The function to spread arguments over.
  34256. * @param {number} start The start position of the spread.
  34257. * @returns {Function} Returns the new function.
  34258. */
  34259. function flatSpread(func, start) {
  34260. return function() {
  34261. var length = arguments.length,
  34262. lastIndex = length - 1,
  34263. args = Array(length);
  34264. while (length--) {
  34265. args[length] = arguments[length];
  34266. }
  34267. var array = args[start],
  34268. otherArgs = args.slice(0, start);
  34269. if (array) {
  34270. push.apply(otherArgs, array);
  34271. }
  34272. if (start != lastIndex) {
  34273. push.apply(otherArgs, args.slice(start + 1));
  34274. }
  34275. return func.apply(this, otherArgs);
  34276. };
  34277. }
  34278. /**
  34279. * Creates a function that wraps `func` and uses `cloner` to clone the first
  34280. * argument it receives.
  34281. *
  34282. * @private
  34283. * @param {Function} func The function to wrap.
  34284. * @param {Function} cloner The function to clone arguments.
  34285. * @returns {Function} Returns the new immutable function.
  34286. */
  34287. function wrapImmutable(func, cloner) {
  34288. return function() {
  34289. var length = arguments.length;
  34290. if (!length) {
  34291. return;
  34292. }
  34293. var args = Array(length);
  34294. while (length--) {
  34295. args[length] = arguments[length];
  34296. }
  34297. var result = args[0] = cloner.apply(undefined, args);
  34298. func.apply(undefined, args);
  34299. return result;
  34300. };
  34301. }
  34302. /**
  34303. * The base implementation of `convert` which accepts a `util` object of methods
  34304. * required to perform conversions.
  34305. *
  34306. * @param {Object} util The util object.
  34307. * @param {string} name The name of the function to convert.
  34308. * @param {Function} func The function to convert.
  34309. * @param {Object} [options] The options object.
  34310. * @param {boolean} [options.cap=true] Specify capping iteratee arguments.
  34311. * @param {boolean} [options.curry=true] Specify currying.
  34312. * @param {boolean} [options.fixed=true] Specify fixed arity.
  34313. * @param {boolean} [options.immutable=true] Specify immutable operations.
  34314. * @param {boolean} [options.rearg=true] Specify rearranging arguments.
  34315. * @returns {Function|Object} Returns the converted function or object.
  34316. */
  34317. function baseConvert(util, name, func, options) {
  34318. var isLib = typeof name == 'function',
  34319. isObj = name === Object(name);
  34320. if (isObj) {
  34321. options = func;
  34322. func = name;
  34323. name = undefined;
  34324. }
  34325. if (func == null) {
  34326. throw new TypeError;
  34327. }
  34328. options || (options = {});
  34329. var config = {
  34330. 'cap': 'cap' in options ? options.cap : true,
  34331. 'curry': 'curry' in options ? options.curry : true,
  34332. 'fixed': 'fixed' in options ? options.fixed : true,
  34333. 'immutable': 'immutable' in options ? options.immutable : true,
  34334. 'rearg': 'rearg' in options ? options.rearg : true
  34335. };
  34336. var defaultHolder = isLib ? func : fallbackHolder,
  34337. forceCurry = ('curry' in options) && options.curry,
  34338. forceFixed = ('fixed' in options) && options.fixed,
  34339. forceRearg = ('rearg' in options) && options.rearg,
  34340. pristine = isLib ? func.runInContext() : undefined;
  34341. var helpers = isLib ? func : {
  34342. 'ary': util.ary,
  34343. 'assign': util.assign,
  34344. 'clone': util.clone,
  34345. 'curry': util.curry,
  34346. 'forEach': util.forEach,
  34347. 'isArray': util.isArray,
  34348. 'isError': util.isError,
  34349. 'isFunction': util.isFunction,
  34350. 'isWeakMap': util.isWeakMap,
  34351. 'iteratee': util.iteratee,
  34352. 'keys': util.keys,
  34353. 'rearg': util.rearg,
  34354. 'toInteger': util.toInteger,
  34355. 'toPath': util.toPath
  34356. };
  34357. var ary = helpers.ary,
  34358. assign = helpers.assign,
  34359. clone = helpers.clone,
  34360. curry = helpers.curry,
  34361. each = helpers.forEach,
  34362. isArray = helpers.isArray,
  34363. isError = helpers.isError,
  34364. isFunction = helpers.isFunction,
  34365. isWeakMap = helpers.isWeakMap,
  34366. keys = helpers.keys,
  34367. rearg = helpers.rearg,
  34368. toInteger = helpers.toInteger,
  34369. toPath = helpers.toPath;
  34370. var aryMethodKeys = keys(mapping.aryMethod);
  34371. var wrappers = {
  34372. 'castArray': function(castArray) {
  34373. return function() {
  34374. var value = arguments[0];
  34375. return isArray(value)
  34376. ? castArray(cloneArray(value))
  34377. : castArray.apply(undefined, arguments);
  34378. };
  34379. },
  34380. 'iteratee': function(iteratee) {
  34381. return function() {
  34382. var func = arguments[0],
  34383. arity = arguments[1],
  34384. result = iteratee(func, arity),
  34385. length = result.length;
  34386. if (config.cap && typeof arity == 'number') {
  34387. arity = arity > 2 ? (arity - 2) : 1;
  34388. return (length && length <= arity) ? result : baseAry(result, arity);
  34389. }
  34390. return result;
  34391. };
  34392. },
  34393. 'mixin': function(mixin) {
  34394. return function(source) {
  34395. var func = this;
  34396. if (!isFunction(func)) {
  34397. return mixin(func, Object(source));
  34398. }
  34399. var pairs = [];
  34400. each(keys(source), function(key) {
  34401. if (isFunction(source[key])) {
  34402. pairs.push([key, func.prototype[key]]);
  34403. }
  34404. });
  34405. mixin(func, Object(source));
  34406. each(pairs, function(pair) {
  34407. var value = pair[1];
  34408. if (isFunction(value)) {
  34409. func.prototype[pair[0]] = value;
  34410. } else {
  34411. delete func.prototype[pair[0]];
  34412. }
  34413. });
  34414. return func;
  34415. };
  34416. },
  34417. 'nthArg': function(nthArg) {
  34418. return function(n) {
  34419. var arity = n < 0 ? 1 : (toInteger(n) + 1);
  34420. return curry(nthArg(n), arity);
  34421. };
  34422. },
  34423. 'rearg': function(rearg) {
  34424. return function(func, indexes) {
  34425. var arity = indexes ? indexes.length : 0;
  34426. return curry(rearg(func, indexes), arity);
  34427. };
  34428. },
  34429. 'runInContext': function(runInContext) {
  34430. return function(context) {
  34431. return baseConvert(util, runInContext(context), options);
  34432. };
  34433. }
  34434. };
  34435. /*--------------------------------------------------------------------------*/
  34436. /**
  34437. * Casts `func` to a function with an arity capped iteratee if needed.
  34438. *
  34439. * @private
  34440. * @param {string} name The name of the function to inspect.
  34441. * @param {Function} func The function to inspect.
  34442. * @returns {Function} Returns the cast function.
  34443. */
  34444. function castCap(name, func) {
  34445. if (config.cap) {
  34446. var indexes = mapping.iterateeRearg[name];
  34447. if (indexes) {
  34448. return iterateeRearg(func, indexes);
  34449. }
  34450. var n = !isLib && mapping.iterateeAry[name];
  34451. if (n) {
  34452. return iterateeAry(func, n);
  34453. }
  34454. }
  34455. return func;
  34456. }
  34457. /**
  34458. * Casts `func` to a curried function if needed.
  34459. *
  34460. * @private
  34461. * @param {string} name The name of the function to inspect.
  34462. * @param {Function} func The function to inspect.
  34463. * @param {number} n The arity of `func`.
  34464. * @returns {Function} Returns the cast function.
  34465. */
  34466. function castCurry(name, func, n) {
  34467. return (forceCurry || (config.curry && n > 1))
  34468. ? curry(func, n)
  34469. : func;
  34470. }
  34471. /**
  34472. * Casts `func` to a fixed arity function if needed.
  34473. *
  34474. * @private
  34475. * @param {string} name The name of the function to inspect.
  34476. * @param {Function} func The function to inspect.
  34477. * @param {number} n The arity cap.
  34478. * @returns {Function} Returns the cast function.
  34479. */
  34480. function castFixed(name, func, n) {
  34481. if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
  34482. var data = mapping.methodSpread[name],
  34483. start = data && data.start;
  34484. return start === undefined ? ary(func, n) : flatSpread(func, start);
  34485. }
  34486. return func;
  34487. }
  34488. /**
  34489. * Casts `func` to an rearged function if needed.
  34490. *
  34491. * @private
  34492. * @param {string} name The name of the function to inspect.
  34493. * @param {Function} func The function to inspect.
  34494. * @param {number} n The arity of `func`.
  34495. * @returns {Function} Returns the cast function.
  34496. */
  34497. function castRearg(name, func, n) {
  34498. return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]))
  34499. ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n])
  34500. : func;
  34501. }
  34502. /**
  34503. * Creates a clone of `object` by `path`.
  34504. *
  34505. * @private
  34506. * @param {Object} object The object to clone.
  34507. * @param {Array|string} path The path to clone by.
  34508. * @returns {Object} Returns the cloned object.
  34509. */
  34510. function cloneByPath(object, path) {
  34511. path = toPath(path);
  34512. var index = -1,
  34513. length = path.length,
  34514. lastIndex = length - 1,
  34515. result = clone(Object(object)),
  34516. nested = result;
  34517. while (nested != null && ++index < length) {
  34518. var key = path[index],
  34519. value = nested[key];
  34520. if (value != null &&
  34521. !(isFunction(value) || isError(value) || isWeakMap(value))) {
  34522. nested[key] = clone(index == lastIndex ? value : Object(value));
  34523. }
  34524. nested = nested[key];
  34525. }
  34526. return result;
  34527. }
  34528. /**
  34529. * Converts `lodash` to an immutable auto-curried iteratee-first data-last
  34530. * version with conversion `options` applied.
  34531. *
  34532. * @param {Object} [options] The options object. See `baseConvert` for more details.
  34533. * @returns {Function} Returns the converted `lodash`.
  34534. */
  34535. function convertLib(options) {
  34536. return _.runInContext.convert(options)(undefined);
  34537. }
  34538. /**
  34539. * Create a converter function for `func` of `name`.
  34540. *
  34541. * @param {string} name The name of the function to convert.
  34542. * @param {Function} func The function to convert.
  34543. * @returns {Function} Returns the new converter function.
  34544. */
  34545. function createConverter(name, func) {
  34546. var realName = mapping.aliasToReal[name] || name,
  34547. methodName = mapping.remap[realName] || realName,
  34548. oldOptions = options;
  34549. return function(options) {
  34550. var newUtil = isLib ? pristine : helpers,
  34551. newFunc = isLib ? pristine[methodName] : func,
  34552. newOptions = assign(assign({}, oldOptions), options);
  34553. return baseConvert(newUtil, realName, newFunc, newOptions);
  34554. };
  34555. }
  34556. /**
  34557. * Creates a function that wraps `func` to invoke its iteratee, with up to `n`
  34558. * arguments, ignoring any additional arguments.
  34559. *
  34560. * @private
  34561. * @param {Function} func The function to cap iteratee arguments for.
  34562. * @param {number} n The arity cap.
  34563. * @returns {Function} Returns the new function.
  34564. */
  34565. function iterateeAry(func, n) {
  34566. return overArg(func, function(func) {
  34567. return typeof func == 'function' ? baseAry(func, n) : func;
  34568. });
  34569. }
  34570. /**
  34571. * Creates a function that wraps `func` to invoke its iteratee with arguments
  34572. * arranged according to the specified `indexes` where the argument value at
  34573. * the first index is provided as the first argument, the argument value at
  34574. * the second index is provided as the second argument, and so on.
  34575. *
  34576. * @private
  34577. * @param {Function} func The function to rearrange iteratee arguments for.
  34578. * @param {number[]} indexes The arranged argument indexes.
  34579. * @returns {Function} Returns the new function.
  34580. */
  34581. function iterateeRearg(func, indexes) {
  34582. return overArg(func, function(func) {
  34583. var n = indexes.length;
  34584. return baseArity(rearg(baseAry(func, n), indexes), n);
  34585. });
  34586. }
  34587. /**
  34588. * Creates a function that invokes `func` with its first argument transformed.
  34589. *
  34590. * @private
  34591. * @param {Function} func The function to wrap.
  34592. * @param {Function} transform The argument transform.
  34593. * @returns {Function} Returns the new function.
  34594. */
  34595. function overArg(func, transform) {
  34596. return function() {
  34597. var length = arguments.length;
  34598. if (!length) {
  34599. return func();
  34600. }
  34601. var args = Array(length);
  34602. while (length--) {
  34603. args[length] = arguments[length];
  34604. }
  34605. var index = config.rearg ? 0 : (length - 1);
  34606. args[index] = transform(args[index]);
  34607. return func.apply(undefined, args);
  34608. };
  34609. }
  34610. /**
  34611. * Creates a function that wraps `func` and applys the conversions
  34612. * rules by `name`.
  34613. *
  34614. * @private
  34615. * @param {string} name The name of the function to wrap.
  34616. * @param {Function} func The function to wrap.
  34617. * @returns {Function} Returns the converted function.
  34618. */
  34619. function wrap(name, func, placeholder) {
  34620. var result,
  34621. realName = mapping.aliasToReal[name] || name,
  34622. wrapped = func,
  34623. wrapper = wrappers[realName];
  34624. if (wrapper) {
  34625. wrapped = wrapper(func);
  34626. }
  34627. else if (config.immutable) {
  34628. if (mapping.mutate.array[realName]) {
  34629. wrapped = wrapImmutable(func, cloneArray);
  34630. }
  34631. else if (mapping.mutate.object[realName]) {
  34632. wrapped = wrapImmutable(func, createCloner(func));
  34633. }
  34634. else if (mapping.mutate.set[realName]) {
  34635. wrapped = wrapImmutable(func, cloneByPath);
  34636. }
  34637. }
  34638. each(aryMethodKeys, function(aryKey) {
  34639. each(mapping.aryMethod[aryKey], function(otherName) {
  34640. if (realName == otherName) {
  34641. var data = mapping.methodSpread[realName],
  34642. afterRearg = data && data.afterRearg;
  34643. result = afterRearg
  34644. ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey)
  34645. : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);
  34646. result = castCap(realName, result);
  34647. result = castCurry(realName, result, aryKey);
  34648. return false;
  34649. }
  34650. });
  34651. return !result;
  34652. });
  34653. result || (result = wrapped);
  34654. if (result == func) {
  34655. result = forceCurry ? curry(result, 1) : function() {
  34656. return func.apply(this, arguments);
  34657. };
  34658. }
  34659. result.convert = createConverter(realName, func);
  34660. result.placeholder = func.placeholder = placeholder;
  34661. return result;
  34662. }
  34663. /*--------------------------------------------------------------------------*/
  34664. if (!isObj) {
  34665. return wrap(name, func, defaultHolder);
  34666. }
  34667. var _ = func;
  34668. // Convert methods by ary cap.
  34669. var pairs = [];
  34670. each(aryMethodKeys, function(aryKey) {
  34671. each(mapping.aryMethod[aryKey], function(key) {
  34672. var func = _[mapping.remap[key] || key];
  34673. if (func) {
  34674. pairs.push([key, wrap(key, func, _)]);
  34675. }
  34676. });
  34677. });
  34678. // Convert remaining methods.
  34679. each(keys(_), function(key) {
  34680. var func = _[key];
  34681. if (typeof func == 'function') {
  34682. var length = pairs.length;
  34683. while (length--) {
  34684. if (pairs[length][0] == key) {
  34685. return;
  34686. }
  34687. }
  34688. func.convert = createConverter(key, func);
  34689. pairs.push([key, func]);
  34690. }
  34691. });
  34692. // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
  34693. each(pairs, function(pair) {
  34694. _[pair[0]] = pair[1];
  34695. });
  34696. _.convert = convertLib;
  34697. _.placeholder = _;
  34698. // Assign aliases.
  34699. each(keys(_), function(key) {
  34700. each(mapping.realToAlias[key] || [], function(alias) {
  34701. _[alias] = _[key];
  34702. });
  34703. });
  34704. return _;
  34705. }
  34706. module.exports = baseConvert;
  34707. /***/ }),
  34708. /* 396 */
  34709. /***/ (function(module, exports) {
  34710. /** Used to map aliases to their real names. */
  34711. exports.aliasToReal = {
  34712. // Lodash aliases.
  34713. 'each': 'forEach',
  34714. 'eachRight': 'forEachRight',
  34715. 'entries': 'toPairs',
  34716. 'entriesIn': 'toPairsIn',
  34717. 'extend': 'assignIn',
  34718. 'extendAll': 'assignInAll',
  34719. 'extendAllWith': 'assignInAllWith',
  34720. 'extendWith': 'assignInWith',
  34721. 'first': 'head',
  34722. // Methods that are curried variants of others.
  34723. 'conforms': 'conformsTo',
  34724. 'matches': 'isMatch',
  34725. 'property': 'get',
  34726. // Ramda aliases.
  34727. '__': 'placeholder',
  34728. 'F': 'stubFalse',
  34729. 'T': 'stubTrue',
  34730. 'all': 'every',
  34731. 'allPass': 'overEvery',
  34732. 'always': 'constant',
  34733. 'any': 'some',
  34734. 'anyPass': 'overSome',
  34735. 'apply': 'spread',
  34736. 'assoc': 'set',
  34737. 'assocPath': 'set',
  34738. 'complement': 'negate',
  34739. 'compose': 'flowRight',
  34740. 'contains': 'includes',
  34741. 'dissoc': 'unset',
  34742. 'dissocPath': 'unset',
  34743. 'dropLast': 'dropRight',
  34744. 'dropLastWhile': 'dropRightWhile',
  34745. 'equals': 'isEqual',
  34746. 'identical': 'eq',
  34747. 'indexBy': 'keyBy',
  34748. 'init': 'initial',
  34749. 'invertObj': 'invert',
  34750. 'juxt': 'over',
  34751. 'omitAll': 'omit',
  34752. 'nAry': 'ary',
  34753. 'path': 'get',
  34754. 'pathEq': 'matchesProperty',
  34755. 'pathOr': 'getOr',
  34756. 'paths': 'at',
  34757. 'pickAll': 'pick',
  34758. 'pipe': 'flow',
  34759. 'pluck': 'map',
  34760. 'prop': 'get',
  34761. 'propEq': 'matchesProperty',
  34762. 'propOr': 'getOr',
  34763. 'props': 'at',
  34764. 'symmetricDifference': 'xor',
  34765. 'symmetricDifferenceBy': 'xorBy',
  34766. 'symmetricDifferenceWith': 'xorWith',
  34767. 'takeLast': 'takeRight',
  34768. 'takeLastWhile': 'takeRightWhile',
  34769. 'unapply': 'rest',
  34770. 'unnest': 'flatten',
  34771. 'useWith': 'overArgs',
  34772. 'where': 'conformsTo',
  34773. 'whereEq': 'isMatch',
  34774. 'zipObj': 'zipObject'
  34775. };
  34776. /** Used to map ary to method names. */
  34777. exports.aryMethod = {
  34778. '1': [
  34779. 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
  34780. 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
  34781. 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll',
  34782. 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse',
  34783. 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
  34784. 'uniqueId', 'words', 'zipAll'
  34785. ],
  34786. '2': [
  34787. 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
  34788. 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',
  34789. 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',
  34790. 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',
  34791. 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
  34792. 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
  34793. 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',
  34794. 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
  34795. 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
  34796. 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',
  34797. 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',
  34798. 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',
  34799. 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',
  34800. 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',
  34801. 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
  34802. 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
  34803. 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
  34804. 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
  34805. 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
  34806. 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
  34807. 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
  34808. 'zipObjectDeep'
  34809. ],
  34810. '3': [
  34811. 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
  34812. 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr',
  34813. 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith',
  34814. 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth',
  34815. 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd',
  34816. 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight',
  34817. 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy',
  34818. 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy',
  34819. 'xorWith', 'zipWith'
  34820. ],
  34821. '4': [
  34822. 'fill', 'setWith', 'updateWith'
  34823. ]
  34824. };
  34825. /** Used to map ary to rearg configs. */
  34826. exports.aryRearg = {
  34827. '2': [1, 0],
  34828. '3': [2, 0, 1],
  34829. '4': [3, 2, 0, 1]
  34830. };
  34831. /** Used to map method names to their iteratee ary. */
  34832. exports.iterateeAry = {
  34833. 'dropRightWhile': 1,
  34834. 'dropWhile': 1,
  34835. 'every': 1,
  34836. 'filter': 1,
  34837. 'find': 1,
  34838. 'findFrom': 1,
  34839. 'findIndex': 1,
  34840. 'findIndexFrom': 1,
  34841. 'findKey': 1,
  34842. 'findLast': 1,
  34843. 'findLastFrom': 1,
  34844. 'findLastIndex': 1,
  34845. 'findLastIndexFrom': 1,
  34846. 'findLastKey': 1,
  34847. 'flatMap': 1,
  34848. 'flatMapDeep': 1,
  34849. 'flatMapDepth': 1,
  34850. 'forEach': 1,
  34851. 'forEachRight': 1,
  34852. 'forIn': 1,
  34853. 'forInRight': 1,
  34854. 'forOwn': 1,
  34855. 'forOwnRight': 1,
  34856. 'map': 1,
  34857. 'mapKeys': 1,
  34858. 'mapValues': 1,
  34859. 'partition': 1,
  34860. 'reduce': 2,
  34861. 'reduceRight': 2,
  34862. 'reject': 1,
  34863. 'remove': 1,
  34864. 'some': 1,
  34865. 'takeRightWhile': 1,
  34866. 'takeWhile': 1,
  34867. 'times': 1,
  34868. 'transform': 2
  34869. };
  34870. /** Used to map method names to iteratee rearg configs. */
  34871. exports.iterateeRearg = {
  34872. 'mapKeys': [1],
  34873. 'reduceRight': [1, 0]
  34874. };
  34875. /** Used to map method names to rearg configs. */
  34876. exports.methodRearg = {
  34877. 'assignInAllWith': [1, 0],
  34878. 'assignInWith': [1, 2, 0],
  34879. 'assignAllWith': [1, 0],
  34880. 'assignWith': [1, 2, 0],
  34881. 'differenceBy': [1, 2, 0],
  34882. 'differenceWith': [1, 2, 0],
  34883. 'getOr': [2, 1, 0],
  34884. 'intersectionBy': [1, 2, 0],
  34885. 'intersectionWith': [1, 2, 0],
  34886. 'isEqualWith': [1, 2, 0],
  34887. 'isMatchWith': [2, 1, 0],
  34888. 'mergeAllWith': [1, 0],
  34889. 'mergeWith': [1, 2, 0],
  34890. 'padChars': [2, 1, 0],
  34891. 'padCharsEnd': [2, 1, 0],
  34892. 'padCharsStart': [2, 1, 0],
  34893. 'pullAllBy': [2, 1, 0],
  34894. 'pullAllWith': [2, 1, 0],
  34895. 'rangeStep': [1, 2, 0],
  34896. 'rangeStepRight': [1, 2, 0],
  34897. 'setWith': [3, 1, 2, 0],
  34898. 'sortedIndexBy': [2, 1, 0],
  34899. 'sortedLastIndexBy': [2, 1, 0],
  34900. 'unionBy': [1, 2, 0],
  34901. 'unionWith': [1, 2, 0],
  34902. 'updateWith': [3, 1, 2, 0],
  34903. 'xorBy': [1, 2, 0],
  34904. 'xorWith': [1, 2, 0],
  34905. 'zipWith': [1, 2, 0]
  34906. };
  34907. /** Used to map method names to spread configs. */
  34908. exports.methodSpread = {
  34909. 'assignAll': { 'start': 0 },
  34910. 'assignAllWith': { 'start': 0 },
  34911. 'assignInAll': { 'start': 0 },
  34912. 'assignInAllWith': { 'start': 0 },
  34913. 'defaultsAll': { 'start': 0 },
  34914. 'defaultsDeepAll': { 'start': 0 },
  34915. 'invokeArgs': { 'start': 2 },
  34916. 'invokeArgsMap': { 'start': 2 },
  34917. 'mergeAll': { 'start': 0 },
  34918. 'mergeAllWith': { 'start': 0 },
  34919. 'partial': { 'start': 1 },
  34920. 'partialRight': { 'start': 1 },
  34921. 'without': { 'start': 1 },
  34922. 'zipAll': { 'start': 0 }
  34923. };
  34924. /** Used to identify methods which mutate arrays or objects. */
  34925. exports.mutate = {
  34926. 'array': {
  34927. 'fill': true,
  34928. 'pull': true,
  34929. 'pullAll': true,
  34930. 'pullAllBy': true,
  34931. 'pullAllWith': true,
  34932. 'pullAt': true,
  34933. 'remove': true,
  34934. 'reverse': true
  34935. },
  34936. 'object': {
  34937. 'assign': true,
  34938. 'assignAll': true,
  34939. 'assignAllWith': true,
  34940. 'assignIn': true,
  34941. 'assignInAll': true,
  34942. 'assignInAllWith': true,
  34943. 'assignInWith': true,
  34944. 'assignWith': true,
  34945. 'defaults': true,
  34946. 'defaultsAll': true,
  34947. 'defaultsDeep': true,
  34948. 'defaultsDeepAll': true,
  34949. 'merge': true,
  34950. 'mergeAll': true,
  34951. 'mergeAllWith': true,
  34952. 'mergeWith': true,
  34953. },
  34954. 'set': {
  34955. 'set': true,
  34956. 'setWith': true,
  34957. 'unset': true,
  34958. 'update': true,
  34959. 'updateWith': true
  34960. }
  34961. };
  34962. /** Used to map real names to their aliases. */
  34963. exports.realToAlias = (function() {
  34964. var hasOwnProperty = Object.prototype.hasOwnProperty,
  34965. object = exports.aliasToReal,
  34966. result = {};
  34967. for (var key in object) {
  34968. var value = object[key];
  34969. if (hasOwnProperty.call(result, value)) {
  34970. result[value].push(key);
  34971. } else {
  34972. result[value] = [key];
  34973. }
  34974. }
  34975. return result;
  34976. }());
  34977. /** Used to map method names to other names. */
  34978. exports.remap = {
  34979. 'assignAll': 'assign',
  34980. 'assignAllWith': 'assignWith',
  34981. 'assignInAll': 'assignIn',
  34982. 'assignInAllWith': 'assignInWith',
  34983. 'curryN': 'curry',
  34984. 'curryRightN': 'curryRight',
  34985. 'defaultsAll': 'defaults',
  34986. 'defaultsDeepAll': 'defaultsDeep',
  34987. 'findFrom': 'find',
  34988. 'findIndexFrom': 'findIndex',
  34989. 'findLastFrom': 'findLast',
  34990. 'findLastIndexFrom': 'findLastIndex',
  34991. 'getOr': 'get',
  34992. 'includesFrom': 'includes',
  34993. 'indexOfFrom': 'indexOf',
  34994. 'invokeArgs': 'invoke',
  34995. 'invokeArgsMap': 'invokeMap',
  34996. 'lastIndexOfFrom': 'lastIndexOf',
  34997. 'mergeAll': 'merge',
  34998. 'mergeAllWith': 'mergeWith',
  34999. 'padChars': 'pad',
  35000. 'padCharsEnd': 'padEnd',
  35001. 'padCharsStart': 'padStart',
  35002. 'propertyOf': 'get',
  35003. 'rangeStep': 'range',
  35004. 'rangeStepRight': 'rangeRight',
  35005. 'restFrom': 'rest',
  35006. 'spreadFrom': 'spread',
  35007. 'trimChars': 'trim',
  35008. 'trimCharsEnd': 'trimEnd',
  35009. 'trimCharsStart': 'trimStart',
  35010. 'zipAll': 'zip'
  35011. };
  35012. /** Used to track methods that skip fixing their arity. */
  35013. exports.skipFixed = {
  35014. 'castArray': true,
  35015. 'flow': true,
  35016. 'flowRight': true,
  35017. 'iteratee': true,
  35018. 'mixin': true,
  35019. 'rearg': true,
  35020. 'runInContext': true
  35021. };
  35022. /** Used to track methods that skip rearranging arguments. */
  35023. exports.skipRearg = {
  35024. 'add': true,
  35025. 'assign': true,
  35026. 'assignIn': true,
  35027. 'bind': true,
  35028. 'bindKey': true,
  35029. 'concat': true,
  35030. 'difference': true,
  35031. 'divide': true,
  35032. 'eq': true,
  35033. 'gt': true,
  35034. 'gte': true,
  35035. 'isEqual': true,
  35036. 'lt': true,
  35037. 'lte': true,
  35038. 'matchesProperty': true,
  35039. 'merge': true,
  35040. 'multiply': true,
  35041. 'overArgs': true,
  35042. 'partial': true,
  35043. 'partialRight': true,
  35044. 'propertyOf': true,
  35045. 'random': true,
  35046. 'range': true,
  35047. 'rangeRight': true,
  35048. 'subtract': true,
  35049. 'zip': true,
  35050. 'zipObject': true,
  35051. 'zipObjectDeep': true
  35052. };
  35053. /***/ }),
  35054. /* 397 */
  35055. /***/ (function(module, exports, __webpack_require__) {
  35056. module.exports = {
  35057. 'ary': __webpack_require__(398),
  35058. 'assign': __webpack_require__(171),
  35059. 'clone': __webpack_require__(35),
  35060. 'curry': __webpack_require__(419),
  35061. 'forEach': __webpack_require__(108),
  35062. 'isArray': __webpack_require__(9),
  35063. 'isError': __webpack_require__(420),
  35064. 'isFunction': __webpack_require__(13),
  35065. 'isWeakMap': __webpack_require__(421),
  35066. 'iteratee': __webpack_require__(422),
  35067. 'keys': __webpack_require__(111),
  35068. 'rearg': __webpack_require__(439),
  35069. 'toInteger': __webpack_require__(87),
  35070. 'toPath': __webpack_require__(442)
  35071. };
  35072. /***/ }),
  35073. /* 398 */
  35074. /***/ (function(module, exports, __webpack_require__) {
  35075. var createWrap = __webpack_require__(118);
  35076. /** Used to compose bitmasks for function metadata. */
  35077. var WRAP_ARY_FLAG = 128;
  35078. /**
  35079. * Creates a function that invokes `func`, with up to `n` arguments,
  35080. * ignoring any additional arguments.
  35081. *
  35082. * @static
  35083. * @memberOf _
  35084. * @since 3.0.0
  35085. * @category Function
  35086. * @param {Function} func The function to cap arguments for.
  35087. * @param {number} [n=func.length] The arity cap.
  35088. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  35089. * @returns {Function} Returns the new capped function.
  35090. * @example
  35091. *
  35092. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  35093. * // => [6, 8, 10]
  35094. */
  35095. function ary(func, n, guard) {
  35096. n = guard ? undefined : n;
  35097. n = (func && n == null) ? func.length : n;
  35098. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  35099. }
  35100. module.exports = ary;
  35101. /***/ }),
  35102. /* 399 */
  35103. /***/ (function(module, exports, __webpack_require__) {
  35104. var createCtor = __webpack_require__(85),
  35105. root = __webpack_require__(10);
  35106. /** Used to compose bitmasks for function metadata. */
  35107. var WRAP_BIND_FLAG = 1;
  35108. /**
  35109. * Creates a function that wraps `func` to invoke it with the optional `this`
  35110. * binding of `thisArg`.
  35111. *
  35112. * @private
  35113. * @param {Function} func The function to wrap.
  35114. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  35115. * @param {*} [thisArg] The `this` binding of `func`.
  35116. * @returns {Function} Returns the new wrapped function.
  35117. */
  35118. function createBind(func, bitmask, thisArg) {
  35119. var isBind = bitmask & WRAP_BIND_FLAG,
  35120. Ctor = createCtor(func);
  35121. function wrapper() {
  35122. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  35123. return fn.apply(isBind ? thisArg : this, arguments);
  35124. }
  35125. return wrapper;
  35126. }
  35127. module.exports = createBind;
  35128. /***/ }),
  35129. /* 400 */
  35130. /***/ (function(module, exports, __webpack_require__) {
  35131. var apply = __webpack_require__(119),
  35132. createCtor = __webpack_require__(85),
  35133. createHybrid = __webpack_require__(195),
  35134. createRecurry = __webpack_require__(198),
  35135. getHolder = __webpack_require__(206),
  35136. replaceHolders = __webpack_require__(123),
  35137. root = __webpack_require__(10);
  35138. /**
  35139. * Creates a function that wraps `func` to enable currying.
  35140. *
  35141. * @private
  35142. * @param {Function} func The function to wrap.
  35143. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  35144. * @param {number} arity The arity of `func`.
  35145. * @returns {Function} Returns the new wrapped function.
  35146. */
  35147. function createCurry(func, bitmask, arity) {
  35148. var Ctor = createCtor(func);
  35149. function wrapper() {
  35150. var length = arguments.length,
  35151. args = Array(length),
  35152. index = length,
  35153. placeholder = getHolder(wrapper);
  35154. while (index--) {
  35155. args[index] = arguments[index];
  35156. }
  35157. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  35158. ? []
  35159. : replaceHolders(args, placeholder);
  35160. length -= holders.length;
  35161. if (length < arity) {
  35162. return createRecurry(
  35163. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  35164. args, holders, undefined, undefined, arity - length);
  35165. }
  35166. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  35167. return apply(fn, this, args);
  35168. }
  35169. return wrapper;
  35170. }
  35171. module.exports = createCurry;
  35172. /***/ }),
  35173. /* 401 */
  35174. /***/ (function(module, exports) {
  35175. /**
  35176. * Gets the number of `placeholder` occurrences in `array`.
  35177. *
  35178. * @private
  35179. * @param {Array} array The array to inspect.
  35180. * @param {*} placeholder The placeholder to search for.
  35181. * @returns {number} Returns the placeholder count.
  35182. */
  35183. function countHolders(array, placeholder) {
  35184. var length = array.length,
  35185. result = 0;
  35186. while (length--) {
  35187. if (array[length] === placeholder) {
  35188. ++result;
  35189. }
  35190. }
  35191. return result;
  35192. }
  35193. module.exports = countHolders;
  35194. /***/ }),
  35195. /* 402 */
  35196. /***/ (function(module, exports, __webpack_require__) {
  35197. var LazyWrapper = __webpack_require__(120),
  35198. getData = __webpack_require__(199),
  35199. getFuncName = __webpack_require__(403),
  35200. lodash = __webpack_require__(405);
  35201. /**
  35202. * Checks if `func` has a lazy counterpart.
  35203. *
  35204. * @private
  35205. * @param {Function} func The function to check.
  35206. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  35207. * else `false`.
  35208. */
  35209. function isLaziable(func) {
  35210. var funcName = getFuncName(func),
  35211. other = lodash[funcName];
  35212. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  35213. return false;
  35214. }
  35215. if (func === other) {
  35216. return true;
  35217. }
  35218. var data = getData(other);
  35219. return !!data && func === data[0];
  35220. }
  35221. module.exports = isLaziable;
  35222. /***/ }),
  35223. /* 403 */
  35224. /***/ (function(module, exports, __webpack_require__) {
  35225. var realNames = __webpack_require__(404);
  35226. /** Used for built-in method references. */
  35227. var objectProto = Object.prototype;
  35228. /** Used to check objects for own properties. */
  35229. var hasOwnProperty = objectProto.hasOwnProperty;
  35230. /**
  35231. * Gets the name of `func`.
  35232. *
  35233. * @private
  35234. * @param {Function} func The function to query.
  35235. * @returns {string} Returns the function name.
  35236. */
  35237. function getFuncName(func) {
  35238. var result = (func.name + ''),
  35239. array = realNames[result],
  35240. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  35241. while (length--) {
  35242. var data = array[length],
  35243. otherFunc = data.func;
  35244. if (otherFunc == null || otherFunc == func) {
  35245. return data.name;
  35246. }
  35247. }
  35248. return result;
  35249. }
  35250. module.exports = getFuncName;
  35251. /***/ }),
  35252. /* 404 */
  35253. /***/ (function(module, exports) {
  35254. /** Used to lookup unminified function names. */
  35255. var realNames = {};
  35256. module.exports = realNames;
  35257. /***/ }),
  35258. /* 405 */
  35259. /***/ (function(module, exports, __webpack_require__) {
  35260. var LazyWrapper = __webpack_require__(120),
  35261. LodashWrapper = __webpack_require__(201),
  35262. baseLodash = __webpack_require__(121),
  35263. isArray = __webpack_require__(9),
  35264. isObjectLike = __webpack_require__(14),
  35265. wrapperClone = __webpack_require__(406);
  35266. /** Used for built-in method references. */
  35267. var objectProto = Object.prototype;
  35268. /** Used to check objects for own properties. */
  35269. var hasOwnProperty = objectProto.hasOwnProperty;
  35270. /**
  35271. * Creates a `lodash` object which wraps `value` to enable implicit method
  35272. * chain sequences. Methods that operate on and return arrays, collections,
  35273. * and functions can be chained together. Methods that retrieve a single value
  35274. * or may return a primitive value will automatically end the chain sequence
  35275. * and return the unwrapped value. Otherwise, the value must be unwrapped
  35276. * with `_#value`.
  35277. *
  35278. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  35279. * enabled using `_.chain`.
  35280. *
  35281. * The execution of chained methods is lazy, that is, it's deferred until
  35282. * `_#value` is implicitly or explicitly called.
  35283. *
  35284. * Lazy evaluation allows several methods to support shortcut fusion.
  35285. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  35286. * the creation of intermediate arrays and can greatly reduce the number of
  35287. * iteratee executions. Sections of a chain sequence qualify for shortcut
  35288. * fusion if the section is applied to an array and iteratees accept only
  35289. * one argument. The heuristic for whether a section qualifies for shortcut
  35290. * fusion is subject to change.
  35291. *
  35292. * Chaining is supported in custom builds as long as the `_#value` method is
  35293. * directly or indirectly included in the build.
  35294. *
  35295. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  35296. *
  35297. * The wrapper `Array` methods are:
  35298. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  35299. *
  35300. * The wrapper `String` methods are:
  35301. * `replace` and `split`
  35302. *
  35303. * The wrapper methods that support shortcut fusion are:
  35304. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  35305. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  35306. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  35307. *
  35308. * The chainable wrapper methods are:
  35309. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  35310. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  35311. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  35312. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  35313. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  35314. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  35315. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  35316. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  35317. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  35318. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  35319. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  35320. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  35321. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  35322. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  35323. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  35324. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  35325. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  35326. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  35327. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  35328. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  35329. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  35330. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  35331. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  35332. * `zipObject`, `zipObjectDeep`, and `zipWith`
  35333. *
  35334. * The wrapper methods that are **not** chainable by default are:
  35335. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  35336. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  35337. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  35338. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  35339. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  35340. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  35341. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  35342. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  35343. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  35344. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  35345. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  35346. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  35347. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  35348. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  35349. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  35350. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  35351. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  35352. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  35353. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  35354. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  35355. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  35356. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  35357. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  35358. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  35359. * `upperFirst`, `value`, and `words`
  35360. *
  35361. * @name _
  35362. * @constructor
  35363. * @category Seq
  35364. * @param {*} value The value to wrap in a `lodash` instance.
  35365. * @returns {Object} Returns the new `lodash` wrapper instance.
  35366. * @example
  35367. *
  35368. * function square(n) {
  35369. * return n * n;
  35370. * }
  35371. *
  35372. * var wrapped = _([1, 2, 3]);
  35373. *
  35374. * // Returns an unwrapped value.
  35375. * wrapped.reduce(_.add);
  35376. * // => 6
  35377. *
  35378. * // Returns a wrapped value.
  35379. * var squares = wrapped.map(square);
  35380. *
  35381. * _.isArray(squares);
  35382. * // => false
  35383. *
  35384. * _.isArray(squares.value());
  35385. * // => true
  35386. */
  35387. function lodash(value) {
  35388. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  35389. if (value instanceof LodashWrapper) {
  35390. return value;
  35391. }
  35392. if (hasOwnProperty.call(value, '__wrapped__')) {
  35393. return wrapperClone(value);
  35394. }
  35395. }
  35396. return new LodashWrapper(value);
  35397. }
  35398. // Ensure wrappers are instances of `baseLodash`.
  35399. lodash.prototype = baseLodash.prototype;
  35400. lodash.prototype.constructor = lodash;
  35401. module.exports = lodash;
  35402. /***/ }),
  35403. /* 406 */
  35404. /***/ (function(module, exports, __webpack_require__) {
  35405. var LazyWrapper = __webpack_require__(120),
  35406. LodashWrapper = __webpack_require__(201),
  35407. copyArray = __webpack_require__(49);
  35408. /**
  35409. * Creates a clone of `wrapper`.
  35410. *
  35411. * @private
  35412. * @param {Object} wrapper The wrapper to clone.
  35413. * @returns {Object} Returns the cloned wrapper.
  35414. */
  35415. function wrapperClone(wrapper) {
  35416. if (wrapper instanceof LazyWrapper) {
  35417. return wrapper.clone();
  35418. }
  35419. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  35420. result.__actions__ = copyArray(wrapper.__actions__);
  35421. result.__index__ = wrapper.__index__;
  35422. result.__values__ = wrapper.__values__;
  35423. return result;
  35424. }
  35425. module.exports = wrapperClone;
  35426. /***/ }),
  35427. /* 407 */
  35428. /***/ (function(module, exports) {
  35429. /** Used to match wrap detail comments. */
  35430. var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  35431. reSplitDetails = /,? & /;
  35432. /**
  35433. * Extracts wrapper details from the `source` body comment.
  35434. *
  35435. * @private
  35436. * @param {string} source The source to inspect.
  35437. * @returns {Array} Returns the wrapper details.
  35438. */
  35439. function getWrapDetails(source) {
  35440. var match = source.match(reWrapDetails);
  35441. return match ? match[1].split(reSplitDetails) : [];
  35442. }
  35443. module.exports = getWrapDetails;
  35444. /***/ }),
  35445. /* 408 */
  35446. /***/ (function(module, exports) {
  35447. /** Used to match wrap detail comments. */
  35448. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
  35449. /**
  35450. * Inserts wrapper `details` in a comment at the top of the `source` body.
  35451. *
  35452. * @private
  35453. * @param {string} source The source to modify.
  35454. * @returns {Array} details The details to insert.
  35455. * @returns {string} Returns the modified source.
  35456. */
  35457. function insertWrapDetails(source, details) {
  35458. var length = details.length;
  35459. if (!length) {
  35460. return source;
  35461. }
  35462. var lastIndex = length - 1;
  35463. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  35464. details = details.join(length > 2 ? ', ' : ' ');
  35465. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  35466. }
  35467. module.exports = insertWrapDetails;
  35468. /***/ }),
  35469. /* 409 */
  35470. /***/ (function(module, exports, __webpack_require__) {
  35471. var constant = __webpack_require__(410),
  35472. defineProperty = __webpack_require__(170),
  35473. identity = __webpack_require__(84);
  35474. /**
  35475. * The base implementation of `setToString` without support for hot loop shorting.
  35476. *
  35477. * @private
  35478. * @param {Function} func The function to modify.
  35479. * @param {Function} string The `toString` result.
  35480. * @returns {Function} Returns `func`.
  35481. */
  35482. var baseSetToString = !defineProperty ? identity : function(func, string) {
  35483. return defineProperty(func, 'toString', {
  35484. 'configurable': true,
  35485. 'enumerable': false,
  35486. 'value': constant(string),
  35487. 'writable': true
  35488. });
  35489. };
  35490. module.exports = baseSetToString;
  35491. /***/ }),
  35492. /* 410 */
  35493. /***/ (function(module, exports) {
  35494. /**
  35495. * Creates a function that returns `value`.
  35496. *
  35497. * @static
  35498. * @memberOf _
  35499. * @since 2.4.0
  35500. * @category Util
  35501. * @param {*} value The value to return from the new function.
  35502. * @returns {Function} Returns the new constant function.
  35503. * @example
  35504. *
  35505. * var objects = _.times(2, _.constant({ 'a': 1 }));
  35506. *
  35507. * console.log(objects);
  35508. * // => [{ 'a': 1 }, { 'a': 1 }]
  35509. *
  35510. * console.log(objects[0] === objects[1]);
  35511. * // => true
  35512. */
  35513. function constant(value) {
  35514. return function() {
  35515. return value;
  35516. };
  35517. }
  35518. module.exports = constant;
  35519. /***/ }),
  35520. /* 411 */
  35521. /***/ (function(module, exports, __webpack_require__) {
  35522. var arrayEach = __webpack_require__(108),
  35523. arrayIncludes = __webpack_require__(86);
  35524. /** Used to compose bitmasks for function metadata. */
  35525. var WRAP_BIND_FLAG = 1,
  35526. WRAP_BIND_KEY_FLAG = 2,
  35527. WRAP_CURRY_FLAG = 8,
  35528. WRAP_CURRY_RIGHT_FLAG = 16,
  35529. WRAP_PARTIAL_FLAG = 32,
  35530. WRAP_PARTIAL_RIGHT_FLAG = 64,
  35531. WRAP_ARY_FLAG = 128,
  35532. WRAP_REARG_FLAG = 256,
  35533. WRAP_FLIP_FLAG = 512;
  35534. /** Used to associate wrap methods with their bit flags. */
  35535. var wrapFlags = [
  35536. ['ary', WRAP_ARY_FLAG],
  35537. ['bind', WRAP_BIND_FLAG],
  35538. ['bindKey', WRAP_BIND_KEY_FLAG],
  35539. ['curry', WRAP_CURRY_FLAG],
  35540. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  35541. ['flip', WRAP_FLIP_FLAG],
  35542. ['partial', WRAP_PARTIAL_FLAG],
  35543. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  35544. ['rearg', WRAP_REARG_FLAG]
  35545. ];
  35546. /**
  35547. * Updates wrapper `details` based on `bitmask` flags.
  35548. *
  35549. * @private
  35550. * @returns {Array} details The details to modify.
  35551. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  35552. * @returns {Array} Returns `details`.
  35553. */
  35554. function updateWrapDetails(details, bitmask) {
  35555. arrayEach(wrapFlags, function(pair) {
  35556. var value = '_.' + pair[0];
  35557. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  35558. details.push(value);
  35559. }
  35560. });
  35561. return details.sort();
  35562. }
  35563. module.exports = updateWrapDetails;
  35564. /***/ }),
  35565. /* 412 */
  35566. /***/ (function(module, exports, __webpack_require__) {
  35567. var baseFindIndex = __webpack_require__(205),
  35568. baseIsNaN = __webpack_require__(413),
  35569. strictIndexOf = __webpack_require__(414);
  35570. /**
  35571. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  35572. *
  35573. * @private
  35574. * @param {Array} array The array to inspect.
  35575. * @param {*} value The value to search for.
  35576. * @param {number} fromIndex The index to search from.
  35577. * @returns {number} Returns the index of the matched value, else `-1`.
  35578. */
  35579. function baseIndexOf(array, value, fromIndex) {
  35580. return value === value
  35581. ? strictIndexOf(array, value, fromIndex)
  35582. : baseFindIndex(array, baseIsNaN, fromIndex);
  35583. }
  35584. module.exports = baseIndexOf;
  35585. /***/ }),
  35586. /* 413 */
  35587. /***/ (function(module, exports) {
  35588. /**
  35589. * The base implementation of `_.isNaN` without support for number objects.
  35590. *
  35591. * @private
  35592. * @param {*} value The value to check.
  35593. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  35594. */
  35595. function baseIsNaN(value) {
  35596. return value !== value;
  35597. }
  35598. module.exports = baseIsNaN;
  35599. /***/ }),
  35600. /* 414 */
  35601. /***/ (function(module, exports) {
  35602. /**
  35603. * A specialized version of `_.indexOf` which performs strict equality
  35604. * comparisons of values, i.e. `===`.
  35605. *
  35606. * @private
  35607. * @param {Array} array The array to inspect.
  35608. * @param {*} value The value to search for.
  35609. * @param {number} fromIndex The index to search from.
  35610. * @returns {number} Returns the index of the matched value, else `-1`.
  35611. */
  35612. function strictIndexOf(array, value, fromIndex) {
  35613. var index = fromIndex - 1,
  35614. length = array.length;
  35615. while (++index < length) {
  35616. if (array[index] === value) {
  35617. return index;
  35618. }
  35619. }
  35620. return -1;
  35621. }
  35622. module.exports = strictIndexOf;
  35623. /***/ }),
  35624. /* 415 */
  35625. /***/ (function(module, exports, __webpack_require__) {
  35626. var copyArray = __webpack_require__(49),
  35627. isIndex = __webpack_require__(63);
  35628. /* Built-in method references for those with the same name as other `lodash` methods. */
  35629. var nativeMin = Math.min;
  35630. /**
  35631. * Reorder `array` according to the specified indexes where the element at
  35632. * the first index is assigned as the first element, the element at
  35633. * the second index is assigned as the second element, and so on.
  35634. *
  35635. * @private
  35636. * @param {Array} array The array to reorder.
  35637. * @param {Array} indexes The arranged array indexes.
  35638. * @returns {Array} Returns `array`.
  35639. */
  35640. function reorder(array, indexes) {
  35641. var arrLength = array.length,
  35642. length = nativeMin(indexes.length, arrLength),
  35643. oldArray = copyArray(array);
  35644. while (length--) {
  35645. var index = indexes[length];
  35646. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  35647. }
  35648. return array;
  35649. }
  35650. module.exports = reorder;
  35651. /***/ }),
  35652. /* 416 */
  35653. /***/ (function(module, exports, __webpack_require__) {
  35654. var apply = __webpack_require__(119),
  35655. createCtor = __webpack_require__(85),
  35656. root = __webpack_require__(10);
  35657. /** Used to compose bitmasks for function metadata. */
  35658. var WRAP_BIND_FLAG = 1;
  35659. /**
  35660. * Creates a function that wraps `func` to invoke it with the `this` binding
  35661. * of `thisArg` and `partials` prepended to the arguments it receives.
  35662. *
  35663. * @private
  35664. * @param {Function} func The function to wrap.
  35665. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  35666. * @param {*} thisArg The `this` binding of `func`.
  35667. * @param {Array} partials The arguments to prepend to those provided to
  35668. * the new function.
  35669. * @returns {Function} Returns the new wrapped function.
  35670. */
  35671. function createPartial(func, bitmask, thisArg, partials) {
  35672. var isBind = bitmask & WRAP_BIND_FLAG,
  35673. Ctor = createCtor(func);
  35674. function wrapper() {
  35675. var argsIndex = -1,
  35676. argsLength = arguments.length,
  35677. leftIndex = -1,
  35678. leftLength = partials.length,
  35679. args = Array(leftLength + argsLength),
  35680. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  35681. while (++leftIndex < leftLength) {
  35682. args[leftIndex] = partials[leftIndex];
  35683. }
  35684. while (argsLength--) {
  35685. args[leftIndex++] = arguments[++argsIndex];
  35686. }
  35687. return apply(fn, isBind ? thisArg : this, args);
  35688. }
  35689. return wrapper;
  35690. }
  35691. module.exports = createPartial;
  35692. /***/ }),
  35693. /* 417 */
  35694. /***/ (function(module, exports, __webpack_require__) {
  35695. var composeArgs = __webpack_require__(196),
  35696. composeArgsRight = __webpack_require__(197),
  35697. replaceHolders = __webpack_require__(123);
  35698. /** Used as the internal argument placeholder. */
  35699. var PLACEHOLDER = '__lodash_placeholder__';
  35700. /** Used to compose bitmasks for function metadata. */
  35701. var WRAP_BIND_FLAG = 1,
  35702. WRAP_BIND_KEY_FLAG = 2,
  35703. WRAP_CURRY_BOUND_FLAG = 4,
  35704. WRAP_CURRY_FLAG = 8,
  35705. WRAP_ARY_FLAG = 128,
  35706. WRAP_REARG_FLAG = 256;
  35707. /* Built-in method references for those with the same name as other `lodash` methods. */
  35708. var nativeMin = Math.min;
  35709. /**
  35710. * Merges the function metadata of `source` into `data`.
  35711. *
  35712. * Merging metadata reduces the number of wrappers used to invoke a function.
  35713. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  35714. * may be applied regardless of execution order. Methods like `_.ary` and
  35715. * `_.rearg` modify function arguments, making the order in which they are
  35716. * executed important, preventing the merging of metadata. However, we make
  35717. * an exception for a safe combined case where curried functions have `_.ary`
  35718. * and or `_.rearg` applied.
  35719. *
  35720. * @private
  35721. * @param {Array} data The destination metadata.
  35722. * @param {Array} source The source metadata.
  35723. * @returns {Array} Returns `data`.
  35724. */
  35725. function mergeData(data, source) {
  35726. var bitmask = data[1],
  35727. srcBitmask = source[1],
  35728. newBitmask = bitmask | srcBitmask,
  35729. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  35730. var isCombo =
  35731. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  35732. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  35733. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  35734. // Exit early if metadata can't be merged.
  35735. if (!(isCommon || isCombo)) {
  35736. return data;
  35737. }
  35738. // Use source `thisArg` if available.
  35739. if (srcBitmask & WRAP_BIND_FLAG) {
  35740. data[2] = source[2];
  35741. // Set when currying a bound function.
  35742. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  35743. }
  35744. // Compose partial arguments.
  35745. var value = source[3];
  35746. if (value) {
  35747. var partials = data[3];
  35748. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  35749. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  35750. }
  35751. // Compose partial right arguments.
  35752. value = source[5];
  35753. if (value) {
  35754. partials = data[5];
  35755. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  35756. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  35757. }
  35758. // Use source `argPos` if available.
  35759. value = source[7];
  35760. if (value) {
  35761. data[7] = value;
  35762. }
  35763. // Use source `ary` if it's smaller.
  35764. if (srcBitmask & WRAP_ARY_FLAG) {
  35765. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  35766. }
  35767. // Use source `arity` if one is not provided.
  35768. if (data[9] == null) {
  35769. data[9] = source[9];
  35770. }
  35771. // Use source `func` and merge bitmasks.
  35772. data[0] = source[0];
  35773. data[1] = newBitmask;
  35774. return data;
  35775. }
  35776. module.exports = mergeData;
  35777. /***/ }),
  35778. /* 418 */
  35779. /***/ (function(module, exports, __webpack_require__) {
  35780. var toNumber = __webpack_require__(207);
  35781. /** Used as references for various `Number` constants. */
  35782. var INFINITY = 1 / 0,
  35783. MAX_INTEGER = 1.7976931348623157e+308;
  35784. /**
  35785. * Converts `value` to a finite number.
  35786. *
  35787. * @static
  35788. * @memberOf _
  35789. * @since 4.12.0
  35790. * @category Lang
  35791. * @param {*} value The value to convert.
  35792. * @returns {number} Returns the converted number.
  35793. * @example
  35794. *
  35795. * _.toFinite(3.2);
  35796. * // => 3.2
  35797. *
  35798. * _.toFinite(Number.MIN_VALUE);
  35799. * // => 5e-324
  35800. *
  35801. * _.toFinite(Infinity);
  35802. * // => 1.7976931348623157e+308
  35803. *
  35804. * _.toFinite('3.2');
  35805. * // => 3.2
  35806. */
  35807. function toFinite(value) {
  35808. if (!value) {
  35809. return value === 0 ? value : 0;
  35810. }
  35811. value = toNumber(value);
  35812. if (value === INFINITY || value === -INFINITY) {
  35813. var sign = (value < 0 ? -1 : 1);
  35814. return sign * MAX_INTEGER;
  35815. }
  35816. return value === value ? value : 0;
  35817. }
  35818. module.exports = toFinite;
  35819. /***/ }),
  35820. /* 419 */
  35821. /***/ (function(module, exports, __webpack_require__) {
  35822. var createWrap = __webpack_require__(118);
  35823. /** Used to compose bitmasks for function metadata. */
  35824. var WRAP_CURRY_FLAG = 8;
  35825. /**
  35826. * Creates a function that accepts arguments of `func` and either invokes
  35827. * `func` returning its result, if at least `arity` number of arguments have
  35828. * been provided, or returns a function that accepts the remaining `func`
  35829. * arguments, and so on. The arity of `func` may be specified if `func.length`
  35830. * is not sufficient.
  35831. *
  35832. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  35833. * may be used as a placeholder for provided arguments.
  35834. *
  35835. * **Note:** This method doesn't set the "length" property of curried functions.
  35836. *
  35837. * @static
  35838. * @memberOf _
  35839. * @since 2.0.0
  35840. * @category Function
  35841. * @param {Function} func The function to curry.
  35842. * @param {number} [arity=func.length] The arity of `func`.
  35843. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  35844. * @returns {Function} Returns the new curried function.
  35845. * @example
  35846. *
  35847. * var abc = function(a, b, c) {
  35848. * return [a, b, c];
  35849. * };
  35850. *
  35851. * var curried = _.curry(abc);
  35852. *
  35853. * curried(1)(2)(3);
  35854. * // => [1, 2, 3]
  35855. *
  35856. * curried(1, 2)(3);
  35857. * // => [1, 2, 3]
  35858. *
  35859. * curried(1, 2, 3);
  35860. * // => [1, 2, 3]
  35861. *
  35862. * // Curried with placeholders.
  35863. * curried(1)(_, 3)(2);
  35864. * // => [1, 2, 3]
  35865. */
  35866. function curry(func, arity, guard) {
  35867. arity = guard ? undefined : arity;
  35868. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  35869. result.placeholder = curry.placeholder;
  35870. return result;
  35871. }
  35872. // Assign default placeholders.
  35873. curry.placeholder = {};
  35874. module.exports = curry;
  35875. /***/ }),
  35876. /* 420 */
  35877. /***/ (function(module, exports, __webpack_require__) {
  35878. var baseGetTag = __webpack_require__(26),
  35879. isObjectLike = __webpack_require__(14),
  35880. isPlainObject = __webpack_require__(124);
  35881. /** `Object#toString` result references. */
  35882. var domExcTag = '[object DOMException]',
  35883. errorTag = '[object Error]';
  35884. /**
  35885. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  35886. * `SyntaxError`, `TypeError`, or `URIError` object.
  35887. *
  35888. * @static
  35889. * @memberOf _
  35890. * @since 3.0.0
  35891. * @category Lang
  35892. * @param {*} value The value to check.
  35893. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  35894. * @example
  35895. *
  35896. * _.isError(new Error);
  35897. * // => true
  35898. *
  35899. * _.isError(Error);
  35900. * // => false
  35901. */
  35902. function isError(value) {
  35903. if (!isObjectLike(value)) {
  35904. return false;
  35905. }
  35906. var tag = baseGetTag(value);
  35907. return tag == errorTag || tag == domExcTag ||
  35908. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  35909. }
  35910. module.exports = isError;
  35911. /***/ }),
  35912. /* 421 */
  35913. /***/ (function(module, exports, __webpack_require__) {
  35914. var getTag = __webpack_require__(39),
  35915. isObjectLike = __webpack_require__(14);
  35916. /** `Object#toString` result references. */
  35917. var weakMapTag = '[object WeakMap]';
  35918. /**
  35919. * Checks if `value` is classified as a `WeakMap` object.
  35920. *
  35921. * @static
  35922. * @memberOf _
  35923. * @since 4.3.0
  35924. * @category Lang
  35925. * @param {*} value The value to check.
  35926. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  35927. * @example
  35928. *
  35929. * _.isWeakMap(new WeakMap);
  35930. * // => true
  35931. *
  35932. * _.isWeakMap(new Map);
  35933. * // => false
  35934. */
  35935. function isWeakMap(value) {
  35936. return isObjectLike(value) && getTag(value) == weakMapTag;
  35937. }
  35938. module.exports = isWeakMap;
  35939. /***/ }),
  35940. /* 422 */
  35941. /***/ (function(module, exports, __webpack_require__) {
  35942. var baseClone = __webpack_require__(74),
  35943. baseIteratee = __webpack_require__(29);
  35944. /** Used to compose bitmasks for cloning. */
  35945. var CLONE_DEEP_FLAG = 1;
  35946. /**
  35947. * Creates a function that invokes `func` with the arguments of the created
  35948. * function. If `func` is a property name, the created function returns the
  35949. * property value for a given element. If `func` is an array or object, the
  35950. * created function returns `true` for elements that contain the equivalent
  35951. * source properties, otherwise it returns `false`.
  35952. *
  35953. * @static
  35954. * @since 4.0.0
  35955. * @memberOf _
  35956. * @category Util
  35957. * @param {*} [func=_.identity] The value to convert to a callback.
  35958. * @returns {Function} Returns the callback.
  35959. * @example
  35960. *
  35961. * var users = [
  35962. * { 'user': 'barney', 'age': 36, 'active': true },
  35963. * { 'user': 'fred', 'age': 40, 'active': false }
  35964. * ];
  35965. *
  35966. * // The `_.matches` iteratee shorthand.
  35967. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  35968. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  35969. *
  35970. * // The `_.matchesProperty` iteratee shorthand.
  35971. * _.filter(users, _.iteratee(['user', 'fred']));
  35972. * // => [{ 'user': 'fred', 'age': 40 }]
  35973. *
  35974. * // The `_.property` iteratee shorthand.
  35975. * _.map(users, _.iteratee('user'));
  35976. * // => ['barney', 'fred']
  35977. *
  35978. * // Create custom iteratee shorthands.
  35979. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  35980. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  35981. * return func.test(string);
  35982. * };
  35983. * });
  35984. *
  35985. * _.filter(['abc', 'def'], /ef/);
  35986. * // => ['def']
  35987. */
  35988. function iteratee(func) {
  35989. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  35990. }
  35991. module.exports = iteratee;
  35992. /***/ }),
  35993. /* 423 */
  35994. /***/ (function(module, exports, __webpack_require__) {
  35995. var baseIsMatch = __webpack_require__(424),
  35996. getMatchData = __webpack_require__(430),
  35997. matchesStrictComparable = __webpack_require__(213);
  35998. /**
  35999. * The base implementation of `_.matches` which doesn't clone `source`.
  36000. *
  36001. * @private
  36002. * @param {Object} source The object of property values to match.
  36003. * @returns {Function} Returns the new spec function.
  36004. */
  36005. function baseMatches(source) {
  36006. var matchData = getMatchData(source);
  36007. if (matchData.length == 1 && matchData[0][2]) {
  36008. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  36009. }
  36010. return function(object) {
  36011. return object === source || baseIsMatch(object, source, matchData);
  36012. };
  36013. }
  36014. module.exports = baseMatches;
  36015. /***/ }),
  36016. /* 424 */
  36017. /***/ (function(module, exports, __webpack_require__) {
  36018. var Stack = __webpack_require__(75),
  36019. baseIsEqual = __webpack_require__(208);
  36020. /** Used to compose bitmasks for value comparisons. */
  36021. var COMPARE_PARTIAL_FLAG = 1,
  36022. COMPARE_UNORDERED_FLAG = 2;
  36023. /**
  36024. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  36025. *
  36026. * @private
  36027. * @param {Object} object The object to inspect.
  36028. * @param {Object} source The object of property values to match.
  36029. * @param {Array} matchData The property names, values, and compare flags to match.
  36030. * @param {Function} [customizer] The function to customize comparisons.
  36031. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  36032. */
  36033. function baseIsMatch(object, source, matchData, customizer) {
  36034. var index = matchData.length,
  36035. length = index,
  36036. noCustomizer = !customizer;
  36037. if (object == null) {
  36038. return !length;
  36039. }
  36040. object = Object(object);
  36041. while (index--) {
  36042. var data = matchData[index];
  36043. if ((noCustomizer && data[2])
  36044. ? data[1] !== object[data[0]]
  36045. : !(data[0] in object)
  36046. ) {
  36047. return false;
  36048. }
  36049. }
  36050. while (++index < length) {
  36051. data = matchData[index];
  36052. var key = data[0],
  36053. objValue = object[key],
  36054. srcValue = data[1];
  36055. if (noCustomizer && data[2]) {
  36056. if (objValue === undefined && !(key in object)) {
  36057. return false;
  36058. }
  36059. } else {
  36060. var stack = new Stack;
  36061. if (customizer) {
  36062. var result = customizer(objValue, srcValue, key, object, source, stack);
  36063. }
  36064. if (!(result === undefined
  36065. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  36066. : result
  36067. )) {
  36068. return false;
  36069. }
  36070. }
  36071. }
  36072. return true;
  36073. }
  36074. module.exports = baseIsMatch;
  36075. /***/ }),
  36076. /* 425 */
  36077. /***/ (function(module, exports, __webpack_require__) {
  36078. var Stack = __webpack_require__(75),
  36079. equalArrays = __webpack_require__(209),
  36080. equalByTag = __webpack_require__(428),
  36081. equalObjects = __webpack_require__(429),
  36082. getTag = __webpack_require__(39),
  36083. isArray = __webpack_require__(9),
  36084. isBuffer = __webpack_require__(62),
  36085. isTypedArray = __webpack_require__(82);
  36086. /** Used to compose bitmasks for value comparisons. */
  36087. var COMPARE_PARTIAL_FLAG = 1;
  36088. /** `Object#toString` result references. */
  36089. var argsTag = '[object Arguments]',
  36090. arrayTag = '[object Array]',
  36091. objectTag = '[object Object]';
  36092. /** Used for built-in method references. */
  36093. var objectProto = Object.prototype;
  36094. /** Used to check objects for own properties. */
  36095. var hasOwnProperty = objectProto.hasOwnProperty;
  36096. /**
  36097. * A specialized version of `baseIsEqual` for arrays and objects which performs
  36098. * deep comparisons and tracks traversed objects enabling objects with circular
  36099. * references to be compared.
  36100. *
  36101. * @private
  36102. * @param {Object} object The object to compare.
  36103. * @param {Object} other The other object to compare.
  36104. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  36105. * @param {Function} customizer The function to customize comparisons.
  36106. * @param {Function} equalFunc The function to determine equivalents of values.
  36107. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  36108. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  36109. */
  36110. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  36111. var objIsArr = isArray(object),
  36112. othIsArr = isArray(other),
  36113. objTag = objIsArr ? arrayTag : getTag(object),
  36114. othTag = othIsArr ? arrayTag : getTag(other);
  36115. objTag = objTag == argsTag ? objectTag : objTag;
  36116. othTag = othTag == argsTag ? objectTag : othTag;
  36117. var objIsObj = objTag == objectTag,
  36118. othIsObj = othTag == objectTag,
  36119. isSameTag = objTag == othTag;
  36120. if (isSameTag && isBuffer(object)) {
  36121. if (!isBuffer(other)) {
  36122. return false;
  36123. }
  36124. objIsArr = true;
  36125. objIsObj = false;
  36126. }
  36127. if (isSameTag && !objIsObj) {
  36128. stack || (stack = new Stack);
  36129. return (objIsArr || isTypedArray(object))
  36130. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  36131. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  36132. }
  36133. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  36134. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  36135. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  36136. if (objIsWrapped || othIsWrapped) {
  36137. var objUnwrapped = objIsWrapped ? object.value() : object,
  36138. othUnwrapped = othIsWrapped ? other.value() : other;
  36139. stack || (stack = new Stack);
  36140. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  36141. }
  36142. }
  36143. if (!isSameTag) {
  36144. return false;
  36145. }
  36146. stack || (stack = new Stack);
  36147. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  36148. }
  36149. module.exports = baseIsEqualDeep;
  36150. /***/ }),
  36151. /* 426 */
  36152. /***/ (function(module, exports) {
  36153. /** Used to stand-in for `undefined` hash values. */
  36154. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  36155. /**
  36156. * Adds `value` to the array cache.
  36157. *
  36158. * @private
  36159. * @name add
  36160. * @memberOf SetCache
  36161. * @alias push
  36162. * @param {*} value The value to cache.
  36163. * @returns {Object} Returns the cache instance.
  36164. */
  36165. function setCacheAdd(value) {
  36166. this.__data__.set(value, HASH_UNDEFINED);
  36167. return this;
  36168. }
  36169. module.exports = setCacheAdd;
  36170. /***/ }),
  36171. /* 427 */
  36172. /***/ (function(module, exports) {
  36173. /**
  36174. * Checks if `value` is in the array cache.
  36175. *
  36176. * @private
  36177. * @name has
  36178. * @memberOf SetCache
  36179. * @param {*} value The value to search for.
  36180. * @returns {number} Returns `true` if `value` is found, else `false`.
  36181. */
  36182. function setCacheHas(value) {
  36183. return this.__data__.has(value);
  36184. }
  36185. module.exports = setCacheHas;
  36186. /***/ }),
  36187. /* 428 */
  36188. /***/ (function(module, exports, __webpack_require__) {
  36189. var Symbol = __webpack_require__(37),
  36190. Uint8Array = __webpack_require__(182),
  36191. eq = __webpack_require__(48),
  36192. equalArrays = __webpack_require__(209),
  36193. mapToArray = __webpack_require__(211),
  36194. setToArray = __webpack_require__(90);
  36195. /** Used to compose bitmasks for value comparisons. */
  36196. var COMPARE_PARTIAL_FLAG = 1,
  36197. COMPARE_UNORDERED_FLAG = 2;
  36198. /** `Object#toString` result references. */
  36199. var boolTag = '[object Boolean]',
  36200. dateTag = '[object Date]',
  36201. errorTag = '[object Error]',
  36202. mapTag = '[object Map]',
  36203. numberTag = '[object Number]',
  36204. regexpTag = '[object RegExp]',
  36205. setTag = '[object Set]',
  36206. stringTag = '[object String]',
  36207. symbolTag = '[object Symbol]';
  36208. var arrayBufferTag = '[object ArrayBuffer]',
  36209. dataViewTag = '[object DataView]';
  36210. /** Used to convert symbols to primitives and strings. */
  36211. var symbolProto = Symbol ? Symbol.prototype : undefined,
  36212. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  36213. /**
  36214. * A specialized version of `baseIsEqualDeep` for comparing objects of
  36215. * the same `toStringTag`.
  36216. *
  36217. * **Note:** This function only supports comparing values with tags of
  36218. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  36219. *
  36220. * @private
  36221. * @param {Object} object The object to compare.
  36222. * @param {Object} other The other object to compare.
  36223. * @param {string} tag The `toStringTag` of the objects to compare.
  36224. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  36225. * @param {Function} customizer The function to customize comparisons.
  36226. * @param {Function} equalFunc The function to determine equivalents of values.
  36227. * @param {Object} stack Tracks traversed `object` and `other` objects.
  36228. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  36229. */
  36230. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  36231. switch (tag) {
  36232. case dataViewTag:
  36233. if ((object.byteLength != other.byteLength) ||
  36234. (object.byteOffset != other.byteOffset)) {
  36235. return false;
  36236. }
  36237. object = object.buffer;
  36238. other = other.buffer;
  36239. case arrayBufferTag:
  36240. if ((object.byteLength != other.byteLength) ||
  36241. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  36242. return false;
  36243. }
  36244. return true;
  36245. case boolTag:
  36246. case dateTag:
  36247. case numberTag:
  36248. // Coerce booleans to `1` or `0` and dates to milliseconds.
  36249. // Invalid dates are coerced to `NaN`.
  36250. return eq(+object, +other);
  36251. case errorTag:
  36252. return object.name == other.name && object.message == other.message;
  36253. case regexpTag:
  36254. case stringTag:
  36255. // Coerce regexes to strings and treat strings, primitives and objects,
  36256. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  36257. // for more details.
  36258. return object == (other + '');
  36259. case mapTag:
  36260. var convert = mapToArray;
  36261. case setTag:
  36262. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  36263. convert || (convert = setToArray);
  36264. if (object.size != other.size && !isPartial) {
  36265. return false;
  36266. }
  36267. // Assume cyclic values are equal.
  36268. var stacked = stack.get(object);
  36269. if (stacked) {
  36270. return stacked == other;
  36271. }
  36272. bitmask |= COMPARE_UNORDERED_FLAG;
  36273. // Recursively compare objects (susceptible to call stack limits).
  36274. stack.set(object, other);
  36275. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  36276. stack['delete'](object);
  36277. return result;
  36278. case symbolTag:
  36279. if (symbolValueOf) {
  36280. return symbolValueOf.call(object) == symbolValueOf.call(other);
  36281. }
  36282. }
  36283. return false;
  36284. }
  36285. module.exports = equalByTag;
  36286. /***/ }),
  36287. /* 429 */
  36288. /***/ (function(module, exports, __webpack_require__) {
  36289. var getAllKeys = __webpack_require__(177);
  36290. /** Used to compose bitmasks for value comparisons. */
  36291. var COMPARE_PARTIAL_FLAG = 1;
  36292. /** Used for built-in method references. */
  36293. var objectProto = Object.prototype;
  36294. /** Used to check objects for own properties. */
  36295. var hasOwnProperty = objectProto.hasOwnProperty;
  36296. /**
  36297. * A specialized version of `baseIsEqualDeep` for objects with support for
  36298. * partial deep comparisons.
  36299. *
  36300. * @private
  36301. * @param {Object} object The object to compare.
  36302. * @param {Object} other The other object to compare.
  36303. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  36304. * @param {Function} customizer The function to customize comparisons.
  36305. * @param {Function} equalFunc The function to determine equivalents of values.
  36306. * @param {Object} stack Tracks traversed `object` and `other` objects.
  36307. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  36308. */
  36309. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  36310. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  36311. objProps = getAllKeys(object),
  36312. objLength = objProps.length,
  36313. othProps = getAllKeys(other),
  36314. othLength = othProps.length;
  36315. if (objLength != othLength && !isPartial) {
  36316. return false;
  36317. }
  36318. var index = objLength;
  36319. while (index--) {
  36320. var key = objProps[index];
  36321. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  36322. return false;
  36323. }
  36324. }
  36325. // Assume cyclic values are equal.
  36326. var stacked = stack.get(object);
  36327. if (stacked && stack.get(other)) {
  36328. return stacked == other;
  36329. }
  36330. var result = true;
  36331. stack.set(object, other);
  36332. stack.set(other, object);
  36333. var skipCtor = isPartial;
  36334. while (++index < objLength) {
  36335. key = objProps[index];
  36336. var objValue = object[key],
  36337. othValue = other[key];
  36338. if (customizer) {
  36339. var compared = isPartial
  36340. ? customizer(othValue, objValue, key, other, object, stack)
  36341. : customizer(objValue, othValue, key, object, other, stack);
  36342. }
  36343. // Recursively compare objects (susceptible to call stack limits).
  36344. if (!(compared === undefined
  36345. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  36346. : compared
  36347. )) {
  36348. result = false;
  36349. break;
  36350. }
  36351. skipCtor || (skipCtor = key == 'constructor');
  36352. }
  36353. if (result && !skipCtor) {
  36354. var objCtor = object.constructor,
  36355. othCtor = other.constructor;
  36356. // Non `Object` object instances with different constructors are not equal.
  36357. if (objCtor != othCtor &&
  36358. ('constructor' in object && 'constructor' in other) &&
  36359. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  36360. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  36361. result = false;
  36362. }
  36363. }
  36364. stack['delete'](object);
  36365. stack['delete'](other);
  36366. return result;
  36367. }
  36368. module.exports = equalObjects;
  36369. /***/ }),
  36370. /* 430 */
  36371. /***/ (function(module, exports, __webpack_require__) {
  36372. var isStrictComparable = __webpack_require__(212),
  36373. keys = __webpack_require__(27);
  36374. /**
  36375. * Gets the property names, values, and compare flags of `object`.
  36376. *
  36377. * @private
  36378. * @param {Object} object The object to query.
  36379. * @returns {Array} Returns the match data of `object`.
  36380. */
  36381. function getMatchData(object) {
  36382. var result = keys(object),
  36383. length = result.length;
  36384. while (length--) {
  36385. var key = result[length],
  36386. value = object[key];
  36387. result[length] = [key, value, isStrictComparable(value)];
  36388. }
  36389. return result;
  36390. }
  36391. module.exports = getMatchData;
  36392. /***/ }),
  36393. /* 431 */
  36394. /***/ (function(module, exports, __webpack_require__) {
  36395. var baseIsEqual = __webpack_require__(208),
  36396. get = __webpack_require__(51),
  36397. hasIn = __webpack_require__(216),
  36398. isKey = __webpack_require__(125),
  36399. isStrictComparable = __webpack_require__(212),
  36400. matchesStrictComparable = __webpack_require__(213),
  36401. toKey = __webpack_require__(41);
  36402. /** Used to compose bitmasks for value comparisons. */
  36403. var COMPARE_PARTIAL_FLAG = 1,
  36404. COMPARE_UNORDERED_FLAG = 2;
  36405. /**
  36406. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  36407. *
  36408. * @private
  36409. * @param {string} path The path of the property to get.
  36410. * @param {*} srcValue The value to match.
  36411. * @returns {Function} Returns the new spec function.
  36412. */
  36413. function baseMatchesProperty(path, srcValue) {
  36414. if (isKey(path) && isStrictComparable(srcValue)) {
  36415. return matchesStrictComparable(toKey(path), srcValue);
  36416. }
  36417. return function(object) {
  36418. var objValue = get(object, path);
  36419. return (objValue === undefined && objValue === srcValue)
  36420. ? hasIn(object, path)
  36421. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  36422. };
  36423. }
  36424. module.exports = baseMatchesProperty;
  36425. /***/ }),
  36426. /* 432 */
  36427. /***/ (function(module, exports, __webpack_require__) {
  36428. var memoize = __webpack_require__(215);
  36429. /** Used as the maximum memoize cache size. */
  36430. var MAX_MEMOIZE_SIZE = 500;
  36431. /**
  36432. * A specialized version of `_.memoize` which clears the memoized function's
  36433. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  36434. *
  36435. * @private
  36436. * @param {Function} func The function to have its output memoized.
  36437. * @returns {Function} Returns the new memoized function.
  36438. */
  36439. function memoizeCapped(func) {
  36440. var result = memoize(func, function(key) {
  36441. if (cache.size === MAX_MEMOIZE_SIZE) {
  36442. cache.clear();
  36443. }
  36444. return key;
  36445. });
  36446. var cache = result.cache;
  36447. return result;
  36448. }
  36449. module.exports = memoizeCapped;
  36450. /***/ }),
  36451. /* 433 */
  36452. /***/ (function(module, exports, __webpack_require__) {
  36453. var Symbol = __webpack_require__(37),
  36454. arrayMap = __webpack_require__(30),
  36455. isArray = __webpack_require__(9),
  36456. isSymbol = __webpack_require__(68);
  36457. /** Used as references for various `Number` constants. */
  36458. var INFINITY = 1 / 0;
  36459. /** Used to convert symbols to primitives and strings. */
  36460. var symbolProto = Symbol ? Symbol.prototype : undefined,
  36461. symbolToString = symbolProto ? symbolProto.toString : undefined;
  36462. /**
  36463. * The base implementation of `_.toString` which doesn't convert nullish
  36464. * values to empty strings.
  36465. *
  36466. * @private
  36467. * @param {*} value The value to process.
  36468. * @returns {string} Returns the string.
  36469. */
  36470. function baseToString(value) {
  36471. // Exit early for strings to avoid a performance hit in some environments.
  36472. if (typeof value == 'string') {
  36473. return value;
  36474. }
  36475. if (isArray(value)) {
  36476. // Recursively convert values (susceptible to call stack limits).
  36477. return arrayMap(value, baseToString) + '';
  36478. }
  36479. if (isSymbol(value)) {
  36480. return symbolToString ? symbolToString.call(value) : '';
  36481. }
  36482. var result = (value + '');
  36483. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  36484. }
  36485. module.exports = baseToString;
  36486. /***/ }),
  36487. /* 434 */
  36488. /***/ (function(module, exports) {
  36489. /**
  36490. * The base implementation of `_.hasIn` without support for deep paths.
  36491. *
  36492. * @private
  36493. * @param {Object} [object] The object to query.
  36494. * @param {Array|string} key The key to check.
  36495. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  36496. */
  36497. function baseHasIn(object, key) {
  36498. return object != null && key in Object(object);
  36499. }
  36500. module.exports = baseHasIn;
  36501. /***/ }),
  36502. /* 435 */
  36503. /***/ (function(module, exports, __webpack_require__) {
  36504. var castPath = __webpack_require__(52),
  36505. isArguments = __webpack_require__(61),
  36506. isArray = __webpack_require__(9),
  36507. isIndex = __webpack_require__(63),
  36508. isLength = __webpack_require__(109),
  36509. toKey = __webpack_require__(41);
  36510. /**
  36511. * Checks if `path` exists on `object`.
  36512. *
  36513. * @private
  36514. * @param {Object} object The object to query.
  36515. * @param {Array|string} path The path to check.
  36516. * @param {Function} hasFunc The function to check properties.
  36517. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  36518. */
  36519. function hasPath(object, path, hasFunc) {
  36520. path = castPath(path, object);
  36521. var index = -1,
  36522. length = path.length,
  36523. result = false;
  36524. while (++index < length) {
  36525. var key = toKey(path[index]);
  36526. if (!(result = object != null && hasFunc(object, key))) {
  36527. break;
  36528. }
  36529. object = object[key];
  36530. }
  36531. if (result || ++index != length) {
  36532. return result;
  36533. }
  36534. length = object == null ? 0 : object.length;
  36535. return !!length && isLength(length) && isIndex(key, length) &&
  36536. (isArray(object) || isArguments(object));
  36537. }
  36538. module.exports = hasPath;
  36539. /***/ }),
  36540. /* 436 */
  36541. /***/ (function(module, exports, __webpack_require__) {
  36542. var baseProperty = __webpack_require__(437),
  36543. basePropertyDeep = __webpack_require__(438),
  36544. isKey = __webpack_require__(125),
  36545. toKey = __webpack_require__(41);
  36546. /**
  36547. * Creates a function that returns the value at `path` of a given object.
  36548. *
  36549. * @static
  36550. * @memberOf _
  36551. * @since 2.4.0
  36552. * @category Util
  36553. * @param {Array|string} path The path of the property to get.
  36554. * @returns {Function} Returns the new accessor function.
  36555. * @example
  36556. *
  36557. * var objects = [
  36558. * { 'a': { 'b': 2 } },
  36559. * { 'a': { 'b': 1 } }
  36560. * ];
  36561. *
  36562. * _.map(objects, _.property('a.b'));
  36563. * // => [2, 1]
  36564. *
  36565. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  36566. * // => [1, 2]
  36567. */
  36568. function property(path) {
  36569. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  36570. }
  36571. module.exports = property;
  36572. /***/ }),
  36573. /* 437 */
  36574. /***/ (function(module, exports) {
  36575. /**
  36576. * The base implementation of `_.property` without support for deep paths.
  36577. *
  36578. * @private
  36579. * @param {string} key The key of the property to get.
  36580. * @returns {Function} Returns the new accessor function.
  36581. */
  36582. function baseProperty(key) {
  36583. return function(object) {
  36584. return object == null ? undefined : object[key];
  36585. };
  36586. }
  36587. module.exports = baseProperty;
  36588. /***/ }),
  36589. /* 438 */
  36590. /***/ (function(module, exports, __webpack_require__) {
  36591. var baseGet = __webpack_require__(91);
  36592. /**
  36593. * A specialized version of `baseProperty` which supports deep paths.
  36594. *
  36595. * @private
  36596. * @param {Array|string} path The path of the property to get.
  36597. * @returns {Function} Returns the new accessor function.
  36598. */
  36599. function basePropertyDeep(path) {
  36600. return function(object) {
  36601. return baseGet(object, path);
  36602. };
  36603. }
  36604. module.exports = basePropertyDeep;
  36605. /***/ }),
  36606. /* 439 */
  36607. /***/ (function(module, exports, __webpack_require__) {
  36608. var createWrap = __webpack_require__(118),
  36609. flatRest = __webpack_require__(126);
  36610. /** Used to compose bitmasks for function metadata. */
  36611. var WRAP_REARG_FLAG = 256;
  36612. /**
  36613. * Creates a function that invokes `func` with arguments arranged according
  36614. * to the specified `indexes` where the argument value at the first index is
  36615. * provided as the first argument, the argument value at the second index is
  36616. * provided as the second argument, and so on.
  36617. *
  36618. * @static
  36619. * @memberOf _
  36620. * @since 3.0.0
  36621. * @category Function
  36622. * @param {Function} func The function to rearrange arguments for.
  36623. * @param {...(number|number[])} indexes The arranged argument indexes.
  36624. * @returns {Function} Returns the new function.
  36625. * @example
  36626. *
  36627. * var rearged = _.rearg(function(a, b, c) {
  36628. * return [a, b, c];
  36629. * }, [2, 0, 1]);
  36630. *
  36631. * rearged('b', 'c', 'a')
  36632. * // => ['a', 'b', 'c']
  36633. */
  36634. var rearg = flatRest(function(func, indexes) {
  36635. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  36636. });
  36637. module.exports = rearg;
  36638. /***/ }),
  36639. /* 440 */
  36640. /***/ (function(module, exports, __webpack_require__) {
  36641. var baseFlatten = __webpack_require__(217);
  36642. /**
  36643. * Flattens `array` a single level deep.
  36644. *
  36645. * @static
  36646. * @memberOf _
  36647. * @since 0.1.0
  36648. * @category Array
  36649. * @param {Array} array The array to flatten.
  36650. * @returns {Array} Returns the new flattened array.
  36651. * @example
  36652. *
  36653. * _.flatten([1, [2, [3, [4]], 5]]);
  36654. * // => [1, 2, [3, [4]], 5]
  36655. */
  36656. function flatten(array) {
  36657. var length = array == null ? 0 : array.length;
  36658. return length ? baseFlatten(array, 1) : [];
  36659. }
  36660. module.exports = flatten;
  36661. /***/ }),
  36662. /* 441 */
  36663. /***/ (function(module, exports, __webpack_require__) {
  36664. var Symbol = __webpack_require__(37),
  36665. isArguments = __webpack_require__(61),
  36666. isArray = __webpack_require__(9);
  36667. /** Built-in value references. */
  36668. var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
  36669. /**
  36670. * Checks if `value` is a flattenable `arguments` object or array.
  36671. *
  36672. * @private
  36673. * @param {*} value The value to check.
  36674. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  36675. */
  36676. function isFlattenable(value) {
  36677. return isArray(value) || isArguments(value) ||
  36678. !!(spreadableSymbol && value && value[spreadableSymbol]);
  36679. }
  36680. module.exports = isFlattenable;
  36681. /***/ }),
  36682. /* 442 */
  36683. /***/ (function(module, exports, __webpack_require__) {
  36684. var arrayMap = __webpack_require__(30),
  36685. copyArray = __webpack_require__(49),
  36686. isArray = __webpack_require__(9),
  36687. isSymbol = __webpack_require__(68),
  36688. stringToPath = __webpack_require__(214),
  36689. toKey = __webpack_require__(41),
  36690. toString = __webpack_require__(92);
  36691. /**
  36692. * Converts `value` to a property path array.
  36693. *
  36694. * @static
  36695. * @memberOf _
  36696. * @since 4.0.0
  36697. * @category Util
  36698. * @param {*} value The value to convert.
  36699. * @returns {Array} Returns the new property path array.
  36700. * @example
  36701. *
  36702. * _.toPath('a.b.c');
  36703. * // => ['a', 'b', 'c']
  36704. *
  36705. * _.toPath('a[0].b.c');
  36706. * // => ['a', '0', 'b', 'c']
  36707. */
  36708. function toPath(value) {
  36709. if (isArray(value)) {
  36710. return arrayMap(value, toKey);
  36711. }
  36712. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  36713. }
  36714. module.exports = toPath;
  36715. /***/ }),
  36716. /* 443 */
  36717. /***/ (function(module, exports, __webpack_require__) {
  36718. var basePickBy = __webpack_require__(444),
  36719. hasIn = __webpack_require__(216);
  36720. /**
  36721. * The base implementation of `_.pick` without support for individual
  36722. * property identifiers.
  36723. *
  36724. * @private
  36725. * @param {Object} object The source object.
  36726. * @param {string[]} paths The property paths to pick.
  36727. * @returns {Object} Returns the new object.
  36728. */
  36729. function basePick(object, paths) {
  36730. return basePickBy(object, paths, function(value, path) {
  36731. return hasIn(object, path);
  36732. });
  36733. }
  36734. module.exports = basePick;
  36735. /***/ }),
  36736. /* 444 */
  36737. /***/ (function(module, exports, __webpack_require__) {
  36738. var baseGet = __webpack_require__(91),
  36739. baseSet = __webpack_require__(445),
  36740. castPath = __webpack_require__(52);
  36741. /**
  36742. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  36743. *
  36744. * @private
  36745. * @param {Object} object The source object.
  36746. * @param {string[]} paths The property paths to pick.
  36747. * @param {Function} predicate The function invoked per property.
  36748. * @returns {Object} Returns the new object.
  36749. */
  36750. function basePickBy(object, paths, predicate) {
  36751. var index = -1,
  36752. length = paths.length,
  36753. result = {};
  36754. while (++index < length) {
  36755. var path = paths[index],
  36756. value = baseGet(object, path);
  36757. if (predicate(value, path)) {
  36758. baseSet(result, castPath(path, object), value);
  36759. }
  36760. }
  36761. return result;
  36762. }
  36763. module.exports = basePickBy;
  36764. /***/ }),
  36765. /* 445 */
  36766. /***/ (function(module, exports, __webpack_require__) {
  36767. var assignValue = __webpack_require__(80),
  36768. castPath = __webpack_require__(52),
  36769. isIndex = __webpack_require__(63),
  36770. isObject = __webpack_require__(7),
  36771. toKey = __webpack_require__(41);
  36772. /**
  36773. * The base implementation of `_.set`.
  36774. *
  36775. * @private
  36776. * @param {Object} object The object to modify.
  36777. * @param {Array|string} path The path of the property to set.
  36778. * @param {*} value The value to set.
  36779. * @param {Function} [customizer] The function to customize path creation.
  36780. * @returns {Object} Returns `object`.
  36781. */
  36782. function baseSet(object, path, value, customizer) {
  36783. if (!isObject(object)) {
  36784. return object;
  36785. }
  36786. path = castPath(path, object);
  36787. var index = -1,
  36788. length = path.length,
  36789. lastIndex = length - 1,
  36790. nested = object;
  36791. while (nested != null && ++index < length) {
  36792. var key = toKey(path[index]),
  36793. newValue = value;
  36794. if (index != lastIndex) {
  36795. var objValue = nested[key];
  36796. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  36797. if (newValue === undefined) {
  36798. newValue = isObject(objValue)
  36799. ? objValue
  36800. : (isIndex(path[index + 1]) ? [] : {});
  36801. }
  36802. }
  36803. assignValue(nested, key, newValue);
  36804. nested = nested[key];
  36805. }
  36806. return object;
  36807. }
  36808. module.exports = baseSet;
  36809. /***/ }),
  36810. /* 446 */
  36811. /***/ (function(module, exports, __webpack_require__) {
  36812. var convert = __webpack_require__(192),
  36813. func = convert('mapKeys', __webpack_require__(447));
  36814. func.placeholder = __webpack_require__(117);
  36815. module.exports = func;
  36816. /***/ }),
  36817. /* 447 */
  36818. /***/ (function(module, exports, __webpack_require__) {
  36819. var baseAssignValue = __webpack_require__(60),
  36820. baseForOwn = __webpack_require__(93),
  36821. baseIteratee = __webpack_require__(29);
  36822. /**
  36823. * The opposite of `_.mapValues`; this method creates an object with the
  36824. * same values as `object` and keys generated by running each own enumerable
  36825. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  36826. * with three arguments: (value, key, object).
  36827. *
  36828. * @static
  36829. * @memberOf _
  36830. * @since 3.8.0
  36831. * @category Object
  36832. * @param {Object} object The object to iterate over.
  36833. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  36834. * @returns {Object} Returns the new mapped object.
  36835. * @see _.mapValues
  36836. * @example
  36837. *
  36838. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  36839. * return key + value;
  36840. * });
  36841. * // => { 'a1': 1, 'b2': 2 }
  36842. */
  36843. function mapKeys(object, iteratee) {
  36844. var result = {};
  36845. iteratee = baseIteratee(iteratee, 3);
  36846. baseForOwn(object, function(value, key, object) {
  36847. baseAssignValue(result, iteratee(value, key, object), value);
  36848. });
  36849. return result;
  36850. }
  36851. module.exports = mapKeys;
  36852. /***/ }),
  36853. /* 448 */
  36854. /***/ (function(module, exports) {
  36855. /**
  36856. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  36857. *
  36858. * @private
  36859. * @param {boolean} [fromRight] Specify iterating from right to left.
  36860. * @returns {Function} Returns the new base function.
  36861. */
  36862. function createBaseFor(fromRight) {
  36863. return function(object, iteratee, keysFunc) {
  36864. var index = -1,
  36865. iterable = Object(object),
  36866. props = keysFunc(object),
  36867. length = props.length;
  36868. while (length--) {
  36869. var key = props[fromRight ? length : ++index];
  36870. if (iteratee(iterable[key], key, iterable) === false) {
  36871. break;
  36872. }
  36873. }
  36874. return object;
  36875. };
  36876. }
  36877. module.exports = createBaseFor;
  36878. /***/ }),
  36879. /* 449 */
  36880. /***/ (function(module, exports, __webpack_require__) {
  36881. /* WEBPACK VAR INJECTION */(function(process) {/**
  36882. * This is the web browser implementation of `debug()`.
  36883. */
  36884. exports.log = log;
  36885. exports.formatArgs = formatArgs;
  36886. exports.save = save;
  36887. exports.load = load;
  36888. exports.useColors = useColors;
  36889. exports.storage = localstorage();
  36890. /**
  36891. * Colors.
  36892. */
  36893. exports.colors = [
  36894. '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
  36895. '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
  36896. '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
  36897. '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
  36898. '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
  36899. '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
  36900. '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
  36901. '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
  36902. '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
  36903. '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
  36904. '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
  36905. ];
  36906. /**
  36907. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  36908. * and the Firebug extension (any Firefox version) are known
  36909. * to support "%c" CSS customizations.
  36910. */
  36911. function useColors() {
  36912. // NB: In an Electron preload script, document will be defined but not fully
  36913. // initialized. Since we know we're in Chrome, we'll just detect this case
  36914. // explicitly
  36915. var useColorsOption = getOption('colors');
  36916. if (/^(no|off|false|disabled)$/i.test(useColorsOption)) {
  36917. return false;
  36918. }
  36919. if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
  36920. return true;
  36921. }
  36922. // Internet Explorer and Edge do not support colors.
  36923. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  36924. return false;
  36925. }
  36926. // is webkit? http://stackoverflow.com/a/16459606/376773
  36927. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  36928. return Boolean((typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  36929. // is firebug? http://stackoverflow.com/a/398120/376773
  36930. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  36931. // is firefox >= v31?
  36932. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  36933. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  36934. // double check webkit in userAgent just in case we are in a worker
  36935. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)));
  36936. }
  36937. /**
  36938. * Colorize log arguments if enabled.
  36939. *
  36940. * @api public
  36941. */
  36942. function formatArgs(args) {
  36943. var useColors = this.useColors;
  36944. args[0] = (useColors ? '%c' : '')
  36945. + this.namespace
  36946. + (useColors ? ' %c' : ' ')
  36947. + args[0]
  36948. + (useColors ? '%c ' : ' ')
  36949. + '+' + module.exports.humanize(this.diff);
  36950. if (!useColors) return;
  36951. var c = 'color: ' + this.color;
  36952. args.splice(1, 0, c, 'color: inherit')
  36953. // the final "%c" is somewhat tricky, because there could be other
  36954. // arguments passed either before or after the %c, so we need to
  36955. // figure out the correct index to insert the CSS into
  36956. var index = 0;
  36957. var lastC = 0;
  36958. args[0].replace(/%[a-zA-Z%]/g, function(match) {
  36959. if ('%%' === match) return;
  36960. index++;
  36961. if ('%c' === match) {
  36962. // we only are interested in the *last* %c
  36963. // (the user may have provided their own)
  36964. lastC = index;
  36965. }
  36966. });
  36967. args.splice(lastC, 0, c);
  36968. }
  36969. /**
  36970. * Invokes `console.log()` when available.
  36971. * No-op when `console.log` is not a "function".
  36972. *
  36973. * @api public
  36974. */
  36975. function log() {
  36976. // this hackery is required for IE8/9, where
  36977. // the `console.log` function doesn't have 'apply'
  36978. return 'object' === typeof console
  36979. && console.log
  36980. && Function.prototype.apply.call(console.log, console, arguments);
  36981. }
  36982. /**
  36983. * Save `namespaces`.
  36984. *
  36985. * @param {String} namespaces
  36986. * @api private
  36987. */
  36988. function save(namespaces) {
  36989. try {
  36990. if (null == namespaces) {
  36991. exports.storage.removeItem('debug');
  36992. } else {
  36993. exports.storage.setItem('debug', namespaces);
  36994. }
  36995. } catch(e) {}
  36996. }
  36997. /**
  36998. * Load `namespaces`.
  36999. *
  37000. * @return {String} returns the previously persisted debug modes
  37001. * @api private
  37002. */
  37003. function load() {
  37004. var r;
  37005. try {
  37006. r = exports.storage.getItem('debug');
  37007. } catch(e) {}
  37008. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  37009. if (!r && typeof process !== 'undefined' && 'env' in process) {
  37010. r = process.env.DEBUG;
  37011. }
  37012. return r;
  37013. }
  37014. function getOption(key) {
  37015. var storageKey = 'debug_' + key.toLowerCase();
  37016. try {
  37017. return exports.storage.getItem(storageKey);
  37018. } catch (err) {
  37019. if (typeof process !== 'undefined' && 'env' in process) {
  37020. return process.env[storageKey.toUpperCase()];
  37021. }
  37022. return undefined;
  37023. }
  37024. }
  37025. /**
  37026. * Localstorage attempts to return the localstorage.
  37027. *
  37028. * This is necessary because safari throws
  37029. * when a user disables cookies/localstorage
  37030. * and you attempt to access it.
  37031. *
  37032. * @return {LocalStorage}
  37033. * @api private
  37034. */
  37035. function localstorage() {
  37036. try {
  37037. // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
  37038. // The Browser also has localStorage in the global context.
  37039. return localStorage;
  37040. } catch (e) {}
  37041. }
  37042. module.exports = __webpack_require__(450)(exports);
  37043. var formatters = module.exports.formatters;
  37044. /**
  37045. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  37046. */
  37047. formatters.j = function(v) {
  37048. try {
  37049. return JSON.stringify(v);
  37050. } catch (err) {
  37051. return '[UnexpectedJSONParseError]: ' + err.message;
  37052. }
  37053. };
  37054. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(67)))
  37055. /***/ }),
  37056. /* 450 */
  37057. /***/ (function(module, exports, __webpack_require__) {
  37058. /**
  37059. * This is the common logic for both the Node.js and web browser
  37060. * implementations of `debug()`.
  37061. */
  37062. module.exports = function setup(env) {
  37063. createDebug.debug = createDebug['default'] = createDebug;
  37064. createDebug.coerce = coerce;
  37065. createDebug.disable = disable;
  37066. createDebug.enable = enable;
  37067. createDebug.enabled = enabled;
  37068. createDebug.humanize = __webpack_require__(451);
  37069. Object.keys(env).forEach(function(key) {
  37070. createDebug[key] = env[key];
  37071. });
  37072. /**
  37073. * Active `debug` instances.
  37074. */
  37075. createDebug.instances = [];
  37076. /**
  37077. * The currently active debug mode names, and names to skip.
  37078. */
  37079. createDebug.names = [];
  37080. createDebug.skips = [];
  37081. /**
  37082. * Map of special "%n" handling functions, for the debug "format" argument.
  37083. *
  37084. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  37085. */
  37086. createDebug.formatters = {};
  37087. /**
  37088. * Select a color.
  37089. * @param {String} namespace
  37090. * @return {Number}
  37091. * @api private
  37092. */
  37093. function selectColor(namespace) {
  37094. var hash = 0, i;
  37095. for (i in namespace) {
  37096. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  37097. hash |= 0; // Convert to 32bit integer
  37098. }
  37099. return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  37100. }
  37101. createDebug.selectColor = selectColor;
  37102. /**
  37103. * Create a debugger with the given `namespace`.
  37104. *
  37105. * @param {String} namespace
  37106. * @return {Function}
  37107. * @api public
  37108. */
  37109. function createDebug(namespace) {
  37110. var prevTime;
  37111. function debug() {
  37112. // disabled?
  37113. if (!debug.enabled) return;
  37114. var self = debug;
  37115. // set `diff` timestamp
  37116. var curr = +new Date();
  37117. var ms = curr - (prevTime || curr);
  37118. self.diff = ms;
  37119. self.prev = prevTime;
  37120. self.curr = curr;
  37121. prevTime = curr;
  37122. // turn the `arguments` into a proper Array
  37123. var args = new Array(arguments.length);
  37124. for (var i = 0; i < args.length; i++) {
  37125. args[i] = arguments[i];
  37126. }
  37127. args[0] = createDebug.coerce(args[0]);
  37128. if ('string' !== typeof args[0]) {
  37129. // anything else let's inspect with %O
  37130. args.unshift('%O');
  37131. }
  37132. // apply any `formatters` transformations
  37133. var index = 0;
  37134. args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
  37135. // if we encounter an escaped % then don't increase the array index
  37136. if (match === '%%') return match;
  37137. index++;
  37138. var formatter = createDebug.formatters[format];
  37139. if ('function' === typeof formatter) {
  37140. var val = args[index];
  37141. match = formatter.call(self, val);
  37142. // now we need to remove `args[index]` since it's inlined in the `format`
  37143. args.splice(index, 1);
  37144. index--;
  37145. }
  37146. return match;
  37147. });
  37148. // apply env-specific formatting (colors, etc.)
  37149. createDebug.formatArgs.call(self, args);
  37150. var logFn = self.log || createDebug.log;
  37151. logFn.apply(self, args);
  37152. }
  37153. debug.namespace = namespace;
  37154. debug.enabled = createDebug.enabled(namespace);
  37155. debug.useColors = createDebug.useColors();
  37156. debug.color = selectColor(namespace);
  37157. debug.destroy = destroy;
  37158. //debug.formatArgs = formatArgs;
  37159. //debug.rawLog = rawLog;
  37160. // env-specific initialization logic for debug instances
  37161. if ('function' === typeof createDebug.init) {
  37162. createDebug.init(debug);
  37163. }
  37164. createDebug.instances.push(debug);
  37165. return debug;
  37166. }
  37167. function destroy () {
  37168. var index = createDebug.instances.indexOf(this);
  37169. if (index !== -1) {
  37170. createDebug.instances.splice(index, 1);
  37171. return true;
  37172. } else {
  37173. return false;
  37174. }
  37175. }
  37176. /**
  37177. * Enables a debug mode by namespaces. This can include modes
  37178. * separated by a colon and wildcards.
  37179. *
  37180. * @param {String} namespaces
  37181. * @api public
  37182. */
  37183. function enable(namespaces) {
  37184. createDebug.save(namespaces);
  37185. createDebug.names = [];
  37186. createDebug.skips = [];
  37187. var i;
  37188. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  37189. var len = split.length;
  37190. for (i = 0; i < len; i++) {
  37191. if (!split[i]) continue; // ignore empty strings
  37192. namespaces = split[i].replace(/\*/g, '.*?');
  37193. if (namespaces[0] === '-') {
  37194. createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  37195. } else {
  37196. createDebug.names.push(new RegExp('^' + namespaces + '$'));
  37197. }
  37198. }
  37199. for (i = 0; i < createDebug.instances.length; i++) {
  37200. var instance = createDebug.instances[i];
  37201. instance.enabled = createDebug.enabled(instance.namespace);
  37202. }
  37203. }
  37204. /**
  37205. * Disable debug output.
  37206. *
  37207. * @api public
  37208. */
  37209. function disable() {
  37210. createDebug.enable('');
  37211. }
  37212. /**
  37213. * Returns true if the given mode name is enabled, false otherwise.
  37214. *
  37215. * @param {String} name
  37216. * @return {Boolean}
  37217. * @api public
  37218. */
  37219. function enabled(name) {
  37220. if (name[name.length - 1] === '*') {
  37221. return true;
  37222. }
  37223. var i, len;
  37224. for (i = 0, len = createDebug.skips.length; i < len; i++) {
  37225. if (createDebug.skips[i].test(name)) {
  37226. return false;
  37227. }
  37228. }
  37229. for (i = 0, len = createDebug.names.length; i < len; i++) {
  37230. if (createDebug.names[i].test(name)) {
  37231. return true;
  37232. }
  37233. }
  37234. return false;
  37235. }
  37236. /**
  37237. * Coerce `val`.
  37238. *
  37239. * @param {Mixed} val
  37240. * @return {Mixed}
  37241. * @api private
  37242. */
  37243. function coerce(val) {
  37244. if (val instanceof Error) return val.stack || val.message;
  37245. return val;
  37246. }
  37247. createDebug.enable(createDebug.load());
  37248. return createDebug;
  37249. }
  37250. /***/ }),
  37251. /* 451 */
  37252. /***/ (function(module, exports) {
  37253. /**
  37254. * Helpers.
  37255. */
  37256. var s = 1000;
  37257. var m = s * 60;
  37258. var h = m * 60;
  37259. var d = h * 24;
  37260. var w = d * 7;
  37261. var y = d * 365.25;
  37262. /**
  37263. * Parse or format the given `val`.
  37264. *
  37265. * Options:
  37266. *
  37267. * - `long` verbose formatting [false]
  37268. *
  37269. * @param {String|Number} val
  37270. * @param {Object} [options]
  37271. * @throws {Error} throw an error if val is not a non-empty string or a number
  37272. * @return {String|Number}
  37273. * @api public
  37274. */
  37275. module.exports = function(val, options) {
  37276. options = options || {};
  37277. var type = typeof val;
  37278. if (type === 'string' && val.length > 0) {
  37279. return parse(val);
  37280. } else if (type === 'number' && isFinite(val)) {
  37281. return options.long ? fmtLong(val) : fmtShort(val);
  37282. }
  37283. throw new Error(
  37284. 'val is not a non-empty string or a valid number. val=' +
  37285. JSON.stringify(val)
  37286. );
  37287. };
  37288. /**
  37289. * Parse the given `str` and return milliseconds.
  37290. *
  37291. * @param {String} str
  37292. * @return {Number}
  37293. * @api private
  37294. */
  37295. function parse(str) {
  37296. str = String(str);
  37297. if (str.length > 100) {
  37298. return;
  37299. }
  37300. var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  37301. str
  37302. );
  37303. if (!match) {
  37304. return;
  37305. }
  37306. var n = parseFloat(match[1]);
  37307. var type = (match[2] || 'ms').toLowerCase();
  37308. switch (type) {
  37309. case 'years':
  37310. case 'year':
  37311. case 'yrs':
  37312. case 'yr':
  37313. case 'y':
  37314. return n * y;
  37315. case 'weeks':
  37316. case 'week':
  37317. case 'w':
  37318. return n * w;
  37319. case 'days':
  37320. case 'day':
  37321. case 'd':
  37322. return n * d;
  37323. case 'hours':
  37324. case 'hour':
  37325. case 'hrs':
  37326. case 'hr':
  37327. case 'h':
  37328. return n * h;
  37329. case 'minutes':
  37330. case 'minute':
  37331. case 'mins':
  37332. case 'min':
  37333. case 'm':
  37334. return n * m;
  37335. case 'seconds':
  37336. case 'second':
  37337. case 'secs':
  37338. case 'sec':
  37339. case 's':
  37340. return n * s;
  37341. case 'milliseconds':
  37342. case 'millisecond':
  37343. case 'msecs':
  37344. case 'msec':
  37345. case 'ms':
  37346. return n;
  37347. default:
  37348. return undefined;
  37349. }
  37350. }
  37351. /**
  37352. * Short format for `ms`.
  37353. *
  37354. * @param {Number} ms
  37355. * @return {String}
  37356. * @api private
  37357. */
  37358. function fmtShort(ms) {
  37359. var msAbs = Math.abs(ms);
  37360. if (msAbs >= d) {
  37361. return Math.round(ms / d) + 'd';
  37362. }
  37363. if (msAbs >= h) {
  37364. return Math.round(ms / h) + 'h';
  37365. }
  37366. if (msAbs >= m) {
  37367. return Math.round(ms / m) + 'm';
  37368. }
  37369. if (msAbs >= s) {
  37370. return Math.round(ms / s) + 's';
  37371. }
  37372. return ms + 'ms';
  37373. }
  37374. /**
  37375. * Long format for `ms`.
  37376. *
  37377. * @param {Number} ms
  37378. * @return {String}
  37379. * @api private
  37380. */
  37381. function fmtLong(ms) {
  37382. var msAbs = Math.abs(ms);
  37383. if (msAbs >= d) {
  37384. return plural(ms, msAbs, d, 'day');
  37385. }
  37386. if (msAbs >= h) {
  37387. return plural(ms, msAbs, h, 'hour');
  37388. }
  37389. if (msAbs >= m) {
  37390. return plural(ms, msAbs, m, 'minute');
  37391. }
  37392. if (msAbs >= s) {
  37393. return plural(ms, msAbs, s, 'second');
  37394. }
  37395. return ms + ' ms';
  37396. }
  37397. /**
  37398. * Pluralization helper.
  37399. */
  37400. function plural(ms, msAbs, n, name) {
  37401. var isPlural = msAbs >= n * 1.5;
  37402. return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  37403. }
  37404. /***/ }),
  37405. /* 452 */
  37406. /***/ (function(module, exports, __webpack_require__) {
  37407. /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */
  37408. ;(function(root) {
  37409. /** Detect free variables */
  37410. var freeExports = true && exports &&
  37411. !exports.nodeType && exports;
  37412. var freeModule = true && module &&
  37413. !module.nodeType && module;
  37414. var freeGlobal = typeof (typeof window !== undefined ? window : global) == 'object' && (typeof window !== undefined ? window : global);
  37415. if (
  37416. freeGlobal.global === freeGlobal ||
  37417. freeGlobal.window === freeGlobal ||
  37418. freeGlobal.self === freeGlobal
  37419. ) {
  37420. root = freeGlobal;
  37421. }
  37422. /**
  37423. * The `punycode` object.
  37424. * @name punycode
  37425. * @type Object
  37426. */
  37427. var punycode,
  37428. /** Highest positive signed 32-bit float value */
  37429. maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
  37430. /** Bootstring parameters */
  37431. base = 36,
  37432. tMin = 1,
  37433. tMax = 26,
  37434. skew = 38,
  37435. damp = 700,
  37436. initialBias = 72,
  37437. initialN = 128, // 0x80
  37438. delimiter = '-', // '\x2D'
  37439. /** Regular expressions */
  37440. regexPunycode = /^xn--/,
  37441. regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
  37442. regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
  37443. /** Error messages */
  37444. errors = {
  37445. 'overflow': 'Overflow: input needs wider integers to process',
  37446. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  37447. 'invalid-input': 'Invalid input'
  37448. },
  37449. /** Convenience shortcuts */
  37450. baseMinusTMin = base - tMin,
  37451. floor = Math.floor,
  37452. stringFromCharCode = String.fromCharCode,
  37453. /** Temporary variable */
  37454. key;
  37455. /*--------------------------------------------------------------------------*/
  37456. /**
  37457. * A generic error utility function.
  37458. * @private
  37459. * @param {String} type The error type.
  37460. * @returns {Error} Throws a `RangeError` with the applicable error message.
  37461. */
  37462. function error(type) {
  37463. throw new RangeError(errors[type]);
  37464. }
  37465. /**
  37466. * A generic `Array#map` utility function.
  37467. * @private
  37468. * @param {Array} array The array to iterate over.
  37469. * @param {Function} callback The function that gets called for every array
  37470. * item.
  37471. * @returns {Array} A new array of values returned by the callback function.
  37472. */
  37473. function map(array, fn) {
  37474. var length = array.length;
  37475. var result = [];
  37476. while (length--) {
  37477. result[length] = fn(array[length]);
  37478. }
  37479. return result;
  37480. }
  37481. /**
  37482. * A simple `Array#map`-like wrapper to work with domain name strings or email
  37483. * addresses.
  37484. * @private
  37485. * @param {String} domain The domain name or email address.
  37486. * @param {Function} callback The function that gets called for every
  37487. * character.
  37488. * @returns {Array} A new string of characters returned by the callback
  37489. * function.
  37490. */
  37491. function mapDomain(string, fn) {
  37492. var parts = string.split('@');
  37493. var result = '';
  37494. if (parts.length > 1) {
  37495. // In email addresses, only the domain name should be punycoded. Leave
  37496. // the local part (i.e. everything up to `@`) intact.
  37497. result = parts[0] + '@';
  37498. string = parts[1];
  37499. }
  37500. // Avoid `split(regex)` for IE8 compatibility. See #17.
  37501. string = string.replace(regexSeparators, '\x2E');
  37502. var labels = string.split('.');
  37503. var encoded = map(labels, fn).join('.');
  37504. return result + encoded;
  37505. }
  37506. /**
  37507. * Creates an array containing the numeric code points of each Unicode
  37508. * character in the string. While JavaScript uses UCS-2 internally,
  37509. * this function will convert a pair of surrogate halves (each of which
  37510. * UCS-2 exposes as separate characters) into a single code point,
  37511. * matching UTF-16.
  37512. * @see `punycode.ucs2.encode`
  37513. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  37514. * @memberOf punycode.ucs2
  37515. * @name decode
  37516. * @param {String} string The Unicode input string (UCS-2).
  37517. * @returns {Array} The new array of code points.
  37518. */
  37519. function ucs2decode(string) {
  37520. var output = [],
  37521. counter = 0,
  37522. length = string.length,
  37523. value,
  37524. extra;
  37525. while (counter < length) {
  37526. value = string.charCodeAt(counter++);
  37527. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  37528. // high surrogate, and there is a next character
  37529. extra = string.charCodeAt(counter++);
  37530. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  37531. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  37532. } else {
  37533. // unmatched surrogate; only append this code unit, in case the next
  37534. // code unit is the high surrogate of a surrogate pair
  37535. output.push(value);
  37536. counter--;
  37537. }
  37538. } else {
  37539. output.push(value);
  37540. }
  37541. }
  37542. return output;
  37543. }
  37544. /**
  37545. * Creates a string based on an array of numeric code points.
  37546. * @see `punycode.ucs2.decode`
  37547. * @memberOf punycode.ucs2
  37548. * @name encode
  37549. * @param {Array} codePoints The array of numeric code points.
  37550. * @returns {String} The new Unicode string (UCS-2).
  37551. */
  37552. function ucs2encode(array) {
  37553. return map(array, function(value) {
  37554. var output = '';
  37555. if (value > 0xFFFF) {
  37556. value -= 0x10000;
  37557. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  37558. value = 0xDC00 | value & 0x3FF;
  37559. }
  37560. output += stringFromCharCode(value);
  37561. return output;
  37562. }).join('');
  37563. }
  37564. /**
  37565. * Converts a basic code point into a digit/integer.
  37566. * @see `digitToBasic()`
  37567. * @private
  37568. * @param {Number} codePoint The basic numeric code point value.
  37569. * @returns {Number} The numeric value of a basic code point (for use in
  37570. * representing integers) in the range `0` to `base - 1`, or `base` if
  37571. * the code point does not represent a value.
  37572. */
  37573. function basicToDigit(codePoint) {
  37574. if (codePoint - 48 < 10) {
  37575. return codePoint - 22;
  37576. }
  37577. if (codePoint - 65 < 26) {
  37578. return codePoint - 65;
  37579. }
  37580. if (codePoint - 97 < 26) {
  37581. return codePoint - 97;
  37582. }
  37583. return base;
  37584. }
  37585. /**
  37586. * Converts a digit/integer into a basic code point.
  37587. * @see `basicToDigit()`
  37588. * @private
  37589. * @param {Number} digit The numeric value of a basic code point.
  37590. * @returns {Number} The basic code point whose value (when used for
  37591. * representing integers) is `digit`, which needs to be in the range
  37592. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  37593. * used; else, the lowercase form is used. The behavior is undefined
  37594. * if `flag` is non-zero and `digit` has no uppercase form.
  37595. */
  37596. function digitToBasic(digit, flag) {
  37597. // 0..25 map to ASCII a..z or A..Z
  37598. // 26..35 map to ASCII 0..9
  37599. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  37600. }
  37601. /**
  37602. * Bias adaptation function as per section 3.4 of RFC 3492.
  37603. * https://tools.ietf.org/html/rfc3492#section-3.4
  37604. * @private
  37605. */
  37606. function adapt(delta, numPoints, firstTime) {
  37607. var k = 0;
  37608. delta = firstTime ? floor(delta / damp) : delta >> 1;
  37609. delta += floor(delta / numPoints);
  37610. for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
  37611. delta = floor(delta / baseMinusTMin);
  37612. }
  37613. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  37614. }
  37615. /**
  37616. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  37617. * symbols.
  37618. * @memberOf punycode
  37619. * @param {String} input The Punycode string of ASCII-only symbols.
  37620. * @returns {String} The resulting string of Unicode symbols.
  37621. */
  37622. function decode(input) {
  37623. // Don't use UCS-2
  37624. var output = [],
  37625. inputLength = input.length,
  37626. out,
  37627. i = 0,
  37628. n = initialN,
  37629. bias = initialBias,
  37630. basic,
  37631. j,
  37632. index,
  37633. oldi,
  37634. w,
  37635. k,
  37636. digit,
  37637. t,
  37638. /** Cached calculation results */
  37639. baseMinusT;
  37640. // Handle the basic code points: let `basic` be the number of input code
  37641. // points before the last delimiter, or `0` if there is none, then copy
  37642. // the first basic code points to the output.
  37643. basic = input.lastIndexOf(delimiter);
  37644. if (basic < 0) {
  37645. basic = 0;
  37646. }
  37647. for (j = 0; j < basic; ++j) {
  37648. // if it's not a basic code point
  37649. if (input.charCodeAt(j) >= 0x80) {
  37650. error('not-basic');
  37651. }
  37652. output.push(input.charCodeAt(j));
  37653. }
  37654. // Main decoding loop: start just after the last delimiter if any basic code
  37655. // points were copied; start at the beginning otherwise.
  37656. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
  37657. // `index` is the index of the next character to be consumed.
  37658. // Decode a generalized variable-length integer into `delta`,
  37659. // which gets added to `i`. The overflow checking is easier
  37660. // if we increase `i` as we go, then subtract off its starting
  37661. // value at the end to obtain `delta`.
  37662. for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
  37663. if (index >= inputLength) {
  37664. error('invalid-input');
  37665. }
  37666. digit = basicToDigit(input.charCodeAt(index++));
  37667. if (digit >= base || digit > floor((maxInt - i) / w)) {
  37668. error('overflow');
  37669. }
  37670. i += digit * w;
  37671. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  37672. if (digit < t) {
  37673. break;
  37674. }
  37675. baseMinusT = base - t;
  37676. if (w > floor(maxInt / baseMinusT)) {
  37677. error('overflow');
  37678. }
  37679. w *= baseMinusT;
  37680. }
  37681. out = output.length + 1;
  37682. bias = adapt(i - oldi, out, oldi == 0);
  37683. // `i` was supposed to wrap around from `out` to `0`,
  37684. // incrementing `n` each time, so we'll fix that now:
  37685. if (floor(i / out) > maxInt - n) {
  37686. error('overflow');
  37687. }
  37688. n += floor(i / out);
  37689. i %= out;
  37690. // Insert `n` at position `i` of the output
  37691. output.splice(i++, 0, n);
  37692. }
  37693. return ucs2encode(output);
  37694. }
  37695. /**
  37696. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  37697. * Punycode string of ASCII-only symbols.
  37698. * @memberOf punycode
  37699. * @param {String} input The string of Unicode symbols.
  37700. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  37701. */
  37702. function encode(input) {
  37703. var n,
  37704. delta,
  37705. handledCPCount,
  37706. basicLength,
  37707. bias,
  37708. j,
  37709. m,
  37710. q,
  37711. k,
  37712. t,
  37713. currentValue,
  37714. output = [],
  37715. /** `inputLength` will hold the number of code points in `input`. */
  37716. inputLength,
  37717. /** Cached calculation results */
  37718. handledCPCountPlusOne,
  37719. baseMinusT,
  37720. qMinusT;
  37721. // Convert the input in UCS-2 to Unicode
  37722. input = ucs2decode(input);
  37723. // Cache the length
  37724. inputLength = input.length;
  37725. // Initialize the state
  37726. n = initialN;
  37727. delta = 0;
  37728. bias = initialBias;
  37729. // Handle the basic code points
  37730. for (j = 0; j < inputLength; ++j) {
  37731. currentValue = input[j];
  37732. if (currentValue < 0x80) {
  37733. output.push(stringFromCharCode(currentValue));
  37734. }
  37735. }
  37736. handledCPCount = basicLength = output.length;
  37737. // `handledCPCount` is the number of code points that have been handled;
  37738. // `basicLength` is the number of basic code points.
  37739. // Finish the basic string - if it is not empty - with a delimiter
  37740. if (basicLength) {
  37741. output.push(delimiter);
  37742. }
  37743. // Main encoding loop:
  37744. while (handledCPCount < inputLength) {
  37745. // All non-basic code points < n have been handled already. Find the next
  37746. // larger one:
  37747. for (m = maxInt, j = 0; j < inputLength; ++j) {
  37748. currentValue = input[j];
  37749. if (currentValue >= n && currentValue < m) {
  37750. m = currentValue;
  37751. }
  37752. }
  37753. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  37754. // but guard against overflow
  37755. handledCPCountPlusOne = handledCPCount + 1;
  37756. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  37757. error('overflow');
  37758. }
  37759. delta += (m - n) * handledCPCountPlusOne;
  37760. n = m;
  37761. for (j = 0; j < inputLength; ++j) {
  37762. currentValue = input[j];
  37763. if (currentValue < n && ++delta > maxInt) {
  37764. error('overflow');
  37765. }
  37766. if (currentValue == n) {
  37767. // Represent delta as a generalized variable-length integer
  37768. for (q = delta, k = base; /* no condition */; k += base) {
  37769. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  37770. if (q < t) {
  37771. break;
  37772. }
  37773. qMinusT = q - t;
  37774. baseMinusT = base - t;
  37775. output.push(
  37776. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  37777. );
  37778. q = floor(qMinusT / baseMinusT);
  37779. }
  37780. output.push(stringFromCharCode(digitToBasic(q, 0)));
  37781. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  37782. delta = 0;
  37783. ++handledCPCount;
  37784. }
  37785. }
  37786. ++delta;
  37787. ++n;
  37788. }
  37789. return output.join('');
  37790. }
  37791. /**
  37792. * Converts a Punycode string representing a domain name or an email address
  37793. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  37794. * it doesn't matter if you call it on a string that has already been
  37795. * converted to Unicode.
  37796. * @memberOf punycode
  37797. * @param {String} input The Punycoded domain name or email address to
  37798. * convert to Unicode.
  37799. * @returns {String} The Unicode representation of the given Punycode
  37800. * string.
  37801. */
  37802. function toUnicode(input) {
  37803. return mapDomain(input, function(string) {
  37804. return regexPunycode.test(string)
  37805. ? decode(string.slice(4).toLowerCase())
  37806. : string;
  37807. });
  37808. }
  37809. /**
  37810. * Converts a Unicode string representing a domain name or an email address to
  37811. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  37812. * i.e. it doesn't matter if you call it with a domain that's already in
  37813. * ASCII.
  37814. * @memberOf punycode
  37815. * @param {String} input The domain name or email address to convert, as a
  37816. * Unicode string.
  37817. * @returns {String} The Punycode representation of the given domain name or
  37818. * email address.
  37819. */
  37820. function toASCII(input) {
  37821. return mapDomain(input, function(string) {
  37822. return regexNonASCII.test(string)
  37823. ? 'xn--' + encode(string)
  37824. : string;
  37825. });
  37826. }
  37827. /*--------------------------------------------------------------------------*/
  37828. /** Define the public API */
  37829. punycode = {
  37830. /**
  37831. * A string representing the current Punycode.js version number.
  37832. * @memberOf punycode
  37833. * @type String
  37834. */
  37835. 'version': '1.4.1',
  37836. /**
  37837. * An object of methods to convert from JavaScript's internal character
  37838. * representation (UCS-2) to Unicode code points, and back.
  37839. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  37840. * @memberOf punycode
  37841. * @type Object
  37842. */
  37843. 'ucs2': {
  37844. 'decode': ucs2decode,
  37845. 'encode': ucs2encode
  37846. },
  37847. 'decode': decode,
  37848. 'encode': encode,
  37849. 'toASCII': toASCII,
  37850. 'toUnicode': toUnicode
  37851. };
  37852. /** Expose `punycode` */
  37853. // Some AMD build optimizers, like r.js, check for specific condition patterns
  37854. // like the following:
  37855. if (
  37856. true
  37857. ) {
  37858. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  37859. return punycode;
  37860. }).call(exports, __webpack_require__, exports, module),
  37861. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  37862. } else {}
  37863. }(this));
  37864. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(81)(module)))
  37865. /***/ }),
  37866. /* 453 */
  37867. /***/ (function(module, exports, __webpack_require__) {
  37868. "use strict";
  37869. module.exports = {
  37870. isString: function(arg) {
  37871. return typeof(arg) === 'string';
  37872. },
  37873. isObject: function(arg) {
  37874. return typeof(arg) === 'object' && arg !== null;
  37875. },
  37876. isNull: function(arg) {
  37877. return arg === null;
  37878. },
  37879. isNullOrUndefined: function(arg) {
  37880. return arg == null;
  37881. }
  37882. };
  37883. /***/ }),
  37884. /* 454 */
  37885. /***/ (function(module, exports, __webpack_require__) {
  37886. "use strict";
  37887. exports.decode = exports.parse = __webpack_require__(455);
  37888. exports.encode = exports.stringify = __webpack_require__(456);
  37889. /***/ }),
  37890. /* 455 */
  37891. /***/ (function(module, exports, __webpack_require__) {
  37892. "use strict";
  37893. // Copyright Joyent, Inc. and other Node contributors.
  37894. //
  37895. // Permission is hereby granted, free of charge, to any person obtaining a
  37896. // copy of this software and associated documentation files (the
  37897. // "Software"), to deal in the Software without restriction, including
  37898. // without limitation the rights to use, copy, modify, merge, publish,
  37899. // distribute, sublicense, and/or sell copies of the Software, and to permit
  37900. // persons to whom the Software is furnished to do so, subject to the
  37901. // following conditions:
  37902. //
  37903. // The above copyright notice and this permission notice shall be included
  37904. // in all copies or substantial portions of the Software.
  37905. //
  37906. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  37907. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  37908. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  37909. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  37910. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  37911. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  37912. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  37913. // If obj.hasOwnProperty has been overridden, then calling
  37914. // obj.hasOwnProperty(prop) will break.
  37915. // See: https://github.com/joyent/node/issues/1707
  37916. function hasOwnProperty(obj, prop) {
  37917. return Object.prototype.hasOwnProperty.call(obj, prop);
  37918. }
  37919. module.exports = function(qs, sep, eq, options) {
  37920. sep = sep || '&';
  37921. eq = eq || '=';
  37922. var obj = {};
  37923. if (typeof qs !== 'string' || qs.length === 0) {
  37924. return obj;
  37925. }
  37926. var regexp = /\+/g;
  37927. qs = qs.split(sep);
  37928. var maxKeys = 1000;
  37929. if (options && typeof options.maxKeys === 'number') {
  37930. maxKeys = options.maxKeys;
  37931. }
  37932. var len = qs.length;
  37933. // maxKeys <= 0 means that we should not limit keys count
  37934. if (maxKeys > 0 && len > maxKeys) {
  37935. len = maxKeys;
  37936. }
  37937. for (var i = 0; i < len; ++i) {
  37938. var x = qs[i].replace(regexp, '%20'),
  37939. idx = x.indexOf(eq),
  37940. kstr, vstr, k, v;
  37941. if (idx >= 0) {
  37942. kstr = x.substr(0, idx);
  37943. vstr = x.substr(idx + 1);
  37944. } else {
  37945. kstr = x;
  37946. vstr = '';
  37947. }
  37948. k = decodeURIComponent(kstr);
  37949. v = decodeURIComponent(vstr);
  37950. if (!hasOwnProperty(obj, k)) {
  37951. obj[k] = v;
  37952. } else if (isArray(obj[k])) {
  37953. obj[k].push(v);
  37954. } else {
  37955. obj[k] = [obj[k], v];
  37956. }
  37957. }
  37958. return obj;
  37959. };
  37960. var isArray = Array.isArray || function (xs) {
  37961. return Object.prototype.toString.call(xs) === '[object Array]';
  37962. };
  37963. /***/ }),
  37964. /* 456 */
  37965. /***/ (function(module, exports, __webpack_require__) {
  37966. "use strict";
  37967. // Copyright Joyent, Inc. and other Node contributors.
  37968. //
  37969. // Permission is hereby granted, free of charge, to any person obtaining a
  37970. // copy of this software and associated documentation files (the
  37971. // "Software"), to deal in the Software without restriction, including
  37972. // without limitation the rights to use, copy, modify, merge, publish,
  37973. // distribute, sublicense, and/or sell copies of the Software, and to permit
  37974. // persons to whom the Software is furnished to do so, subject to the
  37975. // following conditions:
  37976. //
  37977. // The above copyright notice and this permission notice shall be included
  37978. // in all copies or substantial portions of the Software.
  37979. //
  37980. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  37981. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  37982. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  37983. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  37984. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  37985. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  37986. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  37987. var stringifyPrimitive = function(v) {
  37988. switch (typeof v) {
  37989. case 'string':
  37990. return v;
  37991. case 'boolean':
  37992. return v ? 'true' : 'false';
  37993. case 'number':
  37994. return isFinite(v) ? v : '';
  37995. default:
  37996. return '';
  37997. }
  37998. };
  37999. module.exports = function(obj, sep, eq, name) {
  38000. sep = sep || '&';
  38001. eq = eq || '=';
  38002. if (obj === null) {
  38003. obj = undefined;
  38004. }
  38005. if (typeof obj === 'object') {
  38006. return map(objectKeys(obj), function(k) {
  38007. var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
  38008. if (isArray(obj[k])) {
  38009. return map(obj[k], function(v) {
  38010. return ks + encodeURIComponent(stringifyPrimitive(v));
  38011. }).join(sep);
  38012. } else {
  38013. return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
  38014. }
  38015. }).join(sep);
  38016. }
  38017. if (!name) return '';
  38018. return encodeURIComponent(stringifyPrimitive(name)) + eq +
  38019. encodeURIComponent(stringifyPrimitive(obj));
  38020. };
  38021. var isArray = Array.isArray || function (xs) {
  38022. return Object.prototype.toString.call(xs) === '[object Array]';
  38023. };
  38024. function map (xs, f) {
  38025. if (xs.map) return xs.map(f);
  38026. var res = [];
  38027. for (var i = 0; i < xs.length; i++) {
  38028. res.push(f(xs[i], i));
  38029. }
  38030. return res;
  38031. }
  38032. var objectKeys = Object.keys || function (obj) {
  38033. var res = [];
  38034. for (var key in obj) {
  38035. if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
  38036. }
  38037. return res;
  38038. };
  38039. /***/ }),
  38040. /* 457 */
  38041. /***/ (function(module, exports, __webpack_require__) {
  38042. "use strict";
  38043. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  38044. /* eslint-disable no-param-reassign, no-void, no-underscore-dangle */
  38045. const isObject = __webpack_require__(7);
  38046. const specialDomProperties = {
  38047. for: 'htmlFor',
  38048. class: 'className'
  38049. };
  38050. module.exports = function (ElementCollection) {
  38051. // Gets or sets the attribute called +name+ for the first element in the collection
  38052. ElementCollection.prototype.attr = function (name, value) {
  38053. if (isObject(name)) {
  38054. let actualName;
  38055. Object.keys(name).forEach(key => {
  38056. actualName = specialDomProperties[key] || key;
  38057. this.first.setAttribute(actualName, name[key]);
  38058. });
  38059. } else if (value === void 0) {
  38060. return this.first.getAttribute(specialDomProperties[name] || name);
  38061. } else {
  38062. this.first.setAttribute(specialDomProperties[name] || name, value);
  38063. }
  38064. return this;
  38065. }; // Removes an attribute called +name+ for the every element in the collection.
  38066. ElementCollection.prototype.removeAttr = function (name) {
  38067. const actualName = specialDomProperties[name] || name;
  38068. this.forEach(element => {
  38069. element.removeAttribute(actualName);
  38070. });
  38071. return this;
  38072. }; // Gets, and optionally sets, the html body of the first element
  38073. // in the collection. If the +html+ is provided then the first
  38074. // element's html body will be replaced with it.
  38075. //
  38076. ElementCollection.prototype.html = function (html) {
  38077. if (html !== void 0) {
  38078. this.first.innerHTML = html;
  38079. }
  38080. return this.first.innerHTML;
  38081. }; // Centers +element+ within the global. You can pass through the width and height
  38082. // if you know it, if you don't they will be calculated for you.
  38083. ElementCollection.prototype.center = function (width, height) {
  38084. let $element;
  38085. this.forEach(element => {
  38086. $element = new ElementCollection(element);
  38087. width = width || parseInt($element.width(), 10);
  38088. height = height || parseInt($element.height(), 10);
  38089. const marginLeft = -0.5 * width + "px";
  38090. const marginTop = -0.5 * height + "px";
  38091. $element.css('margin', marginTop + " 0 0 " + marginLeft).addClass('OT_centered');
  38092. });
  38093. return this;
  38094. }; // @remove
  38095. // Centers +element+ within the global. You can pass through the width and height
  38096. // if you know it, if you don't they will be calculated for you.
  38097. ElementCollection._attachToOTHelpers.centerElement = function (element, width, height) {
  38098. return new ElementCollection(element).center(width, height);
  38099. };
  38100. /**
  38101. * Methods to calculate element widths and heights.
  38102. */
  38103. const _width = function _width(element) {
  38104. if (element.offsetWidth > 0) {
  38105. return element.offsetWidth + "px";
  38106. }
  38107. return new ElementCollection(element).css('width');
  38108. };
  38109. const _height = function _height(element) {
  38110. if (element.offsetHeight > 0) {
  38111. return element.offsetHeight + "px";
  38112. }
  38113. return new ElementCollection(element).css('height');
  38114. };
  38115. ElementCollection.prototype.width = function (newWidth) {
  38116. if (newWidth) {
  38117. this.css('width', newWidth);
  38118. return this;
  38119. }
  38120. if (this.isDisplayNone()) {
  38121. return this.makeVisibleAndYield(element => _width(element))[0];
  38122. }
  38123. return _width(this.get(0));
  38124. }; // @remove
  38125. ElementCollection._attachToOTHelpers.width = function (element, newWidth) {
  38126. const ret = new ElementCollection(element).width(newWidth);
  38127. return newWidth ? ElementCollection._attachToOTHelpers : ret;
  38128. };
  38129. ElementCollection.prototype.height = function (newHeight) {
  38130. if (newHeight) {
  38131. this.css('height', newHeight);
  38132. return this;
  38133. }
  38134. if (this.isDisplayNone()) {
  38135. // We can't get the height, probably since the element is hidden.
  38136. return this.makeVisibleAndYield(element => _height(element))[0];
  38137. }
  38138. return _height(this.get(0));
  38139. }; // @remove
  38140. ElementCollection._attachToOTHelpers.height = function (element, newHeight) {
  38141. const ret = new ElementCollection(element).height(newHeight);
  38142. return newHeight ? ElementCollection._attachToOTHelpers : ret;
  38143. };
  38144. };
  38145. /***/ }),
  38146. /* 458 */
  38147. /***/ (function(module, exports, __webpack_require__) {
  38148. "use strict";
  38149. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  38150. /* eslint-disable import/newline-after-import, prefer-const, no-restricted-syntax */
  38151. /* eslint-disable no-prototype-builtins, no-param-reassign, one-var, no-void */
  38152. const env = __webpack_require__(3);
  38153. const getCompStyle = (typeof window !== undefined ? window : global).getComputedStyle;
  38154. const VENDOR_PREFIXES = {
  38155. Firefox: 'moz',
  38156. Opera: 'O',
  38157. Chrome: 'Webkit',
  38158. Safari: 'Webkit'
  38159. };
  38160. function vendorPrefix() {
  38161. return VENDOR_PREFIXES[env.name];
  38162. }
  38163. module.exports = function (ElementCollection, findElementWithDisplayNone) {
  38164. const displayStateCache = {};
  38165. const defaultDisplays = {};
  38166. const defaultDisplayValueForElement = function defaultDisplayValueForElement(element) {
  38167. if (defaultDisplays[element.ownerDocument] && defaultDisplays[element.ownerDocument][element.nodeName]) {
  38168. return defaultDisplays[element.ownerDocument][element.nodeName];
  38169. }
  38170. if (!defaultDisplays[element.ownerDocument]) {
  38171. defaultDisplays[element.ownerDocument] = {};
  38172. } // We need to know what display value to use for this node. The easiest way
  38173. // is to actually create a node and read it out.
  38174. let testNode = element.ownerDocument.createElement(element.nodeName);
  38175. let defaultDisplay;
  38176. element.ownerDocument.body.appendChild(testNode);
  38177. defaultDisplay = new ElementCollection(testNode).css('display');
  38178. defaultDisplays[element.ownerDocument][element.nodeName] = defaultDisplay;
  38179. new ElementCollection(testNode).remove();
  38180. testNode = null;
  38181. return defaultDisplay;
  38182. };
  38183. const isHidden = function isHidden(element) {
  38184. const computedStyle = getCompStyle(element);
  38185. return computedStyle.getPropertyValue('display') === 'none';
  38186. };
  38187. const getNormalisedPropName = function getNormalisedPropName(element, name) {
  38188. if (name in element.style) {
  38189. return name;
  38190. } // Try vendored names next
  38191. const prefix = vendorPrefix();
  38192. const capitalName = prefix + name[0].toUpperCase() + name.slice(1);
  38193. if (capitalName in element.style) {
  38194. return capitalName;
  38195. }
  38196. return name;
  38197. };
  38198. const setCssProperties = function setCssProperties(element, hash) {
  38199. const style = element.style;
  38200. for (const cssName in hash) {
  38201. if (hash.hasOwnProperty(cssName)) {
  38202. style[getNormalisedPropName(element, cssName)] = hash[cssName];
  38203. }
  38204. }
  38205. };
  38206. const setCssProperty = function setCssProperty(element, name, value) {
  38207. element.style[getNormalisedPropName(element, name)] = value;
  38208. };
  38209. const getCssProperty = function getCssProperty(element, unnormalisedName) {
  38210. const name = getNormalisedPropName(element, unnormalisedName);
  38211. const computedStyle = getCompStyle(element);
  38212. let currentValue = computedStyle.getPropertyValue(name);
  38213. if (currentValue === '') {
  38214. currentValue = element.style[name];
  38215. }
  38216. return currentValue;
  38217. };
  38218. const applyCSS = function applyCSS(element, styles, callback) {
  38219. const $element = new ElementCollection(element);
  38220. const oldStyles = {};
  38221. let name, ret; // Backup the old styles
  38222. for (name in styles) {
  38223. if (styles.hasOwnProperty(name)) {
  38224. // We intentionally read out of style here, instead of using the css
  38225. // helper. This is because the css helper uses querySelector and we
  38226. // only want to pull values out of the style (domeElement.style) hash.
  38227. oldStyles[name] = element.style[name];
  38228. $element.css(name, styles[name]);
  38229. }
  38230. }
  38231. ret = callback(element); // Restore the old styles
  38232. for (name in styles) {
  38233. if (styles.hasOwnProperty(name)) {
  38234. $element.css(name, oldStyles[name] || '');
  38235. }
  38236. }
  38237. return ret;
  38238. };
  38239. ElementCollection.prototype.show = function () {
  38240. return this.forEach(element => {
  38241. const display = element.style.display;
  38242. if (display === '' || display === 'none') {
  38243. element.style.display = displayStateCache[element] || '';
  38244. delete displayStateCache[element];
  38245. }
  38246. if (isHidden(element)) {
  38247. // It's still hidden so there's probably a stylesheet that declares this
  38248. // element as display:none;
  38249. displayStateCache[element] = 'none';
  38250. element.style.display = defaultDisplayValueForElement(element);
  38251. }
  38252. });
  38253. };
  38254. ElementCollection.prototype.hide = function () {
  38255. return this.forEach(element => {
  38256. if (element.style.display === 'none') {
  38257. return;
  38258. }
  38259. displayStateCache[element] = element.style.display;
  38260. element.style.display = 'none';
  38261. });
  38262. };
  38263. ElementCollection.prototype.css = function (nameOrHash, value) {
  38264. if (this.length === 0) {
  38265. // FIXME: I made this `return undefined` to preserve behaviour, but `return this` is probably
  38266. // more consistent.
  38267. return undefined;
  38268. }
  38269. if (typeof nameOrHash !== 'string') {
  38270. return this.forEach(element => {
  38271. setCssProperties(element, nameOrHash);
  38272. });
  38273. }
  38274. if (value !== undefined) {
  38275. return this.forEach(element => {
  38276. setCssProperty(element, nameOrHash, value);
  38277. });
  38278. }
  38279. return getCssProperty(this.first, nameOrHash, value);
  38280. }; // Make +element+ visible while executing +callback+.
  38281. ElementCollection.prototype.makeVisibleAndYield = function (callback) {
  38282. const hiddenVisually = {
  38283. display: 'block',
  38284. visibility: 'hidden'
  38285. };
  38286. const results = [];
  38287. this.forEach(element => {
  38288. // find whether it's the element or an ancestor that's display none and
  38289. // then apply to whichever it is
  38290. const targetElement = findElementWithDisplayNone(element);
  38291. if (!targetElement) {
  38292. results.push(void 0);
  38293. } else {
  38294. results.push(applyCSS(targetElement, hiddenVisually, callback));
  38295. }
  38296. });
  38297. return results;
  38298. };
  38299. };
  38300. /***/ }),
  38301. /* 459 */
  38302. /***/ (function(module, exports, __webpack_require__) {
  38303. "use strict";
  38304. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  38305. /* eslint-disable no-param-reassign, no-bitwise */
  38306. const hasClassListCapability = __webpack_require__(460);
  38307. function hasClass(element, className) {
  38308. if (!className) {
  38309. return false;
  38310. }
  38311. if (hasClassListCapability()) {
  38312. return element.classList.contains(className);
  38313. }
  38314. return element.className.indexOf(className) > -1;
  38315. }
  38316. function toggleClasses(element, classNames) {
  38317. if (!classNames || classNames.length === 0) {
  38318. return;
  38319. } // Only bother targeting Element nodes, ignore Text Nodes, CDATA, etc
  38320. if (element.nodeType !== 1) {
  38321. return;
  38322. }
  38323. const numClasses = classNames.length;
  38324. let i = 0;
  38325. if (hasClassListCapability()) {
  38326. for (; i < numClasses; ++i) {
  38327. element.classList.toggle(classNames[i]);
  38328. }
  38329. return;
  38330. }
  38331. let className = (" " + element.className + " ").replace(/[\s+]/, ' ');
  38332. for (; i < numClasses; ++i) {
  38333. if (hasClass(element, classNames[i])) {
  38334. className = className.replace(" " + classNames[i] + " ", ' ');
  38335. } else {
  38336. className += classNames[i] + " ";
  38337. }
  38338. }
  38339. element.className = className.trim();
  38340. }
  38341. function addClass(element, classNames) {
  38342. if (!classNames || classNames.length === 0) {
  38343. return;
  38344. } // Only bother targeting Element nodes, ignore Text Nodes, CDATA, etc
  38345. if (element.nodeType !== 1) {
  38346. return;
  38347. }
  38348. const numClasses = classNames.length;
  38349. let i = 0;
  38350. if (hasClassListCapability()) {
  38351. for (; i < numClasses; ++i) {
  38352. element.classList.add(classNames[i]);
  38353. }
  38354. return;
  38355. } // Here's our fallback to browsers that don't support element.classList
  38356. if (!element.className && classNames.length === 1) {
  38357. element.className = classNames.join(' ');
  38358. } else {
  38359. let setClass = " " + element.className + " ";
  38360. for (; i < numClasses; ++i) {
  38361. if (!~setClass.indexOf(" " + classNames[i] + " ")) {
  38362. setClass += classNames[i] + " ";
  38363. }
  38364. }
  38365. element.className = setClass.trim();
  38366. }
  38367. }
  38368. function removeClass(element, classNames) {
  38369. if (!classNames || classNames.length === 0) {
  38370. return;
  38371. } // Only bother targeting Element nodes, ignore Text Nodes, CDATA, etc
  38372. if (element.nodeType !== 1) {
  38373. return;
  38374. }
  38375. const numClasses = classNames.length;
  38376. let i = 0;
  38377. if (hasClassListCapability()) {
  38378. for (; i < numClasses; ++i) {
  38379. element.classList.remove(classNames[i]);
  38380. }
  38381. return;
  38382. }
  38383. let className = (" " + element.className + " ").replace(/[\s+]/, ' ');
  38384. for (; i < numClasses; ++i) {
  38385. className = className.replace(" " + classNames[i] + " ", ' ');
  38386. }
  38387. element.className = className.trim();
  38388. }
  38389. module.exports = function (ElementCollection) {
  38390. ElementCollection.prototype.addClass = function (value) {
  38391. if (value) {
  38392. const classNames = value.trim().split(/\s+/);
  38393. this.forEach(element => {
  38394. addClass(element, classNames);
  38395. });
  38396. }
  38397. return this;
  38398. };
  38399. ElementCollection.prototype.removeClass = function (value) {
  38400. if (value) {
  38401. const classNames = value.trim().split(/\s+/);
  38402. this.forEach(element => {
  38403. removeClass(element, classNames);
  38404. });
  38405. }
  38406. return this;
  38407. };
  38408. ElementCollection.prototype.toggleClass = function (value) {
  38409. if (value) {
  38410. const classNames = value.trim().split(/\s+/);
  38411. this.forEach(element => {
  38412. toggleClasses(element, classNames);
  38413. });
  38414. }
  38415. return this;
  38416. };
  38417. ElementCollection.prototype.hasClass = function (value) {
  38418. return this.some(element => hasClass(element, value));
  38419. };
  38420. };
  38421. /***/ }),
  38422. /* 460 */
  38423. /***/ (function(module, exports, __webpack_require__) {
  38424. "use strict";
  38425. module.exports = () => typeof document !== 'undefined' && 'classList' in document.createElement('a');
  38426. /***/ }),
  38427. /* 461 */
  38428. /***/ (function(module, exports, __webpack_require__) {
  38429. "use strict";
  38430. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  38431. /* eslint-disable prefer-rest-params, no-param-reassign */
  38432. /* eslint-disable no-underscore-dangle */
  38433. const isEmpty = __webpack_require__(462);
  38434. module.exports = function (ElementCollection) {
  38435. let sizeObserverCount = 0;
  38436. let nodeRemovalObserverCount = 0;
  38437. const observeStyleChanges = function observeStyleChanges(element, stylesToObserve, onChange) {
  38438. const oldStyles = {};
  38439. const getStyle = function getStyle(style) {
  38440. switch (style) {
  38441. case 'width':
  38442. return new ElementCollection(element).width();
  38443. case 'height':
  38444. return new ElementCollection(element).height();
  38445. default:
  38446. return new ElementCollection(element).css(style);
  38447. }
  38448. }; // get the inital values
  38449. stylesToObserve.forEach(style => {
  38450. oldStyles[style] = getStyle(style);
  38451. });
  38452. const observer = new (typeof window !== undefined ? window : global).MutationObserver(mutations => {
  38453. const changeSet = {};
  38454. mutations.forEach(mutation => {
  38455. if (mutation.attributeName !== 'style') {
  38456. return;
  38457. }
  38458. const isHidden = new ElementCollection(element).isDisplayNone();
  38459. stylesToObserve.forEach(style => {
  38460. if (isHidden && (style === 'width' || style === 'height')) {
  38461. return;
  38462. }
  38463. const newValue = getStyle(style);
  38464. if (newValue !== oldStyles[style]) {
  38465. changeSet[style] = [oldStyles[style], newValue];
  38466. oldStyles[style] = newValue;
  38467. }
  38468. });
  38469. });
  38470. if (!isEmpty(changeSet)) {
  38471. // Do this after so as to help avoid infinite loops of mutations.
  38472. setTimeout(() => {
  38473. onChange.call(null, changeSet);
  38474. });
  38475. }
  38476. });
  38477. observer.observe(element, {
  38478. attributes: true,
  38479. attributeFilter: ['style'],
  38480. childList: false,
  38481. characterData: false,
  38482. subtree: false
  38483. });
  38484. return observer;
  38485. };
  38486. const observeNodeOrChildNodeRemoval = function observeNodeOrChildNodeRemoval(element, onChange) {
  38487. const observer = new (typeof window !== undefined ? window : global).MutationObserver(mutations => {
  38488. let removedNodes = [];
  38489. mutations.forEach(mutation => {
  38490. if (mutation.removedNodes.length) {
  38491. removedNodes = removedNodes.concat(Array.prototype.slice.call(mutation.removedNodes));
  38492. }
  38493. });
  38494. if (removedNodes.length) {
  38495. // Do this after so as to help avoid infinite loops of mutations.
  38496. setTimeout(() => {
  38497. onChange(new ElementCollection(removedNodes));
  38498. });
  38499. }
  38500. });
  38501. observer.observe(element, {
  38502. attributes: false,
  38503. childList: true,
  38504. characterData: false,
  38505. subtree: true
  38506. });
  38507. nodeRemovalObserverCount++; // Intercept the native disconnect method so we can keep a valid count
  38508. // of the currently active node removal observers
  38509. const nativeDisconnect = observer.disconnect;
  38510. observer.disconnect = function () {
  38511. nativeDisconnect.apply(observer, arguments);
  38512. nodeRemovalObserverCount--;
  38513. };
  38514. return observer;
  38515. };
  38516. const observeSize = function observeSize(element, onChange) {
  38517. let previousSize = {
  38518. width: 0,
  38519. height: 0
  38520. };
  38521. const interval = setInterval(() => {
  38522. const rect = element.getBoundingClientRect();
  38523. if (previousSize.width !== rect.width || previousSize.height !== rect.height) {
  38524. onChange(rect, previousSize);
  38525. previousSize = {
  38526. width: rect.width,
  38527. height: rect.height
  38528. };
  38529. }
  38530. }, 1000 / 5);
  38531. sizeObserverCount++;
  38532. return {
  38533. disconnect() {
  38534. clearInterval(interval);
  38535. sizeObserverCount--;
  38536. }
  38537. };
  38538. }; // Allows an +onChange+ callback to be triggered when specific style properties
  38539. // of +element+ are notified. The callback accepts a single parameter, which is
  38540. // a hash where the keys are the style property that changed and the values are
  38541. // an array containing the old and new values ([oldValue, newValue]).
  38542. //
  38543. // Width and Height changes while the element is display: none will not be
  38544. // fired until such time as the element becomes visible again.
  38545. //
  38546. // This function returns the MutationObserver itself. Once you no longer wish
  38547. // to observe the element you should call disconnect on the observer.
  38548. //
  38549. // Observing changes:
  38550. // // observe changings to the width and height of object
  38551. // dimensionsObserver = OTHelpers(object).observeStyleChanges(,
  38552. // ['width', 'height'], function(changeSet) {
  38553. // OT.debug("The new width and height are " +
  38554. // changeSet.width[1] + ',' + changeSet.height[1]);
  38555. // });
  38556. //
  38557. // Cleaning up
  38558. // // stop observing changes
  38559. // dimensionsObserver.disconnect();
  38560. // dimensionsObserver = null;
  38561. //
  38562. ElementCollection.prototype.observeStyleChanges = function (stylesToObserve, onChange) {
  38563. const observers = [];
  38564. this.forEach(element => {
  38565. observers.push(observeStyleChanges(element, stylesToObserve, onChange));
  38566. });
  38567. return observers;
  38568. }; // trigger the +onChange+ callback whenever
  38569. // 1. +element+ is removed
  38570. // 2. or an immediate child of +element+ is removed.
  38571. //
  38572. // This function returns the MutationObserver itself. Once you no longer wish
  38573. // to observe the element you should call disconnect on the observer.
  38574. //
  38575. // Observing changes:
  38576. // // observe changings to the width and height of object
  38577. // nodeObserver = OTHelpers(object).observeNodeOrChildNodeRemoval(function(removedNodes) {
  38578. // OT.debug("Some child nodes were removed");
  38579. // removedNodes.forEach(function(node) {
  38580. // OT.debug(node);
  38581. // });
  38582. // });
  38583. //
  38584. // Cleaning up
  38585. // // stop observing changes
  38586. // nodeObserver.disconnect();
  38587. // nodeObserver = null;
  38588. //
  38589. ElementCollection.prototype.observeNodeOrChildNodeRemoval = function (onChange) {
  38590. const observers = [];
  38591. this.forEach(element => {
  38592. observers.push(observeNodeOrChildNodeRemoval(element, onChange));
  38593. });
  38594. return observers;
  38595. }; // trigger the +onChange+ callback whenever the width or the height of the element changes
  38596. //
  38597. // Once you no longer wish to observe the element you should call disconnect on the observer.
  38598. //
  38599. // Observing changes:
  38600. // // observe changings to the width and height of object
  38601. // sizeObserver = OTHelpers(object).observeSize(function(newSize, previousSize) {
  38602. // OT.debug("The new width and height are " +
  38603. // newSize.width + ',' + newSize.height);
  38604. // });
  38605. //
  38606. // Cleaning up
  38607. // // stop observing changes
  38608. // sizeObserver.disconnect();
  38609. // sizeObserver = null;
  38610. //
  38611. ElementCollection.prototype.observeSize = function (onChange) {
  38612. const observers = [];
  38613. this.forEach(element => {
  38614. observers.push(observeSize(element, onChange));
  38615. });
  38616. return observers;
  38617. }; // @remove
  38618. ElementCollection._attachToOTHelpers.observeStyleChanges = function (element, stylesToObserve, onChange) {
  38619. return new ElementCollection(element).observeStyleChanges(stylesToObserve, onChange)[0];
  38620. }; // @remove
  38621. ElementCollection._attachToOTHelpers.observeNodeOrChildNodeRemoval = function (element, onChange) {
  38622. return new ElementCollection(element).observeNodeOrChildNodeRemoval(onChange)[0];
  38623. }; // We expose observer counts for testing purposes.
  38624. if (!ElementCollection.__testOnly) {
  38625. ElementCollection.__testOnly = {};
  38626. }
  38627. ElementCollection.__testOnly.sizeObserverCount = function () {
  38628. return sizeObserverCount;
  38629. };
  38630. ElementCollection.__testOnly.nodeRemovalObserverCount = function () {
  38631. return nodeRemovalObserverCount;
  38632. };
  38633. };
  38634. /***/ }),
  38635. /* 462 */
  38636. /***/ (function(module, exports, __webpack_require__) {
  38637. var baseKeys = __webpack_require__(111),
  38638. getTag = __webpack_require__(39),
  38639. isArguments = __webpack_require__(61),
  38640. isArray = __webpack_require__(9),
  38641. isArrayLike = __webpack_require__(21),
  38642. isBuffer = __webpack_require__(62),
  38643. isPrototype = __webpack_require__(65),
  38644. isTypedArray = __webpack_require__(82);
  38645. /** `Object#toString` result references. */
  38646. var mapTag = '[object Map]',
  38647. setTag = '[object Set]';
  38648. /** Used for built-in method references. */
  38649. var objectProto = Object.prototype;
  38650. /** Used to check objects for own properties. */
  38651. var hasOwnProperty = objectProto.hasOwnProperty;
  38652. /**
  38653. * Checks if `value` is an empty object, collection, map, or set.
  38654. *
  38655. * Objects are considered empty if they have no own enumerable string keyed
  38656. * properties.
  38657. *
  38658. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  38659. * jQuery-like collections are considered empty if they have a `length` of `0`.
  38660. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  38661. *
  38662. * @static
  38663. * @memberOf _
  38664. * @since 0.1.0
  38665. * @category Lang
  38666. * @param {*} value The value to check.
  38667. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  38668. * @example
  38669. *
  38670. * _.isEmpty(null);
  38671. * // => true
  38672. *
  38673. * _.isEmpty(true);
  38674. * // => true
  38675. *
  38676. * _.isEmpty(1);
  38677. * // => true
  38678. *
  38679. * _.isEmpty([1, 2, 3]);
  38680. * // => false
  38681. *
  38682. * _.isEmpty({ 'a': 1 });
  38683. * // => false
  38684. */
  38685. function isEmpty(value) {
  38686. if (value == null) {
  38687. return true;
  38688. }
  38689. if (isArrayLike(value) &&
  38690. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  38691. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  38692. return !value.length;
  38693. }
  38694. var tag = getTag(value);
  38695. if (tag == mapTag || tag == setTag) {
  38696. return !value.size;
  38697. }
  38698. if (isPrototype(value)) {
  38699. return !baseKeys(value).length;
  38700. }
  38701. for (var key in value) {
  38702. if (hasOwnProperty.call(value, key)) {
  38703. return false;
  38704. }
  38705. }
  38706. return true;
  38707. }
  38708. module.exports = isEmpty;
  38709. /***/ }),
  38710. /* 463 */
  38711. /***/ (function(module, exports, __webpack_require__) {
  38712. "use strict";
  38713. const WeakMap = __webpack_require__(225);
  38714. const contexts = new WeakMap();
  38715. /**
  38716. * This method needs to memoize fns with their context, this is
  38717. * so that calls to off will have the same identity to the calls
  38718. * to on.
  38719. * @param {function} fn
  38720. * @param {object} context
  38721. */
  38722. function weakMemoizeBind(fn, context) {
  38723. if (context === undefined) {
  38724. return fn;
  38725. }
  38726. if (!contexts.has(context)) {
  38727. contexts.set(context, new WeakMap());
  38728. }
  38729. const fnMap = contexts.get(context);
  38730. if (!fnMap.has(fn)) {
  38731. fnMap.set(fn, fn.bind(context));
  38732. }
  38733. return fnMap.get(fn);
  38734. }
  38735. module.exports = weakMemoizeBind;
  38736. /***/ }),
  38737. /* 464 */
  38738. /***/ (function(module, exports, __webpack_require__) {
  38739. "use strict";
  38740. module.exports = function () {
  38741. var weakMap, obj;
  38742. if (typeof WeakMap !== "function") return false;
  38743. try {
  38744. // WebKit doesn't support arguments and crashes
  38745. weakMap = new WeakMap([[obj = {}, "one"], [{}, "two"], [{}, "three"]]);
  38746. } catch (e) {
  38747. return false;
  38748. }
  38749. if (String(weakMap) !== "[object WeakMap]") return false;
  38750. if (typeof weakMap.set !== "function") return false;
  38751. if (weakMap.set({}, 1) !== weakMap) return false;
  38752. if (typeof weakMap.delete !== "function") return false;
  38753. if (typeof weakMap.has !== "function") return false;
  38754. if (weakMap.get(obj) !== "one") return false;
  38755. return true;
  38756. };
  38757. /***/ }),
  38758. /* 465 */
  38759. /***/ (function(module, exports, __webpack_require__) {
  38760. "use strict";
  38761. var isValue = __webpack_require__(44)
  38762. , setPrototypeOf = __webpack_require__(130)
  38763. , object = __webpack_require__(468)
  38764. , ensureValue = __webpack_require__(31)
  38765. , randomUniq = __webpack_require__(469)
  38766. , d = __webpack_require__(32)
  38767. , getIterator = __webpack_require__(232)
  38768. , forOf = __webpack_require__(511)
  38769. , toStringTagSymbol = __webpack_require__(45).toStringTag
  38770. , isNative = __webpack_require__(512)
  38771. , isArray = Array.isArray, defineProperty = Object.defineProperty
  38772. , objHasOwnProperty = Object.prototype.hasOwnProperty, getPrototypeOf = Object.getPrototypeOf
  38773. , WeakMapPoly;
  38774. module.exports = WeakMapPoly = function (/* Iterable*/) {
  38775. var iterable = arguments[0], self;
  38776. if (!(this instanceof WeakMapPoly)) throw new TypeError("Constructor requires 'new'");
  38777. self = isNative && setPrototypeOf && (WeakMap !== WeakMapPoly)
  38778. ? setPrototypeOf(new WeakMap(), getPrototypeOf(this)) : this;
  38779. if (isValue(iterable)) {
  38780. if (!isArray(iterable)) iterable = getIterator(iterable);
  38781. }
  38782. defineProperty(self, "__weakMapData__", d("c", "$weakMap$" + randomUniq()));
  38783. if (!iterable) return self;
  38784. forOf(iterable, function (val) {
  38785. ensureValue(val);
  38786. self.set(val[0], val[1]);
  38787. });
  38788. return self;
  38789. };
  38790. if (isNative) {
  38791. if (setPrototypeOf) setPrototypeOf(WeakMapPoly, WeakMap);
  38792. WeakMapPoly.prototype = Object.create(WeakMap.prototype, { constructor: d(WeakMapPoly) });
  38793. }
  38794. Object.defineProperties(WeakMapPoly.prototype, {
  38795. delete: d(function (key) {
  38796. if (objHasOwnProperty.call(object(key), this.__weakMapData__)) {
  38797. delete key[this.__weakMapData__];
  38798. return true;
  38799. }
  38800. return false;
  38801. }),
  38802. get: d(function (key) {
  38803. if (!objHasOwnProperty.call(object(key), this.__weakMapData__)) return undefined;
  38804. return key[this.__weakMapData__];
  38805. }),
  38806. has: d(function (key) {
  38807. return objHasOwnProperty.call(object(key), this.__weakMapData__);
  38808. }),
  38809. set: d(function (key, value) {
  38810. defineProperty(object(key), this.__weakMapData__, d("c", value));
  38811. return this;
  38812. }),
  38813. toString: d(function () {
  38814. return "[object WeakMap]";
  38815. })
  38816. });
  38817. defineProperty(WeakMapPoly.prototype, toStringTagSymbol, d("c", "WeakMap"));
  38818. /***/ }),
  38819. /* 466 */
  38820. /***/ (function(module, exports, __webpack_require__) {
  38821. "use strict";
  38822. // eslint-disable-next-line no-empty-function
  38823. module.exports = function () {};
  38824. /***/ }),
  38825. /* 467 */
  38826. /***/ (function(module, exports, __webpack_require__) {
  38827. "use strict";
  38828. // Workaround for http://code.google.com/p/v8/issues/detail?id=2804
  38829. var create = Object.create, shim;
  38830. if (!__webpack_require__(226)()) {
  38831. shim = __webpack_require__(227);
  38832. }
  38833. module.exports = (function () {
  38834. var nullObject, polyProps, desc;
  38835. if (!shim) return create;
  38836. if (shim.level !== 1) return create;
  38837. nullObject = {};
  38838. polyProps = {};
  38839. desc = { configurable: false, enumerable: false, writable: true, value: undefined };
  38840. Object.getOwnPropertyNames(Object.prototype).forEach(function (name) {
  38841. if (name === "__proto__") {
  38842. polyProps[name] = {
  38843. configurable: true,
  38844. enumerable: false,
  38845. writable: true,
  38846. value: undefined
  38847. };
  38848. return;
  38849. }
  38850. polyProps[name] = desc;
  38851. });
  38852. Object.defineProperties(nullObject, polyProps);
  38853. Object.defineProperty(shim, "nullPolyfill", {
  38854. configurable: false,
  38855. enumerable: false,
  38856. writable: false,
  38857. value: nullObject
  38858. });
  38859. return function (prototype, props) {
  38860. return create(prototype === null ? nullObject : prototype, props);
  38861. };
  38862. })();
  38863. /***/ }),
  38864. /* 468 */
  38865. /***/ (function(module, exports, __webpack_require__) {
  38866. "use strict";
  38867. var isObject = __webpack_require__(228);
  38868. module.exports = function (value) {
  38869. if (!isObject(value)) throw new TypeError(value + " is not an Object");
  38870. return value;
  38871. };
  38872. /***/ }),
  38873. /* 469 */
  38874. /***/ (function(module, exports, __webpack_require__) {
  38875. "use strict";
  38876. var generated = Object.create(null), random = Math.random;
  38877. module.exports = function () {
  38878. var str;
  38879. do {
  38880. str = random().toString(36).slice(2);
  38881. } while (generated[str]);
  38882. return str;
  38883. };
  38884. /***/ }),
  38885. /* 470 */
  38886. /***/ (function(module, exports, __webpack_require__) {
  38887. "use strict";
  38888. var isPrototype = __webpack_require__(471);
  38889. module.exports = function (value) {
  38890. if (typeof value !== "function") return false;
  38891. if (!hasOwnProperty.call(value, "length")) return false;
  38892. try {
  38893. if (typeof value.length !== "number") return false;
  38894. if (typeof value.call !== "function") return false;
  38895. if (typeof value.apply !== "function") return false;
  38896. } catch (error) {
  38897. return false;
  38898. }
  38899. return !isPrototype(value);
  38900. };
  38901. /***/ }),
  38902. /* 471 */
  38903. /***/ (function(module, exports, __webpack_require__) {
  38904. "use strict";
  38905. var isObject = __webpack_require__(131);
  38906. module.exports = function (value) {
  38907. if (!isObject(value)) return false;
  38908. try {
  38909. if (!value.constructor) return false;
  38910. return value.constructor.prototype === value;
  38911. } catch (error) {
  38912. return false;
  38913. }
  38914. };
  38915. /***/ }),
  38916. /* 472 */
  38917. /***/ (function(module, exports, __webpack_require__) {
  38918. "use strict";
  38919. module.exports = function () {
  38920. var assign = Object.assign, obj;
  38921. if (typeof assign !== "function") return false;
  38922. obj = { foo: "raz" };
  38923. assign(obj, { bar: "dwa" }, { trzy: "trzy" });
  38924. return obj.foo + obj.bar + obj.trzy === "razdwatrzy";
  38925. };
  38926. /***/ }),
  38927. /* 473 */
  38928. /***/ (function(module, exports, __webpack_require__) {
  38929. "use strict";
  38930. var keys = __webpack_require__(474)
  38931. , value = __webpack_require__(31)
  38932. , max = Math.max;
  38933. module.exports = function (dest, src/*, …srcn*/) {
  38934. var error, i, length = max(arguments.length, 2), assign;
  38935. dest = Object(value(dest));
  38936. assign = function (key) {
  38937. try {
  38938. dest[key] = src[key];
  38939. } catch (e) {
  38940. if (!error) error = e;
  38941. }
  38942. };
  38943. for (i = 1; i < length; ++i) {
  38944. src = arguments[i];
  38945. keys(src).forEach(assign);
  38946. }
  38947. if (error !== undefined) throw error;
  38948. return dest;
  38949. };
  38950. /***/ }),
  38951. /* 474 */
  38952. /***/ (function(module, exports, __webpack_require__) {
  38953. "use strict";
  38954. module.exports = __webpack_require__(475)() ? Object.keys : __webpack_require__(476);
  38955. /***/ }),
  38956. /* 475 */
  38957. /***/ (function(module, exports, __webpack_require__) {
  38958. "use strict";
  38959. module.exports = function () {
  38960. try {
  38961. Object.keys("primitive");
  38962. return true;
  38963. } catch (e) {
  38964. return false;
  38965. }
  38966. };
  38967. /***/ }),
  38968. /* 476 */
  38969. /***/ (function(module, exports, __webpack_require__) {
  38970. "use strict";
  38971. var isValue = __webpack_require__(44);
  38972. var keys = Object.keys;
  38973. module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); };
  38974. /***/ }),
  38975. /* 477 */
  38976. /***/ (function(module, exports, __webpack_require__) {
  38977. "use strict";
  38978. var str = "razdwatrzy";
  38979. module.exports = function () {
  38980. if (typeof str.contains !== "function") return false;
  38981. return str.contains("dwa") === true && str.contains("foo") === false;
  38982. };
  38983. /***/ }),
  38984. /* 478 */
  38985. /***/ (function(module, exports, __webpack_require__) {
  38986. "use strict";
  38987. var indexOf = String.prototype.indexOf;
  38988. module.exports = function (searchString/*, position*/) {
  38989. return indexOf.call(this, searchString, arguments[1]) > -1;
  38990. };
  38991. /***/ }),
  38992. /* 479 */
  38993. /***/ (function(module, exports, __webpack_require__) {
  38994. "use strict";
  38995. var setPrototypeOf = __webpack_require__(130)
  38996. , contains = __webpack_require__(231)
  38997. , d = __webpack_require__(32)
  38998. , Symbol = __webpack_require__(45)
  38999. , Iterator = __webpack_require__(234);
  39000. var defineProperty = Object.defineProperty, ArrayIterator;
  39001. ArrayIterator = module.exports = function (arr, kind) {
  39002. if (!(this instanceof ArrayIterator)) throw new TypeError("Constructor requires 'new'");
  39003. Iterator.call(this, arr);
  39004. if (!kind) kind = "value";
  39005. else if (contains.call(kind, "key+value")) kind = "key+value";
  39006. else if (contains.call(kind, "key")) kind = "key";
  39007. else kind = "value";
  39008. defineProperty(this, "__kind__", d("", kind));
  39009. };
  39010. if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator);
  39011. // Internal %ArrayIteratorPrototype% doesn't expose its constructor
  39012. delete ArrayIterator.prototype.constructor;
  39013. ArrayIterator.prototype = Object.create(Iterator.prototype, {
  39014. _resolve: d(function (i) {
  39015. if (this.__kind__ === "value") return this.__list__[i];
  39016. if (this.__kind__ === "key+value") return [i, this.__list__[i]];
  39017. return i;
  39018. })
  39019. });
  39020. defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator"));
  39021. /***/ }),
  39022. /* 480 */
  39023. /***/ (function(module, exports, __webpack_require__) {
  39024. "use strict";
  39025. var global = __webpack_require__(97)
  39026. , validTypes = { object: true, symbol: true };
  39027. module.exports = function () {
  39028. var Symbol = global.Symbol;
  39029. var symbol;
  39030. if (typeof Symbol !== "function") return false;
  39031. symbol = Symbol("test symbol");
  39032. try { String(symbol); }
  39033. catch (e) { return false; }
  39034. // Return 'true' also for polyfills
  39035. if (!validTypes[typeof Symbol.iterator]) return false;
  39036. if (!validTypes[typeof Symbol.toPrimitive]) return false;
  39037. if (!validTypes[typeof Symbol.toStringTag]) return false;
  39038. return true;
  39039. };
  39040. /***/ }),
  39041. /* 481 */
  39042. /***/ (function(module, exports, __webpack_require__) {
  39043. "use strict";
  39044. module.exports = function () {
  39045. if (typeof globalThis !== "object") return false;
  39046. if (!globalThis) return false;
  39047. return globalThis.Array === Array;
  39048. };
  39049. /***/ }),
  39050. /* 482 */
  39051. /***/ (function(module, exports) {
  39052. var naiveFallback = function () {
  39053. if (typeof self === "object" && self) return self;
  39054. if (typeof window === "object" && window) return window;
  39055. throw new Error("Unable to resolve global `this`");
  39056. };
  39057. module.exports = (function () {
  39058. if (this) return this;
  39059. // Unexpected strict mode (may happen if e.g. bundled into ESM module)
  39060. // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
  39061. // In all ES5+ engines global object inherits from Object.prototype
  39062. // (if you approached one that doesn't please report)
  39063. try {
  39064. Object.defineProperty(Object.prototype, "__global__", {
  39065. get: function () { return this; },
  39066. configurable: true
  39067. });
  39068. } catch (error) {
  39069. // Unfortunate case of Object.prototype being sealed (via preventExtensions, seal or freeze)
  39070. return naiveFallback();
  39071. }
  39072. try {
  39073. // Safari case (window.__global__ is resolved with global context, but __global__ does not)
  39074. if (!__global__) return naiveFallback();
  39075. return __global__;
  39076. } finally {
  39077. delete Object.prototype.__global__;
  39078. }
  39079. })();
  39080. /***/ }),
  39081. /* 483 */
  39082. /***/ (function(module, exports, __webpack_require__) {
  39083. "use strict";
  39084. // ES2015 Symbol polyfill for environments that do not (or partially) support it
  39085. var d = __webpack_require__(32)
  39086. , validateSymbol = __webpack_require__(233)
  39087. , NativeSymbol = __webpack_require__(97).Symbol
  39088. , generateName = __webpack_require__(485)
  39089. , setupStandardSymbols = __webpack_require__(486)
  39090. , setupSymbolRegistry = __webpack_require__(487);
  39091. var create = Object.create
  39092. , defineProperties = Object.defineProperties
  39093. , defineProperty = Object.defineProperty;
  39094. var SymbolPolyfill, HiddenSymbol, isNativeSafe;
  39095. if (typeof NativeSymbol === "function") {
  39096. try {
  39097. String(NativeSymbol());
  39098. isNativeSafe = true;
  39099. } catch (ignore) {}
  39100. } else {
  39101. NativeSymbol = null;
  39102. }
  39103. // Internal constructor (not one exposed) for creating Symbol instances.
  39104. // This one is used to ensure that `someSymbol instanceof Symbol` always return false
  39105. HiddenSymbol = function Symbol(description) {
  39106. if (this instanceof HiddenSymbol) throw new TypeError("Symbol is not a constructor");
  39107. return SymbolPolyfill(description);
  39108. };
  39109. // Exposed `Symbol` constructor
  39110. // (returns instances of HiddenSymbol)
  39111. module.exports = SymbolPolyfill = function Symbol(description) {
  39112. var symbol;
  39113. if (this instanceof Symbol) throw new TypeError("Symbol is not a constructor");
  39114. if (isNativeSafe) return NativeSymbol(description);
  39115. symbol = create(HiddenSymbol.prototype);
  39116. description = description === undefined ? "" : String(description);
  39117. return defineProperties(symbol, {
  39118. __description__: d("", description),
  39119. __name__: d("", generateName(description))
  39120. });
  39121. };
  39122. setupStandardSymbols(SymbolPolyfill);
  39123. setupSymbolRegistry(SymbolPolyfill);
  39124. // Internal tweaks for real symbol producer
  39125. defineProperties(HiddenSymbol.prototype, {
  39126. constructor: d(SymbolPolyfill),
  39127. toString: d("", function () { return this.__name__; })
  39128. });
  39129. // Proper implementation of methods exposed on Symbol.prototype
  39130. // They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype
  39131. defineProperties(SymbolPolyfill.prototype, {
  39132. toString: d(function () { return "Symbol (" + validateSymbol(this).__description__ + ")"; }),
  39133. valueOf: d(function () { return validateSymbol(this); })
  39134. });
  39135. defineProperty(
  39136. SymbolPolyfill.prototype,
  39137. SymbolPolyfill.toPrimitive,
  39138. d("", function () {
  39139. var symbol = validateSymbol(this);
  39140. if (typeof symbol === "symbol") return symbol;
  39141. return symbol.toString();
  39142. })
  39143. );
  39144. defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d("c", "Symbol"));
  39145. // Proper implementaton of toPrimitive and toStringTag for returned symbol instances
  39146. defineProperty(
  39147. HiddenSymbol.prototype, SymbolPolyfill.toStringTag,
  39148. d("c", SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])
  39149. );
  39150. // Note: It's important to define `toPrimitive` as last one, as some implementations
  39151. // implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols)
  39152. // And that may invoke error in definition flow:
  39153. // See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149
  39154. defineProperty(
  39155. HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,
  39156. d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])
  39157. );
  39158. /***/ }),
  39159. /* 484 */
  39160. /***/ (function(module, exports, __webpack_require__) {
  39161. "use strict";
  39162. module.exports = function (value) {
  39163. if (!value) return false;
  39164. if (typeof value === "symbol") return true;
  39165. if (!value.constructor) return false;
  39166. if (value.constructor.name !== "Symbol") return false;
  39167. return value[value.constructor.toStringTag] === "Symbol";
  39168. };
  39169. /***/ }),
  39170. /* 485 */
  39171. /***/ (function(module, exports, __webpack_require__) {
  39172. "use strict";
  39173. var d = __webpack_require__(32);
  39174. var create = Object.create, defineProperty = Object.defineProperty, objPrototype = Object.prototype;
  39175. var created = create(null);
  39176. module.exports = function (desc) {
  39177. var postfix = 0, name, ie11BugWorkaround;
  39178. while (created[desc + (postfix || "")]) ++postfix;
  39179. desc += postfix || "";
  39180. created[desc] = true;
  39181. name = "@@" + desc;
  39182. defineProperty(
  39183. objPrototype,
  39184. name,
  39185. d.gs(null, function (value) {
  39186. // For IE11 issue see:
  39187. // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/
  39188. // ie11-broken-getters-on-dom-objects
  39189. // https://github.com/medikoo/es6-symbol/issues/12
  39190. if (ie11BugWorkaround) return;
  39191. ie11BugWorkaround = true;
  39192. defineProperty(this, name, d(value));
  39193. ie11BugWorkaround = false;
  39194. })
  39195. );
  39196. return name;
  39197. };
  39198. /***/ }),
  39199. /* 486 */
  39200. /***/ (function(module, exports, __webpack_require__) {
  39201. "use strict";
  39202. var d = __webpack_require__(32)
  39203. , NativeSymbol = __webpack_require__(97).Symbol;
  39204. module.exports = function (SymbolPolyfill) {
  39205. return Object.defineProperties(SymbolPolyfill, {
  39206. // To ensure proper interoperability with other native functions (e.g. Array.from)
  39207. // fallback to eventual native implementation of given symbol
  39208. hasInstance: d(
  39209. "", (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill("hasInstance")
  39210. ),
  39211. isConcatSpreadable: d(
  39212. "",
  39213. (NativeSymbol && NativeSymbol.isConcatSpreadable) ||
  39214. SymbolPolyfill("isConcatSpreadable")
  39215. ),
  39216. iterator: d("", (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill("iterator")),
  39217. match: d("", (NativeSymbol && NativeSymbol.match) || SymbolPolyfill("match")),
  39218. replace: d("", (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill("replace")),
  39219. search: d("", (NativeSymbol && NativeSymbol.search) || SymbolPolyfill("search")),
  39220. species: d("", (NativeSymbol && NativeSymbol.species) || SymbolPolyfill("species")),
  39221. split: d("", (NativeSymbol && NativeSymbol.split) || SymbolPolyfill("split")),
  39222. toPrimitive: d(
  39223. "", (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill("toPrimitive")
  39224. ),
  39225. toStringTag: d(
  39226. "", (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill("toStringTag")
  39227. ),
  39228. unscopables: d(
  39229. "", (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill("unscopables")
  39230. )
  39231. });
  39232. };
  39233. /***/ }),
  39234. /* 487 */
  39235. /***/ (function(module, exports, __webpack_require__) {
  39236. "use strict";
  39237. var d = __webpack_require__(32)
  39238. , validateSymbol = __webpack_require__(233);
  39239. var registry = Object.create(null);
  39240. module.exports = function (SymbolPolyfill) {
  39241. return Object.defineProperties(SymbolPolyfill, {
  39242. for: d(function (key) {
  39243. if (registry[key]) return registry[key];
  39244. return (registry[key] = SymbolPolyfill(String(key)));
  39245. }),
  39246. keyFor: d(function (symbol) {
  39247. var key;
  39248. validateSymbol(symbol);
  39249. for (key in registry) {
  39250. if (registry[key] === symbol) return key;
  39251. }
  39252. return undefined;
  39253. })
  39254. });
  39255. };
  39256. /***/ }),
  39257. /* 488 */
  39258. /***/ (function(module, exports, __webpack_require__) {
  39259. "use strict";
  39260. // Inspired by Google Closure:
  39261. // http://closure-library.googlecode.com/svn/docs/
  39262. // closure_goog_array_array.js.html#goog.array.clear
  39263. var value = __webpack_require__(31);
  39264. module.exports = function () {
  39265. value(this).length = 0;
  39266. return this;
  39267. };
  39268. /***/ }),
  39269. /* 489 */
  39270. /***/ (function(module, exports, __webpack_require__) {
  39271. "use strict";
  39272. var isValue = __webpack_require__(53)
  39273. , ensureValue = __webpack_require__(490)
  39274. , ensurePlainFunction = __webpack_require__(494)
  39275. , copy = __webpack_require__(495)
  39276. , normalizeOptions = __webpack_require__(230)
  39277. , map = __webpack_require__(505);
  39278. var bind = Function.prototype.bind
  39279. , defineProperty = Object.defineProperty
  39280. , hasOwnProperty = Object.prototype.hasOwnProperty
  39281. , define;
  39282. define = function (name, desc, options) {
  39283. var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
  39284. dgs = copy(desc);
  39285. delete dgs.writable;
  39286. delete dgs.value;
  39287. dgs.get = function () {
  39288. if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
  39289. desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
  39290. defineProperty(this, name, desc);
  39291. return this[name];
  39292. };
  39293. return dgs;
  39294. };
  39295. module.exports = function (props/*, options*/) {
  39296. var options = normalizeOptions(arguments[1]);
  39297. if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
  39298. return map(props, function (desc, name) { return define(name, desc, options); });
  39299. };
  39300. /***/ }),
  39301. /* 490 */
  39302. /***/ (function(module, exports, __webpack_require__) {
  39303. "use strict";
  39304. var resolveException = __webpack_require__(235)
  39305. , is = __webpack_require__(53);
  39306. module.exports = function (value/*, options*/) {
  39307. if (is(value)) return value;
  39308. return resolveException(value, "Cannot use %v", arguments[1]);
  39309. };
  39310. /***/ }),
  39311. /* 491 */
  39312. /***/ (function(module, exports, __webpack_require__) {
  39313. "use strict";
  39314. var isValue = __webpack_require__(53)
  39315. , isObject = __webpack_require__(131);
  39316. var objectToString = Object.prototype.toString;
  39317. module.exports = function (value) {
  39318. if (!isValue(value)) return null;
  39319. if (isObject(value)) {
  39320. // Reject Object.prototype.toString coercion
  39321. var valueToString = value.toString;
  39322. if (typeof valueToString !== "function") return null;
  39323. if (valueToString === objectToString) return null;
  39324. // Note: It can be object coming from other realm, still as there's no ES3 and CSP compliant
  39325. // way to resolve its realm's Object.prototype.toString it's left as not addressed edge case
  39326. }
  39327. try {
  39328. return "" + value; // Ensure implicit coercion
  39329. } catch (error) {
  39330. return null;
  39331. }
  39332. };
  39333. /***/ }),
  39334. /* 492 */
  39335. /***/ (function(module, exports, __webpack_require__) {
  39336. "use strict";
  39337. var safeToString = __webpack_require__(493);
  39338. var reNewLine = /[\n\r\u2028\u2029]/g;
  39339. module.exports = function (value) {
  39340. var string = safeToString(value);
  39341. if (string === null) return "<Non-coercible to string value>";
  39342. // Trim if too long
  39343. if (string.length > 100) string = string.slice(0, 99) + "…";
  39344. // Replace eventual new lines
  39345. string = string.replace(reNewLine, function (char) {
  39346. switch (char) {
  39347. case "\n":
  39348. return "\\n";
  39349. case "\r":
  39350. return "\\r";
  39351. case "\u2028":
  39352. return "\\u2028";
  39353. case "\u2029":
  39354. return "\\u2029";
  39355. /* istanbul ignore next */
  39356. default:
  39357. throw new Error("Unexpected character");
  39358. }
  39359. });
  39360. return string;
  39361. };
  39362. /***/ }),
  39363. /* 493 */
  39364. /***/ (function(module, exports, __webpack_require__) {
  39365. "use strict";
  39366. module.exports = function (value) {
  39367. try {
  39368. return value.toString();
  39369. } catch (error) {
  39370. try { return String(value); }
  39371. catch (error2) { return null; }
  39372. }
  39373. };
  39374. /***/ }),
  39375. /* 494 */
  39376. /***/ (function(module, exports, __webpack_require__) {
  39377. "use strict";
  39378. var resolveException = __webpack_require__(235)
  39379. , is = __webpack_require__(229);
  39380. module.exports = function (value/*, options*/) {
  39381. if (is(value)) return value;
  39382. return resolveException(value, "%v is not a plain function", arguments[1]);
  39383. };
  39384. /***/ }),
  39385. /* 495 */
  39386. /***/ (function(module, exports, __webpack_require__) {
  39387. "use strict";
  39388. var aFrom = __webpack_require__(496)
  39389. , assign = __webpack_require__(132)
  39390. , value = __webpack_require__(31);
  39391. module.exports = function (obj/*, propertyNames, options*/) {
  39392. var copy = Object(value(obj)), propertyNames = arguments[1], options = Object(arguments[2]);
  39393. if (copy !== obj && !propertyNames) return copy;
  39394. var result = {};
  39395. if (propertyNames) {
  39396. aFrom(propertyNames, function (propertyName) {
  39397. if (options.ensure || propertyName in obj) result[propertyName] = obj[propertyName];
  39398. });
  39399. } else {
  39400. assign(result, obj);
  39401. }
  39402. return result;
  39403. };
  39404. /***/ }),
  39405. /* 496 */
  39406. /***/ (function(module, exports, __webpack_require__) {
  39407. "use strict";
  39408. module.exports = __webpack_require__(497)() ? Array.from : __webpack_require__(498);
  39409. /***/ }),
  39410. /* 497 */
  39411. /***/ (function(module, exports, __webpack_require__) {
  39412. "use strict";
  39413. module.exports = function () {
  39414. var from = Array.from, arr, result;
  39415. if (typeof from !== "function") return false;
  39416. arr = ["raz", "dwa"];
  39417. result = from(arr);
  39418. return Boolean(result && result !== arr && result[1] === "dwa");
  39419. };
  39420. /***/ }),
  39421. /* 498 */
  39422. /***/ (function(module, exports, __webpack_require__) {
  39423. "use strict";
  39424. var iteratorSymbol = __webpack_require__(45).iterator
  39425. , isArguments = __webpack_require__(95)
  39426. , isFunction = __webpack_require__(499)
  39427. , toPosInt = __webpack_require__(500)
  39428. , callable = __webpack_require__(70)
  39429. , validValue = __webpack_require__(31)
  39430. , isValue = __webpack_require__(44)
  39431. , isString = __webpack_require__(96)
  39432. , isArray = Array.isArray
  39433. , call = Function.prototype.call
  39434. , desc = { configurable: true, enumerable: true, writable: true, value: null }
  39435. , defineProperty = Object.defineProperty;
  39436. // eslint-disable-next-line complexity, max-lines-per-function
  39437. module.exports = function (arrayLike/*, mapFn, thisArg*/) {
  39438. var mapFn = arguments[1]
  39439. , thisArg = arguments[2]
  39440. , Context
  39441. , i
  39442. , j
  39443. , arr
  39444. , length
  39445. , code
  39446. , iterator
  39447. , result
  39448. , getIterator
  39449. , value;
  39450. arrayLike = Object(validValue(arrayLike));
  39451. if (isValue(mapFn)) callable(mapFn);
  39452. if (!this || this === Array || !isFunction(this)) {
  39453. // Result: Plain array
  39454. if (!mapFn) {
  39455. if (isArguments(arrayLike)) {
  39456. // Source: Arguments
  39457. length = arrayLike.length;
  39458. if (length !== 1) return Array.apply(null, arrayLike);
  39459. arr = new Array(1);
  39460. arr[0] = arrayLike[0];
  39461. return arr;
  39462. }
  39463. if (isArray(arrayLike)) {
  39464. // Source: Array
  39465. arr = new Array((length = arrayLike.length));
  39466. for (i = 0; i < length; ++i) arr[i] = arrayLike[i];
  39467. return arr;
  39468. }
  39469. }
  39470. arr = [];
  39471. } else {
  39472. // Result: Non plain array
  39473. Context = this;
  39474. }
  39475. if (!isArray(arrayLike)) {
  39476. if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) {
  39477. // Source: Iterator
  39478. iterator = callable(getIterator).call(arrayLike);
  39479. if (Context) arr = new Context();
  39480. result = iterator.next();
  39481. i = 0;
  39482. while (!result.done) {
  39483. value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;
  39484. if (Context) {
  39485. desc.value = value;
  39486. defineProperty(arr, i, desc);
  39487. } else {
  39488. arr[i] = value;
  39489. }
  39490. result = iterator.next();
  39491. ++i;
  39492. }
  39493. length = i;
  39494. } else if (isString(arrayLike)) {
  39495. // Source: String
  39496. length = arrayLike.length;
  39497. if (Context) arr = new Context();
  39498. for (i = 0, j = 0; i < length; ++i) {
  39499. value = arrayLike[i];
  39500. if (i + 1 < length) {
  39501. code = value.charCodeAt(0);
  39502. // eslint-disable-next-line max-depth
  39503. if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i];
  39504. }
  39505. value = mapFn ? call.call(mapFn, thisArg, value, j) : value;
  39506. if (Context) {
  39507. desc.value = value;
  39508. defineProperty(arr, j, desc);
  39509. } else {
  39510. arr[j] = value;
  39511. }
  39512. ++j;
  39513. }
  39514. length = j;
  39515. }
  39516. }
  39517. if (length === undefined) {
  39518. // Source: array or array-like
  39519. length = toPosInt(arrayLike.length);
  39520. if (Context) arr = new Context(length);
  39521. for (i = 0; i < length; ++i) {
  39522. value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];
  39523. if (Context) {
  39524. desc.value = value;
  39525. defineProperty(arr, i, desc);
  39526. } else {
  39527. arr[i] = value;
  39528. }
  39529. }
  39530. }
  39531. if (Context) {
  39532. desc.value = null;
  39533. arr.length = length;
  39534. }
  39535. return arr;
  39536. };
  39537. /***/ }),
  39538. /* 499 */
  39539. /***/ (function(module, exports, __webpack_require__) {
  39540. "use strict";
  39541. var objToString = Object.prototype.toString
  39542. , isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
  39543. module.exports = function (value) {
  39544. return typeof value === "function" && isFunctionStringTag(objToString.call(value));
  39545. };
  39546. /***/ }),
  39547. /* 500 */
  39548. /***/ (function(module, exports, __webpack_require__) {
  39549. "use strict";
  39550. var toInteger = __webpack_require__(501)
  39551. , max = Math.max;
  39552. module.exports = function (value) { return max(0, toInteger(value)); };
  39553. /***/ }),
  39554. /* 501 */
  39555. /***/ (function(module, exports, __webpack_require__) {
  39556. "use strict";
  39557. var sign = __webpack_require__(502)
  39558. , abs = Math.abs
  39559. , floor = Math.floor;
  39560. module.exports = function (value) {
  39561. if (isNaN(value)) return 0;
  39562. value = Number(value);
  39563. if (value === 0 || !isFinite(value)) return value;
  39564. return sign(value) * floor(abs(value));
  39565. };
  39566. /***/ }),
  39567. /* 502 */
  39568. /***/ (function(module, exports, __webpack_require__) {
  39569. "use strict";
  39570. module.exports = __webpack_require__(503)() ? Math.sign : __webpack_require__(504);
  39571. /***/ }),
  39572. /* 503 */
  39573. /***/ (function(module, exports, __webpack_require__) {
  39574. "use strict";
  39575. module.exports = function () {
  39576. var sign = Math.sign;
  39577. if (typeof sign !== "function") return false;
  39578. return sign(10) === 1 && sign(-20) === -1;
  39579. };
  39580. /***/ }),
  39581. /* 504 */
  39582. /***/ (function(module, exports, __webpack_require__) {
  39583. "use strict";
  39584. module.exports = function (value) {
  39585. value = Number(value);
  39586. if (isNaN(value) || value === 0) return value;
  39587. return value > 0 ? 1 : -1;
  39588. };
  39589. /***/ }),
  39590. /* 505 */
  39591. /***/ (function(module, exports, __webpack_require__) {
  39592. "use strict";
  39593. var callable = __webpack_require__(70)
  39594. , forEach = __webpack_require__(506)
  39595. , call = Function.prototype.call;
  39596. module.exports = function (obj, cb/*, thisArg*/) {
  39597. var result = {}, thisArg = arguments[2];
  39598. callable(cb);
  39599. forEach(obj, function (value, key, targetObj, index) {
  39600. result[key] = call.call(cb, thisArg, value, key, targetObj, index);
  39601. });
  39602. return result;
  39603. };
  39604. /***/ }),
  39605. /* 506 */
  39606. /***/ (function(module, exports, __webpack_require__) {
  39607. "use strict";
  39608. module.exports = __webpack_require__(507)("forEach");
  39609. /***/ }),
  39610. /* 507 */
  39611. /***/ (function(module, exports, __webpack_require__) {
  39612. "use strict";
  39613. // Internal method, used by iteration functions.
  39614. // Calls a function for each key-value pair found in object
  39615. // Optionally takes compareFn to iterate object in specific order
  39616. var callable = __webpack_require__(70)
  39617. , value = __webpack_require__(31)
  39618. , bind = Function.prototype.bind
  39619. , call = Function.prototype.call
  39620. , keys = Object.keys
  39621. , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
  39622. module.exports = function (method, defVal) {
  39623. return function (obj, cb/*, thisArg, compareFn*/) {
  39624. var list, thisArg = arguments[2], compareFn = arguments[3];
  39625. obj = Object(value(obj));
  39626. callable(cb);
  39627. list = keys(obj);
  39628. if (compareFn) {
  39629. list.sort(typeof compareFn === "function" ? bind.call(compareFn, obj) : undefined);
  39630. }
  39631. if (typeof method !== "function") method = list[method];
  39632. return call.call(method, list, function (key, index) {
  39633. if (!objPropertyIsEnumerable.call(obj, key)) return defVal;
  39634. return call.call(cb, thisArg, obj[key], key, obj, index);
  39635. });
  39636. };
  39637. };
  39638. /***/ }),
  39639. /* 508 */
  39640. /***/ (function(module, exports, __webpack_require__) {
  39641. "use strict";
  39642. // Thanks @mathiasbynens
  39643. // http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols
  39644. var setPrototypeOf = __webpack_require__(130)
  39645. , d = __webpack_require__(32)
  39646. , Symbol = __webpack_require__(45)
  39647. , Iterator = __webpack_require__(234);
  39648. var defineProperty = Object.defineProperty, StringIterator;
  39649. StringIterator = module.exports = function (str) {
  39650. if (!(this instanceof StringIterator)) throw new TypeError("Constructor requires 'new'");
  39651. str = String(str);
  39652. Iterator.call(this, str);
  39653. defineProperty(this, "__length__", d("", str.length));
  39654. };
  39655. if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator);
  39656. // Internal %ArrayIteratorPrototype% doesn't expose its constructor
  39657. delete StringIterator.prototype.constructor;
  39658. StringIterator.prototype = Object.create(Iterator.prototype, {
  39659. _next: d(function () {
  39660. if (!this.__list__) return undefined;
  39661. if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++;
  39662. this._unBind();
  39663. return undefined;
  39664. }),
  39665. _resolve: d(function (i) {
  39666. var char = this.__list__[i], code;
  39667. if (this.__nextIndex__ === this.__length__) return char;
  39668. code = char.charCodeAt(0);
  39669. if (code >= 0xd800 && code <= 0xdbff) return char + this.__list__[this.__nextIndex__++];
  39670. return char;
  39671. })
  39672. });
  39673. defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator"));
  39674. /***/ }),
  39675. /* 509 */
  39676. /***/ (function(module, exports, __webpack_require__) {
  39677. "use strict";
  39678. var isIterable = __webpack_require__(510);
  39679. module.exports = function (value) {
  39680. if (!isIterable(value)) throw new TypeError(value + " is not iterable");
  39681. return value;
  39682. };
  39683. /***/ }),
  39684. /* 510 */
  39685. /***/ (function(module, exports, __webpack_require__) {
  39686. "use strict";
  39687. var isArguments = __webpack_require__(95)
  39688. , isValue = __webpack_require__(44)
  39689. , isString = __webpack_require__(96);
  39690. var iteratorSymbol = __webpack_require__(45).iterator
  39691. , isArray = Array.isArray;
  39692. module.exports = function (value) {
  39693. if (!isValue(value)) return false;
  39694. if (isArray(value)) return true;
  39695. if (isString(value)) return true;
  39696. if (isArguments(value)) return true;
  39697. return typeof value[iteratorSymbol] === "function";
  39698. };
  39699. /***/ }),
  39700. /* 511 */
  39701. /***/ (function(module, exports, __webpack_require__) {
  39702. "use strict";
  39703. var isArguments = __webpack_require__(95)
  39704. , callable = __webpack_require__(70)
  39705. , isString = __webpack_require__(96)
  39706. , get = __webpack_require__(232);
  39707. var isArray = Array.isArray, call = Function.prototype.call, some = Array.prototype.some;
  39708. module.exports = function (iterable, cb /*, thisArg*/) {
  39709. var mode, thisArg = arguments[2], result, doBreak, broken, i, length, char, code;
  39710. if (isArray(iterable) || isArguments(iterable)) mode = "array";
  39711. else if (isString(iterable)) mode = "string";
  39712. else iterable = get(iterable);
  39713. callable(cb);
  39714. doBreak = function () {
  39715. broken = true;
  39716. };
  39717. if (mode === "array") {
  39718. some.call(iterable, function (value) {
  39719. call.call(cb, thisArg, value, doBreak);
  39720. return broken;
  39721. });
  39722. return;
  39723. }
  39724. if (mode === "string") {
  39725. length = iterable.length;
  39726. for (i = 0; i < length; ++i) {
  39727. char = iterable[i];
  39728. if (i + 1 < length) {
  39729. code = char.charCodeAt(0);
  39730. if (code >= 0xd800 && code <= 0xdbff) char += iterable[++i];
  39731. }
  39732. call.call(cb, thisArg, char, doBreak);
  39733. if (broken) break;
  39734. }
  39735. return;
  39736. }
  39737. result = iterable.next();
  39738. while (!result.done) {
  39739. call.call(cb, thisArg, result.value, doBreak);
  39740. if (broken) return;
  39741. result = iterable.next();
  39742. }
  39743. };
  39744. /***/ }),
  39745. /* 512 */
  39746. /***/ (function(module, exports, __webpack_require__) {
  39747. "use strict";
  39748. // Exports true if environment provides native `WeakMap` implementation, whatever that is.
  39749. module.exports = (function () {
  39750. if (typeof WeakMap !== "function") return false;
  39751. return Object.prototype.toString.call(new WeakMap()) === "[object WeakMap]";
  39752. }());
  39753. /***/ }),
  39754. /* 513 */
  39755. /***/ (function(module, exports, __webpack_require__) {
  39756. "use strict";
  39757. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  39758. /* eslint-disable no-param-reassign, prefer-rest-params */
  39759. const isFunction = __webpack_require__(13);
  39760. module.exports = function statable(self, possibleStates, initialState, stateChanged, stateChangedFailed) {
  39761. let previousState;
  39762. let currentState = initialState;
  39763. self.currentState = initialState;
  39764. const setState = function setState(state) {
  39765. if (currentState !== state) {
  39766. if (possibleStates.indexOf(state) === -1) {
  39767. if (stateChangedFailed && isFunction(stateChangedFailed)) {
  39768. stateChangedFailed('invalidState', state);
  39769. }
  39770. return;
  39771. }
  39772. self.previousState = currentState;
  39773. previousState = currentState;
  39774. self.currentState = state;
  39775. currentState = state;
  39776. if (stateChanged && isFunction(stateChanged)) {
  39777. stateChanged(state, previousState);
  39778. }
  39779. }
  39780. }; // Returns a number of states and returns true if the current state
  39781. // is any of them.
  39782. //
  39783. // @example
  39784. // if (this.is('connecting', 'connected')) {
  39785. // // do some stuff
  39786. // }
  39787. //
  39788. self.is = function ()
  39789. /* state0:String, state1:String, ..., stateN:String */
  39790. {
  39791. return Array.prototype.indexOf.call(arguments, currentState) !== -1;
  39792. }; // Returns a number of states and returns true if the current state
  39793. // is none of them.
  39794. //
  39795. // @example
  39796. // if (this.isNot('connecting', 'connected')) {
  39797. // // do some stuff
  39798. // }
  39799. //
  39800. self.isNot = function ()
  39801. /* state0:String, state1:String, ..., stateN:String */
  39802. {
  39803. return Array.prototype.indexOf.call(arguments, currentState) === -1;
  39804. };
  39805. return setState;
  39806. };
  39807. /***/ }),
  39808. /* 514 */
  39809. /***/ (function(module, exports, __webpack_require__) {
  39810. "use strict";
  39811. var _interopRequireDefault = __webpack_require__(2);
  39812. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  39813. let QueueRunner = /*#__PURE__*/function () {
  39814. function QueueRunner(_temp) {
  39815. let _ref = _temp === void 0 ? {} : _temp,
  39816. _ref$waitTime = _ref.waitTime,
  39817. waitTime = _ref$waitTime === void 0 ? 50 : _ref$waitTime;
  39818. (0, _defineProperty2.default)(this, "queue", []);
  39819. (0, _defineProperty2.default)(this, "running", false);
  39820. this.waitTime = waitTime;
  39821. }
  39822. var _proto = QueueRunner.prototype;
  39823. _proto.add = function add(fn) {
  39824. this.queue.push(fn);
  39825. this.run();
  39826. };
  39827. _proto.run = function run() {
  39828. if (this.running) {
  39829. return;
  39830. }
  39831. this.running = true;
  39832. const loop = () => {
  39833. if (this.queue.length === 0) {
  39834. this.running = false;
  39835. return;
  39836. }
  39837. const fn = this.queue.shift();
  39838. fn(() => {
  39839. setTimeout(loop, this.waitTime);
  39840. });
  39841. };
  39842. loop();
  39843. };
  39844. return QueueRunner;
  39845. }();
  39846. module.exports = QueueRunner;
  39847. /***/ }),
  39848. /* 515 */
  39849. /***/ (function(module, exports, __webpack_require__) {
  39850. var rng = __webpack_require__(239);
  39851. var bytesToUuid = __webpack_require__(240);
  39852. // **`v1()` - Generate time-based UUID**
  39853. //
  39854. // Inspired by https://github.com/LiosK/UUID.js
  39855. // and http://docs.python.org/library/uuid.html
  39856. var _nodeId;
  39857. var _clockseq;
  39858. // Previous uuid creation time
  39859. var _lastMSecs = 0;
  39860. var _lastNSecs = 0;
  39861. // See https://github.com/uuidjs/uuid for API details
  39862. function v1(options, buf, offset) {
  39863. var i = buf && offset || 0;
  39864. var b = buf || [];
  39865. options = options || {};
  39866. var node = options.node || _nodeId;
  39867. var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
  39868. // node and clockseq need to be initialized to random values if they're not
  39869. // specified. We do this lazily to minimize issues related to insufficient
  39870. // system entropy. See #189
  39871. if (node == null || clockseq == null) {
  39872. var seedBytes = rng();
  39873. if (node == null) {
  39874. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  39875. node = _nodeId = [
  39876. seedBytes[0] | 0x01,
  39877. seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
  39878. ];
  39879. }
  39880. if (clockseq == null) {
  39881. // Per 4.2.2, randomize (14 bit) clockseq
  39882. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  39883. }
  39884. }
  39885. // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  39886. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  39887. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  39888. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  39889. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
  39890. // Per 4.2.1.2, use count of uuid's generated during the current clock
  39891. // cycle to simulate higher resolution clock
  39892. var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
  39893. // Time since last uuid creation (in msecs)
  39894. var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
  39895. // Per 4.2.1.2, Bump clockseq on clock regression
  39896. if (dt < 0 && options.clockseq === undefined) {
  39897. clockseq = clockseq + 1 & 0x3fff;
  39898. }
  39899. // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  39900. // time interval
  39901. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  39902. nsecs = 0;
  39903. }
  39904. // Per 4.2.1.2 Throw error if too many uuids are requested
  39905. if (nsecs >= 10000) {
  39906. throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  39907. }
  39908. _lastMSecs = msecs;
  39909. _lastNSecs = nsecs;
  39910. _clockseq = clockseq;
  39911. // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  39912. msecs += 12219292800000;
  39913. // `time_low`
  39914. var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  39915. b[i++] = tl >>> 24 & 0xff;
  39916. b[i++] = tl >>> 16 & 0xff;
  39917. b[i++] = tl >>> 8 & 0xff;
  39918. b[i++] = tl & 0xff;
  39919. // `time_mid`
  39920. var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
  39921. b[i++] = tmh >>> 8 & 0xff;
  39922. b[i++] = tmh & 0xff;
  39923. // `time_high_and_version`
  39924. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  39925. b[i++] = tmh >>> 16 & 0xff;
  39926. // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  39927. b[i++] = clockseq >>> 8 | 0x80;
  39928. // `clock_seq_low`
  39929. b[i++] = clockseq & 0xff;
  39930. // `node`
  39931. for (var n = 0; n < 6; ++n) {
  39932. b[i + n] = node[n];
  39933. }
  39934. return buf ? buf : bytesToUuid(b);
  39935. }
  39936. module.exports = v1;
  39937. /***/ }),
  39938. /* 516 */
  39939. /***/ (function(module, exports, __webpack_require__) {
  39940. var rng = __webpack_require__(239);
  39941. var bytesToUuid = __webpack_require__(240);
  39942. function v4(options, buf, offset) {
  39943. var i = buf && offset || 0;
  39944. if (typeof(options) == 'string') {
  39945. buf = options === 'binary' ? new Array(16) : null;
  39946. options = null;
  39947. }
  39948. options = options || {};
  39949. var rnds = options.random || (options.rng || rng)();
  39950. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  39951. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  39952. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  39953. // Copy bytes to buffer, if provided
  39954. if (buf) {
  39955. for (var ii = 0; ii < 16; ++ii) {
  39956. buf[i + ii] = rnds[ii];
  39957. }
  39958. }
  39959. return buf || bytesToUuid(rnds);
  39960. }
  39961. module.exports = v4;
  39962. /***/ }),
  39963. /* 517 */
  39964. /***/ (function(module, exports, __webpack_require__) {
  39965. "use strict";
  39966. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  39967. /* eslint-disable no-param-reassign */
  39968. const makeEverythingAttachToOTHelpers = __webpack_require__(237);
  39969. const domExtras = {};
  39970. module.exports = domExtras;
  39971. domExtras.isElementNode = function (node) {
  39972. return node && typeof node === 'object' && node.nodeType === 1;
  39973. };
  39974. domExtras.createElement = function (nodeName, attributes, children, doc) {
  39975. const element = (doc || document).createElement(nodeName);
  39976. attributes = attributes || {};
  39977. Object.keys(attributes).forEach(name => {
  39978. if (typeof attributes[name] === 'object') {
  39979. if (!element[name]) {
  39980. element[name] = {};
  39981. }
  39982. const subAttrs = attributes[name];
  39983. Object.keys(subAttrs).forEach(n => {
  39984. element[name][n] = subAttrs[n];
  39985. });
  39986. } else if (name === 'className') {
  39987. element.className = attributes[name];
  39988. } else {
  39989. element.setAttribute(name, attributes[name]);
  39990. }
  39991. });
  39992. const setChildren = function setChildren(child) {
  39993. if (typeof child === 'string') {
  39994. element.innerHTML += child;
  39995. } else {
  39996. element.appendChild(child);
  39997. }
  39998. };
  39999. if (Array.isArray(children)) {
  40000. children.forEach(setChildren);
  40001. } else if (children) {
  40002. setChildren(children);
  40003. }
  40004. return element;
  40005. };
  40006. makeEverythingAttachToOTHelpers(domExtras);
  40007. /***/ }),
  40008. /* 518 */
  40009. /***/ (function(module, exports, __webpack_require__) {
  40010. /**
  40011. * Enforces a single instance of the Raven client, and the
  40012. * main entry point for Raven. If you are a consumer of the
  40013. * Raven library, you SHOULD load this file (vs raven.js).
  40014. **/
  40015. var RavenConstructor = __webpack_require__(519);
  40016. // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
  40017. var _window =
  40018. typeof window !== 'undefined'
  40019. ? window
  40020. : typeof (typeof window !== undefined ? window : global) !== 'undefined' ? (typeof window !== undefined ? window : global) : typeof self !== 'undefined' ? self : {};
  40021. var _Raven = _window.Raven;
  40022. var Raven = new RavenConstructor();
  40023. /*
  40024. * Allow multiple versions of Raven to be installed.
  40025. * Strip Raven from the global context and returns the instance.
  40026. *
  40027. * @return {Raven}
  40028. */
  40029. Raven.noConflict = function() {
  40030. _window.Raven = _Raven;
  40031. return Raven;
  40032. };
  40033. Raven.afterLoad();
  40034. module.exports = Raven;
  40035. /**
  40036. * DISCLAIMER:
  40037. *
  40038. * Expose `Client` constructor for cases where user want to track multiple "sub-applications" in one larger app.
  40039. * It's not meant to be used by a wide audience, so pleaaase make sure that you know what you're doing before using it.
  40040. * Accidentally calling `install` multiple times, may result in an unexpected behavior that's very hard to debug.
  40041. *
  40042. * It's called `Client' to be in-line with Raven Node implementation.
  40043. *
  40044. * HOWTO:
  40045. *
  40046. * import Raven from 'raven-js';
  40047. *
  40048. * const someAppReporter = new Raven.Client();
  40049. * const someOtherAppReporter = new Raven.Client();
  40050. *
  40051. * someAppReporter.config('__DSN__', {
  40052. * ...config goes here
  40053. * });
  40054. *
  40055. * someOtherAppReporter.config('__OTHER_DSN__', {
  40056. * ...config goes here
  40057. * });
  40058. *
  40059. * someAppReporter.captureMessage(...);
  40060. * someAppReporter.captureException(...);
  40061. * someAppReporter.captureBreadcrumb(...);
  40062. *
  40063. * someOtherAppReporter.captureMessage(...);
  40064. * someOtherAppReporter.captureException(...);
  40065. * someOtherAppReporter.captureBreadcrumb(...);
  40066. *
  40067. * It should "just work".
  40068. */
  40069. module.exports.Client = RavenConstructor;
  40070. /***/ }),
  40071. /* 519 */
  40072. /***/ (function(module, exports, __webpack_require__) {
  40073. /*global XDomainRequest:false */
  40074. var TraceKit = __webpack_require__(520);
  40075. var stringify = __webpack_require__(243);
  40076. var md5 = __webpack_require__(521);
  40077. var RavenConfigError = __webpack_require__(522);
  40078. var utils = __webpack_require__(134);
  40079. var isErrorEvent = utils.isErrorEvent;
  40080. var isDOMError = utils.isDOMError;
  40081. var isDOMException = utils.isDOMException;
  40082. var isError = utils.isError;
  40083. var isObject = utils.isObject;
  40084. var isPlainObject = utils.isPlainObject;
  40085. var isUndefined = utils.isUndefined;
  40086. var isFunction = utils.isFunction;
  40087. var isString = utils.isString;
  40088. var isArray = utils.isArray;
  40089. var isEmptyObject = utils.isEmptyObject;
  40090. var each = utils.each;
  40091. var objectMerge = utils.objectMerge;
  40092. var truncate = utils.truncate;
  40093. var objectFrozen = utils.objectFrozen;
  40094. var hasKey = utils.hasKey;
  40095. var joinRegExp = utils.joinRegExp;
  40096. var urlencode = utils.urlencode;
  40097. var uuid4 = utils.uuid4;
  40098. var htmlTreeAsString = utils.htmlTreeAsString;
  40099. var isSameException = utils.isSameException;
  40100. var isSameStacktrace = utils.isSameStacktrace;
  40101. var parseUrl = utils.parseUrl;
  40102. var fill = utils.fill;
  40103. var supportsFetch = utils.supportsFetch;
  40104. var supportsReferrerPolicy = utils.supportsReferrerPolicy;
  40105. var serializeKeysForMessage = utils.serializeKeysForMessage;
  40106. var serializeException = utils.serializeException;
  40107. var sanitize = utils.sanitize;
  40108. var wrapConsoleMethod = __webpack_require__(523).wrapMethod;
  40109. var dsnKeys = 'source protocol user pass host port path'.split(' '),
  40110. dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
  40111. function now() {
  40112. return +new Date();
  40113. }
  40114. // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
  40115. var _window =
  40116. typeof window !== 'undefined'
  40117. ? window
  40118. : typeof (typeof window !== undefined ? window : global) !== 'undefined' ? (typeof window !== undefined ? window : global) : typeof self !== 'undefined' ? self : {};
  40119. var _document = _window.document;
  40120. var _navigator = _window.navigator;
  40121. function keepOriginalCallback(original, callback) {
  40122. return isFunction(callback)
  40123. ? function(data) {
  40124. return callback(data, original);
  40125. }
  40126. : callback;
  40127. }
  40128. // First, check for JSON support
  40129. // If there is no JSON, we no-op the core features of Raven
  40130. // since JSON is required to encode the payload
  40131. function Raven() {
  40132. this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);
  40133. // Raven can run in contexts where there's no document (react-native)
  40134. this._hasDocument = !isUndefined(_document);
  40135. this._hasNavigator = !isUndefined(_navigator);
  40136. this._lastCapturedException = null;
  40137. this._lastData = null;
  40138. this._lastEventId = null;
  40139. this._globalServer = null;
  40140. this._globalKey = null;
  40141. this._globalProject = null;
  40142. this._globalContext = {};
  40143. this._globalOptions = {
  40144. // SENTRY_RELEASE can be injected by https://github.com/getsentry/sentry-webpack-plugin
  40145. release: _window.SENTRY_RELEASE && _window.SENTRY_RELEASE.id,
  40146. logger: 'javascript',
  40147. ignoreErrors: [],
  40148. ignoreUrls: [],
  40149. whitelistUrls: [],
  40150. includePaths: [],
  40151. headers: null,
  40152. collectWindowErrors: true,
  40153. captureUnhandledRejections: true,
  40154. maxMessageLength: 0,
  40155. // By default, truncates URL values to 250 chars
  40156. maxUrlLength: 250,
  40157. stackTraceLimit: 50,
  40158. autoBreadcrumbs: true,
  40159. instrument: true,
  40160. sampleRate: 1,
  40161. sanitizeKeys: []
  40162. };
  40163. this._fetchDefaults = {
  40164. method: 'POST',
  40165. // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default
  40166. // https://caniuse.com/#feat=referrer-policy
  40167. // It doesn't. And it throw exception instead of ignoring this parameter...
  40168. // REF: https://github.com/getsentry/raven-js/issues/1233
  40169. referrerPolicy: supportsReferrerPolicy() ? 'origin' : ''
  40170. };
  40171. this._ignoreOnError = 0;
  40172. this._isRavenInstalled = false;
  40173. this._originalErrorStackTraceLimit = Error.stackTraceLimit;
  40174. // capture references to window.console *and* all its methods first
  40175. // before the console plugin has a chance to monkey patch
  40176. this._originalConsole = _window.console || {};
  40177. this._originalConsoleMethods = {};
  40178. this._plugins = [];
  40179. this._startTime = now();
  40180. this._wrappedBuiltIns = [];
  40181. this._breadcrumbs = [];
  40182. this._lastCapturedEvent = null;
  40183. this._keypressTimeout;
  40184. this._location = _window.location;
  40185. this._lastHref = this._location && this._location.href;
  40186. this._resetBackoff();
  40187. // eslint-disable-next-line guard-for-in
  40188. for (var method in this._originalConsole) {
  40189. this._originalConsoleMethods[method] = this._originalConsole[method];
  40190. }
  40191. }
  40192. /*
  40193. * The core Raven singleton
  40194. *
  40195. * @this {Raven}
  40196. */
  40197. Raven.prototype = {
  40198. // Hardcode version string so that raven source can be loaded directly via
  40199. // webpack (using a build step causes webpack #1617). Grunt verifies that
  40200. // this value matches package.json during build.
  40201. // See: https://github.com/getsentry/raven-js/issues/465
  40202. VERSION: '3.27.2',
  40203. debug: false,
  40204. TraceKit: TraceKit, // alias to TraceKit
  40205. /*
  40206. * Configure Raven with a DSN and extra options
  40207. *
  40208. * @param {string} dsn The public Sentry DSN
  40209. * @param {object} options Set of global options [optional]
  40210. * @return {Raven}
  40211. */
  40212. config: function(dsn, options) {
  40213. var self = this;
  40214. if (self._globalServer) {
  40215. this._logDebug('error', 'Error: Raven has already been configured');
  40216. return self;
  40217. }
  40218. if (!dsn) return self;
  40219. var globalOptions = self._globalOptions;
  40220. // merge in options
  40221. if (options) {
  40222. each(options, function(key, value) {
  40223. // tags and extra are special and need to be put into context
  40224. if (key === 'tags' || key === 'extra' || key === 'user') {
  40225. self._globalContext[key] = value;
  40226. } else {
  40227. globalOptions[key] = value;
  40228. }
  40229. });
  40230. }
  40231. self.setDSN(dsn);
  40232. // "Script error." is hard coded into browsers for errors that it can't read.
  40233. // this is the result of a script being pulled in from an external domain and CORS.
  40234. globalOptions.ignoreErrors.push(/^Script error\.?$/);
  40235. globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
  40236. // join regexp rules into one big rule
  40237. globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
  40238. globalOptions.ignoreUrls = globalOptions.ignoreUrls.length
  40239. ? joinRegExp(globalOptions.ignoreUrls)
  40240. : false;
  40241. globalOptions.whitelistUrls = globalOptions.whitelistUrls.length
  40242. ? joinRegExp(globalOptions.whitelistUrls)
  40243. : false;
  40244. globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
  40245. globalOptions.maxBreadcrumbs = Math.max(
  40246. 0,
  40247. Math.min(globalOptions.maxBreadcrumbs || 100, 100)
  40248. ); // default and hard limit is 100
  40249. var autoBreadcrumbDefaults = {
  40250. xhr: true,
  40251. console: true,
  40252. dom: true,
  40253. location: true,
  40254. sentry: true
  40255. };
  40256. var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
  40257. if ({}.toString.call(autoBreadcrumbs) === '[object Object]') {
  40258. autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
  40259. } else if (autoBreadcrumbs !== false) {
  40260. autoBreadcrumbs = autoBreadcrumbDefaults;
  40261. }
  40262. globalOptions.autoBreadcrumbs = autoBreadcrumbs;
  40263. var instrumentDefaults = {
  40264. tryCatch: true
  40265. };
  40266. var instrument = globalOptions.instrument;
  40267. if ({}.toString.call(instrument) === '[object Object]') {
  40268. instrument = objectMerge(instrumentDefaults, instrument);
  40269. } else if (instrument !== false) {
  40270. instrument = instrumentDefaults;
  40271. }
  40272. globalOptions.instrument = instrument;
  40273. TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
  40274. // return for chaining
  40275. return self;
  40276. },
  40277. /*
  40278. * Installs a global window.onerror error handler
  40279. * to capture and report uncaught exceptions.
  40280. * At this point, install() is required to be called due
  40281. * to the way TraceKit is set up.
  40282. *
  40283. * @return {Raven}
  40284. */
  40285. install: function() {
  40286. var self = this;
  40287. if (self.isSetup() && !self._isRavenInstalled) {
  40288. TraceKit.report.subscribe(function() {
  40289. self._handleOnErrorStackInfo.apply(self, arguments);
  40290. });
  40291. if (self._globalOptions.captureUnhandledRejections) {
  40292. self._attachPromiseRejectionHandler();
  40293. }
  40294. self._patchFunctionToString();
  40295. if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
  40296. self._instrumentTryCatch();
  40297. }
  40298. if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
  40299. // Install all of the plugins
  40300. self._drainPlugins();
  40301. self._isRavenInstalled = true;
  40302. }
  40303. Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
  40304. return this;
  40305. },
  40306. /*
  40307. * Set the DSN (can be called multiple time unlike config)
  40308. *
  40309. * @param {string} dsn The public Sentry DSN
  40310. */
  40311. setDSN: function(dsn) {
  40312. var self = this,
  40313. uri = self._parseDSN(dsn),
  40314. lastSlash = uri.path.lastIndexOf('/'),
  40315. path = uri.path.substr(1, lastSlash);
  40316. self._dsn = dsn;
  40317. self._globalKey = uri.user;
  40318. self._globalSecret = uri.pass && uri.pass.substr(1);
  40319. self._globalProject = uri.path.substr(lastSlash + 1);
  40320. self._globalServer = self._getGlobalServer(uri);
  40321. self._globalEndpoint =
  40322. self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/';
  40323. // Reset backoff state since we may be pointing at a
  40324. // new project/server
  40325. this._resetBackoff();
  40326. },
  40327. /*
  40328. * Wrap code within a context so Raven can capture errors
  40329. * reliably across domains that is executed immediately.
  40330. *
  40331. * @param {object} options A specific set of options for this context [optional]
  40332. * @param {function} func The callback to be immediately executed within the context
  40333. * @param {array} args An array of arguments to be called with the callback [optional]
  40334. */
  40335. context: function(options, func, args) {
  40336. if (isFunction(options)) {
  40337. args = func || [];
  40338. func = options;
  40339. options = {};
  40340. }
  40341. return this.wrap(options, func).apply(this, args);
  40342. },
  40343. /*
  40344. * Wrap code within a context and returns back a new function to be executed
  40345. *
  40346. * @param {object} options A specific set of options for this context [optional]
  40347. * @param {function} func The function to be wrapped in a new context
  40348. * @param {function} _before A function to call before the try/catch wrapper [optional, private]
  40349. * @return {function} The newly wrapped functions with a context
  40350. */
  40351. wrap: function(options, func, _before) {
  40352. var self = this;
  40353. // 1 argument has been passed, and it's not a function
  40354. // so just return it
  40355. if (isUndefined(func) && !isFunction(options)) {
  40356. return options;
  40357. }
  40358. // options is optional
  40359. if (isFunction(options)) {
  40360. func = options;
  40361. options = undefined;
  40362. }
  40363. // At this point, we've passed along 2 arguments, and the second one
  40364. // is not a function either, so we'll just return the second argument.
  40365. if (!isFunction(func)) {
  40366. return func;
  40367. }
  40368. // We don't wanna wrap it twice!
  40369. try {
  40370. if (func.__raven__) {
  40371. return func;
  40372. }
  40373. // If this has already been wrapped in the past, return that
  40374. if (func.__raven_wrapper__) {
  40375. return func.__raven_wrapper__;
  40376. }
  40377. } catch (e) {
  40378. // Just accessing custom props in some Selenium environments
  40379. // can cause a "Permission denied" exception (see raven-js#495).
  40380. // Bail on wrapping and return the function as-is (defers to window.onerror).
  40381. return func;
  40382. }
  40383. function wrapped() {
  40384. var args = [],
  40385. i = arguments.length,
  40386. deep = !options || (options && options.deep !== false);
  40387. if (_before && isFunction(_before)) {
  40388. _before.apply(this, arguments);
  40389. }
  40390. // Recursively wrap all of a function's arguments that are
  40391. // functions themselves.
  40392. while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
  40393. try {
  40394. // Attempt to invoke user-land function
  40395. // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
  40396. // means Raven caught an error invoking your application code. This is
  40397. // expected behavior and NOT indicative of a bug with Raven.js.
  40398. return func.apply(this, args);
  40399. } catch (e) {
  40400. self._ignoreNextOnError();
  40401. self.captureException(e, options);
  40402. throw e;
  40403. }
  40404. }
  40405. // copy over properties of the old function
  40406. for (var property in func) {
  40407. if (hasKey(func, property)) {
  40408. wrapped[property] = func[property];
  40409. }
  40410. }
  40411. wrapped.prototype = func.prototype;
  40412. func.__raven_wrapper__ = wrapped;
  40413. // Signal that this function has been wrapped/filled already
  40414. // for both debugging and to prevent it to being wrapped/filled twice
  40415. wrapped.__raven__ = true;
  40416. wrapped.__orig__ = func;
  40417. return wrapped;
  40418. },
  40419. /**
  40420. * Uninstalls the global error handler.
  40421. *
  40422. * @return {Raven}
  40423. */
  40424. uninstall: function() {
  40425. TraceKit.report.uninstall();
  40426. this._detachPromiseRejectionHandler();
  40427. this._unpatchFunctionToString();
  40428. this._restoreBuiltIns();
  40429. this._restoreConsole();
  40430. Error.stackTraceLimit = this._originalErrorStackTraceLimit;
  40431. this._isRavenInstalled = false;
  40432. return this;
  40433. },
  40434. /**
  40435. * Callback used for `unhandledrejection` event
  40436. *
  40437. * @param {PromiseRejectionEvent} event An object containing
  40438. * promise: the Promise that was rejected
  40439. * reason: the value with which the Promise was rejected
  40440. * @return void
  40441. */
  40442. _promiseRejectionHandler: function(event) {
  40443. this._logDebug('debug', 'Raven caught unhandled promise rejection:', event);
  40444. this.captureException(event.reason, {
  40445. mechanism: {
  40446. type: 'onunhandledrejection',
  40447. handled: false
  40448. }
  40449. });
  40450. },
  40451. /**
  40452. * Installs the global promise rejection handler.
  40453. *
  40454. * @return {raven}
  40455. */
  40456. _attachPromiseRejectionHandler: function() {
  40457. this._promiseRejectionHandler = this._promiseRejectionHandler.bind(this);
  40458. _window.addEventListener &&
  40459. _window.addEventListener('unhandledrejection', this._promiseRejectionHandler);
  40460. return this;
  40461. },
  40462. /**
  40463. * Uninstalls the global promise rejection handler.
  40464. *
  40465. * @return {raven}
  40466. */
  40467. _detachPromiseRejectionHandler: function() {
  40468. _window.removeEventListener &&
  40469. _window.removeEventListener('unhandledrejection', this._promiseRejectionHandler);
  40470. return this;
  40471. },
  40472. /**
  40473. * Manually capture an exception and send it over to Sentry
  40474. *
  40475. * @param {error} ex An exception to be logged
  40476. * @param {object} options A specific set of options for this error [optional]
  40477. * @return {Raven}
  40478. */
  40479. captureException: function(ex, options) {
  40480. options = objectMerge({trimHeadFrames: 0}, options ? options : {});
  40481. if (isErrorEvent(ex) && ex.error) {
  40482. // If it is an ErrorEvent with `error` property, extract it to get actual Error
  40483. ex = ex.error;
  40484. } else if (isDOMError(ex) || isDOMException(ex)) {
  40485. // If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)
  40486. // then we just extract the name and message, as they don't provide anything else
  40487. // https://developer.mozilla.org/en-US/docs/Web/API/DOMError
  40488. // https://developer.mozilla.org/en-US/docs/Web/API/DOMException
  40489. var name = ex.name || (isDOMError(ex) ? 'DOMError' : 'DOMException');
  40490. var message = ex.message ? name + ': ' + ex.message : name;
  40491. return this.captureMessage(
  40492. message,
  40493. objectMerge(options, {
  40494. // neither DOMError or DOMException provide stack trace and we most likely wont get it this way as well
  40495. // but it's barely any overhead so we may at least try
  40496. stacktrace: true,
  40497. trimHeadFrames: options.trimHeadFrames + 1
  40498. })
  40499. );
  40500. } else if (isError(ex)) {
  40501. // we have a real Error object
  40502. ex = ex;
  40503. } else if (isPlainObject(ex)) {
  40504. // If it is plain Object, serialize it manually and extract options
  40505. // This will allow us to group events based on top-level keys
  40506. // which is much better than creating new group when any key/value change
  40507. options = this._getCaptureExceptionOptionsFromPlainObject(options, ex);
  40508. ex = new Error(options.message);
  40509. } else {
  40510. // If none of previous checks were valid, then it means that
  40511. // it's not a DOMError/DOMException
  40512. // it's not a plain Object
  40513. // it's not a valid ErrorEvent (one with an error property)
  40514. // it's not an Error
  40515. // So bail out and capture it as a simple message:
  40516. return this.captureMessage(
  40517. ex,
  40518. objectMerge(options, {
  40519. stacktrace: true, // if we fall back to captureMessage, default to attempting a new trace
  40520. trimHeadFrames: options.trimHeadFrames + 1
  40521. })
  40522. );
  40523. }
  40524. // Store the raw exception object for potential debugging and introspection
  40525. this._lastCapturedException = ex;
  40526. // TraceKit.report will re-raise any exception passed to it,
  40527. // which means you have to wrap it in try/catch. Instead, we
  40528. // can wrap it here and only re-raise if TraceKit.report
  40529. // raises an exception different from the one we asked to
  40530. // report on.
  40531. try {
  40532. var stack = TraceKit.computeStackTrace(ex);
  40533. this._handleStackInfo(stack, options);
  40534. } catch (ex1) {
  40535. if (ex !== ex1) {
  40536. throw ex1;
  40537. }
  40538. }
  40539. return this;
  40540. },
  40541. _getCaptureExceptionOptionsFromPlainObject: function(currentOptions, ex) {
  40542. var exKeys = Object.keys(ex).sort();
  40543. var options = objectMerge(currentOptions, {
  40544. message:
  40545. 'Non-Error exception captured with keys: ' + serializeKeysForMessage(exKeys),
  40546. fingerprint: [md5(exKeys)],
  40547. extra: currentOptions.extra || {}
  40548. });
  40549. options.extra.__serialized__ = serializeException(ex);
  40550. return options;
  40551. },
  40552. /*
  40553. * Manually send a message to Sentry
  40554. *
  40555. * @param {string} msg A plain message to be captured in Sentry
  40556. * @param {object} options A specific set of options for this message [optional]
  40557. * @return {Raven}
  40558. */
  40559. captureMessage: function(msg, options) {
  40560. // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
  40561. // early call; we'll error on the side of logging anything called before configuration since it's
  40562. // probably something you should see:
  40563. if (
  40564. !!this._globalOptions.ignoreErrors.test &&
  40565. this._globalOptions.ignoreErrors.test(msg)
  40566. ) {
  40567. return;
  40568. }
  40569. options = options || {};
  40570. msg = msg + ''; // Make sure it's actually a string
  40571. var data = objectMerge(
  40572. {
  40573. message: msg
  40574. },
  40575. options
  40576. );
  40577. var ex;
  40578. // Generate a "synthetic" stack trace from this point.
  40579. // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
  40580. // of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
  40581. // or if it catches a thrown object without a "stack" property.
  40582. try {
  40583. throw new Error(msg);
  40584. } catch (ex1) {
  40585. ex = ex1;
  40586. }
  40587. // null exception name so `Error` isn't prefixed to msg
  40588. ex.name = null;
  40589. var stack = TraceKit.computeStackTrace(ex);
  40590. // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
  40591. var initialCall = isArray(stack.stack) && stack.stack[1];
  40592. // if stack[1] is `Raven.captureException`, it means that someone passed a string to it and we redirected that call
  40593. // to be handled by `captureMessage`, thus `initialCall` is the 3rd one, not 2nd
  40594. // initialCall => captureException(string) => captureMessage(string)
  40595. if (initialCall && initialCall.func === 'Raven.captureException') {
  40596. initialCall = stack.stack[2];
  40597. }
  40598. var fileurl = (initialCall && initialCall.url) || '';
  40599. if (
  40600. !!this._globalOptions.ignoreUrls.test &&
  40601. this._globalOptions.ignoreUrls.test(fileurl)
  40602. ) {
  40603. return;
  40604. }
  40605. if (
  40606. !!this._globalOptions.whitelistUrls.test &&
  40607. !this._globalOptions.whitelistUrls.test(fileurl)
  40608. ) {
  40609. return;
  40610. }
  40611. // Always attempt to get stacktrace if message is empty.
  40612. // It's the only way to provide any helpful information to the user.
  40613. if (this._globalOptions.stacktrace || options.stacktrace || data.message === '') {
  40614. // fingerprint on msg, not stack trace (legacy behavior, could be revisited)
  40615. data.fingerprint = data.fingerprint == null ? msg : data.fingerprint;
  40616. options = objectMerge(
  40617. {
  40618. trimHeadFrames: 0
  40619. },
  40620. options
  40621. );
  40622. // Since we know this is a synthetic trace, the top frame (this function call)
  40623. // MUST be from Raven.js, so mark it for trimming
  40624. // We add to the trim counter so that callers can choose to trim extra frames, such
  40625. // as utility functions.
  40626. options.trimHeadFrames += 1;
  40627. var frames = this._prepareFrames(stack, options);
  40628. data.stacktrace = {
  40629. // Sentry expects frames oldest to newest
  40630. frames: frames.reverse()
  40631. };
  40632. }
  40633. // Make sure that fingerprint is always wrapped in an array
  40634. if (data.fingerprint) {
  40635. data.fingerprint = isArray(data.fingerprint)
  40636. ? data.fingerprint
  40637. : [data.fingerprint];
  40638. }
  40639. // Fire away!
  40640. this._send(data);
  40641. return this;
  40642. },
  40643. captureBreadcrumb: function(obj) {
  40644. var crumb = objectMerge(
  40645. {
  40646. timestamp: now() / 1000
  40647. },
  40648. obj
  40649. );
  40650. if (isFunction(this._globalOptions.breadcrumbCallback)) {
  40651. var result = this._globalOptions.breadcrumbCallback(crumb);
  40652. if (isObject(result) && !isEmptyObject(result)) {
  40653. crumb = result;
  40654. } else if (result === false) {
  40655. return this;
  40656. }
  40657. }
  40658. this._breadcrumbs.push(crumb);
  40659. if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
  40660. this._breadcrumbs.shift();
  40661. }
  40662. return this;
  40663. },
  40664. addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
  40665. var pluginArgs = [].slice.call(arguments, 1);
  40666. this._plugins.push([plugin, pluginArgs]);
  40667. if (this._isRavenInstalled) {
  40668. this._drainPlugins();
  40669. }
  40670. return this;
  40671. },
  40672. /*
  40673. * Set/clear a user to be sent along with the payload.
  40674. *
  40675. * @param {object} user An object representing user data [optional]
  40676. * @return {Raven}
  40677. */
  40678. setUserContext: function(user) {
  40679. // Intentionally do not merge here since that's an unexpected behavior.
  40680. this._globalContext.user = user;
  40681. return this;
  40682. },
  40683. /*
  40684. * Merge extra attributes to be sent along with the payload.
  40685. *
  40686. * @param {object} extra An object representing extra data [optional]
  40687. * @return {Raven}
  40688. */
  40689. setExtraContext: function(extra) {
  40690. this._mergeContext('extra', extra);
  40691. return this;
  40692. },
  40693. /*
  40694. * Merge tags to be sent along with the payload.
  40695. *
  40696. * @param {object} tags An object representing tags [optional]
  40697. * @return {Raven}
  40698. */
  40699. setTagsContext: function(tags) {
  40700. this._mergeContext('tags', tags);
  40701. return this;
  40702. },
  40703. /*
  40704. * Clear all of the context.
  40705. *
  40706. * @return {Raven}
  40707. */
  40708. clearContext: function() {
  40709. this._globalContext = {};
  40710. return this;
  40711. },
  40712. /*
  40713. * Get a copy of the current context. This cannot be mutated.
  40714. *
  40715. * @return {object} copy of context
  40716. */
  40717. getContext: function() {
  40718. // lol javascript
  40719. return JSON.parse(stringify(this._globalContext));
  40720. },
  40721. /*
  40722. * Set environment of application
  40723. *
  40724. * @param {string} environment Typically something like 'production'.
  40725. * @return {Raven}
  40726. */
  40727. setEnvironment: function(environment) {
  40728. this._globalOptions.environment = environment;
  40729. return this;
  40730. },
  40731. /*
  40732. * Set release version of application
  40733. *
  40734. * @param {string} release Typically something like a git SHA to identify version
  40735. * @return {Raven}
  40736. */
  40737. setRelease: function(release) {
  40738. this._globalOptions.release = release;
  40739. return this;
  40740. },
  40741. /*
  40742. * Set the dataCallback option
  40743. *
  40744. * @param {function} callback The callback to run which allows the
  40745. * data blob to be mutated before sending
  40746. * @return {Raven}
  40747. */
  40748. setDataCallback: function(callback) {
  40749. var original = this._globalOptions.dataCallback;
  40750. this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
  40751. return this;
  40752. },
  40753. /*
  40754. * Set the breadcrumbCallback option
  40755. *
  40756. * @param {function} callback The callback to run which allows filtering
  40757. * or mutating breadcrumbs
  40758. * @return {Raven}
  40759. */
  40760. setBreadcrumbCallback: function(callback) {
  40761. var original = this._globalOptions.breadcrumbCallback;
  40762. this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
  40763. return this;
  40764. },
  40765. /*
  40766. * Set the shouldSendCallback option
  40767. *
  40768. * @param {function} callback The callback to run which allows
  40769. * introspecting the blob before sending
  40770. * @return {Raven}
  40771. */
  40772. setShouldSendCallback: function(callback) {
  40773. var original = this._globalOptions.shouldSendCallback;
  40774. this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
  40775. return this;
  40776. },
  40777. /**
  40778. * Override the default HTTP transport mechanism that transmits data
  40779. * to the Sentry server.
  40780. *
  40781. * @param {function} transport Function invoked instead of the default
  40782. * `makeRequest` handler.
  40783. *
  40784. * @return {Raven}
  40785. */
  40786. setTransport: function(transport) {
  40787. this._globalOptions.transport = transport;
  40788. return this;
  40789. },
  40790. /*
  40791. * Get the latest raw exception that was captured by Raven.
  40792. *
  40793. * @return {error}
  40794. */
  40795. lastException: function() {
  40796. return this._lastCapturedException;
  40797. },
  40798. /*
  40799. * Get the last event id
  40800. *
  40801. * @return {string}
  40802. */
  40803. lastEventId: function() {
  40804. return this._lastEventId;
  40805. },
  40806. /*
  40807. * Determine if Raven is setup and ready to go.
  40808. *
  40809. * @return {boolean}
  40810. */
  40811. isSetup: function() {
  40812. if (!this._hasJSON) return false; // needs JSON support
  40813. if (!this._globalServer) {
  40814. if (!this.ravenNotConfiguredError) {
  40815. this.ravenNotConfiguredError = true;
  40816. this._logDebug('error', 'Error: Raven has not been configured.');
  40817. }
  40818. return false;
  40819. }
  40820. return true;
  40821. },
  40822. afterLoad: function() {
  40823. // TODO: remove window dependence?
  40824. // Attempt to initialize Raven on load
  40825. var RavenConfig = _window.RavenConfig;
  40826. if (RavenConfig) {
  40827. this.config(RavenConfig.dsn, RavenConfig.config).install();
  40828. }
  40829. },
  40830. showReportDialog: function(options) {
  40831. if (
  40832. !_document // doesn't work without a document (React native)
  40833. )
  40834. return;
  40835. options = objectMerge(
  40836. {
  40837. eventId: this.lastEventId(),
  40838. dsn: this._dsn,
  40839. user: this._globalContext.user || {}
  40840. },
  40841. options
  40842. );
  40843. if (!options.eventId) {
  40844. throw new RavenConfigError('Missing eventId');
  40845. }
  40846. if (!options.dsn) {
  40847. throw new RavenConfigError('Missing DSN');
  40848. }
  40849. var encode = encodeURIComponent;
  40850. var encodedOptions = [];
  40851. for (var key in options) {
  40852. if (key === 'user') {
  40853. var user = options.user;
  40854. if (user.name) encodedOptions.push('name=' + encode(user.name));
  40855. if (user.email) encodedOptions.push('email=' + encode(user.email));
  40856. } else {
  40857. encodedOptions.push(encode(key) + '=' + encode(options[key]));
  40858. }
  40859. }
  40860. var globalServer = this._getGlobalServer(this._parseDSN(options.dsn));
  40861. var script = _document.createElement('script');
  40862. script.async = true;
  40863. script.src = globalServer + '/api/embed/error-page/?' + encodedOptions.join('&');
  40864. (_document.head || _document.body).appendChild(script);
  40865. },
  40866. /**** Private functions ****/
  40867. _ignoreNextOnError: function() {
  40868. var self = this;
  40869. this._ignoreOnError += 1;
  40870. setTimeout(function() {
  40871. // onerror should trigger before setTimeout
  40872. self._ignoreOnError -= 1;
  40873. });
  40874. },
  40875. _triggerEvent: function(eventType, options) {
  40876. // NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
  40877. var evt, key;
  40878. if (!this._hasDocument) return;
  40879. options = options || {};
  40880. eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
  40881. if (_document.createEvent) {
  40882. evt = _document.createEvent('HTMLEvents');
  40883. evt.initEvent(eventType, true, true);
  40884. } else {
  40885. evt = _document.createEventObject();
  40886. evt.eventType = eventType;
  40887. }
  40888. for (key in options)
  40889. if (hasKey(options, key)) {
  40890. evt[key] = options[key];
  40891. }
  40892. if (_document.createEvent) {
  40893. // IE9 if standards
  40894. _document.dispatchEvent(evt);
  40895. } else {
  40896. // IE8 regardless of Quirks or Standards
  40897. // IE9 if quirks
  40898. try {
  40899. _document.fireEvent('on' + evt.eventType.toLowerCase(), evt);
  40900. } catch (e) {
  40901. // Do nothing
  40902. }
  40903. }
  40904. },
  40905. /**
  40906. * Wraps addEventListener to capture UI breadcrumbs
  40907. * @param evtName the event name (e.g. "click")
  40908. * @returns {Function}
  40909. * @private
  40910. */
  40911. _breadcrumbEventHandler: function(evtName) {
  40912. var self = this;
  40913. return function(evt) {
  40914. // reset keypress timeout; e.g. triggering a 'click' after
  40915. // a 'keypress' will reset the keypress debounce so that a new
  40916. // set of keypresses can be recorded
  40917. self._keypressTimeout = null;
  40918. // It's possible this handler might trigger multiple times for the same
  40919. // event (e.g. event propagation through node ancestors). Ignore if we've
  40920. // already captured the event.
  40921. if (self._lastCapturedEvent === evt) return;
  40922. self._lastCapturedEvent = evt;
  40923. // try/catch both:
  40924. // - accessing evt.target (see getsentry/raven-js#838, #768)
  40925. // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
  40926. // can throw an exception in some circumstances.
  40927. var target;
  40928. try {
  40929. target = htmlTreeAsString(evt.target);
  40930. } catch (e) {
  40931. target = '<unknown>';
  40932. }
  40933. self.captureBreadcrumb({
  40934. category: 'ui.' + evtName, // e.g. ui.click, ui.input
  40935. message: target
  40936. });
  40937. };
  40938. },
  40939. /**
  40940. * Wraps addEventListener to capture keypress UI events
  40941. * @returns {Function}
  40942. * @private
  40943. */
  40944. _keypressEventHandler: function() {
  40945. var self = this,
  40946. debounceDuration = 1000; // milliseconds
  40947. // TODO: if somehow user switches keypress target before
  40948. // debounce timeout is triggered, we will only capture
  40949. // a single breadcrumb from the FIRST target (acceptable?)
  40950. return function(evt) {
  40951. var target;
  40952. try {
  40953. target = evt.target;
  40954. } catch (e) {
  40955. // just accessing event properties can throw an exception in some rare circumstances
  40956. // see: https://github.com/getsentry/raven-js/issues/838
  40957. return;
  40958. }
  40959. var tagName = target && target.tagName;
  40960. // only consider keypress events on actual input elements
  40961. // this will disregard keypresses targeting body (e.g. tabbing
  40962. // through elements, hotkeys, etc)
  40963. if (
  40964. !tagName ||
  40965. (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)
  40966. )
  40967. return;
  40968. // record first keypress in a series, but ignore subsequent
  40969. // keypresses until debounce clears
  40970. var timeout = self._keypressTimeout;
  40971. if (!timeout) {
  40972. self._breadcrumbEventHandler('input')(evt);
  40973. }
  40974. clearTimeout(timeout);
  40975. self._keypressTimeout = setTimeout(function() {
  40976. self._keypressTimeout = null;
  40977. }, debounceDuration);
  40978. };
  40979. },
  40980. /**
  40981. * Captures a breadcrumb of type "navigation", normalizing input URLs
  40982. * @param to the originating URL
  40983. * @param from the target URL
  40984. * @private
  40985. */
  40986. _captureUrlChange: function(from, to) {
  40987. var parsedLoc = parseUrl(this._location.href);
  40988. var parsedTo = parseUrl(to);
  40989. var parsedFrom = parseUrl(from);
  40990. // because onpopstate only tells you the "new" (to) value of location.href, and
  40991. // not the previous (from) value, we need to track the value of the current URL
  40992. // state ourselves
  40993. this._lastHref = to;
  40994. // Use only the path component of the URL if the URL matches the current
  40995. // document (almost all the time when using pushState)
  40996. if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host)
  40997. to = parsedTo.relative;
  40998. if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host)
  40999. from = parsedFrom.relative;
  41000. this.captureBreadcrumb({
  41001. category: 'navigation',
  41002. data: {
  41003. to: to,
  41004. from: from
  41005. }
  41006. });
  41007. },
  41008. _patchFunctionToString: function() {
  41009. var self = this;
  41010. self._originalFunctionToString = Function.prototype.toString;
  41011. // eslint-disable-next-line no-extend-native
  41012. Function.prototype.toString = function() {
  41013. if (typeof this === 'function' && this.__raven__) {
  41014. return self._originalFunctionToString.apply(this.__orig__, arguments);
  41015. }
  41016. return self._originalFunctionToString.apply(this, arguments);
  41017. };
  41018. },
  41019. _unpatchFunctionToString: function() {
  41020. if (this._originalFunctionToString) {
  41021. // eslint-disable-next-line no-extend-native
  41022. Function.prototype.toString = this._originalFunctionToString;
  41023. }
  41024. },
  41025. /**
  41026. * Wrap timer functions and event targets to catch errors and provide
  41027. * better metadata.
  41028. */
  41029. _instrumentTryCatch: function() {
  41030. var self = this;
  41031. var wrappedBuiltIns = self._wrappedBuiltIns;
  41032. function wrapTimeFn(orig) {
  41033. return function(fn, t) {
  41034. // preserve arity
  41035. // Make a copy of the arguments to prevent deoptimization
  41036. // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
  41037. var args = new Array(arguments.length);
  41038. for (var i = 0; i < args.length; ++i) {
  41039. args[i] = arguments[i];
  41040. }
  41041. var originalCallback = args[0];
  41042. if (isFunction(originalCallback)) {
  41043. args[0] = self.wrap(
  41044. {
  41045. mechanism: {
  41046. type: 'instrument',
  41047. data: {function: orig.name || '<anonymous>'}
  41048. }
  41049. },
  41050. originalCallback
  41051. );
  41052. }
  41053. // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
  41054. // also supports only two arguments and doesn't care what this is, so we
  41055. // can just call the original function directly.
  41056. if (orig.apply) {
  41057. return orig.apply(this, args);
  41058. } else {
  41059. return orig(args[0], args[1]);
  41060. }
  41061. };
  41062. }
  41063. var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
  41064. function wrapEventTarget(global) {
  41065. var proto = _window[global] && _window[global].prototype;
  41066. if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
  41067. fill(
  41068. proto,
  41069. 'addEventListener',
  41070. function(orig) {
  41071. return function(evtName, fn, capture, secure) {
  41072. // preserve arity
  41073. try {
  41074. if (fn && fn.handleEvent) {
  41075. fn.handleEvent = self.wrap(
  41076. {
  41077. mechanism: {
  41078. type: 'instrument',
  41079. data: {
  41080. target: global,
  41081. function: 'handleEvent',
  41082. handler: (fn && fn.name) || '<anonymous>'
  41083. }
  41084. }
  41085. },
  41086. fn.handleEvent
  41087. );
  41088. }
  41089. } catch (err) {
  41090. // can sometimes get 'Permission denied to access property "handle Event'
  41091. }
  41092. // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
  41093. // so that we don't have more than one wrapper function
  41094. var before, clickHandler, keypressHandler;
  41095. if (
  41096. autoBreadcrumbs &&
  41097. autoBreadcrumbs.dom &&
  41098. (global === 'EventTarget' || global === 'Node')
  41099. ) {
  41100. // NOTE: generating multiple handlers per addEventListener invocation, should
  41101. // revisit and verify we can just use one (almost certainly)
  41102. clickHandler = self._breadcrumbEventHandler('click');
  41103. keypressHandler = self._keypressEventHandler();
  41104. before = function(evt) {
  41105. // need to intercept every DOM event in `before` argument, in case that
  41106. // same wrapped method is re-used for different events (e.g. mousemove THEN click)
  41107. // see #724
  41108. if (!evt) return;
  41109. var eventType;
  41110. try {
  41111. eventType = evt.type;
  41112. } catch (e) {
  41113. // just accessing event properties can throw an exception in some rare circumstances
  41114. // see: https://github.com/getsentry/raven-js/issues/838
  41115. return;
  41116. }
  41117. if (eventType === 'click') return clickHandler(evt);
  41118. else if (eventType === 'keypress') return keypressHandler(evt);
  41119. };
  41120. }
  41121. return orig.call(
  41122. this,
  41123. evtName,
  41124. self.wrap(
  41125. {
  41126. mechanism: {
  41127. type: 'instrument',
  41128. data: {
  41129. target: global,
  41130. function: 'addEventListener',
  41131. handler: (fn && fn.name) || '<anonymous>'
  41132. }
  41133. }
  41134. },
  41135. fn,
  41136. before
  41137. ),
  41138. capture,
  41139. secure
  41140. );
  41141. };
  41142. },
  41143. wrappedBuiltIns
  41144. );
  41145. fill(
  41146. proto,
  41147. 'removeEventListener',
  41148. function(orig) {
  41149. return function(evt, fn, capture, secure) {
  41150. try {
  41151. fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
  41152. } catch (e) {
  41153. // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
  41154. }
  41155. return orig.call(this, evt, fn, capture, secure);
  41156. };
  41157. },
  41158. wrappedBuiltIns
  41159. );
  41160. }
  41161. }
  41162. fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
  41163. fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
  41164. if (_window.requestAnimationFrame) {
  41165. fill(
  41166. _window,
  41167. 'requestAnimationFrame',
  41168. function(orig) {
  41169. return function(cb) {
  41170. return orig(
  41171. self.wrap(
  41172. {
  41173. mechanism: {
  41174. type: 'instrument',
  41175. data: {
  41176. function: 'requestAnimationFrame',
  41177. handler: (orig && orig.name) || '<anonymous>'
  41178. }
  41179. }
  41180. },
  41181. cb
  41182. )
  41183. );
  41184. };
  41185. },
  41186. wrappedBuiltIns
  41187. );
  41188. }
  41189. // event targets borrowed from bugsnag-js:
  41190. // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
  41191. var eventTargets = [
  41192. 'EventTarget',
  41193. 'Window',
  41194. 'Node',
  41195. 'ApplicationCache',
  41196. 'AudioTrackList',
  41197. 'ChannelMergerNode',
  41198. 'CryptoOperation',
  41199. 'EventSource',
  41200. 'FileReader',
  41201. 'HTMLUnknownElement',
  41202. 'IDBDatabase',
  41203. 'IDBRequest',
  41204. 'IDBTransaction',
  41205. 'KeyOperation',
  41206. 'MediaController',
  41207. 'MessagePort',
  41208. 'ModalWindow',
  41209. 'Notification',
  41210. 'SVGElementInstance',
  41211. 'Screen',
  41212. 'TextTrack',
  41213. 'TextTrackCue',
  41214. 'TextTrackList',
  41215. 'WebSocket',
  41216. 'WebSocketWorker',
  41217. 'Worker',
  41218. 'XMLHttpRequest',
  41219. 'XMLHttpRequestEventTarget',
  41220. 'XMLHttpRequestUpload'
  41221. ];
  41222. for (var i = 0; i < eventTargets.length; i++) {
  41223. wrapEventTarget(eventTargets[i]);
  41224. }
  41225. },
  41226. /**
  41227. * Instrument browser built-ins w/ breadcrumb capturing
  41228. * - XMLHttpRequests
  41229. * - DOM interactions (click/typing)
  41230. * - window.location changes
  41231. * - console
  41232. *
  41233. * Can be disabled or individually configured via the `autoBreadcrumbs` config option
  41234. */
  41235. _instrumentBreadcrumbs: function() {
  41236. var self = this;
  41237. var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
  41238. var wrappedBuiltIns = self._wrappedBuiltIns;
  41239. function wrapProp(prop, xhr) {
  41240. if (prop in xhr && isFunction(xhr[prop])) {
  41241. fill(xhr, prop, function(orig) {
  41242. return self.wrap(
  41243. {
  41244. mechanism: {
  41245. type: 'instrument',
  41246. data: {function: prop, handler: (orig && orig.name) || '<anonymous>'}
  41247. }
  41248. },
  41249. orig
  41250. );
  41251. }); // intentionally don't track filled methods on XHR instances
  41252. }
  41253. }
  41254. if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
  41255. var xhrproto = _window.XMLHttpRequest && _window.XMLHttpRequest.prototype;
  41256. fill(
  41257. xhrproto,
  41258. 'open',
  41259. function(origOpen) {
  41260. return function(method, url) {
  41261. // preserve arity
  41262. // if Sentry key appears in URL, don't capture
  41263. if (isString(url) && url.indexOf(self._globalKey) === -1) {
  41264. this.__raven_xhr = {
  41265. method: method,
  41266. url: url,
  41267. status_code: null
  41268. };
  41269. }
  41270. return origOpen.apply(this, arguments);
  41271. };
  41272. },
  41273. wrappedBuiltIns
  41274. );
  41275. fill(
  41276. xhrproto,
  41277. 'send',
  41278. function(origSend) {
  41279. return function() {
  41280. // preserve arity
  41281. var xhr = this;
  41282. function onreadystatechangeHandler() {
  41283. if (xhr.__raven_xhr && xhr.readyState === 4) {
  41284. try {
  41285. // touching statusCode in some platforms throws
  41286. // an exception
  41287. xhr.__raven_xhr.status_code = xhr.status;
  41288. } catch (e) {
  41289. /* do nothing */
  41290. }
  41291. self.captureBreadcrumb({
  41292. type: 'http',
  41293. category: 'xhr',
  41294. data: xhr.__raven_xhr
  41295. });
  41296. }
  41297. }
  41298. var props = ['onload', 'onerror', 'onprogress'];
  41299. for (var j = 0; j < props.length; j++) {
  41300. wrapProp(props[j], xhr);
  41301. }
  41302. if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) {
  41303. fill(
  41304. xhr,
  41305. 'onreadystatechange',
  41306. function(orig) {
  41307. return self.wrap(
  41308. {
  41309. mechanism: {
  41310. type: 'instrument',
  41311. data: {
  41312. function: 'onreadystatechange',
  41313. handler: (orig && orig.name) || '<anonymous>'
  41314. }
  41315. }
  41316. },
  41317. orig,
  41318. onreadystatechangeHandler
  41319. );
  41320. } /* intentionally don't track this instrumentation */
  41321. );
  41322. } else {
  41323. // if onreadystatechange wasn't actually set by the page on this xhr, we
  41324. // are free to set our own and capture the breadcrumb
  41325. xhr.onreadystatechange = onreadystatechangeHandler;
  41326. }
  41327. return origSend.apply(this, arguments);
  41328. };
  41329. },
  41330. wrappedBuiltIns
  41331. );
  41332. }
  41333. if (autoBreadcrumbs.xhr && supportsFetch()) {
  41334. fill(
  41335. _window,
  41336. 'fetch',
  41337. function(origFetch) {
  41338. return function() {
  41339. // preserve arity
  41340. // Make a copy of the arguments to prevent deoptimization
  41341. // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
  41342. var args = new Array(arguments.length);
  41343. for (var i = 0; i < args.length; ++i) {
  41344. args[i] = arguments[i];
  41345. }
  41346. var fetchInput = args[0];
  41347. var method = 'GET';
  41348. var url;
  41349. if (typeof fetchInput === 'string') {
  41350. url = fetchInput;
  41351. } else if ('Request' in _window && fetchInput instanceof _window.Request) {
  41352. url = fetchInput.url;
  41353. if (fetchInput.method) {
  41354. method = fetchInput.method;
  41355. }
  41356. } else {
  41357. url = '' + fetchInput;
  41358. }
  41359. // if Sentry key appears in URL, don't capture, as it's our own request
  41360. if (url.indexOf(self._globalKey) !== -1) {
  41361. return origFetch.apply(this, args);
  41362. }
  41363. if (args[1] && args[1].method) {
  41364. method = args[1].method;
  41365. }
  41366. var fetchData = {
  41367. method: method,
  41368. url: url,
  41369. status_code: null
  41370. };
  41371. return origFetch
  41372. .apply(this, args)
  41373. .then(function(response) {
  41374. fetchData.status_code = response.status;
  41375. self.captureBreadcrumb({
  41376. type: 'http',
  41377. category: 'fetch',
  41378. data: fetchData
  41379. });
  41380. return response;
  41381. })
  41382. ['catch'](function(err) {
  41383. // if there is an error performing the request
  41384. self.captureBreadcrumb({
  41385. type: 'http',
  41386. category: 'fetch',
  41387. data: fetchData,
  41388. level: 'error'
  41389. });
  41390. throw err;
  41391. });
  41392. };
  41393. },
  41394. wrappedBuiltIns
  41395. );
  41396. }
  41397. // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
  41398. // to the document. Do this before we instrument addEventListener.
  41399. if (autoBreadcrumbs.dom && this._hasDocument) {
  41400. if (_document.addEventListener) {
  41401. _document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
  41402. _document.addEventListener('keypress', self._keypressEventHandler(), false);
  41403. } else if (_document.attachEvent) {
  41404. // IE8 Compatibility
  41405. _document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
  41406. _document.attachEvent('onkeypress', self._keypressEventHandler());
  41407. }
  41408. }
  41409. // record navigation (URL) changes
  41410. // NOTE: in Chrome App environment, touching history.pushState, *even inside
  41411. // a try/catch block*, will cause Chrome to output an error to console.error
  41412. // borrowed from: https://github.com/angular/angular.js/pull/13945/files
  41413. var chrome = _window.chrome;
  41414. var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
  41415. var hasPushAndReplaceState =
  41416. !isChromePackagedApp &&
  41417. _window.history &&
  41418. _window.history.pushState &&
  41419. _window.history.replaceState;
  41420. if (autoBreadcrumbs.location && hasPushAndReplaceState) {
  41421. // TODO: remove onpopstate handler on uninstall()
  41422. var oldOnPopState = _window.onpopstate;
  41423. _window.onpopstate = function() {
  41424. var currentHref = self._location.href;
  41425. self._captureUrlChange(self._lastHref, currentHref);
  41426. if (oldOnPopState) {
  41427. return oldOnPopState.apply(this, arguments);
  41428. }
  41429. };
  41430. var historyReplacementFunction = function(origHistFunction) {
  41431. // note history.pushState.length is 0; intentionally not declaring
  41432. // params to preserve 0 arity
  41433. return function(/* state, title, url */) {
  41434. var url = arguments.length > 2 ? arguments[2] : undefined;
  41435. // url argument is optional
  41436. if (url) {
  41437. // coerce to string (this is what pushState does)
  41438. self._captureUrlChange(self._lastHref, url + '');
  41439. }
  41440. return origHistFunction.apply(this, arguments);
  41441. };
  41442. };
  41443. fill(_window.history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
  41444. fill(_window.history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
  41445. }
  41446. if (autoBreadcrumbs.console && 'console' in _window && console.log) {
  41447. // console
  41448. var consoleMethodCallback = function(msg, data) {
  41449. self.captureBreadcrumb({
  41450. message: msg,
  41451. level: data.level,
  41452. category: 'console'
  41453. });
  41454. };
  41455. each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) {
  41456. wrapConsoleMethod(console, level, consoleMethodCallback);
  41457. });
  41458. }
  41459. },
  41460. _restoreBuiltIns: function() {
  41461. // restore any wrapped builtins
  41462. var builtin;
  41463. while (this._wrappedBuiltIns.length) {
  41464. builtin = this._wrappedBuiltIns.shift();
  41465. var obj = builtin[0],
  41466. name = builtin[1],
  41467. orig = builtin[2];
  41468. obj[name] = orig;
  41469. }
  41470. },
  41471. _restoreConsole: function() {
  41472. // eslint-disable-next-line guard-for-in
  41473. for (var method in this._originalConsoleMethods) {
  41474. this._originalConsole[method] = this._originalConsoleMethods[method];
  41475. }
  41476. },
  41477. _drainPlugins: function() {
  41478. var self = this;
  41479. // FIX ME TODO
  41480. each(this._plugins, function(_, plugin) {
  41481. var installer = plugin[0];
  41482. var args = plugin[1];
  41483. installer.apply(self, [self].concat(args));
  41484. });
  41485. },
  41486. _parseDSN: function(str) {
  41487. var m = dsnPattern.exec(str),
  41488. dsn = {},
  41489. i = 7;
  41490. try {
  41491. while (i--) dsn[dsnKeys[i]] = m[i] || '';
  41492. } catch (e) {
  41493. throw new RavenConfigError('Invalid DSN: ' + str);
  41494. }
  41495. if (dsn.pass && !this._globalOptions.allowSecretKey) {
  41496. throw new RavenConfigError(
  41497. 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
  41498. );
  41499. }
  41500. return dsn;
  41501. },
  41502. _getGlobalServer: function(uri) {
  41503. // assemble the endpoint from the uri pieces
  41504. var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : '');
  41505. if (uri.protocol) {
  41506. globalServer = uri.protocol + ':' + globalServer;
  41507. }
  41508. return globalServer;
  41509. },
  41510. _handleOnErrorStackInfo: function(stackInfo, options) {
  41511. options = options || {};
  41512. options.mechanism = options.mechanism || {
  41513. type: 'onerror',
  41514. handled: false
  41515. };
  41516. // if we are intentionally ignoring errors via onerror, bail out
  41517. if (!this._ignoreOnError) {
  41518. this._handleStackInfo(stackInfo, options);
  41519. }
  41520. },
  41521. _handleStackInfo: function(stackInfo, options) {
  41522. var frames = this._prepareFrames(stackInfo, options);
  41523. this._triggerEvent('handle', {
  41524. stackInfo: stackInfo,
  41525. options: options
  41526. });
  41527. this._processException(
  41528. stackInfo.name,
  41529. stackInfo.message,
  41530. stackInfo.url,
  41531. stackInfo.lineno,
  41532. frames,
  41533. options
  41534. );
  41535. },
  41536. _prepareFrames: function(stackInfo, options) {
  41537. var self = this;
  41538. var frames = [];
  41539. if (stackInfo.stack && stackInfo.stack.length) {
  41540. each(stackInfo.stack, function(i, stack) {
  41541. var frame = self._normalizeFrame(stack, stackInfo.url);
  41542. if (frame) {
  41543. frames.push(frame);
  41544. }
  41545. });
  41546. // e.g. frames captured via captureMessage throw
  41547. if (options && options.trimHeadFrames) {
  41548. for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
  41549. frames[j].in_app = false;
  41550. }
  41551. }
  41552. }
  41553. frames = frames.slice(0, this._globalOptions.stackTraceLimit);
  41554. return frames;
  41555. },
  41556. _normalizeFrame: function(frame, stackInfoUrl) {
  41557. // normalize the frames data
  41558. var normalized = {
  41559. filename: frame.url,
  41560. lineno: frame.line,
  41561. colno: frame.column,
  41562. function: frame.func || '?'
  41563. };
  41564. // Case when we don't have any information about the error
  41565. // E.g. throwing a string or raw object, instead of an `Error` in Firefox
  41566. // Generating synthetic error doesn't add any value here
  41567. //
  41568. // We should probably somehow let a user know that they should fix their code
  41569. if (!frame.url) {
  41570. normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler
  41571. }
  41572. normalized.in_app = !// determine if an exception came from outside of our app
  41573. // first we check the global includePaths list.
  41574. (
  41575. (!!this._globalOptions.includePaths.test &&
  41576. !this._globalOptions.includePaths.test(normalized.filename)) ||
  41577. // Now we check for fun, if the function name is Raven or TraceKit
  41578. /(Raven|TraceKit)\./.test(normalized['function']) ||
  41579. // finally, we do a last ditch effort and check for raven.min.js
  41580. /raven\.(min\.)?js$/.test(normalized.filename)
  41581. );
  41582. return normalized;
  41583. },
  41584. _processException: function(type, message, fileurl, lineno, frames, options) {
  41585. var prefixedMessage = (type ? type + ': ' : '') + (message || '');
  41586. if (
  41587. !!this._globalOptions.ignoreErrors.test &&
  41588. (this._globalOptions.ignoreErrors.test(message) ||
  41589. this._globalOptions.ignoreErrors.test(prefixedMessage))
  41590. ) {
  41591. return;
  41592. }
  41593. var stacktrace;
  41594. if (frames && frames.length) {
  41595. fileurl = frames[0].filename || fileurl;
  41596. // Sentry expects frames oldest to newest
  41597. // and JS sends them as newest to oldest
  41598. frames.reverse();
  41599. stacktrace = {frames: frames};
  41600. } else if (fileurl) {
  41601. stacktrace = {
  41602. frames: [
  41603. {
  41604. filename: fileurl,
  41605. lineno: lineno,
  41606. in_app: true
  41607. }
  41608. ]
  41609. };
  41610. }
  41611. if (
  41612. !!this._globalOptions.ignoreUrls.test &&
  41613. this._globalOptions.ignoreUrls.test(fileurl)
  41614. ) {
  41615. return;
  41616. }
  41617. if (
  41618. !!this._globalOptions.whitelistUrls.test &&
  41619. !this._globalOptions.whitelistUrls.test(fileurl)
  41620. ) {
  41621. return;
  41622. }
  41623. var data = objectMerge(
  41624. {
  41625. // sentry.interfaces.Exception
  41626. exception: {
  41627. values: [
  41628. {
  41629. type: type,
  41630. value: message,
  41631. stacktrace: stacktrace
  41632. }
  41633. ]
  41634. },
  41635. transaction: fileurl
  41636. },
  41637. options
  41638. );
  41639. var ex = data.exception.values[0];
  41640. if (ex.type == null && ex.value === '') {
  41641. ex.value = 'Unrecoverable error caught';
  41642. }
  41643. // Move mechanism from options to exception interface
  41644. // We do this, as requiring user to pass `{exception:{mechanism:{ ... }}}` would be
  41645. // too much
  41646. if (!data.exception.mechanism && data.mechanism) {
  41647. data.exception.mechanism = data.mechanism;
  41648. delete data.mechanism;
  41649. }
  41650. data.exception.mechanism = objectMerge(
  41651. {
  41652. type: 'generic',
  41653. handled: true
  41654. },
  41655. data.exception.mechanism || {}
  41656. );
  41657. // Fire away!
  41658. this._send(data);
  41659. },
  41660. _trimPacket: function(data) {
  41661. // For now, we only want to truncate the two different messages
  41662. // but this could/should be expanded to just trim everything
  41663. var max = this._globalOptions.maxMessageLength;
  41664. if (data.message) {
  41665. data.message = truncate(data.message, max);
  41666. }
  41667. if (data.exception) {
  41668. var exception = data.exception.values[0];
  41669. exception.value = truncate(exception.value, max);
  41670. }
  41671. var request = data.request;
  41672. if (request) {
  41673. if (request.url) {
  41674. request.url = truncate(request.url, this._globalOptions.maxUrlLength);
  41675. }
  41676. if (request.Referer) {
  41677. request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
  41678. }
  41679. }
  41680. if (data.breadcrumbs && data.breadcrumbs.values)
  41681. this._trimBreadcrumbs(data.breadcrumbs);
  41682. return data;
  41683. },
  41684. /**
  41685. * Truncate breadcrumb values (right now just URLs)
  41686. */
  41687. _trimBreadcrumbs: function(breadcrumbs) {
  41688. // known breadcrumb properties with urls
  41689. // TODO: also consider arbitrary prop values that start with (https?)?://
  41690. var urlProps = ['to', 'from', 'url'],
  41691. urlProp,
  41692. crumb,
  41693. data;
  41694. for (var i = 0; i < breadcrumbs.values.length; ++i) {
  41695. crumb = breadcrumbs.values[i];
  41696. if (
  41697. !crumb.hasOwnProperty('data') ||
  41698. !isObject(crumb.data) ||
  41699. objectFrozen(crumb.data)
  41700. )
  41701. continue;
  41702. data = objectMerge({}, crumb.data);
  41703. for (var j = 0; j < urlProps.length; ++j) {
  41704. urlProp = urlProps[j];
  41705. if (data.hasOwnProperty(urlProp) && data[urlProp]) {
  41706. data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
  41707. }
  41708. }
  41709. breadcrumbs.values[i].data = data;
  41710. }
  41711. },
  41712. _getHttpData: function() {
  41713. if (!this._hasNavigator && !this._hasDocument) return;
  41714. var httpData = {};
  41715. if (this._hasNavigator && _navigator.userAgent) {
  41716. httpData.headers = {
  41717. 'User-Agent': _navigator.userAgent
  41718. };
  41719. }
  41720. // Check in `window` instead of `document`, as we may be in ServiceWorker environment
  41721. if (_window.location && _window.location.href) {
  41722. httpData.url = _window.location.href;
  41723. }
  41724. if (this._hasDocument && _document.referrer) {
  41725. if (!httpData.headers) httpData.headers = {};
  41726. httpData.headers.Referer = _document.referrer;
  41727. }
  41728. return httpData;
  41729. },
  41730. _resetBackoff: function() {
  41731. this._backoffDuration = 0;
  41732. this._backoffStart = null;
  41733. },
  41734. _shouldBackoff: function() {
  41735. return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
  41736. },
  41737. /**
  41738. * Returns true if the in-process data payload matches the signature
  41739. * of the previously-sent data
  41740. *
  41741. * NOTE: This has to be done at this level because TraceKit can generate
  41742. * data from window.onerror WITHOUT an exception object (IE8, IE9,
  41743. * other old browsers). This can take the form of an "exception"
  41744. * data object with a single frame (derived from the onerror args).
  41745. */
  41746. _isRepeatData: function(current) {
  41747. var last = this._lastData;
  41748. if (
  41749. !last ||
  41750. current.message !== last.message || // defined for captureMessage
  41751. current.transaction !== last.transaction // defined for captureException/onerror
  41752. )
  41753. return false;
  41754. // Stacktrace interface (i.e. from captureMessage)
  41755. if (current.stacktrace || last.stacktrace) {
  41756. return isSameStacktrace(current.stacktrace, last.stacktrace);
  41757. } else if (current.exception || last.exception) {
  41758. // Exception interface (i.e. from captureException/onerror)
  41759. return isSameException(current.exception, last.exception);
  41760. } else if (current.fingerprint || last.fingerprint) {
  41761. return Boolean(current.fingerprint && last.fingerprint) &&
  41762. JSON.stringify(current.fingerprint) === JSON.stringify(last.fingerprint)
  41763. }
  41764. return true;
  41765. },
  41766. _setBackoffState: function(request) {
  41767. // If we are already in a backoff state, don't change anything
  41768. if (this._shouldBackoff()) {
  41769. return;
  41770. }
  41771. var status = request.status;
  41772. // 400 - project_id doesn't exist or some other fatal
  41773. // 401 - invalid/revoked dsn
  41774. // 429 - too many requests
  41775. if (!(status === 400 || status === 401 || status === 429)) return;
  41776. var retry;
  41777. try {
  41778. // If Retry-After is not in Access-Control-Expose-Headers, most
  41779. // browsers will throw an exception trying to access it
  41780. if (supportsFetch()) {
  41781. retry = request.headers.get('Retry-After');
  41782. } else {
  41783. retry = request.getResponseHeader('Retry-After');
  41784. }
  41785. // Retry-After is returned in seconds
  41786. retry = parseInt(retry, 10) * 1000;
  41787. } catch (e) {
  41788. /* eslint no-empty:0 */
  41789. }
  41790. this._backoffDuration = retry
  41791. ? // If Sentry server returned a Retry-After value, use it
  41792. retry
  41793. : // Otherwise, double the last backoff duration (starts at 1 sec)
  41794. this._backoffDuration * 2 || 1000;
  41795. this._backoffStart = now();
  41796. },
  41797. _send: function(data) {
  41798. var globalOptions = this._globalOptions;
  41799. var baseData = {
  41800. project: this._globalProject,
  41801. logger: globalOptions.logger,
  41802. platform: 'javascript'
  41803. },
  41804. httpData = this._getHttpData();
  41805. if (httpData) {
  41806. baseData.request = httpData;
  41807. }
  41808. // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
  41809. if (data.trimHeadFrames) delete data.trimHeadFrames;
  41810. data = objectMerge(baseData, data);
  41811. // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
  41812. data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
  41813. data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
  41814. // Send along our own collected metadata with extra
  41815. data.extra['session:duration'] = now() - this._startTime;
  41816. if (this._breadcrumbs && this._breadcrumbs.length > 0) {
  41817. // intentionally make shallow copy so that additions
  41818. // to breadcrumbs aren't accidentally sent in this request
  41819. data.breadcrumbs = {
  41820. values: [].slice.call(this._breadcrumbs, 0)
  41821. };
  41822. }
  41823. if (this._globalContext.user) {
  41824. // sentry.interfaces.User
  41825. data.user = this._globalContext.user;
  41826. }
  41827. // Include the environment if it's defined in globalOptions
  41828. if (globalOptions.environment) data.environment = globalOptions.environment;
  41829. // Include the release if it's defined in globalOptions
  41830. if (globalOptions.release) data.release = globalOptions.release;
  41831. // Include server_name if it's defined in globalOptions
  41832. if (globalOptions.serverName) data.server_name = globalOptions.serverName;
  41833. data = this._sanitizeData(data);
  41834. // Cleanup empty properties before sending them to the server
  41835. Object.keys(data).forEach(function(key) {
  41836. if (data[key] == null || data[key] === '' || isEmptyObject(data[key])) {
  41837. delete data[key];
  41838. }
  41839. });
  41840. if (isFunction(globalOptions.dataCallback)) {
  41841. data = globalOptions.dataCallback(data) || data;
  41842. }
  41843. // Why??????????
  41844. if (!data || isEmptyObject(data)) {
  41845. return;
  41846. }
  41847. // Check if the request should be filtered or not
  41848. if (
  41849. isFunction(globalOptions.shouldSendCallback) &&
  41850. !globalOptions.shouldSendCallback(data)
  41851. ) {
  41852. return;
  41853. }
  41854. // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
  41855. // so drop requests until "cool-off" period has elapsed.
  41856. if (this._shouldBackoff()) {
  41857. this._logDebug('warn', 'Raven dropped error due to backoff: ', data);
  41858. return;
  41859. }
  41860. if (typeof globalOptions.sampleRate === 'number') {
  41861. if (Math.random() < globalOptions.sampleRate) {
  41862. this._sendProcessedPayload(data);
  41863. }
  41864. } else {
  41865. this._sendProcessedPayload(data);
  41866. }
  41867. },
  41868. _sanitizeData: function(data) {
  41869. return sanitize(data, this._globalOptions.sanitizeKeys);
  41870. },
  41871. _getUuid: function() {
  41872. return uuid4();
  41873. },
  41874. _sendProcessedPayload: function(data, callback) {
  41875. var self = this;
  41876. var globalOptions = this._globalOptions;
  41877. if (!this.isSetup()) return;
  41878. // Try and clean up the packet before sending by truncating long values
  41879. data = this._trimPacket(data);
  41880. // ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback,
  41881. // but this would require copying an un-truncated copy of the data packet, which can be
  41882. // arbitrarily deep (extra_data) -- could be worthwhile? will revisit
  41883. if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
  41884. this._logDebug('warn', 'Raven dropped repeat event: ', data);
  41885. return;
  41886. }
  41887. // Send along an event_id if not explicitly passed.
  41888. // This event_id can be used to reference the error within Sentry itself.
  41889. // Set lastEventId after we know the error should actually be sent
  41890. this._lastEventId = data.event_id || (data.event_id = this._getUuid());
  41891. // Store outbound payload after trim
  41892. this._lastData = data;
  41893. this._logDebug('debug', 'Raven about to send:', data);
  41894. var auth = {
  41895. sentry_version: '7',
  41896. sentry_client: 'raven-js/' + this.VERSION,
  41897. sentry_key: this._globalKey
  41898. };
  41899. if (this._globalSecret) {
  41900. auth.sentry_secret = this._globalSecret;
  41901. }
  41902. var exception = data.exception && data.exception.values[0];
  41903. // only capture 'sentry' breadcrumb is autoBreadcrumbs is truthy
  41904. if (
  41905. this._globalOptions.autoBreadcrumbs &&
  41906. this._globalOptions.autoBreadcrumbs.sentry
  41907. ) {
  41908. this.captureBreadcrumb({
  41909. category: 'sentry',
  41910. message: exception
  41911. ? (exception.type ? exception.type + ': ' : '') + exception.value
  41912. : data.message,
  41913. event_id: data.event_id,
  41914. level: data.level || 'error' // presume error unless specified
  41915. });
  41916. }
  41917. var url = this._globalEndpoint;
  41918. (globalOptions.transport || this._makeRequest).call(this, {
  41919. url: url,
  41920. auth: auth,
  41921. data: data,
  41922. options: globalOptions,
  41923. onSuccess: function success() {
  41924. self._resetBackoff();
  41925. self._triggerEvent('success', {
  41926. data: data,
  41927. src: url
  41928. });
  41929. callback && callback();
  41930. },
  41931. onError: function failure(error) {
  41932. self._logDebug('error', 'Raven transport failed to send: ', error);
  41933. if (error.request) {
  41934. self._setBackoffState(error.request);
  41935. }
  41936. self._triggerEvent('failure', {
  41937. data: data,
  41938. src: url
  41939. });
  41940. error = error || new Error('Raven send failed (no additional details provided)');
  41941. callback && callback(error);
  41942. }
  41943. });
  41944. },
  41945. _makeRequest: function(opts) {
  41946. // Auth is intentionally sent as part of query string (NOT as custom HTTP header) to avoid preflight CORS requests
  41947. var url = opts.url + '?' + urlencode(opts.auth);
  41948. var evaluatedHeaders = null;
  41949. var evaluatedFetchParameters = {};
  41950. if (opts.options.headers) {
  41951. evaluatedHeaders = this._evaluateHash(opts.options.headers);
  41952. }
  41953. if (opts.options.fetchParameters) {
  41954. evaluatedFetchParameters = this._evaluateHash(opts.options.fetchParameters);
  41955. }
  41956. if (supportsFetch()) {
  41957. evaluatedFetchParameters.body = stringify(opts.data);
  41958. var defaultFetchOptions = objectMerge({}, this._fetchDefaults);
  41959. var fetchOptions = objectMerge(defaultFetchOptions, evaluatedFetchParameters);
  41960. if (evaluatedHeaders) {
  41961. fetchOptions.headers = evaluatedHeaders;
  41962. }
  41963. return _window
  41964. .fetch(url, fetchOptions)
  41965. .then(function(response) {
  41966. if (response.ok) {
  41967. opts.onSuccess && opts.onSuccess();
  41968. } else {
  41969. var error = new Error('Sentry error code: ' + response.status);
  41970. // It's called request only to keep compatibility with XHR interface
  41971. // and not add more redundant checks in setBackoffState method
  41972. error.request = response;
  41973. opts.onError && opts.onError(error);
  41974. }
  41975. })
  41976. ['catch'](function() {
  41977. opts.onError &&
  41978. opts.onError(new Error('Sentry error code: network unavailable'));
  41979. });
  41980. }
  41981. var request = _window.XMLHttpRequest && new _window.XMLHttpRequest();
  41982. if (!request) return;
  41983. // if browser doesn't support CORS (e.g. IE7), we are out of luck
  41984. var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined';
  41985. if (!hasCORS) return;
  41986. if ('withCredentials' in request) {
  41987. request.onreadystatechange = function() {
  41988. if (request.readyState !== 4) {
  41989. return;
  41990. } else if (request.status === 200) {
  41991. opts.onSuccess && opts.onSuccess();
  41992. } else if (opts.onError) {
  41993. var err = new Error('Sentry error code: ' + request.status);
  41994. err.request = request;
  41995. opts.onError(err);
  41996. }
  41997. };
  41998. } else {
  41999. request = new XDomainRequest();
  42000. // xdomainrequest cannot go http -> https (or vice versa),
  42001. // so always use protocol relative
  42002. url = url.replace(/^https?:/, '');
  42003. // onreadystatechange not supported by XDomainRequest
  42004. if (opts.onSuccess) {
  42005. request.onload = opts.onSuccess;
  42006. }
  42007. if (opts.onError) {
  42008. request.onerror = function() {
  42009. var err = new Error('Sentry error code: XDomainRequest');
  42010. err.request = request;
  42011. opts.onError(err);
  42012. };
  42013. }
  42014. }
  42015. request.open('POST', url);
  42016. if (evaluatedHeaders) {
  42017. each(evaluatedHeaders, function(key, value) {
  42018. request.setRequestHeader(key, value);
  42019. });
  42020. }
  42021. request.send(stringify(opts.data));
  42022. },
  42023. _evaluateHash: function(hash) {
  42024. var evaluated = {};
  42025. for (var key in hash) {
  42026. if (hash.hasOwnProperty(key)) {
  42027. var value = hash[key];
  42028. evaluated[key] = typeof value === 'function' ? value() : value;
  42029. }
  42030. }
  42031. return evaluated;
  42032. },
  42033. _logDebug: function(level) {
  42034. // We allow `Raven.debug` and `Raven.config(DSN, { debug: true })` to not make backward incompatible API change
  42035. if (
  42036. this._originalConsoleMethods[level] &&
  42037. (this.debug || this._globalOptions.debug)
  42038. ) {
  42039. // In IE<10 console methods do not have their own 'apply' method
  42040. Function.prototype.apply.call(
  42041. this._originalConsoleMethods[level],
  42042. this._originalConsole,
  42043. [].slice.call(arguments, 1)
  42044. );
  42045. }
  42046. },
  42047. _mergeContext: function(key, context) {
  42048. if (isUndefined(context)) {
  42049. delete this._globalContext[key];
  42050. } else {
  42051. this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
  42052. }
  42053. }
  42054. };
  42055. // Deprecations
  42056. Raven.prototype.setUser = Raven.prototype.setUserContext;
  42057. Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
  42058. module.exports = Raven;
  42059. /***/ }),
  42060. /* 520 */
  42061. /***/ (function(module, exports, __webpack_require__) {
  42062. var utils = __webpack_require__(134);
  42063. /*
  42064. TraceKit - Cross brower stack traces
  42065. This was originally forked from github.com/occ/TraceKit, but has since been
  42066. largely re-written and is now maintained as part of raven-js. Tests for
  42067. this are in test/vendor.
  42068. MIT license
  42069. */
  42070. var TraceKit = {
  42071. collectWindowErrors: true,
  42072. debug: false
  42073. };
  42074. // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
  42075. var _window =
  42076. typeof window !== 'undefined'
  42077. ? window
  42078. : typeof (typeof window !== undefined ? window : global) !== 'undefined'
  42079. ? (typeof window !== undefined ? window : global)
  42080. : typeof self !== 'undefined'
  42081. ? self
  42082. : {};
  42083. // global reference to slice
  42084. var _slice = [].slice;
  42085. var UNKNOWN_FUNCTION = '?';
  42086. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
  42087. var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
  42088. function getLocationHref() {
  42089. if (typeof document === 'undefined' || document.location == null) return '';
  42090. return document.location.href;
  42091. }
  42092. function getLocationOrigin() {
  42093. if (typeof document === 'undefined' || document.location == null) return '';
  42094. // Oh dear IE10...
  42095. if (!document.location.origin) {
  42096. return (
  42097. document.location.protocol +
  42098. '//' +
  42099. document.location.hostname +
  42100. (document.location.port ? ':' + document.location.port : '')
  42101. );
  42102. }
  42103. return document.location.origin;
  42104. }
  42105. /**
  42106. * TraceKit.report: cross-browser processing of unhandled exceptions
  42107. *
  42108. * Syntax:
  42109. * TraceKit.report.subscribe(function(stackInfo) { ... })
  42110. * TraceKit.report.unsubscribe(function(stackInfo) { ... })
  42111. * TraceKit.report(exception)
  42112. * try { ...code... } catch(ex) { TraceKit.report(ex); }
  42113. *
  42114. * Supports:
  42115. * - Firefox: full stack trace with line numbers, plus column number
  42116. * on top frame; column number is not guaranteed
  42117. * - Opera: full stack trace with line and column numbers
  42118. * - Chrome: full stack trace with line and column numbers
  42119. * - Safari: line and column number for the top frame only; some frames
  42120. * may be missing, and column number is not guaranteed
  42121. * - IE: line and column number for the top frame only; some frames
  42122. * may be missing, and column number is not guaranteed
  42123. *
  42124. * In theory, TraceKit should work on all of the following versions:
  42125. * - IE5.5+ (only 8.0 tested)
  42126. * - Firefox 0.9+ (only 3.5+ tested)
  42127. * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
  42128. * Exceptions Have Stacktrace to be enabled in opera:config)
  42129. * - Safari 3+ (only 4+ tested)
  42130. * - Chrome 1+ (only 5+ tested)
  42131. * - Konqueror 3.5+ (untested)
  42132. *
  42133. * Requires TraceKit.computeStackTrace.
  42134. *
  42135. * Tries to catch all unhandled exceptions and report them to the
  42136. * subscribed handlers. Please note that TraceKit.report will rethrow the
  42137. * exception. This is REQUIRED in order to get a useful stack trace in IE.
  42138. * If the exception does not reach the top of the browser, you will only
  42139. * get a stack trace from the point where TraceKit.report was called.
  42140. *
  42141. * Handlers receive a stackInfo object as described in the
  42142. * TraceKit.computeStackTrace docs.
  42143. */
  42144. TraceKit.report = (function reportModuleWrapper() {
  42145. var handlers = [],
  42146. lastArgs = null,
  42147. lastException = null,
  42148. lastExceptionStack = null;
  42149. /**
  42150. * Add a crash handler.
  42151. * @param {Function} handler
  42152. */
  42153. function subscribe(handler) {
  42154. installGlobalHandler();
  42155. handlers.push(handler);
  42156. }
  42157. /**
  42158. * Remove a crash handler.
  42159. * @param {Function} handler
  42160. */
  42161. function unsubscribe(handler) {
  42162. for (var i = handlers.length - 1; i >= 0; --i) {
  42163. if (handlers[i] === handler) {
  42164. handlers.splice(i, 1);
  42165. }
  42166. }
  42167. }
  42168. /**
  42169. * Remove all crash handlers.
  42170. */
  42171. function unsubscribeAll() {
  42172. uninstallGlobalHandler();
  42173. handlers = [];
  42174. }
  42175. /**
  42176. * Dispatch stack information to all handlers.
  42177. * @param {Object.<string, *>} stack
  42178. */
  42179. function notifyHandlers(stack, isWindowError) {
  42180. var exception = null;
  42181. if (isWindowError && !TraceKit.collectWindowErrors) {
  42182. return;
  42183. }
  42184. for (var i in handlers) {
  42185. if (handlers.hasOwnProperty(i)) {
  42186. try {
  42187. handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
  42188. } catch (inner) {
  42189. exception = inner;
  42190. }
  42191. }
  42192. }
  42193. if (exception) {
  42194. throw exception;
  42195. }
  42196. }
  42197. var _oldOnerrorHandler, _onErrorHandlerInstalled;
  42198. /**
  42199. * Ensures all global unhandled exceptions are recorded.
  42200. * Supported by Gecko and IE.
  42201. * @param {string} msg Error message.
  42202. * @param {string} url URL of script that generated the exception.
  42203. * @param {(number|string)} lineNo The line number at which the error
  42204. * occurred.
  42205. * @param {?(number|string)} colNo The column number at which the error
  42206. * occurred.
  42207. * @param {?Error} ex The actual Error object.
  42208. */
  42209. function traceKitWindowOnError(msg, url, lineNo, colNo, ex) {
  42210. var stack = null;
  42211. // If 'ex' is ErrorEvent, get real Error from inside
  42212. var exception = utils.isErrorEvent(ex) ? ex.error : ex;
  42213. // If 'msg' is ErrorEvent, get real message from inside
  42214. var message = utils.isErrorEvent(msg) ? msg.message : msg;
  42215. if (lastExceptionStack) {
  42216. TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
  42217. lastExceptionStack,
  42218. url,
  42219. lineNo,
  42220. message
  42221. );
  42222. processLastException();
  42223. } else if (exception && utils.isError(exception)) {
  42224. // non-string `exception` arg; attempt to extract stack trace
  42225. // New chrome and blink send along a real error object
  42226. // Let's just report that like a normal error.
  42227. // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
  42228. stack = TraceKit.computeStackTrace(exception);
  42229. notifyHandlers(stack, true);
  42230. } else {
  42231. var location = {
  42232. url: url,
  42233. line: lineNo,
  42234. column: colNo
  42235. };
  42236. var name = undefined;
  42237. var groups;
  42238. if ({}.toString.call(message) === '[object String]') {
  42239. var groups = message.match(ERROR_TYPES_RE);
  42240. if (groups) {
  42241. name = groups[1];
  42242. message = groups[2];
  42243. }
  42244. }
  42245. location.func = UNKNOWN_FUNCTION;
  42246. stack = {
  42247. name: name,
  42248. message: message,
  42249. url: getLocationHref(),
  42250. stack: [location]
  42251. };
  42252. notifyHandlers(stack, true);
  42253. }
  42254. if (_oldOnerrorHandler) {
  42255. return _oldOnerrorHandler.apply(this, arguments);
  42256. }
  42257. return false;
  42258. }
  42259. function installGlobalHandler() {
  42260. if (_onErrorHandlerInstalled) {
  42261. return;
  42262. }
  42263. _oldOnerrorHandler = _window.onerror;
  42264. _window.onerror = traceKitWindowOnError;
  42265. _onErrorHandlerInstalled = true;
  42266. }
  42267. function uninstallGlobalHandler() {
  42268. if (!_onErrorHandlerInstalled) {
  42269. return;
  42270. }
  42271. _window.onerror = _oldOnerrorHandler;
  42272. _onErrorHandlerInstalled = false;
  42273. _oldOnerrorHandler = undefined;
  42274. }
  42275. function processLastException() {
  42276. var _lastExceptionStack = lastExceptionStack,
  42277. _lastArgs = lastArgs;
  42278. lastArgs = null;
  42279. lastExceptionStack = null;
  42280. lastException = null;
  42281. notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
  42282. }
  42283. /**
  42284. * Reports an unhandled Error to TraceKit.
  42285. * @param {Error} ex
  42286. * @param {?boolean} rethrow If false, do not re-throw the exception.
  42287. * Only used for window.onerror to not cause an infinite loop of
  42288. * rethrowing.
  42289. */
  42290. function report(ex, rethrow) {
  42291. var args = _slice.call(arguments, 1);
  42292. if (lastExceptionStack) {
  42293. if (lastException === ex) {
  42294. return; // already caught by an inner catch block, ignore
  42295. } else {
  42296. processLastException();
  42297. }
  42298. }
  42299. var stack = TraceKit.computeStackTrace(ex);
  42300. lastExceptionStack = stack;
  42301. lastException = ex;
  42302. lastArgs = args;
  42303. // If the stack trace is incomplete, wait for 2 seconds for
  42304. // slow slow IE to see if onerror occurs or not before reporting
  42305. // this exception; otherwise, we will end up with an incomplete
  42306. // stack trace
  42307. setTimeout(
  42308. function() {
  42309. if (lastException === ex) {
  42310. processLastException();
  42311. }
  42312. },
  42313. stack.incomplete ? 2000 : 0
  42314. );
  42315. if (rethrow !== false) {
  42316. throw ex; // re-throw to propagate to the top level (and cause window.onerror)
  42317. }
  42318. }
  42319. report.subscribe = subscribe;
  42320. report.unsubscribe = unsubscribe;
  42321. report.uninstall = unsubscribeAll;
  42322. return report;
  42323. })();
  42324. /**
  42325. * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
  42326. *
  42327. * Syntax:
  42328. * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
  42329. * Returns:
  42330. * s.name - exception name
  42331. * s.message - exception message
  42332. * s.stack[i].url - JavaScript or HTML file URL
  42333. * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
  42334. * s.stack[i].args - arguments passed to the function, if known
  42335. * s.stack[i].line - line number, if known
  42336. * s.stack[i].column - column number, if known
  42337. *
  42338. * Supports:
  42339. * - Firefox: full stack trace with line numbers and unreliable column
  42340. * number on top frame
  42341. * - Opera 10: full stack trace with line and column numbers
  42342. * - Opera 9-: full stack trace with line numbers
  42343. * - Chrome: full stack trace with line and column numbers
  42344. * - Safari: line and column number for the topmost stacktrace element
  42345. * only
  42346. * - IE: no line numbers whatsoever
  42347. *
  42348. * Tries to guess names of anonymous functions by looking for assignments
  42349. * in the source code. In IE and Safari, we have to guess source file names
  42350. * by searching for function bodies inside all page scripts. This will not
  42351. * work for scripts that are loaded cross-domain.
  42352. * Here be dragons: some function names may be guessed incorrectly, and
  42353. * duplicate functions may be mismatched.
  42354. *
  42355. * TraceKit.computeStackTrace should only be used for tracing purposes.
  42356. * Logging of unhandled exceptions should be done with TraceKit.report,
  42357. * which builds on top of TraceKit.computeStackTrace and provides better
  42358. * IE support by utilizing the window.onerror event to retrieve information
  42359. * about the top of the stack.
  42360. *
  42361. * Note: In IE and Safari, no stack trace is recorded on the Error object,
  42362. * so computeStackTrace instead walks its *own* chain of callers.
  42363. * This means that:
  42364. * * in Safari, some methods may be missing from the stack trace;
  42365. * * in IE, the topmost function in the stack trace will always be the
  42366. * caller of computeStackTrace.
  42367. *
  42368. * This is okay for tracing (because you are likely to be calling
  42369. * computeStackTrace from the function you want to be the topmost element
  42370. * of the stack trace anyway), but not okay for logging unhandled
  42371. * exceptions (because your catch block will likely be far away from the
  42372. * inner function that actually caused the exception).
  42373. *
  42374. */
  42375. TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
  42376. // Contents of Exception in various browsers.
  42377. //
  42378. // SAFARI:
  42379. // ex.message = Can't find variable: qq
  42380. // ex.line = 59
  42381. // ex.sourceId = 580238192
  42382. // ex.sourceURL = http://...
  42383. // ex.expressionBeginOffset = 96
  42384. // ex.expressionCaretOffset = 98
  42385. // ex.expressionEndOffset = 98
  42386. // ex.name = ReferenceError
  42387. //
  42388. // FIREFOX:
  42389. // ex.message = qq is not defined
  42390. // ex.fileName = http://...
  42391. // ex.lineNumber = 59
  42392. // ex.columnNumber = 69
  42393. // ex.stack = ...stack trace... (see the example below)
  42394. // ex.name = ReferenceError
  42395. //
  42396. // CHROME:
  42397. // ex.message = qq is not defined
  42398. // ex.name = ReferenceError
  42399. // ex.type = not_defined
  42400. // ex.arguments = ['aa']
  42401. // ex.stack = ...stack trace...
  42402. //
  42403. // INTERNET EXPLORER:
  42404. // ex.message = ...
  42405. // ex.name = ReferenceError
  42406. //
  42407. // OPERA:
  42408. // ex.message = ...message... (see the example below)
  42409. // ex.name = ReferenceError
  42410. // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
  42411. // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
  42412. /**
  42413. * Computes stack trace information from the stack property.
  42414. * Chrome and Gecko use this property.
  42415. * @param {Error} ex
  42416. * @return {?Object.<string, *>} Stack trace information.
  42417. */
  42418. function computeStackTraceFromStackProp(ex) {
  42419. if (typeof ex.stack === 'undefined' || !ex.stack) return;
  42420. var chrome = /^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
  42421. var winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx(?:-web)|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
  42422. // NOTE: blob urls are now supposed to always have an origin, therefore it's format
  42423. // which is `blob:http://url/path/with-some-uuid`, is matched by `blob.*?:\/` as well
  42424. var gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i;
  42425. // Used to additionally parse URL/line/column from eval frames
  42426. var geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
  42427. var chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/;
  42428. var lines = ex.stack.split('\n');
  42429. var stack = [];
  42430. var submatch;
  42431. var parts;
  42432. var element;
  42433. var reference = /^(.*) is undefined$/.exec(ex.message);
  42434. for (var i = 0, j = lines.length; i < j; ++i) {
  42435. if ((parts = chrome.exec(lines[i]))) {
  42436. var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
  42437. var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
  42438. if (isEval && (submatch = chromeEval.exec(parts[2]))) {
  42439. // throw out eval line/column and use top-most line/column number
  42440. parts[2] = submatch[1]; // url
  42441. parts[3] = submatch[2]; // line
  42442. parts[4] = submatch[3]; // column
  42443. }
  42444. element = {
  42445. url: !isNative ? parts[2] : null,
  42446. func: parts[1] || UNKNOWN_FUNCTION,
  42447. args: isNative ? [parts[2]] : [],
  42448. line: parts[3] ? +parts[3] : null,
  42449. column: parts[4] ? +parts[4] : null
  42450. };
  42451. } else if ((parts = winjs.exec(lines[i]))) {
  42452. element = {
  42453. url: parts[2],
  42454. func: parts[1] || UNKNOWN_FUNCTION,
  42455. args: [],
  42456. line: +parts[3],
  42457. column: parts[4] ? +parts[4] : null
  42458. };
  42459. } else if ((parts = gecko.exec(lines[i]))) {
  42460. var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
  42461. if (isEval && (submatch = geckoEval.exec(parts[3]))) {
  42462. // throw out eval line/column and use top-most line number
  42463. parts[3] = submatch[1];
  42464. parts[4] = submatch[2];
  42465. parts[5] = null; // no column when eval
  42466. } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
  42467. // FireFox uses this awesome columnNumber property for its top frame
  42468. // Also note, Firefox's column number is 0-based and everything else expects 1-based,
  42469. // so adding 1
  42470. // NOTE: this hack doesn't work if top-most frame is eval
  42471. stack[0].column = ex.columnNumber + 1;
  42472. }
  42473. element = {
  42474. url: parts[3],
  42475. func: parts[1] || UNKNOWN_FUNCTION,
  42476. args: parts[2] ? parts[2].split(',') : [],
  42477. line: parts[4] ? +parts[4] : null,
  42478. column: parts[5] ? +parts[5] : null
  42479. };
  42480. } else {
  42481. continue;
  42482. }
  42483. if (!element.func && element.line) {
  42484. element.func = UNKNOWN_FUNCTION;
  42485. }
  42486. if (element.url && element.url.substr(0, 5) === 'blob:') {
  42487. // Special case for handling JavaScript loaded into a blob.
  42488. // We use a synchronous AJAX request here as a blob is already in
  42489. // memory - it's not making a network request. This will generate a warning
  42490. // in the browser console, but there has already been an error so that's not
  42491. // that much of an issue.
  42492. var xhr = new XMLHttpRequest();
  42493. xhr.open('GET', element.url, false);
  42494. xhr.send(null);
  42495. // If we failed to download the source, skip this patch
  42496. if (xhr.status === 200) {
  42497. var source = xhr.responseText || '';
  42498. // We trim the source down to the last 300 characters as sourceMappingURL is always at the end of the file.
  42499. // Why 300? To be in line with: https://github.com/getsentry/sentry/blob/4af29e8f2350e20c28a6933354e4f42437b4ba42/src/sentry/lang/javascript/processor.py#L164-L175
  42500. source = source.slice(-300);
  42501. // Now we dig out the source map URL
  42502. var sourceMaps = source.match(/\/\/# sourceMappingURL=(.*)$/);
  42503. // If we don't find a source map comment or we find more than one, continue on to the next element.
  42504. if (sourceMaps) {
  42505. var sourceMapAddress = sourceMaps[1];
  42506. // Now we check to see if it's a relative URL.
  42507. // If it is, convert it to an absolute one.
  42508. if (sourceMapAddress.charAt(0) === '~') {
  42509. sourceMapAddress = getLocationOrigin() + sourceMapAddress.slice(1);
  42510. }
  42511. // Now we strip the '.map' off of the end of the URL and update the
  42512. // element so that Sentry can match the map to the blob.
  42513. element.url = sourceMapAddress.slice(0, -4);
  42514. }
  42515. }
  42516. }
  42517. stack.push(element);
  42518. }
  42519. if (!stack.length) {
  42520. return null;
  42521. }
  42522. return {
  42523. name: ex.name,
  42524. message: ex.message,
  42525. url: getLocationHref(),
  42526. stack: stack
  42527. };
  42528. }
  42529. /**
  42530. * Adds information about the first frame to incomplete stack traces.
  42531. * Safari and IE require this to get complete data on the first frame.
  42532. * @param {Object.<string, *>} stackInfo Stack trace information from
  42533. * one of the compute* methods.
  42534. * @param {string} url The URL of the script that caused an error.
  42535. * @param {(number|string)} lineNo The line number of the script that
  42536. * caused an error.
  42537. * @param {string=} message The error generated by the browser, which
  42538. * hopefully contains the name of the object that caused the error.
  42539. * @return {boolean} Whether or not the stack information was
  42540. * augmented.
  42541. */
  42542. function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
  42543. var initial = {
  42544. url: url,
  42545. line: lineNo
  42546. };
  42547. if (initial.url && initial.line) {
  42548. stackInfo.incomplete = false;
  42549. if (!initial.func) {
  42550. initial.func = UNKNOWN_FUNCTION;
  42551. }
  42552. if (stackInfo.stack.length > 0) {
  42553. if (stackInfo.stack[0].url === initial.url) {
  42554. if (stackInfo.stack[0].line === initial.line) {
  42555. return false; // already in stack trace
  42556. } else if (
  42557. !stackInfo.stack[0].line &&
  42558. stackInfo.stack[0].func === initial.func
  42559. ) {
  42560. stackInfo.stack[0].line = initial.line;
  42561. return false;
  42562. }
  42563. }
  42564. }
  42565. stackInfo.stack.unshift(initial);
  42566. stackInfo.partial = true;
  42567. return true;
  42568. } else {
  42569. stackInfo.incomplete = true;
  42570. }
  42571. return false;
  42572. }
  42573. /**
  42574. * Computes stack trace information by walking the arguments.caller
  42575. * chain at the time the exception occurred. This will cause earlier
  42576. * frames to be missed but is the only way to get any stack trace in
  42577. * Safari and IE. The top frame is restored by
  42578. * {@link augmentStackTraceWithInitialElement}.
  42579. * @param {Error} ex
  42580. * @return {?Object.<string, *>} Stack trace information.
  42581. */
  42582. function computeStackTraceByWalkingCallerChain(ex, depth) {
  42583. var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
  42584. stack = [],
  42585. funcs = {},
  42586. recursion = false,
  42587. parts,
  42588. item,
  42589. source;
  42590. for (
  42591. var curr = computeStackTraceByWalkingCallerChain.caller;
  42592. curr && !recursion;
  42593. curr = curr.caller
  42594. ) {
  42595. if (curr === computeStackTrace || curr === TraceKit.report) {
  42596. // console.log('skipping internal function');
  42597. continue;
  42598. }
  42599. item = {
  42600. url: null,
  42601. func: UNKNOWN_FUNCTION,
  42602. line: null,
  42603. column: null
  42604. };
  42605. if (curr.name) {
  42606. item.func = curr.name;
  42607. } else if ((parts = functionName.exec(curr.toString()))) {
  42608. item.func = parts[1];
  42609. }
  42610. if (typeof item.func === 'undefined') {
  42611. try {
  42612. item.func = parts.input.substring(0, parts.input.indexOf('{'));
  42613. } catch (e) {}
  42614. }
  42615. if (funcs['' + curr]) {
  42616. recursion = true;
  42617. } else {
  42618. funcs['' + curr] = true;
  42619. }
  42620. stack.push(item);
  42621. }
  42622. if (depth) {
  42623. // console.log('depth is ' + depth);
  42624. // console.log('stack is ' + stack.length);
  42625. stack.splice(0, depth);
  42626. }
  42627. var result = {
  42628. name: ex.name,
  42629. message: ex.message,
  42630. url: getLocationHref(),
  42631. stack: stack
  42632. };
  42633. augmentStackTraceWithInitialElement(
  42634. result,
  42635. ex.sourceURL || ex.fileName,
  42636. ex.line || ex.lineNumber,
  42637. ex.message || ex.description
  42638. );
  42639. return result;
  42640. }
  42641. /**
  42642. * Computes a stack trace for an exception.
  42643. * @param {Error} ex
  42644. * @param {(string|number)=} depth
  42645. */
  42646. function computeStackTrace(ex, depth) {
  42647. var stack = null;
  42648. depth = depth == null ? 0 : +depth;
  42649. try {
  42650. stack = computeStackTraceFromStackProp(ex);
  42651. if (stack) {
  42652. return stack;
  42653. }
  42654. } catch (e) {
  42655. if (TraceKit.debug) {
  42656. throw e;
  42657. }
  42658. }
  42659. try {
  42660. stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
  42661. if (stack) {
  42662. return stack;
  42663. }
  42664. } catch (e) {
  42665. if (TraceKit.debug) {
  42666. throw e;
  42667. }
  42668. }
  42669. return {
  42670. name: ex.name,
  42671. message: ex.message,
  42672. url: getLocationHref()
  42673. };
  42674. }
  42675. computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
  42676. computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
  42677. return computeStackTrace;
  42678. })();
  42679. module.exports = TraceKit;
  42680. /***/ }),
  42681. /* 521 */
  42682. /***/ (function(module, exports) {
  42683. /*
  42684. * JavaScript MD5
  42685. * https://github.com/blueimp/JavaScript-MD5
  42686. *
  42687. * Copyright 2011, Sebastian Tschan
  42688. * https://blueimp.net
  42689. *
  42690. * Licensed under the MIT license:
  42691. * https://opensource.org/licenses/MIT
  42692. *
  42693. * Based on
  42694. * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
  42695. * Digest Algorithm, as defined in RFC 1321.
  42696. * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
  42697. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  42698. * Distributed under the BSD License
  42699. * See http://pajhome.org.uk/crypt/md5 for more info.
  42700. */
  42701. /*
  42702. * Add integers, wrapping at 2^32. This uses 16-bit operations internally
  42703. * to work around bugs in some JS interpreters.
  42704. */
  42705. function safeAdd(x, y) {
  42706. var lsw = (x & 0xffff) + (y & 0xffff);
  42707. var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  42708. return (msw << 16) | (lsw & 0xffff);
  42709. }
  42710. /*
  42711. * Bitwise rotate a 32-bit number to the left.
  42712. */
  42713. function bitRotateLeft(num, cnt) {
  42714. return (num << cnt) | (num >>> (32 - cnt));
  42715. }
  42716. /*
  42717. * These functions implement the four basic operations the algorithm uses.
  42718. */
  42719. function md5cmn(q, a, b, x, s, t) {
  42720. return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
  42721. }
  42722. function md5ff(a, b, c, d, x, s, t) {
  42723. return md5cmn((b & c) | (~b & d), a, b, x, s, t);
  42724. }
  42725. function md5gg(a, b, c, d, x, s, t) {
  42726. return md5cmn((b & d) | (c & ~d), a, b, x, s, t);
  42727. }
  42728. function md5hh(a, b, c, d, x, s, t) {
  42729. return md5cmn(b ^ c ^ d, a, b, x, s, t);
  42730. }
  42731. function md5ii(a, b, c, d, x, s, t) {
  42732. return md5cmn(c ^ (b | ~d), a, b, x, s, t);
  42733. }
  42734. /*
  42735. * Calculate the MD5 of an array of little-endian words, and a bit length.
  42736. */
  42737. function binlMD5(x, len) {
  42738. /* append padding */
  42739. x[len >> 5] |= 0x80 << (len % 32);
  42740. x[(((len + 64) >>> 9) << 4) + 14] = len;
  42741. var i;
  42742. var olda;
  42743. var oldb;
  42744. var oldc;
  42745. var oldd;
  42746. var a = 1732584193;
  42747. var b = -271733879;
  42748. var c = -1732584194;
  42749. var d = 271733878;
  42750. for (i = 0; i < x.length; i += 16) {
  42751. olda = a;
  42752. oldb = b;
  42753. oldc = c;
  42754. oldd = d;
  42755. a = md5ff(a, b, c, d, x[i], 7, -680876936);
  42756. d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
  42757. c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
  42758. b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
  42759. a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
  42760. d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
  42761. c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
  42762. b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
  42763. a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
  42764. d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
  42765. c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
  42766. b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
  42767. a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
  42768. d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
  42769. c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
  42770. b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
  42771. a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
  42772. d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
  42773. c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
  42774. b = md5gg(b, c, d, a, x[i], 20, -373897302);
  42775. a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
  42776. d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
  42777. c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
  42778. b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
  42779. a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
  42780. d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
  42781. c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
  42782. b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
  42783. a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
  42784. d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
  42785. c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
  42786. b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
  42787. a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
  42788. d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
  42789. c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
  42790. b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
  42791. a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
  42792. d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
  42793. c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
  42794. b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
  42795. a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
  42796. d = md5hh(d, a, b, c, x[i], 11, -358537222);
  42797. c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
  42798. b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
  42799. a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
  42800. d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
  42801. c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
  42802. b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
  42803. a = md5ii(a, b, c, d, x[i], 6, -198630844);
  42804. d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
  42805. c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
  42806. b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
  42807. a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
  42808. d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
  42809. c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
  42810. b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
  42811. a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
  42812. d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
  42813. c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
  42814. b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
  42815. a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
  42816. d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
  42817. c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
  42818. b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
  42819. a = safeAdd(a, olda);
  42820. b = safeAdd(b, oldb);
  42821. c = safeAdd(c, oldc);
  42822. d = safeAdd(d, oldd);
  42823. }
  42824. return [a, b, c, d];
  42825. }
  42826. /*
  42827. * Convert an array of little-endian words to a string
  42828. */
  42829. function binl2rstr(input) {
  42830. var i;
  42831. var output = '';
  42832. var length32 = input.length * 32;
  42833. for (i = 0; i < length32; i += 8) {
  42834. output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff);
  42835. }
  42836. return output;
  42837. }
  42838. /*
  42839. * Convert a raw string to an array of little-endian words
  42840. * Characters >255 have their high-byte silently ignored.
  42841. */
  42842. function rstr2binl(input) {
  42843. var i;
  42844. var output = [];
  42845. output[(input.length >> 2) - 1] = undefined;
  42846. for (i = 0; i < output.length; i += 1) {
  42847. output[i] = 0;
  42848. }
  42849. var length8 = input.length * 8;
  42850. for (i = 0; i < length8; i += 8) {
  42851. output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32);
  42852. }
  42853. return output;
  42854. }
  42855. /*
  42856. * Calculate the MD5 of a raw string
  42857. */
  42858. function rstrMD5(s) {
  42859. return binl2rstr(binlMD5(rstr2binl(s), s.length * 8));
  42860. }
  42861. /*
  42862. * Calculate the HMAC-MD5, of a key and some data (raw strings)
  42863. */
  42864. function rstrHMACMD5(key, data) {
  42865. var i;
  42866. var bkey = rstr2binl(key);
  42867. var ipad = [];
  42868. var opad = [];
  42869. var hash;
  42870. ipad[15] = opad[15] = undefined;
  42871. if (bkey.length > 16) {
  42872. bkey = binlMD5(bkey, key.length * 8);
  42873. }
  42874. for (i = 0; i < 16; i += 1) {
  42875. ipad[i] = bkey[i] ^ 0x36363636;
  42876. opad[i] = bkey[i] ^ 0x5c5c5c5c;
  42877. }
  42878. hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
  42879. return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));
  42880. }
  42881. /*
  42882. * Convert a raw string to a hex string
  42883. */
  42884. function rstr2hex(input) {
  42885. var hexTab = '0123456789abcdef';
  42886. var output = '';
  42887. var x;
  42888. var i;
  42889. for (i = 0; i < input.length; i += 1) {
  42890. x = input.charCodeAt(i);
  42891. output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f);
  42892. }
  42893. return output;
  42894. }
  42895. /*
  42896. * Encode a string as utf-8
  42897. */
  42898. function str2rstrUTF8(input) {
  42899. return unescape(encodeURIComponent(input));
  42900. }
  42901. /*
  42902. * Take string arguments and return either raw or hex encoded strings
  42903. */
  42904. function rawMD5(s) {
  42905. return rstrMD5(str2rstrUTF8(s));
  42906. }
  42907. function hexMD5(s) {
  42908. return rstr2hex(rawMD5(s));
  42909. }
  42910. function rawHMACMD5(k, d) {
  42911. return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d));
  42912. }
  42913. function hexHMACMD5(k, d) {
  42914. return rstr2hex(rawHMACMD5(k, d));
  42915. }
  42916. function md5(string, key, raw) {
  42917. if (!key) {
  42918. if (!raw) {
  42919. return hexMD5(string);
  42920. }
  42921. return rawMD5(string);
  42922. }
  42923. if (!raw) {
  42924. return hexHMACMD5(key, string);
  42925. }
  42926. return rawHMACMD5(key, string);
  42927. }
  42928. module.exports = md5;
  42929. /***/ }),
  42930. /* 522 */
  42931. /***/ (function(module, exports) {
  42932. function RavenConfigError(message) {
  42933. this.name = 'RavenConfigError';
  42934. this.message = message;
  42935. }
  42936. RavenConfigError.prototype = new Error();
  42937. RavenConfigError.prototype.constructor = RavenConfigError;
  42938. module.exports = RavenConfigError;
  42939. /***/ }),
  42940. /* 523 */
  42941. /***/ (function(module, exports, __webpack_require__) {
  42942. var utils = __webpack_require__(134);
  42943. var wrapMethod = function(console, level, callback) {
  42944. var originalConsoleLevel = console[level];
  42945. var originalConsole = console;
  42946. if (!(level in console)) {
  42947. return;
  42948. }
  42949. var sentryLevel = level === 'warn' ? 'warning' : level;
  42950. console[level] = function() {
  42951. var args = [].slice.call(arguments);
  42952. var msg = utils.safeJoin(args, ' ');
  42953. var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
  42954. if (level === 'assert') {
  42955. if (args[0] === false) {
  42956. // Default browsers message
  42957. msg =
  42958. 'Assertion failed: ' + (utils.safeJoin(args.slice(1), ' ') || 'console.assert');
  42959. data.extra.arguments = args.slice(1);
  42960. callback && callback(msg, data);
  42961. }
  42962. } else {
  42963. callback && callback(msg, data);
  42964. }
  42965. // this fails for some browsers. :(
  42966. if (originalConsoleLevel) {
  42967. // IE9 doesn't allow calling apply on console functions directly
  42968. // See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
  42969. Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
  42970. }
  42971. };
  42972. };
  42973. module.exports = {
  42974. wrapMethod: wrapMethod
  42975. };
  42976. /***/ }),
  42977. /* 524 */
  42978. /***/ (function(module, exports, __webpack_require__) {
  42979. var SetCache = __webpack_require__(88),
  42980. arrayIncludes = __webpack_require__(86),
  42981. arrayIncludesWith = __webpack_require__(136),
  42982. arrayMap = __webpack_require__(30),
  42983. baseUnary = __webpack_require__(64),
  42984. cacheHas = __webpack_require__(89);
  42985. /* Built-in method references for those with the same name as other `lodash` methods. */
  42986. var nativeMin = Math.min;
  42987. /**
  42988. * The base implementation of methods like `_.intersection`, without support
  42989. * for iteratee shorthands, that accepts an array of arrays to inspect.
  42990. *
  42991. * @private
  42992. * @param {Array} arrays The arrays to inspect.
  42993. * @param {Function} [iteratee] The iteratee invoked per element.
  42994. * @param {Function} [comparator] The comparator invoked per element.
  42995. * @returns {Array} Returns the new array of shared values.
  42996. */
  42997. function baseIntersection(arrays, iteratee, comparator) {
  42998. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  42999. length = arrays[0].length,
  43000. othLength = arrays.length,
  43001. othIndex = othLength,
  43002. caches = Array(othLength),
  43003. maxLength = Infinity,
  43004. result = [];
  43005. while (othIndex--) {
  43006. var array = arrays[othIndex];
  43007. if (othIndex && iteratee) {
  43008. array = arrayMap(array, baseUnary(iteratee));
  43009. }
  43010. maxLength = nativeMin(array.length, maxLength);
  43011. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  43012. ? new SetCache(othIndex && array)
  43013. : undefined;
  43014. }
  43015. array = arrays[0];
  43016. var index = -1,
  43017. seen = caches[0];
  43018. outer:
  43019. while (++index < length && result.length < maxLength) {
  43020. var value = array[index],
  43021. computed = iteratee ? iteratee(value) : value;
  43022. value = (comparator || value !== 0) ? value : 0;
  43023. if (!(seen
  43024. ? cacheHas(seen, computed)
  43025. : includes(result, computed, comparator)
  43026. )) {
  43027. othIndex = othLength;
  43028. while (--othIndex) {
  43029. var cache = caches[othIndex];
  43030. if (!(cache
  43031. ? cacheHas(cache, computed)
  43032. : includes(arrays[othIndex], computed, comparator))
  43033. ) {
  43034. continue outer;
  43035. }
  43036. }
  43037. if (seen) {
  43038. seen.push(computed);
  43039. }
  43040. result.push(value);
  43041. }
  43042. }
  43043. return result;
  43044. }
  43045. module.exports = baseIntersection;
  43046. /***/ }),
  43047. /* 525 */
  43048. /***/ (function(module, exports, __webpack_require__) {
  43049. var isArrayLikeObject = __webpack_require__(137);
  43050. /**
  43051. * Casts `value` to an empty array if it's not an array like object.
  43052. *
  43053. * @private
  43054. * @param {*} value The value to inspect.
  43055. * @returns {Array|Object} Returns the cast array-like object.
  43056. */
  43057. function castArrayLikeObject(value) {
  43058. return isArrayLikeObject(value) ? value : [];
  43059. }
  43060. module.exports = castArrayLikeObject;
  43061. /***/ }),
  43062. /* 526 */
  43063. /***/ (function(module, exports, __webpack_require__) {
  43064. "use strict";
  43065. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  43066. /* eslint-disable one-var, no-underscore-dangle, no-use-before-define, no-param-reassign */
  43067. /* eslint-disable max-len, no-var, vars-on-top, global-require */
  43068. const blacklistedStats = __webpack_require__(527);
  43069. module.exports = function (deps) {
  43070. if (deps === void 0) {
  43071. deps = {};
  43072. }
  43073. const isSessionProxied = deps.isSessionProxied || __webpack_require__(528);
  43074. const _deps = deps,
  43075. sessionId = _deps.sessionId;
  43076. if (!isSessionProxied(sessionId)) {
  43077. return;
  43078. }
  43079. blacklistedStats.forEach(stat => {
  43080. if (stat in deps) {
  43081. deps[stat] = '';
  43082. }
  43083. });
  43084. };
  43085. /***/ }),
  43086. /* 527 */
  43087. /***/ (function(module, exports, __webpack_require__) {
  43088. "use strict";
  43089. // List of QoS to be filtered from payload if IP Proxy is enabled
  43090. module.exports = ['audioLocalAddress', 'audioRemoteAddress', 'videoLocalAddress', 'videoRemoteAddress'];
  43091. /***/ }),
  43092. /* 528 */
  43093. /***/ (function(module, exports, __webpack_require__) {
  43094. "use strict";
  43095. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  43096. /* eslint-disable one-var, no-underscore-dangle, no-use-before-define, no-param-reassign */
  43097. /* eslint-disable max-len, no-var, vars-on-top, global-require */
  43098. const sessionObjects = __webpack_require__(22);
  43099. const sessions = sessionObjects.sessions;
  43100. module.exports = sessionId => {
  43101. const session = sessions.get(sessionId);
  43102. return session ? !!session._.getProxyUrl() : false;
  43103. };
  43104. /***/ }),
  43105. /* 529 */
  43106. /***/ (function(module, exports, __webpack_require__) {
  43107. "use strict";
  43108. const runtimeProperties = ['buildHash', 'minimumVersion', 'debug', ['websiteURL', 'websiteUrl'], ['cdnURL', 'cdnUrl'], ['loggingURL', 'loggingUrl'], ['apiURL', 'apiUrl'], ['supportSSL', true], ['cdnURLSSL', 'cdnUrl'], ['loggingURLSSL', 'loggingUrl'], ['apiURLSSL', 'apiUrl'], 'enableErrorReporting', ['assetURL', 'assetUrl']];
  43109. module.exports = runtimeProperties;
  43110. /***/ }),
  43111. /* 530 */
  43112. /***/ (function(module, exports, __webpack_require__) {
  43113. "use strict";
  43114. const mutableRuntimeProperties = ['apiUrl', 'apiURL', 'apiURLSSL'];
  43115. module.exports = mutableRuntimeProperties;
  43116. /***/ }),
  43117. /* 531 */
  43118. /***/ (function(module, exports, __webpack_require__) {
  43119. "use strict";
  43120. module.exports = function noConflict() {
  43121. const globalOT = (typeof window !== undefined ? window : global).OT;
  43122. const globalTB = (typeof window !== undefined ? window : global).TB;
  43123. return () => {
  43124. const OT = (typeof window !== undefined ? window : global).OT;
  43125. (typeof window !== undefined ? window : global).OT = globalOT;
  43126. (typeof window !== undefined ? window : global).TB = globalTB;
  43127. return OT;
  43128. };
  43129. };
  43130. /***/ }),
  43131. /* 532 */
  43132. /***/ (function(module, exports, __webpack_require__) {
  43133. "use strict";
  43134. // We can't use ES6 classes with babel because babel invokes the super
  43135. // constructor without the new keyword. This triggers an error when used
  43136. // with RTCPeerConnection and other native classes.
  43137. const getOwnProperties = target => {
  43138. const properties = {};
  43139. Object.getOwnPropertyNames(target).forEach(key => {
  43140. properties[key] = Object.getOwnPropertyDescriptor(target, key);
  43141. });
  43142. return properties;
  43143. };
  43144. module.exports = function extendES5Native(ParentClass) {
  43145. function ChildClass() {
  43146. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  43147. args[_key] = arguments[_key];
  43148. }
  43149. const instance = new ParentClass(...args);
  43150. Object.setPrototypeOf(instance, ChildClass.prototype);
  43151. return instance;
  43152. }
  43153. ChildClass.prototype = Object.create(ParentClass.prototype);
  43154. Object.defineProperties(ChildClass.prototype, getOwnProperties(ParentClass.prototype));
  43155. Object.keys(ParentClass).forEach(staticKey => {
  43156. ChildClass[staticKey] = ParentClass[staticKey];
  43157. });
  43158. return ChildClass;
  43159. };
  43160. /***/ }),
  43161. /* 533 */
  43162. /***/ (function(module, exports, __webpack_require__) {
  43163. "use strict";
  43164. /*
  43165. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  43166. *
  43167. * Use of this source code is governed by a BSD-style license
  43168. * that can be found in the LICENSE file in the root of the source
  43169. * tree.
  43170. */
  43171. /* eslint-env node */
  43172. var utils = __webpack_require__(25);
  43173. // Shimming starts here.
  43174. module.exports = function(dependencies, opts) {
  43175. var window = dependencies && dependencies.window;
  43176. var options = {
  43177. shimChrome: true,
  43178. shimFirefox: true,
  43179. shimEdge: true,
  43180. shimSafari: true,
  43181. };
  43182. for (var key in opts) {
  43183. if (hasOwnProperty.call(opts, key)) {
  43184. options[key] = opts[key];
  43185. }
  43186. }
  43187. // Utils.
  43188. var logging = utils.log;
  43189. var browserDetails = utils.detectBrowser(window);
  43190. // Uncomment the line below if you want logging to occur, including logging
  43191. // for the switch statement below. Can also be turned on in the browser via
  43192. // adapter.disableLog(false), but then logging from the switch statement below
  43193. // will not appear.
  43194. // require('./utils').disableLog(false);
  43195. // Browser shims.
  43196. var chromeShim = __webpack_require__(534) || null;
  43197. var edgeShim = __webpack_require__(536) || null;
  43198. var firefoxShim = __webpack_require__(540) || null;
  43199. var safariShim = __webpack_require__(542) || null;
  43200. var commonShim = __webpack_require__(543) || null;
  43201. // Export to the adapter global object visible in the browser.
  43202. var adapter = {
  43203. browserDetails: browserDetails,
  43204. commonShim: commonShim,
  43205. extractVersion: utils.extractVersion,
  43206. disableLog: utils.disableLog,
  43207. disableWarnings: utils.disableWarnings
  43208. };
  43209. // Shim browser if found.
  43210. switch (browserDetails.browser) {
  43211. case 'chrome':
  43212. if (!chromeShim || !chromeShim.shimPeerConnection ||
  43213. !options.shimChrome) {
  43214. logging('Chrome shim is not included in this adapter release.');
  43215. return adapter;
  43216. }
  43217. logging('adapter.js shimming chrome.');
  43218. // Export to the adapter global object visible in the browser.
  43219. adapter.browserShim = chromeShim;
  43220. commonShim.shimCreateObjectURL(window);
  43221. chromeShim.shimGetUserMedia(window);
  43222. chromeShim.shimMediaStream(window);
  43223. chromeShim.shimSourceObject(window);
  43224. chromeShim.shimPeerConnection(window);
  43225. chromeShim.shimOnTrack(window);
  43226. chromeShim.shimAddTrackRemoveTrack(window);
  43227. chromeShim.shimGetSendersWithDtmf(window);
  43228. chromeShim.shimSenderReceiverGetStats(window);
  43229. chromeShim.fixNegotiationNeeded(window);
  43230. commonShim.shimRTCIceCandidate(window);
  43231. commonShim.shimMaxMessageSize(window);
  43232. commonShim.shimSendThrowTypeError(window);
  43233. break;
  43234. case 'firefox':
  43235. if (!firefoxShim || !firefoxShim.shimPeerConnection ||
  43236. !options.shimFirefox) {
  43237. logging('Firefox shim is not included in this adapter release.');
  43238. return adapter;
  43239. }
  43240. logging('adapter.js shimming firefox.');
  43241. // Export to the adapter global object visible in the browser.
  43242. adapter.browserShim = firefoxShim;
  43243. commonShim.shimCreateObjectURL(window);
  43244. firefoxShim.shimGetUserMedia(window);
  43245. firefoxShim.shimSourceObject(window);
  43246. firefoxShim.shimPeerConnection(window);
  43247. firefoxShim.shimOnTrack(window);
  43248. firefoxShim.shimRemoveStream(window);
  43249. firefoxShim.shimSenderGetStats(window);
  43250. firefoxShim.shimReceiverGetStats(window);
  43251. firefoxShim.shimRTCDataChannel(window);
  43252. commonShim.shimRTCIceCandidate(window);
  43253. commonShim.shimMaxMessageSize(window);
  43254. commonShim.shimSendThrowTypeError(window);
  43255. break;
  43256. case 'edge':
  43257. if (!edgeShim || !edgeShim.shimPeerConnection || !options.shimEdge) {
  43258. logging('MS edge shim is not included in this adapter release.');
  43259. return adapter;
  43260. }
  43261. logging('adapter.js shimming edge.');
  43262. // Export to the adapter global object visible in the browser.
  43263. adapter.browserShim = edgeShim;
  43264. commonShim.shimCreateObjectURL(window);
  43265. edgeShim.shimGetUserMedia(window);
  43266. edgeShim.shimPeerConnection(window);
  43267. edgeShim.shimReplaceTrack(window);
  43268. edgeShim.shimGetDisplayMedia(window);
  43269. // the edge shim implements the full RTCIceCandidate object.
  43270. commonShim.shimMaxMessageSize(window);
  43271. commonShim.shimSendThrowTypeError(window);
  43272. break;
  43273. case 'safari':
  43274. if (!safariShim || !options.shimSafari) {
  43275. logging('Safari shim is not included in this adapter release.');
  43276. return adapter;
  43277. }
  43278. logging('adapter.js shimming safari.');
  43279. // Export to the adapter global object visible in the browser.
  43280. adapter.browserShim = safariShim;
  43281. commonShim.shimCreateObjectURL(window);
  43282. safariShim.shimRTCIceServerUrls(window);
  43283. safariShim.shimCreateOfferLegacy(window);
  43284. safariShim.shimCallbacksAPI(window);
  43285. safariShim.shimLocalStreamsAPI(window);
  43286. safariShim.shimRemoteStreamsAPI(window);
  43287. safariShim.shimTrackEventTransceiver(window);
  43288. safariShim.shimGetUserMedia(window);
  43289. commonShim.shimRTCIceCandidate(window);
  43290. commonShim.shimMaxMessageSize(window);
  43291. commonShim.shimSendThrowTypeError(window);
  43292. break;
  43293. default:
  43294. logging('Unsupported browser!');
  43295. break;
  43296. }
  43297. return adapter;
  43298. };
  43299. /***/ }),
  43300. /* 534 */
  43301. /***/ (function(module, exports, __webpack_require__) {
  43302. "use strict";
  43303. /* WEBPACK VAR INJECTION */(function(Promise) {
  43304. /*
  43305. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  43306. *
  43307. * Use of this source code is governed by a BSD-style license
  43308. * that can be found in the LICENSE file in the root of the source
  43309. * tree.
  43310. */
  43311. /* eslint-env node */
  43312. var utils = __webpack_require__(25);
  43313. var logging = utils.log;
  43314. /* iterates the stats graph recursively. */
  43315. function walkStats(stats, base, resultSet) {
  43316. if (!base || resultSet.has(base.id)) {
  43317. return;
  43318. }
  43319. resultSet.set(base.id, base);
  43320. Object.keys(base).forEach(function(name) {
  43321. if (name.endsWith('Id')) {
  43322. walkStats(stats, stats.get(base[name]), resultSet);
  43323. } else if (name.endsWith('Ids')) {
  43324. base[name].forEach(function(id) {
  43325. walkStats(stats, stats.get(id), resultSet);
  43326. });
  43327. }
  43328. });
  43329. }
  43330. /* filter getStats for a sender/receiver track. */
  43331. function filterStats(result, track, outbound) {
  43332. var streamStatsType = outbound ? 'outbound-rtp' : 'inbound-rtp';
  43333. var filteredResult = new Map();
  43334. if (track === null) {
  43335. return filteredResult;
  43336. }
  43337. var trackStats = [];
  43338. result.forEach(function(value) {
  43339. if (value.type === 'track' &&
  43340. value.trackIdentifier === track.id) {
  43341. trackStats.push(value);
  43342. }
  43343. });
  43344. trackStats.forEach(function(trackStat) {
  43345. result.forEach(function(stats) {
  43346. if (stats.type === streamStatsType && stats.trackId === trackStat.id) {
  43347. walkStats(result, stats, filteredResult);
  43348. }
  43349. });
  43350. });
  43351. return filteredResult;
  43352. }
  43353. module.exports = {
  43354. shimGetUserMedia: __webpack_require__(535),
  43355. shimMediaStream: function(window) {
  43356. window.MediaStream = window.MediaStream || window.webkitMediaStream;
  43357. },
  43358. shimOnTrack: function(window) {
  43359. if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in
  43360. window.RTCPeerConnection.prototype)) {
  43361. Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {
  43362. get: function() {
  43363. return this._ontrack;
  43364. },
  43365. set: function(f) {
  43366. if (this._ontrack) {
  43367. this.removeEventListener('track', this._ontrack);
  43368. }
  43369. this.addEventListener('track', this._ontrack = f);
  43370. },
  43371. enumerable: true,
  43372. configurable: true
  43373. });
  43374. var origSetRemoteDescription =
  43375. window.RTCPeerConnection.prototype.setRemoteDescription;
  43376. window.RTCPeerConnection.prototype.setRemoteDescription = function() {
  43377. var pc = this;
  43378. if (!pc._ontrackpoly) {
  43379. pc._ontrackpoly = function(e) {
  43380. // onaddstream does not fire when a track is added to an existing
  43381. // stream. But stream.onaddtrack is implemented so we use that.
  43382. e.stream.addEventListener('addtrack', function(te) {
  43383. var receiver;
  43384. if (window.RTCPeerConnection.prototype.getReceivers) {
  43385. receiver = pc.getReceivers().find(function(r) {
  43386. return r.track && r.track.id === te.track.id;
  43387. });
  43388. } else {
  43389. receiver = {track: te.track};
  43390. }
  43391. var event = new Event('track');
  43392. event.track = te.track;
  43393. event.receiver = receiver;
  43394. event.transceiver = {receiver: receiver};
  43395. event.streams = [e.stream];
  43396. pc.dispatchEvent(event);
  43397. });
  43398. e.stream.getTracks().forEach(function(track) {
  43399. var receiver;
  43400. if (window.RTCPeerConnection.prototype.getReceivers) {
  43401. receiver = pc.getReceivers().find(function(r) {
  43402. return r.track && r.track.id === track.id;
  43403. });
  43404. } else {
  43405. receiver = {track: track};
  43406. }
  43407. var event = new Event('track');
  43408. event.track = track;
  43409. event.receiver = receiver;
  43410. event.transceiver = {receiver: receiver};
  43411. event.streams = [e.stream];
  43412. pc.dispatchEvent(event);
  43413. });
  43414. };
  43415. pc.addEventListener('addstream', pc._ontrackpoly);
  43416. }
  43417. return origSetRemoteDescription.apply(pc, arguments);
  43418. };
  43419. } else {
  43420. // even if RTCRtpTransceiver is in window, it is only used and
  43421. // emitted in unified-plan. Unfortunately this means we need
  43422. // to unconditionally wrap the event.
  43423. utils.wrapPeerConnectionEvent(window, 'track', function(e) {
  43424. if (!e.transceiver) {
  43425. Object.defineProperty(e, 'transceiver',
  43426. {value: {receiver: e.receiver}});
  43427. }
  43428. return e;
  43429. });
  43430. }
  43431. },
  43432. shimGetSendersWithDtmf: function(window) {
  43433. // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack.
  43434. if (typeof window === 'object' && window.RTCPeerConnection &&
  43435. !('getSenders' in window.RTCPeerConnection.prototype) &&
  43436. 'createDTMFSender' in window.RTCPeerConnection.prototype) {
  43437. var shimSenderWithDtmf = function(pc, track) {
  43438. return {
  43439. track: track,
  43440. get dtmf() {
  43441. if (this._dtmf === undefined) {
  43442. if (track.kind === 'audio') {
  43443. this._dtmf = pc.createDTMFSender(track);
  43444. } else {
  43445. this._dtmf = null;
  43446. }
  43447. }
  43448. return this._dtmf;
  43449. },
  43450. _pc: pc
  43451. };
  43452. };
  43453. // augment addTrack when getSenders is not available.
  43454. if (!window.RTCPeerConnection.prototype.getSenders) {
  43455. window.RTCPeerConnection.prototype.getSenders = function() {
  43456. this._senders = this._senders || [];
  43457. return this._senders.slice(); // return a copy of the internal state.
  43458. };
  43459. var origAddTrack = window.RTCPeerConnection.prototype.addTrack;
  43460. window.RTCPeerConnection.prototype.addTrack = function(track, stream) {
  43461. var pc = this;
  43462. var sender = origAddTrack.apply(pc, arguments);
  43463. if (!sender) {
  43464. sender = shimSenderWithDtmf(pc, track);
  43465. pc._senders.push(sender);
  43466. }
  43467. return sender;
  43468. };
  43469. var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack;
  43470. window.RTCPeerConnection.prototype.removeTrack = function(sender) {
  43471. var pc = this;
  43472. origRemoveTrack.apply(pc, arguments);
  43473. var idx = pc._senders.indexOf(sender);
  43474. if (idx !== -1) {
  43475. pc._senders.splice(idx, 1);
  43476. }
  43477. };
  43478. }
  43479. var origAddStream = window.RTCPeerConnection.prototype.addStream;
  43480. window.RTCPeerConnection.prototype.addStream = function(stream) {
  43481. var pc = this;
  43482. pc._senders = pc._senders || [];
  43483. origAddStream.apply(pc, [stream]);
  43484. stream.getTracks().forEach(function(track) {
  43485. pc._senders.push(shimSenderWithDtmf(pc, track));
  43486. });
  43487. };
  43488. var origRemoveStream = window.RTCPeerConnection.prototype.removeStream;
  43489. window.RTCPeerConnection.prototype.removeStream = function(stream) {
  43490. var pc = this;
  43491. pc._senders = pc._senders || [];
  43492. origRemoveStream.apply(pc, [stream]);
  43493. stream.getTracks().forEach(function(track) {
  43494. var sender = pc._senders.find(function(s) {
  43495. return s.track === track;
  43496. });
  43497. if (sender) {
  43498. pc._senders.splice(pc._senders.indexOf(sender), 1); // remove sender
  43499. }
  43500. });
  43501. };
  43502. } else if (typeof window === 'object' && window.RTCPeerConnection &&
  43503. 'getSenders' in window.RTCPeerConnection.prototype &&
  43504. 'createDTMFSender' in window.RTCPeerConnection.prototype &&
  43505. window.RTCRtpSender &&
  43506. !('dtmf' in window.RTCRtpSender.prototype)) {
  43507. var origGetSenders = window.RTCPeerConnection.prototype.getSenders;
  43508. window.RTCPeerConnection.prototype.getSenders = function() {
  43509. var pc = this;
  43510. var senders = origGetSenders.apply(pc, []);
  43511. senders.forEach(function(sender) {
  43512. sender._pc = pc;
  43513. });
  43514. return senders;
  43515. };
  43516. Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', {
  43517. get: function() {
  43518. if (this._dtmf === undefined) {
  43519. if (this.track.kind === 'audio') {
  43520. this._dtmf = this._pc.createDTMFSender(this.track);
  43521. } else {
  43522. this._dtmf = null;
  43523. }
  43524. }
  43525. return this._dtmf;
  43526. }
  43527. });
  43528. }
  43529. },
  43530. shimSenderReceiverGetStats: function(window) {
  43531. if (!(typeof window === 'object' && window.RTCPeerConnection &&
  43532. window.RTCRtpSender && window.RTCRtpReceiver)) {
  43533. return;
  43534. }
  43535. // shim sender stats.
  43536. if (!('getStats' in window.RTCRtpSender.prototype)) {
  43537. var origGetSenders = window.RTCPeerConnection.prototype.getSenders;
  43538. if (origGetSenders) {
  43539. window.RTCPeerConnection.prototype.getSenders = function() {
  43540. var pc = this;
  43541. var senders = origGetSenders.apply(pc, []);
  43542. senders.forEach(function(sender) {
  43543. sender._pc = pc;
  43544. });
  43545. return senders;
  43546. };
  43547. }
  43548. var origAddTrack = window.RTCPeerConnection.prototype.addTrack;
  43549. if (origAddTrack) {
  43550. window.RTCPeerConnection.prototype.addTrack = function() {
  43551. var sender = origAddTrack.apply(this, arguments);
  43552. sender._pc = this;
  43553. return sender;
  43554. };
  43555. }
  43556. window.RTCRtpSender.prototype.getStats = function() {
  43557. var sender = this;
  43558. return this._pc.getStats().then(function(result) {
  43559. /* Note: this will include stats of all senders that
  43560. * send a track with the same id as sender.track as
  43561. * it is not possible to identify the RTCRtpSender.
  43562. */
  43563. return filterStats(result, sender.track, true);
  43564. });
  43565. };
  43566. }
  43567. // shim receiver stats.
  43568. if (!('getStats' in window.RTCRtpReceiver.prototype)) {
  43569. var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers;
  43570. if (origGetReceivers) {
  43571. window.RTCPeerConnection.prototype.getReceivers = function() {
  43572. var pc = this;
  43573. var receivers = origGetReceivers.apply(pc, []);
  43574. receivers.forEach(function(receiver) {
  43575. receiver._pc = pc;
  43576. });
  43577. return receivers;
  43578. };
  43579. }
  43580. utils.wrapPeerConnectionEvent(window, 'track', function(e) {
  43581. e.receiver._pc = e.srcElement;
  43582. return e;
  43583. });
  43584. window.RTCRtpReceiver.prototype.getStats = function() {
  43585. var receiver = this;
  43586. return this._pc.getStats().then(function(result) {
  43587. return filterStats(result, receiver.track, false);
  43588. });
  43589. };
  43590. }
  43591. if (!('getStats' in window.RTCRtpSender.prototype &&
  43592. 'getStats' in window.RTCRtpReceiver.prototype)) {
  43593. return;
  43594. }
  43595. // shim RTCPeerConnection.getStats(track).
  43596. var origGetStats = window.RTCPeerConnection.prototype.getStats;
  43597. window.RTCPeerConnection.prototype.getStats = function() {
  43598. var pc = this;
  43599. if (arguments.length > 0 &&
  43600. arguments[0] instanceof window.MediaStreamTrack) {
  43601. var track = arguments[0];
  43602. var sender;
  43603. var receiver;
  43604. var err;
  43605. pc.getSenders().forEach(function(s) {
  43606. if (s.track === track) {
  43607. if (sender) {
  43608. err = true;
  43609. } else {
  43610. sender = s;
  43611. }
  43612. }
  43613. });
  43614. pc.getReceivers().forEach(function(r) {
  43615. if (r.track === track) {
  43616. if (receiver) {
  43617. err = true;
  43618. } else {
  43619. receiver = r;
  43620. }
  43621. }
  43622. return r.track === track;
  43623. });
  43624. if (err || (sender && receiver)) {
  43625. return Promise.reject(new DOMException(
  43626. 'There are more than one sender or receiver for the track.',
  43627. 'InvalidAccessError'));
  43628. } else if (sender) {
  43629. return sender.getStats();
  43630. } else if (receiver) {
  43631. return receiver.getStats();
  43632. }
  43633. return Promise.reject(new DOMException(
  43634. 'There is no sender or receiver for the track.',
  43635. 'InvalidAccessError'));
  43636. }
  43637. return origGetStats.apply(pc, arguments);
  43638. };
  43639. },
  43640. shimSourceObject: function(window) {
  43641. var URL = window && window.URL;
  43642. if (typeof window === 'object') {
  43643. if (window.HTMLMediaElement &&
  43644. !('srcObject' in window.HTMLMediaElement.prototype)) {
  43645. // Shim the srcObject property, once, when HTMLMediaElement is found.
  43646. Object.defineProperty(window.HTMLMediaElement.prototype, 'srcObject', {
  43647. get: function() {
  43648. return this._srcObject;
  43649. },
  43650. set: function(stream) {
  43651. var self = this;
  43652. // Use _srcObject as a private property for this shim
  43653. this._srcObject = stream;
  43654. if (this.src) {
  43655. URL.revokeObjectURL(this.src);
  43656. }
  43657. if (!stream) {
  43658. this.src = '';
  43659. return undefined;
  43660. }
  43661. this.src = URL.createObjectURL(stream);
  43662. // We need to recreate the blob url when a track is added or
  43663. // removed. Doing it manually since we want to avoid a recursion.
  43664. stream.addEventListener('addtrack', function() {
  43665. if (self.src) {
  43666. URL.revokeObjectURL(self.src);
  43667. }
  43668. self.src = URL.createObjectURL(stream);
  43669. });
  43670. stream.addEventListener('removetrack', function() {
  43671. if (self.src) {
  43672. URL.revokeObjectURL(self.src);
  43673. }
  43674. self.src = URL.createObjectURL(stream);
  43675. });
  43676. }
  43677. });
  43678. }
  43679. }
  43680. },
  43681. shimAddTrackRemoveTrackWithNative: function(window) {
  43682. // shim addTrack/removeTrack with native variants in order to make
  43683. // the interactions with legacy getLocalStreams behave as in other browsers.
  43684. // Keeps a mapping stream.id => [stream, rtpsenders...]
  43685. window.RTCPeerConnection.prototype.getLocalStreams = function() {
  43686. var pc = this;
  43687. this._shimmedLocalStreams = this._shimmedLocalStreams || {};
  43688. return Object.keys(this._shimmedLocalStreams).map(function(streamId) {
  43689. return pc._shimmedLocalStreams[streamId][0];
  43690. });
  43691. };
  43692. var origAddTrack = window.RTCPeerConnection.prototype.addTrack;
  43693. window.RTCPeerConnection.prototype.addTrack = function(track, stream) {
  43694. if (!stream) {
  43695. return origAddTrack.apply(this, arguments);
  43696. }
  43697. this._shimmedLocalStreams = this._shimmedLocalStreams || {};
  43698. var sender = origAddTrack.apply(this, arguments);
  43699. if (!this._shimmedLocalStreams[stream.id]) {
  43700. this._shimmedLocalStreams[stream.id] = [stream, sender];
  43701. } else if (this._shimmedLocalStreams[stream.id].indexOf(sender) === -1) {
  43702. this._shimmedLocalStreams[stream.id].push(sender);
  43703. }
  43704. return sender;
  43705. };
  43706. var origAddStream = window.RTCPeerConnection.prototype.addStream;
  43707. window.RTCPeerConnection.prototype.addStream = function(stream) {
  43708. var pc = this;
  43709. this._shimmedLocalStreams = this._shimmedLocalStreams || {};
  43710. stream.getTracks().forEach(function(track) {
  43711. var alreadyExists = pc.getSenders().find(function(s) {
  43712. return s.track === track;
  43713. });
  43714. if (alreadyExists) {
  43715. throw new DOMException('Track already exists.',
  43716. 'InvalidAccessError');
  43717. }
  43718. });
  43719. var existingSenders = pc.getSenders();
  43720. origAddStream.apply(this, arguments);
  43721. var newSenders = pc.getSenders().filter(function(newSender) {
  43722. return existingSenders.indexOf(newSender) === -1;
  43723. });
  43724. this._shimmedLocalStreams[stream.id] = [stream].concat(newSenders);
  43725. };
  43726. var origRemoveStream = window.RTCPeerConnection.prototype.removeStream;
  43727. window.RTCPeerConnection.prototype.removeStream = function(stream) {
  43728. this._shimmedLocalStreams = this._shimmedLocalStreams || {};
  43729. delete this._shimmedLocalStreams[stream.id];
  43730. return origRemoveStream.apply(this, arguments);
  43731. };
  43732. var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack;
  43733. window.RTCPeerConnection.prototype.removeTrack = function(sender) {
  43734. var pc = this;
  43735. this._shimmedLocalStreams = this._shimmedLocalStreams || {};
  43736. if (sender) {
  43737. Object.keys(this._shimmedLocalStreams).forEach(function(streamId) {
  43738. var idx = pc._shimmedLocalStreams[streamId].indexOf(sender);
  43739. if (idx !== -1) {
  43740. pc._shimmedLocalStreams[streamId].splice(idx, 1);
  43741. }
  43742. if (pc._shimmedLocalStreams[streamId].length === 1) {
  43743. delete pc._shimmedLocalStreams[streamId];
  43744. }
  43745. });
  43746. }
  43747. return origRemoveTrack.apply(this, arguments);
  43748. };
  43749. },
  43750. shimAddTrackRemoveTrack: function(window) {
  43751. if (!window.RTCPeerConnection) {
  43752. return;
  43753. }
  43754. var browserDetails = utils.detectBrowser(window);
  43755. // shim addTrack and removeTrack.
  43756. if (window.RTCPeerConnection.prototype.addTrack &&
  43757. browserDetails.version >= 65) {
  43758. return this.shimAddTrackRemoveTrackWithNative(window);
  43759. }
  43760. // also shim pc.getLocalStreams when addTrack is shimmed
  43761. // to return the original streams.
  43762. var origGetLocalStreams = window.RTCPeerConnection.prototype
  43763. .getLocalStreams;
  43764. window.RTCPeerConnection.prototype.getLocalStreams = function() {
  43765. var pc = this;
  43766. var nativeStreams = origGetLocalStreams.apply(this);
  43767. pc._reverseStreams = pc._reverseStreams || {};
  43768. return nativeStreams.map(function(stream) {
  43769. return pc._reverseStreams[stream.id];
  43770. });
  43771. };
  43772. var origAddStream = window.RTCPeerConnection.prototype.addStream;
  43773. window.RTCPeerConnection.prototype.addStream = function(stream) {
  43774. var pc = this;
  43775. pc._streams = pc._streams || {};
  43776. pc._reverseStreams = pc._reverseStreams || {};
  43777. stream.getTracks().forEach(function(track) {
  43778. var alreadyExists = pc.getSenders().find(function(s) {
  43779. return s.track === track;
  43780. });
  43781. if (alreadyExists) {
  43782. throw new DOMException('Track already exists.',
  43783. 'InvalidAccessError');
  43784. }
  43785. });
  43786. // Add identity mapping for consistency with addTrack.
  43787. // Unless this is being used with a stream from addTrack.
  43788. if (!pc._reverseStreams[stream.id]) {
  43789. var newStream = new window.MediaStream(stream.getTracks());
  43790. pc._streams[stream.id] = newStream;
  43791. pc._reverseStreams[newStream.id] = stream;
  43792. stream = newStream;
  43793. }
  43794. origAddStream.apply(pc, [stream]);
  43795. };
  43796. var origRemoveStream = window.RTCPeerConnection.prototype.removeStream;
  43797. window.RTCPeerConnection.prototype.removeStream = function(stream) {
  43798. var pc = this;
  43799. pc._streams = pc._streams || {};
  43800. pc._reverseStreams = pc._reverseStreams || {};
  43801. origRemoveStream.apply(pc, [(pc._streams[stream.id] || stream)]);
  43802. delete pc._reverseStreams[(pc._streams[stream.id] ?
  43803. pc._streams[stream.id].id : stream.id)];
  43804. delete pc._streams[stream.id];
  43805. };
  43806. window.RTCPeerConnection.prototype.addTrack = function(track, stream) {
  43807. var pc = this;
  43808. if (pc.signalingState === 'closed') {
  43809. throw new DOMException(
  43810. 'The RTCPeerConnection\'s signalingState is \'closed\'.',
  43811. 'InvalidStateError');
  43812. }
  43813. var streams = [].slice.call(arguments, 1);
  43814. if (streams.length !== 1 ||
  43815. !streams[0].getTracks().find(function(t) {
  43816. return t === track;
  43817. })) {
  43818. // this is not fully correct but all we can manage without
  43819. // [[associated MediaStreams]] internal slot.
  43820. throw new DOMException(
  43821. 'The adapter.js addTrack polyfill only supports a single ' +
  43822. ' stream which is associated with the specified track.',
  43823. 'NotSupportedError');
  43824. }
  43825. var alreadyExists = pc.getSenders().find(function(s) {
  43826. return s.track === track;
  43827. });
  43828. if (alreadyExists) {
  43829. throw new DOMException('Track already exists.',
  43830. 'InvalidAccessError');
  43831. }
  43832. pc._streams = pc._streams || {};
  43833. pc._reverseStreams = pc._reverseStreams || {};
  43834. var oldStream = pc._streams[stream.id];
  43835. if (oldStream) {
  43836. // this is using odd Chrome behaviour, use with caution:
  43837. // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815
  43838. // Note: we rely on the high-level addTrack/dtmf shim to
  43839. // create the sender with a dtmf sender.
  43840. oldStream.addTrack(track);
  43841. // Trigger ONN async.
  43842. Promise.resolve().then(function() {
  43843. pc.dispatchEvent(new Event('negotiationneeded'));
  43844. });
  43845. } else {
  43846. var newStream = new window.MediaStream([track]);
  43847. pc._streams[stream.id] = newStream;
  43848. pc._reverseStreams[newStream.id] = stream;
  43849. pc.addStream(newStream);
  43850. }
  43851. return pc.getSenders().find(function(s) {
  43852. return s.track === track;
  43853. });
  43854. };
  43855. // replace the internal stream id with the external one and
  43856. // vice versa.
  43857. function replaceInternalStreamId(pc, description) {
  43858. var sdp = description.sdp;
  43859. Object.keys(pc._reverseStreams || []).forEach(function(internalId) {
  43860. var externalStream = pc._reverseStreams[internalId];
  43861. var internalStream = pc._streams[externalStream.id];
  43862. sdp = sdp.replace(new RegExp(internalStream.id, 'g'),
  43863. externalStream.id);
  43864. });
  43865. return new RTCSessionDescription({
  43866. type: description.type,
  43867. sdp: sdp
  43868. });
  43869. }
  43870. function replaceExternalStreamId(pc, description) {
  43871. var sdp = description.sdp;
  43872. Object.keys(pc._reverseStreams || []).forEach(function(internalId) {
  43873. var externalStream = pc._reverseStreams[internalId];
  43874. var internalStream = pc._streams[externalStream.id];
  43875. sdp = sdp.replace(new RegExp(externalStream.id, 'g'),
  43876. internalStream.id);
  43877. });
  43878. return new RTCSessionDescription({
  43879. type: description.type,
  43880. sdp: sdp
  43881. });
  43882. }
  43883. ['createOffer', 'createAnswer'].forEach(function(method) {
  43884. var nativeMethod = window.RTCPeerConnection.prototype[method];
  43885. window.RTCPeerConnection.prototype[method] = function() {
  43886. var pc = this;
  43887. var args = arguments;
  43888. var isLegacyCall = arguments.length &&
  43889. typeof arguments[0] === 'function';
  43890. if (isLegacyCall) {
  43891. return nativeMethod.apply(pc, [
  43892. function(description) {
  43893. var desc = replaceInternalStreamId(pc, description);
  43894. args[0].apply(null, [desc]);
  43895. },
  43896. function(err) {
  43897. if (args[1]) {
  43898. args[1].apply(null, err);
  43899. }
  43900. }, arguments[2]
  43901. ]);
  43902. }
  43903. return nativeMethod.apply(pc, arguments)
  43904. .then(function(description) {
  43905. return replaceInternalStreamId(pc, description);
  43906. });
  43907. };
  43908. });
  43909. var origSetLocalDescription =
  43910. window.RTCPeerConnection.prototype.setLocalDescription;
  43911. window.RTCPeerConnection.prototype.setLocalDescription = function() {
  43912. var pc = this;
  43913. if (!arguments.length || !arguments[0].type) {
  43914. return origSetLocalDescription.apply(pc, arguments);
  43915. }
  43916. arguments[0] = replaceExternalStreamId(pc, arguments[0]);
  43917. return origSetLocalDescription.apply(pc, arguments);
  43918. };
  43919. // TODO: mangle getStats: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamstats-streamidentifier
  43920. var origLocalDescription = Object.getOwnPropertyDescriptor(
  43921. window.RTCPeerConnection.prototype, 'localDescription');
  43922. Object.defineProperty(window.RTCPeerConnection.prototype,
  43923. 'localDescription', {
  43924. get: function() {
  43925. var pc = this;
  43926. var description = origLocalDescription.get.apply(this);
  43927. if (description.type === '') {
  43928. return description;
  43929. }
  43930. return replaceInternalStreamId(pc, description);
  43931. }
  43932. });
  43933. window.RTCPeerConnection.prototype.removeTrack = function(sender) {
  43934. var pc = this;
  43935. if (pc.signalingState === 'closed') {
  43936. throw new DOMException(
  43937. 'The RTCPeerConnection\'s signalingState is \'closed\'.',
  43938. 'InvalidStateError');
  43939. }
  43940. // We can not yet check for sender instanceof RTCRtpSender
  43941. // since we shim RTPSender. So we check if sender._pc is set.
  43942. if (!sender._pc) {
  43943. throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack ' +
  43944. 'does not implement interface RTCRtpSender.', 'TypeError');
  43945. }
  43946. var isLocal = sender._pc === pc;
  43947. if (!isLocal) {
  43948. throw new DOMException('Sender was not created by this connection.',
  43949. 'InvalidAccessError');
  43950. }
  43951. // Search for the native stream the senders track belongs to.
  43952. pc._streams = pc._streams || {};
  43953. var stream;
  43954. Object.keys(pc._streams).forEach(function(streamid) {
  43955. var hasTrack = pc._streams[streamid].getTracks().find(function(track) {
  43956. return sender.track === track;
  43957. });
  43958. if (hasTrack) {
  43959. stream = pc._streams[streamid];
  43960. }
  43961. });
  43962. if (stream) {
  43963. if (stream.getTracks().length === 1) {
  43964. // if this is the last track of the stream, remove the stream. This
  43965. // takes care of any shimmed _senders.
  43966. pc.removeStream(pc._reverseStreams[stream.id]);
  43967. } else {
  43968. // relying on the same odd chrome behaviour as above.
  43969. stream.removeTrack(sender.track);
  43970. }
  43971. pc.dispatchEvent(new Event('negotiationneeded'));
  43972. }
  43973. };
  43974. },
  43975. shimPeerConnection: function(window) {
  43976. var browserDetails = utils.detectBrowser(window);
  43977. // The RTCPeerConnection object.
  43978. if (!window.RTCPeerConnection && window.webkitRTCPeerConnection) {
  43979. window.RTCPeerConnection = function(pcConfig, pcConstraints) {
  43980. // Translate iceTransportPolicy to iceTransports,
  43981. // see https://code.google.com/p/webrtc/issues/detail?id=4869
  43982. // this was fixed in M56 along with unprefixing RTCPeerConnection.
  43983. logging('PeerConnection');
  43984. if (pcConfig && pcConfig.iceTransportPolicy) {
  43985. pcConfig.iceTransports = pcConfig.iceTransportPolicy;
  43986. }
  43987. return new window.webkitRTCPeerConnection(pcConfig, pcConstraints);
  43988. };
  43989. window.RTCPeerConnection.prototype =
  43990. window.webkitRTCPeerConnection.prototype;
  43991. // wrap static methods. Currently just generateCertificate.
  43992. if (window.webkitRTCPeerConnection.generateCertificate) {
  43993. Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {
  43994. get: function() {
  43995. return window.webkitRTCPeerConnection.generateCertificate;
  43996. }
  43997. });
  43998. }
  43999. }
  44000. if (!window.RTCPeerConnection) {
  44001. return;
  44002. }
  44003. var origGetStats = window.RTCPeerConnection.prototype.getStats;
  44004. window.RTCPeerConnection.prototype.getStats = function(selector,
  44005. successCallback, errorCallback) {
  44006. var pc = this;
  44007. var args = arguments;
  44008. // If selector is a function then we are in the old style stats so just
  44009. // pass back the original getStats format to avoid breaking old users.
  44010. if (arguments.length > 0 && typeof selector === 'function') {
  44011. return origGetStats.apply(this, arguments);
  44012. }
  44013. // When spec-style getStats is supported, return those when called with
  44014. // either no arguments or the selector argument is null.
  44015. if (origGetStats.length === 0 && (arguments.length === 0 ||
  44016. typeof arguments[0] !== 'function')) {
  44017. return origGetStats.apply(this, []);
  44018. }
  44019. var fixChromeStats_ = function(response) {
  44020. var standardReport = {};
  44021. var reports = response.result();
  44022. reports.forEach(function(report) {
  44023. var standardStats = {
  44024. id: report.id,
  44025. timestamp: report.timestamp,
  44026. type: {
  44027. localcandidate: 'local-candidate',
  44028. remotecandidate: 'remote-candidate'
  44029. }[report.type] || report.type
  44030. };
  44031. report.names().forEach(function(name) {
  44032. standardStats[name] = report.stat(name);
  44033. });
  44034. standardReport[standardStats.id] = standardStats;
  44035. });
  44036. return standardReport;
  44037. };
  44038. // shim getStats with maplike support
  44039. var makeMapStats = function(stats) {
  44040. return new Map(Object.keys(stats).map(function(key) {
  44041. return [key, stats[key]];
  44042. }));
  44043. };
  44044. if (arguments.length >= 2) {
  44045. var successCallbackWrapper_ = function(response) {
  44046. args[1](makeMapStats(fixChromeStats_(response)));
  44047. };
  44048. return origGetStats.apply(this, [successCallbackWrapper_,
  44049. arguments[0]]);
  44050. }
  44051. // promise-support
  44052. return new Promise(function(resolve, reject) {
  44053. origGetStats.apply(pc, [
  44054. function(response) {
  44055. resolve(makeMapStats(fixChromeStats_(response)));
  44056. }, reject]);
  44057. }).then(successCallback, errorCallback);
  44058. };
  44059. // add promise support -- natively available in Chrome 51
  44060. if (browserDetails.version < 51) {
  44061. ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']
  44062. .forEach(function(method) {
  44063. var nativeMethod = window.RTCPeerConnection.prototype[method];
  44064. window.RTCPeerConnection.prototype[method] = function() {
  44065. var args = arguments;
  44066. var pc = this;
  44067. var promise = new Promise(function(resolve, reject) {
  44068. nativeMethod.apply(pc, [args[0], resolve, reject]);
  44069. });
  44070. if (args.length < 2) {
  44071. return promise;
  44072. }
  44073. return promise.then(function() {
  44074. args[1].apply(null, []);
  44075. },
  44076. function(err) {
  44077. if (args.length >= 3) {
  44078. args[2].apply(null, [err]);
  44079. }
  44080. });
  44081. };
  44082. });
  44083. }
  44084. // promise support for createOffer and createAnswer. Available (without
  44085. // bugs) since M52: crbug/619289
  44086. if (browserDetails.version < 52) {
  44087. ['createOffer', 'createAnswer'].forEach(function(method) {
  44088. var nativeMethod = window.RTCPeerConnection.prototype[method];
  44089. window.RTCPeerConnection.prototype[method] = function() {
  44090. var pc = this;
  44091. if (arguments.length < 1 || (arguments.length === 1 &&
  44092. typeof arguments[0] === 'object')) {
  44093. var opts = arguments.length === 1 ? arguments[0] : undefined;
  44094. return new Promise(function(resolve, reject) {
  44095. nativeMethod.apply(pc, [resolve, reject, opts]);
  44096. });
  44097. }
  44098. return nativeMethod.apply(this, arguments);
  44099. };
  44100. });
  44101. }
  44102. // shim implicit creation of RTCSessionDescription/RTCIceCandidate
  44103. ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']
  44104. .forEach(function(method) {
  44105. var nativeMethod = window.RTCPeerConnection.prototype[method];
  44106. window.RTCPeerConnection.prototype[method] = function() {
  44107. arguments[0] = new ((method === 'addIceCandidate') ?
  44108. window.RTCIceCandidate :
  44109. window.RTCSessionDescription)(arguments[0]);
  44110. return nativeMethod.apply(this, arguments);
  44111. };
  44112. });
  44113. // support for addIceCandidate(null or undefined)
  44114. var nativeAddIceCandidate =
  44115. window.RTCPeerConnection.prototype.addIceCandidate;
  44116. window.RTCPeerConnection.prototype.addIceCandidate = function() {
  44117. if (!arguments[0]) {
  44118. if (arguments[1]) {
  44119. arguments[1].apply(null);
  44120. }
  44121. return Promise.resolve();
  44122. }
  44123. return nativeAddIceCandidate.apply(this, arguments);
  44124. };
  44125. },
  44126. fixNegotiationNeeded: function(window) {
  44127. utils.wrapPeerConnectionEvent(window, 'negotiationneeded', function(e) {
  44128. var pc = e.target;
  44129. if (pc.signalingState !== 'stable') {
  44130. return;
  44131. }
  44132. return e;
  44133. });
  44134. },
  44135. shimGetDisplayMedia: function(window, getSourceId) {
  44136. if (!window.navigator || !window.navigator.mediaDevices ||
  44137. 'getDisplayMedia' in window.navigator.mediaDevices) {
  44138. return;
  44139. }
  44140. // getSourceId is a function that returns a promise resolving with
  44141. // the sourceId of the screen/window/tab to be shared.
  44142. if (typeof getSourceId !== 'function') {
  44143. console.error('shimGetDisplayMedia: getSourceId argument is not ' +
  44144. 'a function');
  44145. return;
  44146. }
  44147. window.navigator.mediaDevices.getDisplayMedia = function(constraints) {
  44148. return getSourceId(constraints)
  44149. .then(function(sourceId) {
  44150. var widthSpecified = constraints.video && constraints.video.width;
  44151. var heightSpecified = constraints.video && constraints.video.height;
  44152. var frameRateSpecified = constraints.video &&
  44153. constraints.video.frameRate;
  44154. constraints.video = {
  44155. mandatory: {
  44156. chromeMediaSource: 'desktop',
  44157. chromeMediaSourceId: sourceId,
  44158. maxFrameRate: frameRateSpecified || 3
  44159. }
  44160. };
  44161. if (widthSpecified) {
  44162. constraints.video.mandatory.maxWidth = widthSpecified;
  44163. }
  44164. if (heightSpecified) {
  44165. constraints.video.mandatory.maxHeight = heightSpecified;
  44166. }
  44167. return window.navigator.mediaDevices.getUserMedia(constraints);
  44168. });
  44169. };
  44170. window.navigator.getDisplayMedia = function(constraints) {
  44171. utils.deprecated('navigator.getDisplayMedia',
  44172. 'navigator.mediaDevices.getDisplayMedia');
  44173. return window.navigator.mediaDevices.getDisplayMedia(constraints);
  44174. };
  44175. }
  44176. };
  44177. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  44178. /***/ }),
  44179. /* 535 */
  44180. /***/ (function(module, exports, __webpack_require__) {
  44181. "use strict";
  44182. /* WEBPACK VAR INJECTION */(function(Promise) {/*
  44183. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  44184. *
  44185. * Use of this source code is governed by a BSD-style license
  44186. * that can be found in the LICENSE file in the root of the source
  44187. * tree.
  44188. */
  44189. /* eslint-env node */
  44190. var utils = __webpack_require__(25);
  44191. var logging = utils.log;
  44192. // Expose public methods.
  44193. module.exports = function(window) {
  44194. var browserDetails = utils.detectBrowser(window);
  44195. var navigator = window && window.navigator;
  44196. var constraintsToChrome_ = function(c) {
  44197. if (typeof c !== 'object' || c.mandatory || c.optional) {
  44198. return c;
  44199. }
  44200. var cc = {};
  44201. Object.keys(c).forEach(function(key) {
  44202. if (key === 'require' || key === 'advanced' || key === 'mediaSource') {
  44203. return;
  44204. }
  44205. var r = (typeof c[key] === 'object') ? c[key] : {ideal: c[key]};
  44206. if (r.exact !== undefined && typeof r.exact === 'number') {
  44207. r.min = r.max = r.exact;
  44208. }
  44209. var oldname_ = function(prefix, name) {
  44210. if (prefix) {
  44211. return prefix + name.charAt(0).toUpperCase() + name.slice(1);
  44212. }
  44213. return (name === 'deviceId') ? 'sourceId' : name;
  44214. };
  44215. if (r.ideal !== undefined) {
  44216. cc.optional = cc.optional || [];
  44217. var oc = {};
  44218. if (typeof r.ideal === 'number') {
  44219. oc[oldname_('min', key)] = r.ideal;
  44220. cc.optional.push(oc);
  44221. oc = {};
  44222. oc[oldname_('max', key)] = r.ideal;
  44223. cc.optional.push(oc);
  44224. } else {
  44225. oc[oldname_('', key)] = r.ideal;
  44226. cc.optional.push(oc);
  44227. }
  44228. }
  44229. if (r.exact !== undefined && typeof r.exact !== 'number') {
  44230. cc.mandatory = cc.mandatory || {};
  44231. cc.mandatory[oldname_('', key)] = r.exact;
  44232. } else {
  44233. ['min', 'max'].forEach(function(mix) {
  44234. if (r[mix] !== undefined) {
  44235. cc.mandatory = cc.mandatory || {};
  44236. cc.mandatory[oldname_(mix, key)] = r[mix];
  44237. }
  44238. });
  44239. }
  44240. });
  44241. if (c.advanced) {
  44242. cc.optional = (cc.optional || []).concat(c.advanced);
  44243. }
  44244. return cc;
  44245. };
  44246. var shimConstraints_ = function(constraints, func) {
  44247. if (browserDetails.version >= 61) {
  44248. return func(constraints);
  44249. }
  44250. constraints = JSON.parse(JSON.stringify(constraints));
  44251. if (constraints && typeof constraints.audio === 'object') {
  44252. var remap = function(obj, a, b) {
  44253. if (a in obj && !(b in obj)) {
  44254. obj[b] = obj[a];
  44255. delete obj[a];
  44256. }
  44257. };
  44258. constraints = JSON.parse(JSON.stringify(constraints));
  44259. remap(constraints.audio, 'autoGainControl', 'googAutoGainControl');
  44260. remap(constraints.audio, 'noiseSuppression', 'googNoiseSuppression');
  44261. constraints.audio = constraintsToChrome_(constraints.audio);
  44262. }
  44263. if (constraints && typeof constraints.video === 'object') {
  44264. // Shim facingMode for mobile & surface pro.
  44265. var face = constraints.video.facingMode;
  44266. face = face && ((typeof face === 'object') ? face : {ideal: face});
  44267. var getSupportedFacingModeLies = browserDetails.version < 66;
  44268. if ((face && (face.exact === 'user' || face.exact === 'environment' ||
  44269. face.ideal === 'user' || face.ideal === 'environment')) &&
  44270. !(navigator.mediaDevices.getSupportedConstraints &&
  44271. navigator.mediaDevices.getSupportedConstraints().facingMode &&
  44272. !getSupportedFacingModeLies)) {
  44273. delete constraints.video.facingMode;
  44274. var matches;
  44275. if (face.exact === 'environment' || face.ideal === 'environment') {
  44276. matches = ['back', 'rear'];
  44277. } else if (face.exact === 'user' || face.ideal === 'user') {
  44278. matches = ['front'];
  44279. }
  44280. if (matches) {
  44281. // Look for matches in label, or use last cam for back (typical).
  44282. return navigator.mediaDevices.enumerateDevices()
  44283. .then(function(devices) {
  44284. devices = devices.filter(function(d) {
  44285. return d.kind === 'videoinput';
  44286. });
  44287. var dev = devices.find(function(d) {
  44288. return matches.some(function(match) {
  44289. return d.label.toLowerCase().indexOf(match) !== -1;
  44290. });
  44291. });
  44292. if (!dev && devices.length && matches.indexOf('back') !== -1) {
  44293. dev = devices[devices.length - 1]; // more likely the back cam
  44294. }
  44295. if (dev) {
  44296. constraints.video.deviceId = face.exact ? {exact: dev.deviceId} :
  44297. {ideal: dev.deviceId};
  44298. }
  44299. constraints.video = constraintsToChrome_(constraints.video);
  44300. logging('chrome: ' + JSON.stringify(constraints));
  44301. return func(constraints);
  44302. });
  44303. }
  44304. }
  44305. constraints.video = constraintsToChrome_(constraints.video);
  44306. }
  44307. logging('chrome: ' + JSON.stringify(constraints));
  44308. return func(constraints);
  44309. };
  44310. var shimError_ = function(e) {
  44311. if (browserDetails.version >= 64) {
  44312. return e;
  44313. }
  44314. return {
  44315. name: {
  44316. PermissionDeniedError: 'NotAllowedError',
  44317. PermissionDismissedError: 'NotAllowedError',
  44318. InvalidStateError: 'NotAllowedError',
  44319. DevicesNotFoundError: 'NotFoundError',
  44320. ConstraintNotSatisfiedError: 'OverconstrainedError',
  44321. TrackStartError: 'NotReadableError',
  44322. MediaDeviceFailedDueToShutdown: 'NotAllowedError',
  44323. MediaDeviceKillSwitchOn: 'NotAllowedError',
  44324. TabCaptureError: 'AbortError',
  44325. ScreenCaptureError: 'AbortError',
  44326. DeviceCaptureError: 'AbortError'
  44327. }[e.name] || e.name,
  44328. message: e.message,
  44329. constraint: e.constraint || e.constraintName,
  44330. toString: function() {
  44331. return this.name + (this.message && ': ') + this.message;
  44332. }
  44333. };
  44334. };
  44335. var getUserMedia_ = function(constraints, onSuccess, onError) {
  44336. shimConstraints_(constraints, function(c) {
  44337. navigator.webkitGetUserMedia(c, onSuccess, function(e) {
  44338. if (onError) {
  44339. onError(shimError_(e));
  44340. }
  44341. });
  44342. });
  44343. };
  44344. navigator.getUserMedia = getUserMedia_;
  44345. // Returns the result of getUserMedia as a Promise.
  44346. var getUserMediaPromise_ = function(constraints) {
  44347. return new Promise(function(resolve, reject) {
  44348. navigator.getUserMedia(constraints, resolve, reject);
  44349. });
  44350. };
  44351. if (!navigator.mediaDevices) {
  44352. navigator.mediaDevices = {
  44353. getUserMedia: getUserMediaPromise_,
  44354. enumerateDevices: function() {
  44355. return new Promise(function(resolve) {
  44356. var kinds = {audio: 'audioinput', video: 'videoinput'};
  44357. return window.MediaStreamTrack.getSources(function(devices) {
  44358. resolve(devices.map(function(device) {
  44359. return {label: device.label,
  44360. kind: kinds[device.kind],
  44361. deviceId: device.id,
  44362. groupId: ''};
  44363. }));
  44364. });
  44365. });
  44366. },
  44367. getSupportedConstraints: function() {
  44368. return {
  44369. deviceId: true, echoCancellation: true, facingMode: true,
  44370. frameRate: true, height: true, width: true
  44371. };
  44372. }
  44373. };
  44374. }
  44375. // A shim for getUserMedia method on the mediaDevices object.
  44376. // TODO(KaptenJansson) remove once implemented in Chrome stable.
  44377. if (!navigator.mediaDevices.getUserMedia) {
  44378. navigator.mediaDevices.getUserMedia = function(constraints) {
  44379. return getUserMediaPromise_(constraints);
  44380. };
  44381. } else {
  44382. // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia
  44383. // function which returns a Promise, it does not accept spec-style
  44384. // constraints.
  44385. var origGetUserMedia = navigator.mediaDevices.getUserMedia.
  44386. bind(navigator.mediaDevices);
  44387. navigator.mediaDevices.getUserMedia = function(cs) {
  44388. return shimConstraints_(cs, function(c) {
  44389. return origGetUserMedia(c).then(function(stream) {
  44390. if (c.audio && !stream.getAudioTracks().length ||
  44391. c.video && !stream.getVideoTracks().length) {
  44392. stream.getTracks().forEach(function(track) {
  44393. track.stop();
  44394. });
  44395. throw new DOMException('', 'NotFoundError');
  44396. }
  44397. return stream;
  44398. }, function(e) {
  44399. return Promise.reject(shimError_(e));
  44400. });
  44401. });
  44402. };
  44403. }
  44404. // Dummy devicechange event methods.
  44405. // TODO(KaptenJansson) remove once implemented in Chrome stable.
  44406. if (typeof navigator.mediaDevices.addEventListener === 'undefined') {
  44407. navigator.mediaDevices.addEventListener = function() {
  44408. logging('Dummy mediaDevices.addEventListener called.');
  44409. };
  44410. }
  44411. if (typeof navigator.mediaDevices.removeEventListener === 'undefined') {
  44412. navigator.mediaDevices.removeEventListener = function() {
  44413. logging('Dummy mediaDevices.removeEventListener called.');
  44414. };
  44415. }
  44416. };
  44417. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  44418. /***/ }),
  44419. /* 536 */
  44420. /***/ (function(module, exports, __webpack_require__) {
  44421. "use strict";
  44422. /*
  44423. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  44424. *
  44425. * Use of this source code is governed by a BSD-style license
  44426. * that can be found in the LICENSE file in the root of the source
  44427. * tree.
  44428. */
  44429. /* eslint-env node */
  44430. var utils = __webpack_require__(25);
  44431. var filterIceServers = __webpack_require__(537);
  44432. var shimRTCPeerConnection = __webpack_require__(538);
  44433. module.exports = {
  44434. shimGetUserMedia: __webpack_require__(539),
  44435. shimPeerConnection: function(window) {
  44436. var browserDetails = utils.detectBrowser(window);
  44437. if (window.RTCIceGatherer) {
  44438. if (!window.RTCIceCandidate) {
  44439. window.RTCIceCandidate = function(args) {
  44440. return args;
  44441. };
  44442. }
  44443. if (!window.RTCSessionDescription) {
  44444. window.RTCSessionDescription = function(args) {
  44445. return args;
  44446. };
  44447. }
  44448. // this adds an additional event listener to MediaStrackTrack that signals
  44449. // when a tracks enabled property was changed. Workaround for a bug in
  44450. // addStream, see below. No longer required in 15025+
  44451. if (browserDetails.version < 15025) {
  44452. var origMSTEnabled = Object.getOwnPropertyDescriptor(
  44453. window.MediaStreamTrack.prototype, 'enabled');
  44454. Object.defineProperty(window.MediaStreamTrack.prototype, 'enabled', {
  44455. set: function(value) {
  44456. origMSTEnabled.set.call(this, value);
  44457. var ev = new Event('enabled');
  44458. ev.enabled = value;
  44459. this.dispatchEvent(ev);
  44460. }
  44461. });
  44462. }
  44463. }
  44464. // ORTC defines the DTMF sender a bit different.
  44465. // https://github.com/w3c/ortc/issues/714
  44466. if (window.RTCRtpSender && !('dtmf' in window.RTCRtpSender.prototype)) {
  44467. Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', {
  44468. get: function() {
  44469. if (this._dtmf === undefined) {
  44470. if (this.track.kind === 'audio') {
  44471. this._dtmf = new window.RTCDtmfSender(this);
  44472. } else if (this.track.kind === 'video') {
  44473. this._dtmf = null;
  44474. }
  44475. }
  44476. return this._dtmf;
  44477. }
  44478. });
  44479. }
  44480. // Edge currently only implements the RTCDtmfSender, not the
  44481. // RTCDTMFSender alias. See http://draft.ortc.org/#rtcdtmfsender2*
  44482. if (window.RTCDtmfSender && !window.RTCDTMFSender) {
  44483. window.RTCDTMFSender = window.RTCDtmfSender;
  44484. }
  44485. var RTCPeerConnectionShim = shimRTCPeerConnection(window,
  44486. browserDetails.version);
  44487. window.RTCPeerConnection = function(config) {
  44488. if (config && config.iceServers) {
  44489. config.iceServers = filterIceServers(config.iceServers);
  44490. }
  44491. return new RTCPeerConnectionShim(config);
  44492. };
  44493. window.RTCPeerConnection.prototype = RTCPeerConnectionShim.prototype;
  44494. },
  44495. shimReplaceTrack: function(window) {
  44496. // ORTC has replaceTrack -- https://github.com/w3c/ortc/issues/614
  44497. if (window.RTCRtpSender &&
  44498. !('replaceTrack' in window.RTCRtpSender.prototype)) {
  44499. window.RTCRtpSender.prototype.replaceTrack =
  44500. window.RTCRtpSender.prototype.setTrack;
  44501. }
  44502. },
  44503. shimGetDisplayMedia: function(window, preferredMediaSource) {
  44504. if (!('getDisplayMedia' in window.navigator) ||
  44505. !window.navigator.mediaDevices ||
  44506. 'getDisplayMedia' in window.navigator.mediaDevices) {
  44507. return;
  44508. }
  44509. var origGetDisplayMedia = window.navigator.getDisplayMedia;
  44510. window.navigator.mediaDevices.getDisplayMedia = function(constraints) {
  44511. return origGetDisplayMedia.call(window.navigator, constraints);
  44512. };
  44513. window.navigator.getDisplayMedia = function(constraints) {
  44514. utils.deprecated('navigator.getDisplayMedia',
  44515. 'navigator.mediaDevices.getDisplayMedia');
  44516. return origGetDisplayMedia.call(window.navigator, constraints);
  44517. };
  44518. }
  44519. };
  44520. /***/ }),
  44521. /* 537 */
  44522. /***/ (function(module, exports, __webpack_require__) {
  44523. "use strict";
  44524. /*
  44525. * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
  44526. *
  44527. * Use of this source code is governed by a BSD-style license
  44528. * that can be found in the LICENSE file in the root of the source
  44529. * tree.
  44530. */
  44531. /* eslint-env node */
  44532. var utils = __webpack_require__(25);
  44533. // Edge does not like
  44534. // 1) stun: filtered after 14393 unless ?transport=udp is present
  44535. // 2) turn: that does not have all of turn:host:port?transport=udp
  44536. // 3) turn: with ipv6 addresses
  44537. // 4) turn: occurring muliple times
  44538. module.exports = function(iceServers, edgeVersion) {
  44539. var hasTurn = false;
  44540. iceServers = JSON.parse(JSON.stringify(iceServers));
  44541. return iceServers.filter(function(server) {
  44542. if (server && (server.urls || server.url)) {
  44543. var urls = server.urls || server.url;
  44544. if (server.url && !server.urls) {
  44545. utils.deprecated('RTCIceServer.url', 'RTCIceServer.urls');
  44546. }
  44547. var isString = typeof urls === 'string';
  44548. if (isString) {
  44549. urls = [urls];
  44550. }
  44551. urls = urls.filter(function(url) {
  44552. var validTurn = url.indexOf('turn:') === 0 &&
  44553. url.indexOf('transport=udp') !== -1 &&
  44554. url.indexOf('turn:[') === -1 &&
  44555. !hasTurn;
  44556. if (validTurn) {
  44557. hasTurn = true;
  44558. return true;
  44559. }
  44560. return url.indexOf('stun:') === 0 && edgeVersion >= 14393 &&
  44561. url.indexOf('?transport=udp') === -1;
  44562. });
  44563. delete server.url;
  44564. server.urls = isString ? urls[0] : urls;
  44565. return !!urls.length;
  44566. }
  44567. });
  44568. };
  44569. /***/ }),
  44570. /* 538 */
  44571. /***/ (function(module, exports, __webpack_require__) {
  44572. "use strict";
  44573. /* WEBPACK VAR INJECTION */(function(Promise) {/*
  44574. * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
  44575. *
  44576. * Use of this source code is governed by a BSD-style license
  44577. * that can be found in the LICENSE file in the root of the source
  44578. * tree.
  44579. */
  44580. /* eslint-env node */
  44581. var SDPUtils = __webpack_require__(247);
  44582. function fixStatsType(stat) {
  44583. return {
  44584. inboundrtp: 'inbound-rtp',
  44585. outboundrtp: 'outbound-rtp',
  44586. candidatepair: 'candidate-pair',
  44587. localcandidate: 'local-candidate',
  44588. remotecandidate: 'remote-candidate'
  44589. }[stat.type] || stat.type;
  44590. }
  44591. function writeMediaSection(transceiver, caps, type, stream, dtlsRole) {
  44592. var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps);
  44593. // Map ICE parameters (ufrag, pwd) to SDP.
  44594. sdp += SDPUtils.writeIceParameters(
  44595. transceiver.iceGatherer.getLocalParameters());
  44596. // Map DTLS parameters to SDP.
  44597. sdp += SDPUtils.writeDtlsParameters(
  44598. transceiver.dtlsTransport.getLocalParameters(),
  44599. type === 'offer' ? 'actpass' : dtlsRole || 'active');
  44600. sdp += 'a=mid:' + transceiver.mid + '\r\n';
  44601. if (transceiver.rtpSender && transceiver.rtpReceiver) {
  44602. sdp += 'a=sendrecv\r\n';
  44603. } else if (transceiver.rtpSender) {
  44604. sdp += 'a=sendonly\r\n';
  44605. } else if (transceiver.rtpReceiver) {
  44606. sdp += 'a=recvonly\r\n';
  44607. } else {
  44608. sdp += 'a=inactive\r\n';
  44609. }
  44610. if (transceiver.rtpSender) {
  44611. var trackId = transceiver.rtpSender._initialTrackId ||
  44612. transceiver.rtpSender.track.id;
  44613. transceiver.rtpSender._initialTrackId = trackId;
  44614. // spec.
  44615. var msid = 'msid:' + (stream ? stream.id : '-') + ' ' +
  44616. trackId + '\r\n';
  44617. sdp += 'a=' + msid;
  44618. // for Chrome. Legacy should no longer be required.
  44619. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc +
  44620. ' ' + msid;
  44621. // RTX
  44622. if (transceiver.sendEncodingParameters[0].rtx) {
  44623. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc +
  44624. ' ' + msid;
  44625. sdp += 'a=ssrc-group:FID ' +
  44626. transceiver.sendEncodingParameters[0].ssrc + ' ' +
  44627. transceiver.sendEncodingParameters[0].rtx.ssrc +
  44628. '\r\n';
  44629. }
  44630. }
  44631. // FIXME: this should be written by writeRtpDescription.
  44632. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc +
  44633. ' cname:' + SDPUtils.localCName + '\r\n';
  44634. if (transceiver.rtpSender && transceiver.sendEncodingParameters[0].rtx) {
  44635. sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc +
  44636. ' cname:' + SDPUtils.localCName + '\r\n';
  44637. }
  44638. return sdp;
  44639. }
  44640. // Edge does not like
  44641. // 1) stun: filtered after 14393 unless ?transport=udp is present
  44642. // 2) turn: that does not have all of turn:host:port?transport=udp
  44643. // 3) turn: with ipv6 addresses
  44644. // 4) turn: occurring muliple times
  44645. function filterIceServers(iceServers, edgeVersion) {
  44646. var hasTurn = false;
  44647. iceServers = JSON.parse(JSON.stringify(iceServers));
  44648. return iceServers.filter(function(server) {
  44649. if (server && (server.urls || server.url)) {
  44650. var urls = server.urls || server.url;
  44651. if (server.url && !server.urls) {
  44652. console.warn('RTCIceServer.url is deprecated! Use urls instead.');
  44653. }
  44654. var isString = typeof urls === 'string';
  44655. if (isString) {
  44656. urls = [urls];
  44657. }
  44658. urls = urls.filter(function(url) {
  44659. var validTurn = url.indexOf('turn:') === 0 &&
  44660. url.indexOf('transport=udp') !== -1 &&
  44661. url.indexOf('turn:[') === -1 &&
  44662. !hasTurn;
  44663. if (validTurn) {
  44664. hasTurn = true;
  44665. return true;
  44666. }
  44667. return url.indexOf('stun:') === 0 && edgeVersion >= 14393 &&
  44668. url.indexOf('?transport=udp') === -1;
  44669. });
  44670. delete server.url;
  44671. server.urls = isString ? urls[0] : urls;
  44672. return !!urls.length;
  44673. }
  44674. });
  44675. }
  44676. // Determines the intersection of local and remote capabilities.
  44677. function getCommonCapabilities(localCapabilities, remoteCapabilities) {
  44678. var commonCapabilities = {
  44679. codecs: [],
  44680. headerExtensions: [],
  44681. fecMechanisms: []
  44682. };
  44683. var findCodecByPayloadType = function(pt, codecs) {
  44684. pt = parseInt(pt, 10);
  44685. for (var i = 0; i < codecs.length; i++) {
  44686. if (codecs[i].payloadType === pt ||
  44687. codecs[i].preferredPayloadType === pt) {
  44688. return codecs[i];
  44689. }
  44690. }
  44691. };
  44692. var rtxCapabilityMatches = function(lRtx, rRtx, lCodecs, rCodecs) {
  44693. var lCodec = findCodecByPayloadType(lRtx.parameters.apt, lCodecs);
  44694. var rCodec = findCodecByPayloadType(rRtx.parameters.apt, rCodecs);
  44695. return lCodec && rCodec &&
  44696. lCodec.name.toLowerCase() === rCodec.name.toLowerCase();
  44697. };
  44698. localCapabilities.codecs.forEach(function(lCodec) {
  44699. for (var i = 0; i < remoteCapabilities.codecs.length; i++) {
  44700. var rCodec = remoteCapabilities.codecs[i];
  44701. if (lCodec.name.toLowerCase() === rCodec.name.toLowerCase() &&
  44702. lCodec.clockRate === rCodec.clockRate) {
  44703. if (lCodec.name.toLowerCase() === 'rtx' &&
  44704. lCodec.parameters && rCodec.parameters.apt) {
  44705. // for RTX we need to find the local rtx that has a apt
  44706. // which points to the same local codec as the remote one.
  44707. if (!rtxCapabilityMatches(lCodec, rCodec,
  44708. localCapabilities.codecs, remoteCapabilities.codecs)) {
  44709. continue;
  44710. }
  44711. }
  44712. rCodec = JSON.parse(JSON.stringify(rCodec)); // deepcopy
  44713. // number of channels is the highest common number of channels
  44714. rCodec.numChannels = Math.min(lCodec.numChannels,
  44715. rCodec.numChannels);
  44716. // push rCodec so we reply with offerer payload type
  44717. commonCapabilities.codecs.push(rCodec);
  44718. // determine common feedback mechanisms
  44719. rCodec.rtcpFeedback = rCodec.rtcpFeedback.filter(function(fb) {
  44720. for (var j = 0; j < lCodec.rtcpFeedback.length; j++) {
  44721. if (lCodec.rtcpFeedback[j].type === fb.type &&
  44722. lCodec.rtcpFeedback[j].parameter === fb.parameter) {
  44723. return true;
  44724. }
  44725. }
  44726. return false;
  44727. });
  44728. // FIXME: also need to determine .parameters
  44729. // see https://github.com/openpeer/ortc/issues/569
  44730. break;
  44731. }
  44732. }
  44733. });
  44734. localCapabilities.headerExtensions.forEach(function(lHeaderExtension) {
  44735. for (var i = 0; i < remoteCapabilities.headerExtensions.length;
  44736. i++) {
  44737. var rHeaderExtension = remoteCapabilities.headerExtensions[i];
  44738. if (lHeaderExtension.uri === rHeaderExtension.uri) {
  44739. commonCapabilities.headerExtensions.push(rHeaderExtension);
  44740. break;
  44741. }
  44742. }
  44743. });
  44744. // FIXME: fecMechanisms
  44745. return commonCapabilities;
  44746. }
  44747. // is action=setLocalDescription with type allowed in signalingState
  44748. function isActionAllowedInSignalingState(action, type, signalingState) {
  44749. return {
  44750. offer: {
  44751. setLocalDescription: ['stable', 'have-local-offer'],
  44752. setRemoteDescription: ['stable', 'have-remote-offer']
  44753. },
  44754. answer: {
  44755. setLocalDescription: ['have-remote-offer', 'have-local-pranswer'],
  44756. setRemoteDescription: ['have-local-offer', 'have-remote-pranswer']
  44757. }
  44758. }[type][action].indexOf(signalingState) !== -1;
  44759. }
  44760. function maybeAddCandidate(iceTransport, candidate) {
  44761. // Edge's internal representation adds some fields therefore
  44762. // not all fieldѕ are taken into account.
  44763. var alreadyAdded = iceTransport.getRemoteCandidates()
  44764. .find(function(remoteCandidate) {
  44765. return candidate.foundation === remoteCandidate.foundation &&
  44766. candidate.ip === remoteCandidate.ip &&
  44767. candidate.port === remoteCandidate.port &&
  44768. candidate.priority === remoteCandidate.priority &&
  44769. candidate.protocol === remoteCandidate.protocol &&
  44770. candidate.type === remoteCandidate.type;
  44771. });
  44772. if (!alreadyAdded) {
  44773. iceTransport.addRemoteCandidate(candidate);
  44774. }
  44775. return !alreadyAdded;
  44776. }
  44777. function makeError(name, description) {
  44778. var e = new Error(description);
  44779. e.name = name;
  44780. // legacy error codes from https://heycam.github.io/webidl/#idl-DOMException-error-names
  44781. e.code = {
  44782. NotSupportedError: 9,
  44783. InvalidStateError: 11,
  44784. InvalidAccessError: 15,
  44785. TypeError: undefined,
  44786. OperationError: undefined
  44787. }[name];
  44788. return e;
  44789. }
  44790. module.exports = function(window, edgeVersion) {
  44791. // https://w3c.github.io/mediacapture-main/#mediastream
  44792. // Helper function to add the track to the stream and
  44793. // dispatch the event ourselves.
  44794. function addTrackToStreamAndFireEvent(track, stream) {
  44795. stream.addTrack(track);
  44796. stream.dispatchEvent(new window.MediaStreamTrackEvent('addtrack',
  44797. {track: track}));
  44798. }
  44799. function removeTrackFromStreamAndFireEvent(track, stream) {
  44800. stream.removeTrack(track);
  44801. stream.dispatchEvent(new window.MediaStreamTrackEvent('removetrack',
  44802. {track: track}));
  44803. }
  44804. function fireAddTrack(pc, track, receiver, streams) {
  44805. var trackEvent = new Event('track');
  44806. trackEvent.track = track;
  44807. trackEvent.receiver = receiver;
  44808. trackEvent.transceiver = {receiver: receiver};
  44809. trackEvent.streams = streams;
  44810. window.setTimeout(function() {
  44811. pc._dispatchEvent('track', trackEvent);
  44812. });
  44813. }
  44814. var RTCPeerConnection = function(config) {
  44815. var pc = this;
  44816. var _eventTarget = document.createDocumentFragment();
  44817. ['addEventListener', 'removeEventListener', 'dispatchEvent']
  44818. .forEach(function(method) {
  44819. pc[method] = _eventTarget[method].bind(_eventTarget);
  44820. });
  44821. this.canTrickleIceCandidates = null;
  44822. this.needNegotiation = false;
  44823. this.localStreams = [];
  44824. this.remoteStreams = [];
  44825. this._localDescription = null;
  44826. this._remoteDescription = null;
  44827. this.signalingState = 'stable';
  44828. this.iceConnectionState = 'new';
  44829. this.connectionState = 'new';
  44830. this.iceGatheringState = 'new';
  44831. config = JSON.parse(JSON.stringify(config || {}));
  44832. this.usingBundle = config.bundlePolicy === 'max-bundle';
  44833. if (config.rtcpMuxPolicy === 'negotiate') {
  44834. throw(makeError('NotSupportedError',
  44835. 'rtcpMuxPolicy \'negotiate\' is not supported'));
  44836. } else if (!config.rtcpMuxPolicy) {
  44837. config.rtcpMuxPolicy = 'require';
  44838. }
  44839. switch (config.iceTransportPolicy) {
  44840. case 'all':
  44841. case 'relay':
  44842. break;
  44843. default:
  44844. config.iceTransportPolicy = 'all';
  44845. break;
  44846. }
  44847. switch (config.bundlePolicy) {
  44848. case 'balanced':
  44849. case 'max-compat':
  44850. case 'max-bundle':
  44851. break;
  44852. default:
  44853. config.bundlePolicy = 'balanced';
  44854. break;
  44855. }
  44856. config.iceServers = filterIceServers(config.iceServers || [], edgeVersion);
  44857. this._iceGatherers = [];
  44858. if (config.iceCandidatePoolSize) {
  44859. for (var i = config.iceCandidatePoolSize; i > 0; i--) {
  44860. this._iceGatherers.push(new window.RTCIceGatherer({
  44861. iceServers: config.iceServers,
  44862. gatherPolicy: config.iceTransportPolicy
  44863. }));
  44864. }
  44865. } else {
  44866. config.iceCandidatePoolSize = 0;
  44867. }
  44868. this._config = config;
  44869. // per-track iceGathers, iceTransports, dtlsTransports, rtpSenders, ...
  44870. // everything that is needed to describe a SDP m-line.
  44871. this.transceivers = [];
  44872. this._sdpSessionId = SDPUtils.generateSessionId();
  44873. this._sdpSessionVersion = 0;
  44874. this._dtlsRole = undefined; // role for a=setup to use in answers.
  44875. this._isClosed = false;
  44876. };
  44877. Object.defineProperty(RTCPeerConnection.prototype, 'localDescription', {
  44878. configurable: true,
  44879. get: function() {
  44880. return this._localDescription;
  44881. }
  44882. });
  44883. Object.defineProperty(RTCPeerConnection.prototype, 'remoteDescription', {
  44884. configurable: true,
  44885. get: function() {
  44886. return this._remoteDescription;
  44887. }
  44888. });
  44889. // set up event handlers on prototype
  44890. RTCPeerConnection.prototype.onicecandidate = null;
  44891. RTCPeerConnection.prototype.onaddstream = null;
  44892. RTCPeerConnection.prototype.ontrack = null;
  44893. RTCPeerConnection.prototype.onremovestream = null;
  44894. RTCPeerConnection.prototype.onsignalingstatechange = null;
  44895. RTCPeerConnection.prototype.oniceconnectionstatechange = null;
  44896. RTCPeerConnection.prototype.onconnectionstatechange = null;
  44897. RTCPeerConnection.prototype.onicegatheringstatechange = null;
  44898. RTCPeerConnection.prototype.onnegotiationneeded = null;
  44899. RTCPeerConnection.prototype.ondatachannel = null;
  44900. RTCPeerConnection.prototype._dispatchEvent = function(name, event) {
  44901. if (this._isClosed) {
  44902. return;
  44903. }
  44904. this.dispatchEvent(event);
  44905. if (typeof this['on' + name] === 'function') {
  44906. this['on' + name](event);
  44907. }
  44908. };
  44909. RTCPeerConnection.prototype._emitGatheringStateChange = function() {
  44910. var event = new Event('icegatheringstatechange');
  44911. this._dispatchEvent('icegatheringstatechange', event);
  44912. };
  44913. RTCPeerConnection.prototype.getConfiguration = function() {
  44914. return this._config;
  44915. };
  44916. RTCPeerConnection.prototype.getLocalStreams = function() {
  44917. return this.localStreams;
  44918. };
  44919. RTCPeerConnection.prototype.getRemoteStreams = function() {
  44920. return this.remoteStreams;
  44921. };
  44922. // internal helper to create a transceiver object.
  44923. // (which is not yet the same as the WebRTC 1.0 transceiver)
  44924. RTCPeerConnection.prototype._createTransceiver = function(kind, doNotAdd) {
  44925. var hasBundleTransport = this.transceivers.length > 0;
  44926. var transceiver = {
  44927. track: null,
  44928. iceGatherer: null,
  44929. iceTransport: null,
  44930. dtlsTransport: null,
  44931. localCapabilities: null,
  44932. remoteCapabilities: null,
  44933. rtpSender: null,
  44934. rtpReceiver: null,
  44935. kind: kind,
  44936. mid: null,
  44937. sendEncodingParameters: null,
  44938. recvEncodingParameters: null,
  44939. stream: null,
  44940. associatedRemoteMediaStreams: [],
  44941. wantReceive: true
  44942. };
  44943. if (this.usingBundle && hasBundleTransport) {
  44944. transceiver.iceTransport = this.transceivers[0].iceTransport;
  44945. transceiver.dtlsTransport = this.transceivers[0].dtlsTransport;
  44946. } else {
  44947. var transports = this._createIceAndDtlsTransports();
  44948. transceiver.iceTransport = transports.iceTransport;
  44949. transceiver.dtlsTransport = transports.dtlsTransport;
  44950. }
  44951. if (!doNotAdd) {
  44952. this.transceivers.push(transceiver);
  44953. }
  44954. return transceiver;
  44955. };
  44956. RTCPeerConnection.prototype.addTrack = function(track, stream) {
  44957. if (this._isClosed) {
  44958. throw makeError('InvalidStateError',
  44959. 'Attempted to call addTrack on a closed peerconnection.');
  44960. }
  44961. var alreadyExists = this.transceivers.find(function(s) {
  44962. return s.track === track;
  44963. });
  44964. if (alreadyExists) {
  44965. throw makeError('InvalidAccessError', 'Track already exists.');
  44966. }
  44967. var transceiver;
  44968. for (var i = 0; i < this.transceivers.length; i++) {
  44969. if (!this.transceivers[i].track &&
  44970. this.transceivers[i].kind === track.kind) {
  44971. transceiver = this.transceivers[i];
  44972. }
  44973. }
  44974. if (!transceiver) {
  44975. transceiver = this._createTransceiver(track.kind);
  44976. }
  44977. this._maybeFireNegotiationNeeded();
  44978. if (this.localStreams.indexOf(stream) === -1) {
  44979. this.localStreams.push(stream);
  44980. }
  44981. transceiver.track = track;
  44982. transceiver.stream = stream;
  44983. transceiver.rtpSender = new window.RTCRtpSender(track,
  44984. transceiver.dtlsTransport);
  44985. return transceiver.rtpSender;
  44986. };
  44987. RTCPeerConnection.prototype.addStream = function(stream) {
  44988. var pc = this;
  44989. if (edgeVersion >= 15025) {
  44990. stream.getTracks().forEach(function(track) {
  44991. pc.addTrack(track, stream);
  44992. });
  44993. } else {
  44994. // Clone is necessary for local demos mostly, attaching directly
  44995. // to two different senders does not work (build 10547).
  44996. // Fixed in 15025 (or earlier)
  44997. var clonedStream = stream.clone();
  44998. stream.getTracks().forEach(function(track, idx) {
  44999. var clonedTrack = clonedStream.getTracks()[idx];
  45000. track.addEventListener('enabled', function(event) {
  45001. clonedTrack.enabled = event.enabled;
  45002. });
  45003. });
  45004. clonedStream.getTracks().forEach(function(track) {
  45005. pc.addTrack(track, clonedStream);
  45006. });
  45007. }
  45008. };
  45009. RTCPeerConnection.prototype.removeTrack = function(sender) {
  45010. if (this._isClosed) {
  45011. throw makeError('InvalidStateError',
  45012. 'Attempted to call removeTrack on a closed peerconnection.');
  45013. }
  45014. if (!(sender instanceof window.RTCRtpSender)) {
  45015. throw new TypeError('Argument 1 of RTCPeerConnection.removeTrack ' +
  45016. 'does not implement interface RTCRtpSender.');
  45017. }
  45018. var transceiver = this.transceivers.find(function(t) {
  45019. return t.rtpSender === sender;
  45020. });
  45021. if (!transceiver) {
  45022. throw makeError('InvalidAccessError',
  45023. 'Sender was not created by this connection.');
  45024. }
  45025. var stream = transceiver.stream;
  45026. transceiver.rtpSender.stop();
  45027. transceiver.rtpSender = null;
  45028. transceiver.track = null;
  45029. transceiver.stream = null;
  45030. // remove the stream from the set of local streams
  45031. var localStreams = this.transceivers.map(function(t) {
  45032. return t.stream;
  45033. });
  45034. if (localStreams.indexOf(stream) === -1 &&
  45035. this.localStreams.indexOf(stream) > -1) {
  45036. this.localStreams.splice(this.localStreams.indexOf(stream), 1);
  45037. }
  45038. this._maybeFireNegotiationNeeded();
  45039. };
  45040. RTCPeerConnection.prototype.removeStream = function(stream) {
  45041. var pc = this;
  45042. stream.getTracks().forEach(function(track) {
  45043. var sender = pc.getSenders().find(function(s) {
  45044. return s.track === track;
  45045. });
  45046. if (sender) {
  45047. pc.removeTrack(sender);
  45048. }
  45049. });
  45050. };
  45051. RTCPeerConnection.prototype.getSenders = function() {
  45052. return this.transceivers.filter(function(transceiver) {
  45053. return !!transceiver.rtpSender;
  45054. })
  45055. .map(function(transceiver) {
  45056. return transceiver.rtpSender;
  45057. });
  45058. };
  45059. RTCPeerConnection.prototype.getReceivers = function() {
  45060. return this.transceivers.filter(function(transceiver) {
  45061. return !!transceiver.rtpReceiver;
  45062. })
  45063. .map(function(transceiver) {
  45064. return transceiver.rtpReceiver;
  45065. });
  45066. };
  45067. RTCPeerConnection.prototype._createIceGatherer = function(sdpMLineIndex,
  45068. usingBundle) {
  45069. var pc = this;
  45070. if (usingBundle && sdpMLineIndex > 0) {
  45071. return this.transceivers[0].iceGatherer;
  45072. } else if (this._iceGatherers.length) {
  45073. return this._iceGatherers.shift();
  45074. }
  45075. var iceGatherer = new window.RTCIceGatherer({
  45076. iceServers: this._config.iceServers,
  45077. gatherPolicy: this._config.iceTransportPolicy
  45078. });
  45079. Object.defineProperty(iceGatherer, 'state',
  45080. {value: 'new', writable: true}
  45081. );
  45082. this.transceivers[sdpMLineIndex].bufferedCandidateEvents = [];
  45083. this.transceivers[sdpMLineIndex].bufferCandidates = function(event) {
  45084. var end = !event.candidate || Object.keys(event.candidate).length === 0;
  45085. // polyfill since RTCIceGatherer.state is not implemented in
  45086. // Edge 10547 yet.
  45087. iceGatherer.state = end ? 'completed' : 'gathering';
  45088. if (pc.transceivers[sdpMLineIndex].bufferedCandidateEvents !== null) {
  45089. pc.transceivers[sdpMLineIndex].bufferedCandidateEvents.push(event);
  45090. }
  45091. };
  45092. iceGatherer.addEventListener('localcandidate',
  45093. this.transceivers[sdpMLineIndex].bufferCandidates);
  45094. return iceGatherer;
  45095. };
  45096. // start gathering from an RTCIceGatherer.
  45097. RTCPeerConnection.prototype._gather = function(mid, sdpMLineIndex) {
  45098. var pc = this;
  45099. var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer;
  45100. if (iceGatherer.onlocalcandidate) {
  45101. return;
  45102. }
  45103. var bufferedCandidateEvents =
  45104. this.transceivers[sdpMLineIndex].bufferedCandidateEvents;
  45105. this.transceivers[sdpMLineIndex].bufferedCandidateEvents = null;
  45106. iceGatherer.removeEventListener('localcandidate',
  45107. this.transceivers[sdpMLineIndex].bufferCandidates);
  45108. iceGatherer.onlocalcandidate = function(evt) {
  45109. if (pc.usingBundle && sdpMLineIndex > 0) {
  45110. // if we know that we use bundle we can drop candidates with
  45111. // ѕdpMLineIndex > 0. If we don't do this then our state gets
  45112. // confused since we dispose the extra ice gatherer.
  45113. return;
  45114. }
  45115. var event = new Event('icecandidate');
  45116. event.candidate = {sdpMid: mid, sdpMLineIndex: sdpMLineIndex};
  45117. var cand = evt.candidate;
  45118. // Edge emits an empty object for RTCIceCandidateComplete‥
  45119. var end = !cand || Object.keys(cand).length === 0;
  45120. if (end) {
  45121. // polyfill since RTCIceGatherer.state is not implemented in
  45122. // Edge 10547 yet.
  45123. if (iceGatherer.state === 'new' || iceGatherer.state === 'gathering') {
  45124. iceGatherer.state = 'completed';
  45125. }
  45126. } else {
  45127. if (iceGatherer.state === 'new') {
  45128. iceGatherer.state = 'gathering';
  45129. }
  45130. // RTCIceCandidate doesn't have a component, needs to be added
  45131. cand.component = 1;
  45132. // also the usernameFragment. TODO: update SDP to take both variants.
  45133. cand.ufrag = iceGatherer.getLocalParameters().usernameFragment;
  45134. var serializedCandidate = SDPUtils.writeCandidate(cand);
  45135. event.candidate = Object.assign(event.candidate,
  45136. SDPUtils.parseCandidate(serializedCandidate));
  45137. event.candidate.candidate = serializedCandidate;
  45138. event.candidate.toJSON = function() {
  45139. return {
  45140. candidate: event.candidate.candidate,
  45141. sdpMid: event.candidate.sdpMid,
  45142. sdpMLineIndex: event.candidate.sdpMLineIndex,
  45143. usernameFragment: event.candidate.usernameFragment
  45144. };
  45145. };
  45146. }
  45147. // update local description.
  45148. var sections = SDPUtils.getMediaSections(pc._localDescription.sdp);
  45149. if (!end) {
  45150. sections[event.candidate.sdpMLineIndex] +=
  45151. 'a=' + event.candidate.candidate + '\r\n';
  45152. } else {
  45153. sections[event.candidate.sdpMLineIndex] +=
  45154. 'a=end-of-candidates\r\n';
  45155. }
  45156. pc._localDescription.sdp =
  45157. SDPUtils.getDescription(pc._localDescription.sdp) +
  45158. sections.join('');
  45159. var complete = pc.transceivers.every(function(transceiver) {
  45160. return transceiver.iceGatherer &&
  45161. transceiver.iceGatherer.state === 'completed';
  45162. });
  45163. if (pc.iceGatheringState !== 'gathering') {
  45164. pc.iceGatheringState = 'gathering';
  45165. pc._emitGatheringStateChange();
  45166. }
  45167. // Emit candidate. Also emit null candidate when all gatherers are
  45168. // complete.
  45169. if (!end) {
  45170. pc._dispatchEvent('icecandidate', event);
  45171. }
  45172. if (complete) {
  45173. pc._dispatchEvent('icecandidate', new Event('icecandidate'));
  45174. pc.iceGatheringState = 'complete';
  45175. pc._emitGatheringStateChange();
  45176. }
  45177. };
  45178. // emit already gathered candidates.
  45179. window.setTimeout(function() {
  45180. bufferedCandidateEvents.forEach(function(e) {
  45181. iceGatherer.onlocalcandidate(e);
  45182. });
  45183. }, 0);
  45184. };
  45185. // Create ICE transport and DTLS transport.
  45186. RTCPeerConnection.prototype._createIceAndDtlsTransports = function() {
  45187. var pc = this;
  45188. var iceTransport = new window.RTCIceTransport(null);
  45189. iceTransport.onicestatechange = function() {
  45190. pc._updateIceConnectionState();
  45191. pc._updateConnectionState();
  45192. };
  45193. var dtlsTransport = new window.RTCDtlsTransport(iceTransport);
  45194. dtlsTransport.ondtlsstatechange = function() {
  45195. pc._updateConnectionState();
  45196. };
  45197. dtlsTransport.onerror = function() {
  45198. // onerror does not set state to failed by itself.
  45199. Object.defineProperty(dtlsTransport, 'state',
  45200. {value: 'failed', writable: true});
  45201. pc._updateConnectionState();
  45202. };
  45203. return {
  45204. iceTransport: iceTransport,
  45205. dtlsTransport: dtlsTransport
  45206. };
  45207. };
  45208. // Destroy ICE gatherer, ICE transport and DTLS transport.
  45209. // Without triggering the callbacks.
  45210. RTCPeerConnection.prototype._disposeIceAndDtlsTransports = function(
  45211. sdpMLineIndex) {
  45212. var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer;
  45213. if (iceGatherer) {
  45214. delete iceGatherer.onlocalcandidate;
  45215. delete this.transceivers[sdpMLineIndex].iceGatherer;
  45216. }
  45217. var iceTransport = this.transceivers[sdpMLineIndex].iceTransport;
  45218. if (iceTransport) {
  45219. delete iceTransport.onicestatechange;
  45220. delete this.transceivers[sdpMLineIndex].iceTransport;
  45221. }
  45222. var dtlsTransport = this.transceivers[sdpMLineIndex].dtlsTransport;
  45223. if (dtlsTransport) {
  45224. delete dtlsTransport.ondtlsstatechange;
  45225. delete dtlsTransport.onerror;
  45226. delete this.transceivers[sdpMLineIndex].dtlsTransport;
  45227. }
  45228. };
  45229. // Start the RTP Sender and Receiver for a transceiver.
  45230. RTCPeerConnection.prototype._transceive = function(transceiver,
  45231. send, recv) {
  45232. var params = getCommonCapabilities(transceiver.localCapabilities,
  45233. transceiver.remoteCapabilities);
  45234. if (send && transceiver.rtpSender) {
  45235. params.encodings = transceiver.sendEncodingParameters;
  45236. params.rtcp = {
  45237. cname: SDPUtils.localCName,
  45238. compound: transceiver.rtcpParameters.compound
  45239. };
  45240. if (transceiver.recvEncodingParameters.length) {
  45241. params.rtcp.ssrc = transceiver.recvEncodingParameters[0].ssrc;
  45242. }
  45243. transceiver.rtpSender.send(params);
  45244. }
  45245. if (recv && transceiver.rtpReceiver && params.codecs.length > 0) {
  45246. // remove RTX field in Edge 14942
  45247. if (transceiver.kind === 'video'
  45248. && transceiver.recvEncodingParameters
  45249. && edgeVersion < 15019) {
  45250. transceiver.recvEncodingParameters.forEach(function(p) {
  45251. delete p.rtx;
  45252. });
  45253. }
  45254. if (transceiver.recvEncodingParameters.length) {
  45255. params.encodings = transceiver.recvEncodingParameters;
  45256. } else {
  45257. params.encodings = [{}];
  45258. }
  45259. params.rtcp = {
  45260. compound: transceiver.rtcpParameters.compound
  45261. };
  45262. if (transceiver.rtcpParameters.cname) {
  45263. params.rtcp.cname = transceiver.rtcpParameters.cname;
  45264. }
  45265. if (transceiver.sendEncodingParameters.length) {
  45266. params.rtcp.ssrc = transceiver.sendEncodingParameters[0].ssrc;
  45267. }
  45268. transceiver.rtpReceiver.receive(params);
  45269. }
  45270. };
  45271. RTCPeerConnection.prototype.setLocalDescription = function(description) {
  45272. var pc = this;
  45273. // Note: pranswer is not supported.
  45274. if (['offer', 'answer'].indexOf(description.type) === -1) {
  45275. return Promise.reject(makeError('TypeError',
  45276. 'Unsupported type "' + description.type + '"'));
  45277. }
  45278. if (!isActionAllowedInSignalingState('setLocalDescription',
  45279. description.type, pc.signalingState) || pc._isClosed) {
  45280. return Promise.reject(makeError('InvalidStateError',
  45281. 'Can not set local ' + description.type +
  45282. ' in state ' + pc.signalingState));
  45283. }
  45284. var sections;
  45285. var sessionpart;
  45286. if (description.type === 'offer') {
  45287. // VERY limited support for SDP munging. Limited to:
  45288. // * changing the order of codecs
  45289. sections = SDPUtils.splitSections(description.sdp);
  45290. sessionpart = sections.shift();
  45291. sections.forEach(function(mediaSection, sdpMLineIndex) {
  45292. var caps = SDPUtils.parseRtpParameters(mediaSection);
  45293. pc.transceivers[sdpMLineIndex].localCapabilities = caps;
  45294. });
  45295. pc.transceivers.forEach(function(transceiver, sdpMLineIndex) {
  45296. pc._gather(transceiver.mid, sdpMLineIndex);
  45297. });
  45298. } else if (description.type === 'answer') {
  45299. sections = SDPUtils.splitSections(pc._remoteDescription.sdp);
  45300. sessionpart = sections.shift();
  45301. var isIceLite = SDPUtils.matchPrefix(sessionpart,
  45302. 'a=ice-lite').length > 0;
  45303. sections.forEach(function(mediaSection, sdpMLineIndex) {
  45304. var transceiver = pc.transceivers[sdpMLineIndex];
  45305. var iceGatherer = transceiver.iceGatherer;
  45306. var iceTransport = transceiver.iceTransport;
  45307. var dtlsTransport = transceiver.dtlsTransport;
  45308. var localCapabilities = transceiver.localCapabilities;
  45309. var remoteCapabilities = transceiver.remoteCapabilities;
  45310. // treat bundle-only as not-rejected.
  45311. var rejected = SDPUtils.isRejected(mediaSection) &&
  45312. SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 0;
  45313. if (!rejected && !transceiver.rejected) {
  45314. var remoteIceParameters = SDPUtils.getIceParameters(
  45315. mediaSection, sessionpart);
  45316. var remoteDtlsParameters = SDPUtils.getDtlsParameters(
  45317. mediaSection, sessionpart);
  45318. if (isIceLite) {
  45319. remoteDtlsParameters.role = 'server';
  45320. }
  45321. if (!pc.usingBundle || sdpMLineIndex === 0) {
  45322. pc._gather(transceiver.mid, sdpMLineIndex);
  45323. if (iceTransport.state === 'new') {
  45324. iceTransport.start(iceGatherer, remoteIceParameters,
  45325. isIceLite ? 'controlling' : 'controlled');
  45326. }
  45327. if (dtlsTransport.state === 'new') {
  45328. dtlsTransport.start(remoteDtlsParameters);
  45329. }
  45330. }
  45331. // Calculate intersection of capabilities.
  45332. var params = getCommonCapabilities(localCapabilities,
  45333. remoteCapabilities);
  45334. // Start the RTCRtpSender. The RTCRtpReceiver for this
  45335. // transceiver has already been started in setRemoteDescription.
  45336. pc._transceive(transceiver,
  45337. params.codecs.length > 0,
  45338. false);
  45339. }
  45340. });
  45341. }
  45342. pc._localDescription = {
  45343. type: description.type,
  45344. sdp: description.sdp
  45345. };
  45346. if (description.type === 'offer') {
  45347. pc._updateSignalingState('have-local-offer');
  45348. } else {
  45349. pc._updateSignalingState('stable');
  45350. }
  45351. return Promise.resolve();
  45352. };
  45353. RTCPeerConnection.prototype.setRemoteDescription = function(description) {
  45354. var pc = this;
  45355. // Note: pranswer is not supported.
  45356. if (['offer', 'answer'].indexOf(description.type) === -1) {
  45357. return Promise.reject(makeError('TypeError',
  45358. 'Unsupported type "' + description.type + '"'));
  45359. }
  45360. if (!isActionAllowedInSignalingState('setRemoteDescription',
  45361. description.type, pc.signalingState) || pc._isClosed) {
  45362. return Promise.reject(makeError('InvalidStateError',
  45363. 'Can not set remote ' + description.type +
  45364. ' in state ' + pc.signalingState));
  45365. }
  45366. var streams = {};
  45367. pc.remoteStreams.forEach(function(stream) {
  45368. streams[stream.id] = stream;
  45369. });
  45370. var receiverList = [];
  45371. var sections = SDPUtils.splitSections(description.sdp);
  45372. var sessionpart = sections.shift();
  45373. var isIceLite = SDPUtils.matchPrefix(sessionpart,
  45374. 'a=ice-lite').length > 0;
  45375. var usingBundle = SDPUtils.matchPrefix(sessionpart,
  45376. 'a=group:BUNDLE ').length > 0;
  45377. pc.usingBundle = usingBundle;
  45378. var iceOptions = SDPUtils.matchPrefix(sessionpart,
  45379. 'a=ice-options:')[0];
  45380. if (iceOptions) {
  45381. pc.canTrickleIceCandidates = iceOptions.substr(14).split(' ')
  45382. .indexOf('trickle') >= 0;
  45383. } else {
  45384. pc.canTrickleIceCandidates = false;
  45385. }
  45386. sections.forEach(function(mediaSection, sdpMLineIndex) {
  45387. var lines = SDPUtils.splitLines(mediaSection);
  45388. var kind = SDPUtils.getKind(mediaSection);
  45389. // treat bundle-only as not-rejected.
  45390. var rejected = SDPUtils.isRejected(mediaSection) &&
  45391. SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 0;
  45392. var protocol = lines[0].substr(2).split(' ')[2];
  45393. var direction = SDPUtils.getDirection(mediaSection, sessionpart);
  45394. var remoteMsid = SDPUtils.parseMsid(mediaSection);
  45395. var mid = SDPUtils.getMid(mediaSection) || SDPUtils.generateIdentifier();
  45396. // Reject datachannels which are not implemented yet.
  45397. if (rejected || (kind === 'application' && (protocol === 'DTLS/SCTP' ||
  45398. protocol === 'UDP/DTLS/SCTP'))) {
  45399. // TODO: this is dangerous in the case where a non-rejected m-line
  45400. // becomes rejected.
  45401. pc.transceivers[sdpMLineIndex] = {
  45402. mid: mid,
  45403. kind: kind,
  45404. protocol: protocol,
  45405. rejected: true
  45406. };
  45407. return;
  45408. }
  45409. if (!rejected && pc.transceivers[sdpMLineIndex] &&
  45410. pc.transceivers[sdpMLineIndex].rejected) {
  45411. // recycle a rejected transceiver.
  45412. pc.transceivers[sdpMLineIndex] = pc._createTransceiver(kind, true);
  45413. }
  45414. var transceiver;
  45415. var iceGatherer;
  45416. var iceTransport;
  45417. var dtlsTransport;
  45418. var rtpReceiver;
  45419. var sendEncodingParameters;
  45420. var recvEncodingParameters;
  45421. var localCapabilities;
  45422. var track;
  45423. // FIXME: ensure the mediaSection has rtcp-mux set.
  45424. var remoteCapabilities = SDPUtils.parseRtpParameters(mediaSection);
  45425. var remoteIceParameters;
  45426. var remoteDtlsParameters;
  45427. if (!rejected) {
  45428. remoteIceParameters = SDPUtils.getIceParameters(mediaSection,
  45429. sessionpart);
  45430. remoteDtlsParameters = SDPUtils.getDtlsParameters(mediaSection,
  45431. sessionpart);
  45432. remoteDtlsParameters.role = 'client';
  45433. }
  45434. recvEncodingParameters =
  45435. SDPUtils.parseRtpEncodingParameters(mediaSection);
  45436. var rtcpParameters = SDPUtils.parseRtcpParameters(mediaSection);
  45437. var isComplete = SDPUtils.matchPrefix(mediaSection,
  45438. 'a=end-of-candidates', sessionpart).length > 0;
  45439. var cands = SDPUtils.matchPrefix(mediaSection, 'a=candidate:')
  45440. .map(function(cand) {
  45441. return SDPUtils.parseCandidate(cand);
  45442. })
  45443. .filter(function(cand) {
  45444. return cand.component === 1;
  45445. });
  45446. // Check if we can use BUNDLE and dispose transports.
  45447. if ((description.type === 'offer' || description.type === 'answer') &&
  45448. !rejected && usingBundle && sdpMLineIndex > 0 &&
  45449. pc.transceivers[sdpMLineIndex]) {
  45450. pc._disposeIceAndDtlsTransports(sdpMLineIndex);
  45451. pc.transceivers[sdpMLineIndex].iceGatherer =
  45452. pc.transceivers[0].iceGatherer;
  45453. pc.transceivers[sdpMLineIndex].iceTransport =
  45454. pc.transceivers[0].iceTransport;
  45455. pc.transceivers[sdpMLineIndex].dtlsTransport =
  45456. pc.transceivers[0].dtlsTransport;
  45457. if (pc.transceivers[sdpMLineIndex].rtpSender) {
  45458. pc.transceivers[sdpMLineIndex].rtpSender.setTransport(
  45459. pc.transceivers[0].dtlsTransport);
  45460. }
  45461. if (pc.transceivers[sdpMLineIndex].rtpReceiver) {
  45462. pc.transceivers[sdpMLineIndex].rtpReceiver.setTransport(
  45463. pc.transceivers[0].dtlsTransport);
  45464. }
  45465. }
  45466. if (description.type === 'offer' && !rejected) {
  45467. transceiver = pc.transceivers[sdpMLineIndex] ||
  45468. pc._createTransceiver(kind);
  45469. transceiver.mid = mid;
  45470. if (!transceiver.iceGatherer) {
  45471. transceiver.iceGatherer = pc._createIceGatherer(sdpMLineIndex,
  45472. usingBundle);
  45473. }
  45474. if (cands.length && transceiver.iceTransport.state === 'new') {
  45475. if (isComplete && (!usingBundle || sdpMLineIndex === 0)) {
  45476. transceiver.iceTransport.setRemoteCandidates(cands);
  45477. } else {
  45478. cands.forEach(function(candidate) {
  45479. maybeAddCandidate(transceiver.iceTransport, candidate);
  45480. });
  45481. }
  45482. }
  45483. localCapabilities = window.RTCRtpReceiver.getCapabilities(kind);
  45484. // filter RTX until additional stuff needed for RTX is implemented
  45485. // in adapter.js
  45486. if (edgeVersion < 15019) {
  45487. localCapabilities.codecs = localCapabilities.codecs.filter(
  45488. function(codec) {
  45489. return codec.name !== 'rtx';
  45490. });
  45491. }
  45492. sendEncodingParameters = transceiver.sendEncodingParameters || [{
  45493. ssrc: (2 * sdpMLineIndex + 2) * 1001
  45494. }];
  45495. // TODO: rewrite to use http://w3c.github.io/webrtc-pc/#set-associated-remote-streams
  45496. var isNewTrack = false;
  45497. if (direction === 'sendrecv' || direction === 'sendonly') {
  45498. isNewTrack = !transceiver.rtpReceiver;
  45499. rtpReceiver = transceiver.rtpReceiver ||
  45500. new window.RTCRtpReceiver(transceiver.dtlsTransport, kind);
  45501. if (isNewTrack) {
  45502. var stream;
  45503. track = rtpReceiver.track;
  45504. // FIXME: does not work with Plan B.
  45505. if (remoteMsid && remoteMsid.stream === '-') {
  45506. // no-op. a stream id of '-' means: no associated stream.
  45507. } else if (remoteMsid) {
  45508. if (!streams[remoteMsid.stream]) {
  45509. streams[remoteMsid.stream] = new window.MediaStream();
  45510. Object.defineProperty(streams[remoteMsid.stream], 'id', {
  45511. get: function() {
  45512. return remoteMsid.stream;
  45513. }
  45514. });
  45515. }
  45516. Object.defineProperty(track, 'id', {
  45517. get: function() {
  45518. return remoteMsid.track;
  45519. }
  45520. });
  45521. stream = streams[remoteMsid.stream];
  45522. } else {
  45523. if (!streams.default) {
  45524. streams.default = new window.MediaStream();
  45525. }
  45526. stream = streams.default;
  45527. }
  45528. if (stream) {
  45529. addTrackToStreamAndFireEvent(track, stream);
  45530. transceiver.associatedRemoteMediaStreams.push(stream);
  45531. }
  45532. receiverList.push([track, rtpReceiver, stream]);
  45533. }
  45534. } else if (transceiver.rtpReceiver && transceiver.rtpReceiver.track) {
  45535. transceiver.associatedRemoteMediaStreams.forEach(function(s) {
  45536. var nativeTrack = s.getTracks().find(function(t) {
  45537. return t.id === transceiver.rtpReceiver.track.id;
  45538. });
  45539. if (nativeTrack) {
  45540. removeTrackFromStreamAndFireEvent(nativeTrack, s);
  45541. }
  45542. });
  45543. transceiver.associatedRemoteMediaStreams = [];
  45544. }
  45545. transceiver.localCapabilities = localCapabilities;
  45546. transceiver.remoteCapabilities = remoteCapabilities;
  45547. transceiver.rtpReceiver = rtpReceiver;
  45548. transceiver.rtcpParameters = rtcpParameters;
  45549. transceiver.sendEncodingParameters = sendEncodingParameters;
  45550. transceiver.recvEncodingParameters = recvEncodingParameters;
  45551. // Start the RTCRtpReceiver now. The RTPSender is started in
  45552. // setLocalDescription.
  45553. pc._transceive(pc.transceivers[sdpMLineIndex],
  45554. false,
  45555. isNewTrack);
  45556. } else if (description.type === 'answer' && !rejected) {
  45557. transceiver = pc.transceivers[sdpMLineIndex];
  45558. iceGatherer = transceiver.iceGatherer;
  45559. iceTransport = transceiver.iceTransport;
  45560. dtlsTransport = transceiver.dtlsTransport;
  45561. rtpReceiver = transceiver.rtpReceiver;
  45562. sendEncodingParameters = transceiver.sendEncodingParameters;
  45563. localCapabilities = transceiver.localCapabilities;
  45564. pc.transceivers[sdpMLineIndex].recvEncodingParameters =
  45565. recvEncodingParameters;
  45566. pc.transceivers[sdpMLineIndex].remoteCapabilities =
  45567. remoteCapabilities;
  45568. pc.transceivers[sdpMLineIndex].rtcpParameters = rtcpParameters;
  45569. if (cands.length && iceTransport.state === 'new') {
  45570. if ((isIceLite || isComplete) &&
  45571. (!usingBundle || sdpMLineIndex === 0)) {
  45572. iceTransport.setRemoteCandidates(cands);
  45573. } else {
  45574. cands.forEach(function(candidate) {
  45575. maybeAddCandidate(transceiver.iceTransport, candidate);
  45576. });
  45577. }
  45578. }
  45579. if (!usingBundle || sdpMLineIndex === 0) {
  45580. if (iceTransport.state === 'new') {
  45581. iceTransport.start(iceGatherer, remoteIceParameters,
  45582. 'controlling');
  45583. }
  45584. if (dtlsTransport.state === 'new') {
  45585. dtlsTransport.start(remoteDtlsParameters);
  45586. }
  45587. }
  45588. // If the offer contained RTX but the answer did not,
  45589. // remove RTX from sendEncodingParameters.
  45590. var commonCapabilities = getCommonCapabilities(
  45591. transceiver.localCapabilities,
  45592. transceiver.remoteCapabilities);
  45593. var hasRtx = commonCapabilities.codecs.filter(function(c) {
  45594. return c.name.toLowerCase() === 'rtx';
  45595. }).length;
  45596. if (!hasRtx && transceiver.sendEncodingParameters[0].rtx) {
  45597. delete transceiver.sendEncodingParameters[0].rtx;
  45598. }
  45599. pc._transceive(transceiver,
  45600. direction === 'sendrecv' || direction === 'recvonly',
  45601. direction === 'sendrecv' || direction === 'sendonly');
  45602. // TODO: rewrite to use http://w3c.github.io/webrtc-pc/#set-associated-remote-streams
  45603. if (rtpReceiver &&
  45604. (direction === 'sendrecv' || direction === 'sendonly')) {
  45605. track = rtpReceiver.track;
  45606. if (remoteMsid) {
  45607. if (!streams[remoteMsid.stream]) {
  45608. streams[remoteMsid.stream] = new window.MediaStream();
  45609. }
  45610. addTrackToStreamAndFireEvent(track, streams[remoteMsid.stream]);
  45611. receiverList.push([track, rtpReceiver, streams[remoteMsid.stream]]);
  45612. } else {
  45613. if (!streams.default) {
  45614. streams.default = new window.MediaStream();
  45615. }
  45616. addTrackToStreamAndFireEvent(track, streams.default);
  45617. receiverList.push([track, rtpReceiver, streams.default]);
  45618. }
  45619. } else {
  45620. // FIXME: actually the receiver should be created later.
  45621. delete transceiver.rtpReceiver;
  45622. }
  45623. }
  45624. });
  45625. if (pc._dtlsRole === undefined) {
  45626. pc._dtlsRole = description.type === 'offer' ? 'active' : 'passive';
  45627. }
  45628. pc._remoteDescription = {
  45629. type: description.type,
  45630. sdp: description.sdp
  45631. };
  45632. if (description.type === 'offer') {
  45633. pc._updateSignalingState('have-remote-offer');
  45634. } else {
  45635. pc._updateSignalingState('stable');
  45636. }
  45637. Object.keys(streams).forEach(function(sid) {
  45638. var stream = streams[sid];
  45639. if (stream.getTracks().length) {
  45640. if (pc.remoteStreams.indexOf(stream) === -1) {
  45641. pc.remoteStreams.push(stream);
  45642. var event = new Event('addstream');
  45643. event.stream = stream;
  45644. window.setTimeout(function() {
  45645. pc._dispatchEvent('addstream', event);
  45646. });
  45647. }
  45648. receiverList.forEach(function(item) {
  45649. var track = item[0];
  45650. var receiver = item[1];
  45651. if (stream.id !== item[2].id) {
  45652. return;
  45653. }
  45654. fireAddTrack(pc, track, receiver, [stream]);
  45655. });
  45656. }
  45657. });
  45658. receiverList.forEach(function(item) {
  45659. if (item[2]) {
  45660. return;
  45661. }
  45662. fireAddTrack(pc, item[0], item[1], []);
  45663. });
  45664. // check whether addIceCandidate({}) was called within four seconds after
  45665. // setRemoteDescription.
  45666. window.setTimeout(function() {
  45667. if (!(pc && pc.transceivers)) {
  45668. return;
  45669. }
  45670. pc.transceivers.forEach(function(transceiver) {
  45671. if (transceiver.iceTransport &&
  45672. transceiver.iceTransport.state === 'new' &&
  45673. transceiver.iceTransport.getRemoteCandidates().length > 0) {
  45674. console.warn('Timeout for addRemoteCandidate. Consider sending ' +
  45675. 'an end-of-candidates notification');
  45676. transceiver.iceTransport.addRemoteCandidate({});
  45677. }
  45678. });
  45679. }, 4000);
  45680. return Promise.resolve();
  45681. };
  45682. RTCPeerConnection.prototype.close = function() {
  45683. this.transceivers.forEach(function(transceiver) {
  45684. /* not yet
  45685. if (transceiver.iceGatherer) {
  45686. transceiver.iceGatherer.close();
  45687. }
  45688. */
  45689. if (transceiver.iceTransport) {
  45690. transceiver.iceTransport.stop();
  45691. }
  45692. if (transceiver.dtlsTransport) {
  45693. transceiver.dtlsTransport.stop();
  45694. }
  45695. if (transceiver.rtpSender) {
  45696. transceiver.rtpSender.stop();
  45697. }
  45698. if (transceiver.rtpReceiver) {
  45699. transceiver.rtpReceiver.stop();
  45700. }
  45701. });
  45702. // FIXME: clean up tracks, local streams, remote streams, etc
  45703. this._isClosed = true;
  45704. this._updateSignalingState('closed');
  45705. };
  45706. // Update the signaling state.
  45707. RTCPeerConnection.prototype._updateSignalingState = function(newState) {
  45708. this.signalingState = newState;
  45709. var event = new Event('signalingstatechange');
  45710. this._dispatchEvent('signalingstatechange', event);
  45711. };
  45712. // Determine whether to fire the negotiationneeded event.
  45713. RTCPeerConnection.prototype._maybeFireNegotiationNeeded = function() {
  45714. var pc = this;
  45715. if (this.signalingState !== 'stable' || this.needNegotiation === true) {
  45716. return;
  45717. }
  45718. this.needNegotiation = true;
  45719. window.setTimeout(function() {
  45720. if (pc.needNegotiation) {
  45721. pc.needNegotiation = false;
  45722. var event = new Event('negotiationneeded');
  45723. pc._dispatchEvent('negotiationneeded', event);
  45724. }
  45725. }, 0);
  45726. };
  45727. // Update the ice connection state.
  45728. RTCPeerConnection.prototype._updateIceConnectionState = function() {
  45729. var newState;
  45730. var states = {
  45731. 'new': 0,
  45732. closed: 0,
  45733. checking: 0,
  45734. connected: 0,
  45735. completed: 0,
  45736. disconnected: 0,
  45737. failed: 0
  45738. };
  45739. this.transceivers.forEach(function(transceiver) {
  45740. if (transceiver.iceTransport && !transceiver.rejected) {
  45741. states[transceiver.iceTransport.state]++;
  45742. }
  45743. });
  45744. newState = 'new';
  45745. if (states.failed > 0) {
  45746. newState = 'failed';
  45747. } else if (states.checking > 0) {
  45748. newState = 'checking';
  45749. } else if (states.disconnected > 0) {
  45750. newState = 'disconnected';
  45751. } else if (states.new > 0) {
  45752. newState = 'new';
  45753. } else if (states.connected > 0) {
  45754. newState = 'connected';
  45755. } else if (states.completed > 0) {
  45756. newState = 'completed';
  45757. }
  45758. if (newState !== this.iceConnectionState) {
  45759. this.iceConnectionState = newState;
  45760. var event = new Event('iceconnectionstatechange');
  45761. this._dispatchEvent('iceconnectionstatechange', event);
  45762. }
  45763. };
  45764. // Update the connection state.
  45765. RTCPeerConnection.prototype._updateConnectionState = function() {
  45766. var newState;
  45767. var states = {
  45768. 'new': 0,
  45769. closed: 0,
  45770. connecting: 0,
  45771. connected: 0,
  45772. completed: 0,
  45773. disconnected: 0,
  45774. failed: 0
  45775. };
  45776. this.transceivers.forEach(function(transceiver) {
  45777. if (transceiver.iceTransport && transceiver.dtlsTransport &&
  45778. !transceiver.rejected) {
  45779. states[transceiver.iceTransport.state]++;
  45780. states[transceiver.dtlsTransport.state]++;
  45781. }
  45782. });
  45783. // ICETransport.completed and connected are the same for this purpose.
  45784. states.connected += states.completed;
  45785. newState = 'new';
  45786. if (states.failed > 0) {
  45787. newState = 'failed';
  45788. } else if (states.connecting > 0) {
  45789. newState = 'connecting';
  45790. } else if (states.disconnected > 0) {
  45791. newState = 'disconnected';
  45792. } else if (states.new > 0) {
  45793. newState = 'new';
  45794. } else if (states.connected > 0) {
  45795. newState = 'connected';
  45796. }
  45797. if (newState !== this.connectionState) {
  45798. this.connectionState = newState;
  45799. var event = new Event('connectionstatechange');
  45800. this._dispatchEvent('connectionstatechange', event);
  45801. }
  45802. };
  45803. RTCPeerConnection.prototype.createOffer = function() {
  45804. var pc = this;
  45805. if (pc._isClosed) {
  45806. return Promise.reject(makeError('InvalidStateError',
  45807. 'Can not call createOffer after close'));
  45808. }
  45809. var numAudioTracks = pc.transceivers.filter(function(t) {
  45810. return t.kind === 'audio';
  45811. }).length;
  45812. var numVideoTracks = pc.transceivers.filter(function(t) {
  45813. return t.kind === 'video';
  45814. }).length;
  45815. // Determine number of audio and video tracks we need to send/recv.
  45816. var offerOptions = arguments[0];
  45817. if (offerOptions) {
  45818. // Reject Chrome legacy constraints.
  45819. if (offerOptions.mandatory || offerOptions.optional) {
  45820. throw new TypeError(
  45821. 'Legacy mandatory/optional constraints not supported.');
  45822. }
  45823. if (offerOptions.offerToReceiveAudio !== undefined) {
  45824. if (offerOptions.offerToReceiveAudio === true) {
  45825. numAudioTracks = 1;
  45826. } else if (offerOptions.offerToReceiveAudio === false) {
  45827. numAudioTracks = 0;
  45828. } else {
  45829. numAudioTracks = offerOptions.offerToReceiveAudio;
  45830. }
  45831. }
  45832. if (offerOptions.offerToReceiveVideo !== undefined) {
  45833. if (offerOptions.offerToReceiveVideo === true) {
  45834. numVideoTracks = 1;
  45835. } else if (offerOptions.offerToReceiveVideo === false) {
  45836. numVideoTracks = 0;
  45837. } else {
  45838. numVideoTracks = offerOptions.offerToReceiveVideo;
  45839. }
  45840. }
  45841. }
  45842. pc.transceivers.forEach(function(transceiver) {
  45843. if (transceiver.kind === 'audio') {
  45844. numAudioTracks--;
  45845. if (numAudioTracks < 0) {
  45846. transceiver.wantReceive = false;
  45847. }
  45848. } else if (transceiver.kind === 'video') {
  45849. numVideoTracks--;
  45850. if (numVideoTracks < 0) {
  45851. transceiver.wantReceive = false;
  45852. }
  45853. }
  45854. });
  45855. // Create M-lines for recvonly streams.
  45856. while (numAudioTracks > 0 || numVideoTracks > 0) {
  45857. if (numAudioTracks > 0) {
  45858. pc._createTransceiver('audio');
  45859. numAudioTracks--;
  45860. }
  45861. if (numVideoTracks > 0) {
  45862. pc._createTransceiver('video');
  45863. numVideoTracks--;
  45864. }
  45865. }
  45866. var sdp = SDPUtils.writeSessionBoilerplate(pc._sdpSessionId,
  45867. pc._sdpSessionVersion++);
  45868. pc.transceivers.forEach(function(transceiver, sdpMLineIndex) {
  45869. // For each track, create an ice gatherer, ice transport,
  45870. // dtls transport, potentially rtpsender and rtpreceiver.
  45871. var track = transceiver.track;
  45872. var kind = transceiver.kind;
  45873. var mid = transceiver.mid || SDPUtils.generateIdentifier();
  45874. transceiver.mid = mid;
  45875. if (!transceiver.iceGatherer) {
  45876. transceiver.iceGatherer = pc._createIceGatherer(sdpMLineIndex,
  45877. pc.usingBundle);
  45878. }
  45879. var localCapabilities = window.RTCRtpSender.getCapabilities(kind);
  45880. // filter RTX until additional stuff needed for RTX is implemented
  45881. // in adapter.js
  45882. if (edgeVersion < 15019) {
  45883. localCapabilities.codecs = localCapabilities.codecs.filter(
  45884. function(codec) {
  45885. return codec.name !== 'rtx';
  45886. });
  45887. }
  45888. localCapabilities.codecs.forEach(function(codec) {
  45889. // work around https://bugs.chromium.org/p/webrtc/issues/detail?id=6552
  45890. // by adding level-asymmetry-allowed=1
  45891. if (codec.name === 'H264' &&
  45892. codec.parameters['level-asymmetry-allowed'] === undefined) {
  45893. codec.parameters['level-asymmetry-allowed'] = '1';
  45894. }
  45895. // for subsequent offers, we might have to re-use the payload
  45896. // type of the last offer.
  45897. if (transceiver.remoteCapabilities &&
  45898. transceiver.remoteCapabilities.codecs) {
  45899. transceiver.remoteCapabilities.codecs.forEach(function(remoteCodec) {
  45900. if (codec.name.toLowerCase() === remoteCodec.name.toLowerCase() &&
  45901. codec.clockRate === remoteCodec.clockRate) {
  45902. codec.preferredPayloadType = remoteCodec.payloadType;
  45903. }
  45904. });
  45905. }
  45906. });
  45907. localCapabilities.headerExtensions.forEach(function(hdrExt) {
  45908. var remoteExtensions = transceiver.remoteCapabilities &&
  45909. transceiver.remoteCapabilities.headerExtensions || [];
  45910. remoteExtensions.forEach(function(rHdrExt) {
  45911. if (hdrExt.uri === rHdrExt.uri) {
  45912. hdrExt.id = rHdrExt.id;
  45913. }
  45914. });
  45915. });
  45916. // generate an ssrc now, to be used later in rtpSender.send
  45917. var sendEncodingParameters = transceiver.sendEncodingParameters || [{
  45918. ssrc: (2 * sdpMLineIndex + 1) * 1001
  45919. }];
  45920. if (track) {
  45921. // add RTX
  45922. if (edgeVersion >= 15019 && kind === 'video' &&
  45923. !sendEncodingParameters[0].rtx) {
  45924. sendEncodingParameters[0].rtx = {
  45925. ssrc: sendEncodingParameters[0].ssrc + 1
  45926. };
  45927. }
  45928. }
  45929. if (transceiver.wantReceive) {
  45930. transceiver.rtpReceiver = new window.RTCRtpReceiver(
  45931. transceiver.dtlsTransport, kind);
  45932. }
  45933. transceiver.localCapabilities = localCapabilities;
  45934. transceiver.sendEncodingParameters = sendEncodingParameters;
  45935. });
  45936. // always offer BUNDLE and dispose on return if not supported.
  45937. if (pc._config.bundlePolicy !== 'max-compat') {
  45938. sdp += 'a=group:BUNDLE ' + pc.transceivers.map(function(t) {
  45939. return t.mid;
  45940. }).join(' ') + '\r\n';
  45941. }
  45942. sdp += 'a=ice-options:trickle\r\n';
  45943. pc.transceivers.forEach(function(transceiver, sdpMLineIndex) {
  45944. sdp += writeMediaSection(transceiver, transceiver.localCapabilities,
  45945. 'offer', transceiver.stream, pc._dtlsRole);
  45946. sdp += 'a=rtcp-rsize\r\n';
  45947. if (transceiver.iceGatherer && pc.iceGatheringState !== 'new' &&
  45948. (sdpMLineIndex === 0 || !pc.usingBundle)) {
  45949. transceiver.iceGatherer.getLocalCandidates().forEach(function(cand) {
  45950. cand.component = 1;
  45951. sdp += 'a=' + SDPUtils.writeCandidate(cand) + '\r\n';
  45952. });
  45953. if (transceiver.iceGatherer.state === 'completed') {
  45954. sdp += 'a=end-of-candidates\r\n';
  45955. }
  45956. }
  45957. });
  45958. var desc = new window.RTCSessionDescription({
  45959. type: 'offer',
  45960. sdp: sdp
  45961. });
  45962. return Promise.resolve(desc);
  45963. };
  45964. RTCPeerConnection.prototype.createAnswer = function() {
  45965. var pc = this;
  45966. if (pc._isClosed) {
  45967. return Promise.reject(makeError('InvalidStateError',
  45968. 'Can not call createAnswer after close'));
  45969. }
  45970. if (!(pc.signalingState === 'have-remote-offer' ||
  45971. pc.signalingState === 'have-local-pranswer')) {
  45972. return Promise.reject(makeError('InvalidStateError',
  45973. 'Can not call createAnswer in signalingState ' + pc.signalingState));
  45974. }
  45975. var sdp = SDPUtils.writeSessionBoilerplate(pc._sdpSessionId,
  45976. pc._sdpSessionVersion++);
  45977. if (pc.usingBundle) {
  45978. sdp += 'a=group:BUNDLE ' + pc.transceivers.map(function(t) {
  45979. return t.mid;
  45980. }).join(' ') + '\r\n';
  45981. }
  45982. sdp += 'a=ice-options:trickle\r\n';
  45983. var mediaSectionsInOffer = SDPUtils.getMediaSections(
  45984. pc._remoteDescription.sdp).length;
  45985. pc.transceivers.forEach(function(transceiver, sdpMLineIndex) {
  45986. if (sdpMLineIndex + 1 > mediaSectionsInOffer) {
  45987. return;
  45988. }
  45989. if (transceiver.rejected) {
  45990. if (transceiver.kind === 'application') {
  45991. if (transceiver.protocol === 'DTLS/SCTP') { // legacy fmt
  45992. sdp += 'm=application 0 DTLS/SCTP 5000\r\n';
  45993. } else {
  45994. sdp += 'm=application 0 ' + transceiver.protocol +
  45995. ' webrtc-datachannel\r\n';
  45996. }
  45997. } else if (transceiver.kind === 'audio') {
  45998. sdp += 'm=audio 0 UDP/TLS/RTP/SAVPF 0\r\n' +
  45999. 'a=rtpmap:0 PCMU/8000\r\n';
  46000. } else if (transceiver.kind === 'video') {
  46001. sdp += 'm=video 0 UDP/TLS/RTP/SAVPF 120\r\n' +
  46002. 'a=rtpmap:120 VP8/90000\r\n';
  46003. }
  46004. sdp += 'c=IN IP4 0.0.0.0\r\n' +
  46005. 'a=inactive\r\n' +
  46006. 'a=mid:' + transceiver.mid + '\r\n';
  46007. return;
  46008. }
  46009. // FIXME: look at direction.
  46010. if (transceiver.stream) {
  46011. var localTrack;
  46012. if (transceiver.kind === 'audio') {
  46013. localTrack = transceiver.stream.getAudioTracks()[0];
  46014. } else if (transceiver.kind === 'video') {
  46015. localTrack = transceiver.stream.getVideoTracks()[0];
  46016. }
  46017. if (localTrack) {
  46018. // add RTX
  46019. if (edgeVersion >= 15019 && transceiver.kind === 'video' &&
  46020. !transceiver.sendEncodingParameters[0].rtx) {
  46021. transceiver.sendEncodingParameters[0].rtx = {
  46022. ssrc: transceiver.sendEncodingParameters[0].ssrc + 1
  46023. };
  46024. }
  46025. }
  46026. }
  46027. // Calculate intersection of capabilities.
  46028. var commonCapabilities = getCommonCapabilities(
  46029. transceiver.localCapabilities,
  46030. transceiver.remoteCapabilities);
  46031. var hasRtx = commonCapabilities.codecs.filter(function(c) {
  46032. return c.name.toLowerCase() === 'rtx';
  46033. }).length;
  46034. if (!hasRtx && transceiver.sendEncodingParameters[0].rtx) {
  46035. delete transceiver.sendEncodingParameters[0].rtx;
  46036. }
  46037. sdp += writeMediaSection(transceiver, commonCapabilities,
  46038. 'answer', transceiver.stream, pc._dtlsRole);
  46039. if (transceiver.rtcpParameters &&
  46040. transceiver.rtcpParameters.reducedSize) {
  46041. sdp += 'a=rtcp-rsize\r\n';
  46042. }
  46043. });
  46044. var desc = new window.RTCSessionDescription({
  46045. type: 'answer',
  46046. sdp: sdp
  46047. });
  46048. return Promise.resolve(desc);
  46049. };
  46050. RTCPeerConnection.prototype.addIceCandidate = function(candidate) {
  46051. var pc = this;
  46052. var sections;
  46053. if (candidate && !(candidate.sdpMLineIndex !== undefined ||
  46054. candidate.sdpMid)) {
  46055. return Promise.reject(new TypeError('sdpMLineIndex or sdpMid required'));
  46056. }
  46057. // TODO: needs to go into ops queue.
  46058. return new Promise(function(resolve, reject) {
  46059. if (!pc._remoteDescription) {
  46060. return reject(makeError('InvalidStateError',
  46061. 'Can not add ICE candidate without a remote description'));
  46062. } else if (!candidate || candidate.candidate === '') {
  46063. for (var j = 0; j < pc.transceivers.length; j++) {
  46064. if (pc.transceivers[j].rejected) {
  46065. continue;
  46066. }
  46067. pc.transceivers[j].iceTransport.addRemoteCandidate({});
  46068. sections = SDPUtils.getMediaSections(pc._remoteDescription.sdp);
  46069. sections[j] += 'a=end-of-candidates\r\n';
  46070. pc._remoteDescription.sdp =
  46071. SDPUtils.getDescription(pc._remoteDescription.sdp) +
  46072. sections.join('');
  46073. if (pc.usingBundle) {
  46074. break;
  46075. }
  46076. }
  46077. } else {
  46078. var sdpMLineIndex = candidate.sdpMLineIndex;
  46079. if (candidate.sdpMid) {
  46080. for (var i = 0; i < pc.transceivers.length; i++) {
  46081. if (pc.transceivers[i].mid === candidate.sdpMid) {
  46082. sdpMLineIndex = i;
  46083. break;
  46084. }
  46085. }
  46086. }
  46087. var transceiver = pc.transceivers[sdpMLineIndex];
  46088. if (transceiver) {
  46089. if (transceiver.rejected) {
  46090. return resolve();
  46091. }
  46092. var cand = Object.keys(candidate.candidate).length > 0 ?
  46093. SDPUtils.parseCandidate(candidate.candidate) : {};
  46094. // Ignore Chrome's invalid candidates since Edge does not like them.
  46095. if (cand.protocol === 'tcp' && (cand.port === 0 || cand.port === 9)) {
  46096. return resolve();
  46097. }
  46098. // Ignore RTCP candidates, we assume RTCP-MUX.
  46099. if (cand.component && cand.component !== 1) {
  46100. return resolve();
  46101. }
  46102. // when using bundle, avoid adding candidates to the wrong
  46103. // ice transport. And avoid adding candidates added in the SDP.
  46104. if (sdpMLineIndex === 0 || (sdpMLineIndex > 0 &&
  46105. transceiver.iceTransport !== pc.transceivers[0].iceTransport)) {
  46106. if (!maybeAddCandidate(transceiver.iceTransport, cand)) {
  46107. return reject(makeError('OperationError',
  46108. 'Can not add ICE candidate'));
  46109. }
  46110. }
  46111. // update the remoteDescription.
  46112. var candidateString = candidate.candidate.trim();
  46113. if (candidateString.indexOf('a=') === 0) {
  46114. candidateString = candidateString.substr(2);
  46115. }
  46116. sections = SDPUtils.getMediaSections(pc._remoteDescription.sdp);
  46117. sections[sdpMLineIndex] += 'a=' +
  46118. (cand.type ? candidateString : 'end-of-candidates')
  46119. + '\r\n';
  46120. pc._remoteDescription.sdp =
  46121. SDPUtils.getDescription(pc._remoteDescription.sdp) +
  46122. sections.join('');
  46123. } else {
  46124. return reject(makeError('OperationError',
  46125. 'Can not add ICE candidate'));
  46126. }
  46127. }
  46128. resolve();
  46129. });
  46130. };
  46131. RTCPeerConnection.prototype.getStats = function(selector) {
  46132. if (selector && selector instanceof window.MediaStreamTrack) {
  46133. var senderOrReceiver = null;
  46134. this.transceivers.forEach(function(transceiver) {
  46135. if (transceiver.rtpSender &&
  46136. transceiver.rtpSender.track === selector) {
  46137. senderOrReceiver = transceiver.rtpSender;
  46138. } else if (transceiver.rtpReceiver &&
  46139. transceiver.rtpReceiver.track === selector) {
  46140. senderOrReceiver = transceiver.rtpReceiver;
  46141. }
  46142. });
  46143. if (!senderOrReceiver) {
  46144. throw makeError('InvalidAccessError', 'Invalid selector.');
  46145. }
  46146. return senderOrReceiver.getStats();
  46147. }
  46148. var promises = [];
  46149. this.transceivers.forEach(function(transceiver) {
  46150. ['rtpSender', 'rtpReceiver', 'iceGatherer', 'iceTransport',
  46151. 'dtlsTransport'].forEach(function(method) {
  46152. if (transceiver[method]) {
  46153. promises.push(transceiver[method].getStats());
  46154. }
  46155. });
  46156. });
  46157. return Promise.all(promises).then(function(allStats) {
  46158. var results = new Map();
  46159. allStats.forEach(function(stats) {
  46160. stats.forEach(function(stat) {
  46161. results.set(stat.id, stat);
  46162. });
  46163. });
  46164. return results;
  46165. });
  46166. };
  46167. // fix low-level stat names and return Map instead of object.
  46168. var ortcObjects = ['RTCRtpSender', 'RTCRtpReceiver', 'RTCIceGatherer',
  46169. 'RTCIceTransport', 'RTCDtlsTransport'];
  46170. ortcObjects.forEach(function(ortcObjectName) {
  46171. var obj = window[ortcObjectName];
  46172. if (obj && obj.prototype && obj.prototype.getStats) {
  46173. var nativeGetstats = obj.prototype.getStats;
  46174. obj.prototype.getStats = function() {
  46175. return nativeGetstats.apply(this)
  46176. .then(function(nativeStats) {
  46177. var mapStats = new Map();
  46178. Object.keys(nativeStats).forEach(function(id) {
  46179. nativeStats[id].type = fixStatsType(nativeStats[id]);
  46180. mapStats.set(id, nativeStats[id]);
  46181. });
  46182. return mapStats;
  46183. });
  46184. };
  46185. }
  46186. });
  46187. // legacy callback shims. Should be moved to adapter.js some days.
  46188. var methods = ['createOffer', 'createAnswer'];
  46189. methods.forEach(function(method) {
  46190. var nativeMethod = RTCPeerConnection.prototype[method];
  46191. RTCPeerConnection.prototype[method] = function() {
  46192. var args = arguments;
  46193. if (typeof args[0] === 'function' ||
  46194. typeof args[1] === 'function') { // legacy
  46195. return nativeMethod.apply(this, [arguments[2]])
  46196. .then(function(description) {
  46197. if (typeof args[0] === 'function') {
  46198. args[0].apply(null, [description]);
  46199. }
  46200. }, function(error) {
  46201. if (typeof args[1] === 'function') {
  46202. args[1].apply(null, [error]);
  46203. }
  46204. });
  46205. }
  46206. return nativeMethod.apply(this, arguments);
  46207. };
  46208. });
  46209. methods = ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate'];
  46210. methods.forEach(function(method) {
  46211. var nativeMethod = RTCPeerConnection.prototype[method];
  46212. RTCPeerConnection.prototype[method] = function() {
  46213. var args = arguments;
  46214. if (typeof args[1] === 'function' ||
  46215. typeof args[2] === 'function') { // legacy
  46216. return nativeMethod.apply(this, arguments)
  46217. .then(function() {
  46218. if (typeof args[1] === 'function') {
  46219. args[1].apply(null);
  46220. }
  46221. }, function(error) {
  46222. if (typeof args[2] === 'function') {
  46223. args[2].apply(null, [error]);
  46224. }
  46225. });
  46226. }
  46227. return nativeMethod.apply(this, arguments);
  46228. };
  46229. });
  46230. // getStats is special. It doesn't have a spec legacy method yet we support
  46231. // getStats(something, cb) without error callbacks.
  46232. ['getStats'].forEach(function(method) {
  46233. var nativeMethod = RTCPeerConnection.prototype[method];
  46234. RTCPeerConnection.prototype[method] = function() {
  46235. var args = arguments;
  46236. if (typeof args[1] === 'function') {
  46237. return nativeMethod.apply(this, arguments)
  46238. .then(function() {
  46239. if (typeof args[1] === 'function') {
  46240. args[1].apply(null);
  46241. }
  46242. });
  46243. }
  46244. return nativeMethod.apply(this, arguments);
  46245. };
  46246. });
  46247. return RTCPeerConnection;
  46248. };
  46249. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  46250. /***/ }),
  46251. /* 539 */
  46252. /***/ (function(module, exports, __webpack_require__) {
  46253. "use strict";
  46254. /* WEBPACK VAR INJECTION */(function(Promise) {/*
  46255. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  46256. *
  46257. * Use of this source code is governed by a BSD-style license
  46258. * that can be found in the LICENSE file in the root of the source
  46259. * tree.
  46260. */
  46261. /* eslint-env node */
  46262. // Expose public methods.
  46263. module.exports = function(window) {
  46264. var navigator = window && window.navigator;
  46265. var shimError_ = function(e) {
  46266. return {
  46267. name: {PermissionDeniedError: 'NotAllowedError'}[e.name] || e.name,
  46268. message: e.message,
  46269. constraint: e.constraint,
  46270. toString: function() {
  46271. return this.name;
  46272. }
  46273. };
  46274. };
  46275. // getUserMedia error shim.
  46276. var origGetUserMedia = navigator.mediaDevices.getUserMedia.
  46277. bind(navigator.mediaDevices);
  46278. navigator.mediaDevices.getUserMedia = function(c) {
  46279. return origGetUserMedia(c).catch(function(e) {
  46280. return Promise.reject(shimError_(e));
  46281. });
  46282. };
  46283. };
  46284. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  46285. /***/ }),
  46286. /* 540 */
  46287. /***/ (function(module, exports, __webpack_require__) {
  46288. "use strict";
  46289. /* WEBPACK VAR INJECTION */(function(Promise) {/*
  46290. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  46291. *
  46292. * Use of this source code is governed by a BSD-style license
  46293. * that can be found in the LICENSE file in the root of the source
  46294. * tree.
  46295. */
  46296. /* eslint-env node */
  46297. var utils = __webpack_require__(25);
  46298. module.exports = {
  46299. shimGetUserMedia: __webpack_require__(541),
  46300. shimOnTrack: function(window) {
  46301. if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in
  46302. window.RTCPeerConnection.prototype)) {
  46303. Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {
  46304. get: function() {
  46305. return this._ontrack;
  46306. },
  46307. set: function(f) {
  46308. if (this._ontrack) {
  46309. this.removeEventListener('track', this._ontrack);
  46310. this.removeEventListener('addstream', this._ontrackpoly);
  46311. }
  46312. this.addEventListener('track', this._ontrack = f);
  46313. this.addEventListener('addstream', this._ontrackpoly = function(e) {
  46314. e.stream.getTracks().forEach(function(track) {
  46315. var event = new Event('track');
  46316. event.track = track;
  46317. event.receiver = {track: track};
  46318. event.transceiver = {receiver: event.receiver};
  46319. event.streams = [e.stream];
  46320. this.dispatchEvent(event);
  46321. }.bind(this));
  46322. }.bind(this));
  46323. },
  46324. enumerable: true,
  46325. configurable: true
  46326. });
  46327. }
  46328. if (typeof window === 'object' && window.RTCTrackEvent &&
  46329. ('receiver' in window.RTCTrackEvent.prototype) &&
  46330. !('transceiver' in window.RTCTrackEvent.prototype)) {
  46331. Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', {
  46332. get: function() {
  46333. return {receiver: this.receiver};
  46334. }
  46335. });
  46336. }
  46337. },
  46338. shimSourceObject: function(window) {
  46339. // Firefox has supported mozSrcObject since FF22, unprefixed in 42.
  46340. if (typeof window === 'object') {
  46341. if (window.HTMLMediaElement &&
  46342. !('srcObject' in window.HTMLMediaElement.prototype)) {
  46343. // Shim the srcObject property, once, when HTMLMediaElement is found.
  46344. Object.defineProperty(window.HTMLMediaElement.prototype, 'srcObject', {
  46345. get: function() {
  46346. return this.mozSrcObject;
  46347. },
  46348. set: function(stream) {
  46349. this.mozSrcObject = stream;
  46350. }
  46351. });
  46352. }
  46353. }
  46354. },
  46355. shimPeerConnection: function(window) {
  46356. var browserDetails = utils.detectBrowser(window);
  46357. if (typeof window !== 'object' || !(window.RTCPeerConnection ||
  46358. window.mozRTCPeerConnection)) {
  46359. return; // probably media.peerconnection.enabled=false in about:config
  46360. }
  46361. // The RTCPeerConnection object.
  46362. if (!window.RTCPeerConnection) {
  46363. window.RTCPeerConnection = function(pcConfig, pcConstraints) {
  46364. if (browserDetails.version < 38) {
  46365. // .urls is not supported in FF < 38.
  46366. // create RTCIceServers with a single url.
  46367. if (pcConfig && pcConfig.iceServers) {
  46368. var newIceServers = [];
  46369. for (var i = 0; i < pcConfig.iceServers.length; i++) {
  46370. var server = pcConfig.iceServers[i];
  46371. if (server.hasOwnProperty('urls')) {
  46372. for (var j = 0; j < server.urls.length; j++) {
  46373. var newServer = {
  46374. url: server.urls[j]
  46375. };
  46376. if (server.urls[j].indexOf('turn') === 0) {
  46377. newServer.username = server.username;
  46378. newServer.credential = server.credential;
  46379. }
  46380. newIceServers.push(newServer);
  46381. }
  46382. } else {
  46383. newIceServers.push(pcConfig.iceServers[i]);
  46384. }
  46385. }
  46386. pcConfig.iceServers = newIceServers;
  46387. }
  46388. }
  46389. return new window.mozRTCPeerConnection(pcConfig, pcConstraints);
  46390. };
  46391. window.RTCPeerConnection.prototype =
  46392. window.mozRTCPeerConnection.prototype;
  46393. // wrap static methods. Currently just generateCertificate.
  46394. if (window.mozRTCPeerConnection.generateCertificate) {
  46395. Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {
  46396. get: function() {
  46397. return window.mozRTCPeerConnection.generateCertificate;
  46398. }
  46399. });
  46400. }
  46401. window.RTCSessionDescription = window.mozRTCSessionDescription;
  46402. window.RTCIceCandidate = window.mozRTCIceCandidate;
  46403. }
  46404. // shim away need for obsolete RTCIceCandidate/RTCSessionDescription.
  46405. ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']
  46406. .forEach(function(method) {
  46407. var nativeMethod = window.RTCPeerConnection.prototype[method];
  46408. window.RTCPeerConnection.prototype[method] = function() {
  46409. arguments[0] = new ((method === 'addIceCandidate') ?
  46410. window.RTCIceCandidate :
  46411. window.RTCSessionDescription)(arguments[0]);
  46412. return nativeMethod.apply(this, arguments);
  46413. };
  46414. });
  46415. // support for addIceCandidate(null or undefined)
  46416. var nativeAddIceCandidate =
  46417. window.RTCPeerConnection.prototype.addIceCandidate;
  46418. window.RTCPeerConnection.prototype.addIceCandidate = function() {
  46419. if (!arguments[0]) {
  46420. if (arguments[1]) {
  46421. arguments[1].apply(null);
  46422. }
  46423. return Promise.resolve();
  46424. }
  46425. return nativeAddIceCandidate.apply(this, arguments);
  46426. };
  46427. // shim getStats with maplike support
  46428. var makeMapStats = function(stats) {
  46429. var map = new Map();
  46430. Object.keys(stats).forEach(function(key) {
  46431. map.set(key, stats[key]);
  46432. map[key] = stats[key];
  46433. });
  46434. return map;
  46435. };
  46436. var modernStatsTypes = {
  46437. inboundrtp: 'inbound-rtp',
  46438. outboundrtp: 'outbound-rtp',
  46439. candidatepair: 'candidate-pair',
  46440. localcandidate: 'local-candidate',
  46441. remotecandidate: 'remote-candidate'
  46442. };
  46443. var nativeGetStats = window.RTCPeerConnection.prototype.getStats;
  46444. window.RTCPeerConnection.prototype.getStats = function(
  46445. selector,
  46446. onSucc,
  46447. onErr
  46448. ) {
  46449. return nativeGetStats.apply(this, [selector || null])
  46450. .then(function(stats) {
  46451. if (browserDetails.version < 48) {
  46452. stats = makeMapStats(stats);
  46453. }
  46454. if (browserDetails.version < 53 && !onSucc) {
  46455. // Shim only promise getStats with spec-hyphens in type names
  46456. // Leave callback version alone; misc old uses of forEach before Map
  46457. try {
  46458. stats.forEach(function(stat) {
  46459. stat.type = modernStatsTypes[stat.type] || stat.type;
  46460. });
  46461. } catch (e) {
  46462. if (e.name !== 'TypeError') {
  46463. throw e;
  46464. }
  46465. // Avoid TypeError: "type" is read-only, in old versions. 34-43ish
  46466. stats.forEach(function(stat, i) {
  46467. stats.set(i, Object.assign({}, stat, {
  46468. type: modernStatsTypes[stat.type] || stat.type
  46469. }));
  46470. });
  46471. }
  46472. }
  46473. return stats;
  46474. })
  46475. .then(onSucc, onErr);
  46476. };
  46477. },
  46478. shimSenderGetStats: function(window) {
  46479. if (!(typeof window === 'object' && window.RTCPeerConnection &&
  46480. window.RTCRtpSender)) {
  46481. return;
  46482. }
  46483. if (window.RTCRtpSender && 'getStats' in window.RTCRtpSender.prototype) {
  46484. return;
  46485. }
  46486. var origGetSenders = window.RTCPeerConnection.prototype.getSenders;
  46487. if (origGetSenders) {
  46488. window.RTCPeerConnection.prototype.getSenders = function() {
  46489. var pc = this;
  46490. var senders = origGetSenders.apply(pc, []);
  46491. senders.forEach(function(sender) {
  46492. sender._pc = pc;
  46493. });
  46494. return senders;
  46495. };
  46496. }
  46497. var origAddTrack = window.RTCPeerConnection.prototype.addTrack;
  46498. if (origAddTrack) {
  46499. window.RTCPeerConnection.prototype.addTrack = function() {
  46500. var sender = origAddTrack.apply(this, arguments);
  46501. sender._pc = this;
  46502. return sender;
  46503. };
  46504. }
  46505. window.RTCRtpSender.prototype.getStats = function() {
  46506. return this.track ? this._pc.getStats(this.track) :
  46507. Promise.resolve(new Map());
  46508. };
  46509. },
  46510. shimReceiverGetStats: function(window) {
  46511. if (!(typeof window === 'object' && window.RTCPeerConnection &&
  46512. window.RTCRtpSender)) {
  46513. return;
  46514. }
  46515. if (window.RTCRtpSender && 'getStats' in window.RTCRtpReceiver.prototype) {
  46516. return;
  46517. }
  46518. var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers;
  46519. if (origGetReceivers) {
  46520. window.RTCPeerConnection.prototype.getReceivers = function() {
  46521. var pc = this;
  46522. var receivers = origGetReceivers.apply(pc, []);
  46523. receivers.forEach(function(receiver) {
  46524. receiver._pc = pc;
  46525. });
  46526. return receivers;
  46527. };
  46528. }
  46529. utils.wrapPeerConnectionEvent(window, 'track', function(e) {
  46530. e.receiver._pc = e.srcElement;
  46531. return e;
  46532. });
  46533. window.RTCRtpReceiver.prototype.getStats = function() {
  46534. return this._pc.getStats(this.track);
  46535. };
  46536. },
  46537. shimRemoveStream: function(window) {
  46538. if (!window.RTCPeerConnection ||
  46539. 'removeStream' in window.RTCPeerConnection.prototype) {
  46540. return;
  46541. }
  46542. window.RTCPeerConnection.prototype.removeStream = function(stream) {
  46543. var pc = this;
  46544. utils.deprecated('removeStream', 'removeTrack');
  46545. this.getSenders().forEach(function(sender) {
  46546. if (sender.track && stream.getTracks().indexOf(sender.track) !== -1) {
  46547. pc.removeTrack(sender);
  46548. }
  46549. });
  46550. };
  46551. },
  46552. shimRTCDataChannel: function(window) {
  46553. // rename DataChannel to RTCDataChannel (native fix in FF60):
  46554. // https://bugzilla.mozilla.org/show_bug.cgi?id=1173851
  46555. if (window.DataChannel && !window.RTCDataChannel) {
  46556. window.RTCDataChannel = window.DataChannel;
  46557. }
  46558. },
  46559. shimGetDisplayMedia: function(window, preferredMediaSource) {
  46560. if (!window.navigator || !window.navigator.mediaDevices ||
  46561. 'getDisplayMedia' in window.navigator.mediaDevices) {
  46562. return;
  46563. }
  46564. window.navigator.mediaDevices.getDisplayMedia = function(constraints) {
  46565. if (!(constraints && constraints.video)) {
  46566. var err = new DOMException('getDisplayMedia without video ' +
  46567. 'constraints is undefined');
  46568. err.name = 'NotFoundError';
  46569. // from https://heycam.github.io/webidl/#idl-DOMException-error-names
  46570. err.code = 8;
  46571. return Promise.reject(err);
  46572. }
  46573. if (constraints.video === true) {
  46574. constraints.video = {mediaSource: preferredMediaSource};
  46575. } else {
  46576. constraints.video.mediaSource = preferredMediaSource;
  46577. }
  46578. return window.navigator.mediaDevices.getUserMedia(constraints);
  46579. };
  46580. window.navigator.getDisplayMedia = function(constraints) {
  46581. utils.deprecated('navigator.getDisplayMedia',
  46582. 'navigator.mediaDevices.getDisplayMedia');
  46583. return window.navigator.mediaDevices.getDisplayMedia(constraints);
  46584. };
  46585. }
  46586. };
  46587. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  46588. /***/ }),
  46589. /* 541 */
  46590. /***/ (function(module, exports, __webpack_require__) {
  46591. "use strict";
  46592. /* WEBPACK VAR INJECTION */(function(Promise) {/*
  46593. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  46594. *
  46595. * Use of this source code is governed by a BSD-style license
  46596. * that can be found in the LICENSE file in the root of the source
  46597. * tree.
  46598. */
  46599. /* eslint-env node */
  46600. var utils = __webpack_require__(25);
  46601. var logging = utils.log;
  46602. // Expose public methods.
  46603. module.exports = function(window) {
  46604. var browserDetails = utils.detectBrowser(window);
  46605. var navigator = window && window.navigator;
  46606. var MediaStreamTrack = window && window.MediaStreamTrack;
  46607. var shimError_ = function(e) {
  46608. return {
  46609. name: {
  46610. InternalError: 'NotReadableError',
  46611. NotSupportedError: 'TypeError',
  46612. PermissionDeniedError: 'NotAllowedError',
  46613. SecurityError: 'NotAllowedError'
  46614. }[e.name] || e.name,
  46615. message: {
  46616. 'The operation is insecure.': 'The request is not allowed by the ' +
  46617. 'user agent or the platform in the current context.'
  46618. }[e.message] || e.message,
  46619. constraint: e.constraint,
  46620. toString: function() {
  46621. return this.name + (this.message && ': ') + this.message;
  46622. }
  46623. };
  46624. };
  46625. // getUserMedia constraints shim.
  46626. var getUserMedia_ = function(constraints, onSuccess, onError) {
  46627. var constraintsToFF37_ = function(c) {
  46628. if (typeof c !== 'object' || c.require) {
  46629. return c;
  46630. }
  46631. var _dereq_ = [];
  46632. Object.keys(c).forEach(function(key) {
  46633. if (key === 'require' || key === 'advanced' || key === 'mediaSource') {
  46634. return;
  46635. }
  46636. var r = c[key] = (typeof c[key] === 'object') ?
  46637. c[key] : {ideal: c[key]};
  46638. if (r.min !== undefined ||
  46639. r.max !== undefined || r.exact !== undefined) {
  46640. _dereq_.push(key);
  46641. }
  46642. if (r.exact !== undefined) {
  46643. if (typeof r.exact === 'number') {
  46644. r. min = r.max = r.exact;
  46645. } else {
  46646. c[key] = r.exact;
  46647. }
  46648. delete r.exact;
  46649. }
  46650. if (r.ideal !== undefined) {
  46651. c.advanced = c.advanced || [];
  46652. var oc = {};
  46653. if (typeof r.ideal === 'number') {
  46654. oc[key] = {min: r.ideal, max: r.ideal};
  46655. } else {
  46656. oc[key] = r.ideal;
  46657. }
  46658. c.advanced.push(oc);
  46659. delete r.ideal;
  46660. if (!Object.keys(r).length) {
  46661. delete c[key];
  46662. }
  46663. }
  46664. });
  46665. if (_dereq_.length) {
  46666. c.require = _dereq_;
  46667. }
  46668. return c;
  46669. };
  46670. constraints = JSON.parse(JSON.stringify(constraints));
  46671. if (browserDetails.version < 38) {
  46672. logging('spec: ' + JSON.stringify(constraints));
  46673. if (constraints.audio) {
  46674. constraints.audio = constraintsToFF37_(constraints.audio);
  46675. }
  46676. if (constraints.video) {
  46677. constraints.video = constraintsToFF37_(constraints.video);
  46678. }
  46679. logging('ff37: ' + JSON.stringify(constraints));
  46680. }
  46681. return navigator.mozGetUserMedia(constraints, onSuccess, function(e) {
  46682. onError(shimError_(e));
  46683. });
  46684. };
  46685. // Returns the result of getUserMedia as a Promise.
  46686. var getUserMediaPromise_ = function(constraints) {
  46687. return new Promise(function(resolve, reject) {
  46688. getUserMedia_(constraints, resolve, reject);
  46689. });
  46690. };
  46691. // Shim for mediaDevices on older versions.
  46692. if (!navigator.mediaDevices) {
  46693. navigator.mediaDevices = {getUserMedia: getUserMediaPromise_,
  46694. addEventListener: function() { },
  46695. removeEventListener: function() { }
  46696. };
  46697. }
  46698. navigator.mediaDevices.enumerateDevices =
  46699. navigator.mediaDevices.enumerateDevices || function() {
  46700. return new Promise(function(resolve) {
  46701. var infos = [
  46702. {kind: 'audioinput', deviceId: 'default', label: '', groupId: ''},
  46703. {kind: 'videoinput', deviceId: 'default', label: '', groupId: ''}
  46704. ];
  46705. resolve(infos);
  46706. });
  46707. };
  46708. if (browserDetails.version < 41) {
  46709. // Work around http://bugzil.la/1169665
  46710. var orgEnumerateDevices =
  46711. navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);
  46712. navigator.mediaDevices.enumerateDevices = function() {
  46713. return orgEnumerateDevices().then(undefined, function(e) {
  46714. if (e.name === 'NotFoundError') {
  46715. return [];
  46716. }
  46717. throw e;
  46718. });
  46719. };
  46720. }
  46721. if (browserDetails.version < 49) {
  46722. var origGetUserMedia = navigator.mediaDevices.getUserMedia.
  46723. bind(navigator.mediaDevices);
  46724. navigator.mediaDevices.getUserMedia = function(c) {
  46725. return origGetUserMedia(c).then(function(stream) {
  46726. // Work around https://bugzil.la/802326
  46727. if (c.audio && !stream.getAudioTracks().length ||
  46728. c.video && !stream.getVideoTracks().length) {
  46729. stream.getTracks().forEach(function(track) {
  46730. track.stop();
  46731. });
  46732. throw new DOMException('The object can not be found here.',
  46733. 'NotFoundError');
  46734. }
  46735. return stream;
  46736. }, function(e) {
  46737. return Promise.reject(shimError_(e));
  46738. });
  46739. };
  46740. }
  46741. if (!(browserDetails.version > 55 &&
  46742. 'autoGainControl' in navigator.mediaDevices.getSupportedConstraints())) {
  46743. var remap = function(obj, a, b) {
  46744. if (a in obj && !(b in obj)) {
  46745. obj[b] = obj[a];
  46746. delete obj[a];
  46747. }
  46748. };
  46749. var nativeGetUserMedia = navigator.mediaDevices.getUserMedia.
  46750. bind(navigator.mediaDevices);
  46751. navigator.mediaDevices.getUserMedia = function(c) {
  46752. if (typeof c === 'object' && typeof c.audio === 'object') {
  46753. c = JSON.parse(JSON.stringify(c));
  46754. remap(c.audio, 'autoGainControl', 'mozAutoGainControl');
  46755. remap(c.audio, 'noiseSuppression', 'mozNoiseSuppression');
  46756. }
  46757. return nativeGetUserMedia(c);
  46758. };
  46759. if (MediaStreamTrack && MediaStreamTrack.prototype.getSettings) {
  46760. var nativeGetSettings = MediaStreamTrack.prototype.getSettings;
  46761. MediaStreamTrack.prototype.getSettings = function() {
  46762. var obj = nativeGetSettings.apply(this, arguments);
  46763. remap(obj, 'mozAutoGainControl', 'autoGainControl');
  46764. remap(obj, 'mozNoiseSuppression', 'noiseSuppression');
  46765. return obj;
  46766. };
  46767. }
  46768. if (MediaStreamTrack && MediaStreamTrack.prototype.applyConstraints) {
  46769. var nativeApplyConstraints = MediaStreamTrack.prototype.applyConstraints;
  46770. MediaStreamTrack.prototype.applyConstraints = function(c) {
  46771. if (this.kind === 'audio' && typeof c === 'object') {
  46772. c = JSON.parse(JSON.stringify(c));
  46773. remap(c, 'autoGainControl', 'mozAutoGainControl');
  46774. remap(c, 'noiseSuppression', 'mozNoiseSuppression');
  46775. }
  46776. return nativeApplyConstraints.apply(this, [c]);
  46777. };
  46778. }
  46779. }
  46780. navigator.getUserMedia = function(constraints, onSuccess, onError) {
  46781. if (browserDetails.version < 44) {
  46782. return getUserMedia_(constraints, onSuccess, onError);
  46783. }
  46784. // Replace Firefox 44+'s deprecation warning with unprefixed version.
  46785. utils.deprecated('navigator.getUserMedia',
  46786. 'navigator.mediaDevices.getUserMedia');
  46787. navigator.mediaDevices.getUserMedia(constraints).then(onSuccess, onError);
  46788. };
  46789. };
  46790. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  46791. /***/ }),
  46792. /* 542 */
  46793. /***/ (function(module, exports, __webpack_require__) {
  46794. "use strict";
  46795. /* WEBPACK VAR INJECTION */(function(Promise) {/*
  46796. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  46797. *
  46798. * Use of this source code is governed by a BSD-style license
  46799. * that can be found in the LICENSE file in the root of the source
  46800. * tree.
  46801. */
  46802. var utils = __webpack_require__(25);
  46803. module.exports = {
  46804. shimLocalStreamsAPI: function(window) {
  46805. if (typeof window !== 'object' || !window.RTCPeerConnection) {
  46806. return;
  46807. }
  46808. if (!('getLocalStreams' in window.RTCPeerConnection.prototype)) {
  46809. window.RTCPeerConnection.prototype.getLocalStreams = function() {
  46810. if (!this._localStreams) {
  46811. this._localStreams = [];
  46812. }
  46813. return this._localStreams;
  46814. };
  46815. }
  46816. if (!('getStreamById' in window.RTCPeerConnection.prototype)) {
  46817. window.RTCPeerConnection.prototype.getStreamById = function(id) {
  46818. var result = null;
  46819. if (this._localStreams) {
  46820. this._localStreams.forEach(function(stream) {
  46821. if (stream.id === id) {
  46822. result = stream;
  46823. }
  46824. });
  46825. }
  46826. if (this._remoteStreams) {
  46827. this._remoteStreams.forEach(function(stream) {
  46828. if (stream.id === id) {
  46829. result = stream;
  46830. }
  46831. });
  46832. }
  46833. return result;
  46834. };
  46835. }
  46836. if (!('addStream' in window.RTCPeerConnection.prototype)) {
  46837. var _addTrack = window.RTCPeerConnection.prototype.addTrack;
  46838. window.RTCPeerConnection.prototype.addStream = function(stream) {
  46839. if (!this._localStreams) {
  46840. this._localStreams = [];
  46841. }
  46842. if (this._localStreams.indexOf(stream) === -1) {
  46843. this._localStreams.push(stream);
  46844. }
  46845. var pc = this;
  46846. stream.getTracks().forEach(function(track) {
  46847. _addTrack.call(pc, track, stream);
  46848. });
  46849. };
  46850. window.RTCPeerConnection.prototype.addTrack = function(track, stream) {
  46851. if (stream) {
  46852. if (!this._localStreams) {
  46853. this._localStreams = [stream];
  46854. } else if (this._localStreams.indexOf(stream) === -1) {
  46855. this._localStreams.push(stream);
  46856. }
  46857. }
  46858. return _addTrack.call(this, track, stream);
  46859. };
  46860. }
  46861. if (!('removeStream' in window.RTCPeerConnection.prototype)) {
  46862. window.RTCPeerConnection.prototype.removeStream = function(stream) {
  46863. if (!this._localStreams) {
  46864. this._localStreams = [];
  46865. }
  46866. var index = this._localStreams.indexOf(stream);
  46867. if (index === -1) {
  46868. return;
  46869. }
  46870. this._localStreams.splice(index, 1);
  46871. var pc = this;
  46872. var tracks = stream.getTracks();
  46873. this.getSenders().forEach(function(sender) {
  46874. if (tracks.indexOf(sender.track) !== -1) {
  46875. pc.removeTrack(sender);
  46876. }
  46877. });
  46878. };
  46879. }
  46880. },
  46881. shimRemoteStreamsAPI: function(window) {
  46882. if (typeof window !== 'object' || !window.RTCPeerConnection) {
  46883. return;
  46884. }
  46885. if (!('getRemoteStreams' in window.RTCPeerConnection.prototype)) {
  46886. window.RTCPeerConnection.prototype.getRemoteStreams = function() {
  46887. return this._remoteStreams ? this._remoteStreams : [];
  46888. };
  46889. }
  46890. if (!('onaddstream' in window.RTCPeerConnection.prototype)) {
  46891. Object.defineProperty(window.RTCPeerConnection.prototype, 'onaddstream', {
  46892. get: function() {
  46893. return this._onaddstream;
  46894. },
  46895. set: function(f) {
  46896. if (this._onaddstream) {
  46897. this.removeEventListener('addstream', this._onaddstream);
  46898. }
  46899. this.addEventListener('addstream', this._onaddstream = f);
  46900. }
  46901. });
  46902. var origSetRemoteDescription =
  46903. window.RTCPeerConnection.prototype.setRemoteDescription;
  46904. window.RTCPeerConnection.prototype.setRemoteDescription = function() {
  46905. var pc = this;
  46906. if (!this._onaddstreampoly) {
  46907. this.addEventListener('track', this._onaddstreampoly = function(e) {
  46908. e.streams.forEach(function(stream) {
  46909. if (!pc._remoteStreams) {
  46910. pc._remoteStreams = [];
  46911. }
  46912. if (pc._remoteStreams.indexOf(stream) >= 0) {
  46913. return;
  46914. }
  46915. pc._remoteStreams.push(stream);
  46916. var event = new Event('addstream');
  46917. event.stream = stream;
  46918. pc.dispatchEvent(event);
  46919. });
  46920. });
  46921. }
  46922. return origSetRemoteDescription.apply(pc, arguments);
  46923. };
  46924. }
  46925. },
  46926. shimCallbacksAPI: function(window) {
  46927. if (typeof window !== 'object' || !window.RTCPeerConnection) {
  46928. return;
  46929. }
  46930. var prototype = window.RTCPeerConnection.prototype;
  46931. var createOffer = prototype.createOffer;
  46932. var createAnswer = prototype.createAnswer;
  46933. var setLocalDescription = prototype.setLocalDescription;
  46934. var setRemoteDescription = prototype.setRemoteDescription;
  46935. var addIceCandidate = prototype.addIceCandidate;
  46936. prototype.createOffer = function(successCallback, failureCallback) {
  46937. var options = (arguments.length >= 2) ? arguments[2] : arguments[0];
  46938. var promise = createOffer.apply(this, [options]);
  46939. if (!failureCallback) {
  46940. return promise;
  46941. }
  46942. promise.then(successCallback, failureCallback);
  46943. return Promise.resolve();
  46944. };
  46945. prototype.createAnswer = function(successCallback, failureCallback) {
  46946. var options = (arguments.length >= 2) ? arguments[2] : arguments[0];
  46947. var promise = createAnswer.apply(this, [options]);
  46948. if (!failureCallback) {
  46949. return promise;
  46950. }
  46951. promise.then(successCallback, failureCallback);
  46952. return Promise.resolve();
  46953. };
  46954. var withCallback = function(description, successCallback, failureCallback) {
  46955. var promise = setLocalDescription.apply(this, [description]);
  46956. if (!failureCallback) {
  46957. return promise;
  46958. }
  46959. promise.then(successCallback, failureCallback);
  46960. return Promise.resolve();
  46961. };
  46962. prototype.setLocalDescription = withCallback;
  46963. withCallback = function(description, successCallback, failureCallback) {
  46964. var promise = setRemoteDescription.apply(this, [description]);
  46965. if (!failureCallback) {
  46966. return promise;
  46967. }
  46968. promise.then(successCallback, failureCallback);
  46969. return Promise.resolve();
  46970. };
  46971. prototype.setRemoteDescription = withCallback;
  46972. withCallback = function(candidate, successCallback, failureCallback) {
  46973. var promise = addIceCandidate.apply(this, [candidate]);
  46974. if (!failureCallback) {
  46975. return promise;
  46976. }
  46977. promise.then(successCallback, failureCallback);
  46978. return Promise.resolve();
  46979. };
  46980. prototype.addIceCandidate = withCallback;
  46981. },
  46982. shimGetUserMedia: function(window) {
  46983. var navigator = window && window.navigator;
  46984. if (!navigator.getUserMedia) {
  46985. if (navigator.webkitGetUserMedia) {
  46986. navigator.getUserMedia = navigator.webkitGetUserMedia.bind(navigator);
  46987. } else if (navigator.mediaDevices &&
  46988. navigator.mediaDevices.getUserMedia) {
  46989. navigator.getUserMedia = function(constraints, cb, errcb) {
  46990. navigator.mediaDevices.getUserMedia(constraints)
  46991. .then(cb, errcb);
  46992. }.bind(navigator);
  46993. }
  46994. }
  46995. },
  46996. shimRTCIceServerUrls: function(window) {
  46997. // migrate from non-spec RTCIceServer.url to RTCIceServer.urls
  46998. var OrigPeerConnection = window.RTCPeerConnection;
  46999. window.RTCPeerConnection = function(pcConfig, pcConstraints) {
  47000. if (pcConfig && pcConfig.iceServers) {
  47001. var newIceServers = [];
  47002. for (var i = 0; i < pcConfig.iceServers.length; i++) {
  47003. var server = pcConfig.iceServers[i];
  47004. if (!server.hasOwnProperty('urls') &&
  47005. server.hasOwnProperty('url')) {
  47006. utils.deprecated('RTCIceServer.url', 'RTCIceServer.urls');
  47007. server = JSON.parse(JSON.stringify(server));
  47008. server.urls = server.url;
  47009. delete server.url;
  47010. newIceServers.push(server);
  47011. } else {
  47012. newIceServers.push(pcConfig.iceServers[i]);
  47013. }
  47014. }
  47015. pcConfig.iceServers = newIceServers;
  47016. }
  47017. return new OrigPeerConnection(pcConfig, pcConstraints);
  47018. };
  47019. window.RTCPeerConnection.prototype = OrigPeerConnection.prototype;
  47020. // wrap static methods. Currently just generateCertificate.
  47021. if ('generateCertificate' in window.RTCPeerConnection) {
  47022. Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {
  47023. get: function() {
  47024. return OrigPeerConnection.generateCertificate;
  47025. }
  47026. });
  47027. }
  47028. },
  47029. shimTrackEventTransceiver: function(window) {
  47030. // Add event.transceiver member over deprecated event.receiver
  47031. if (typeof window === 'object' && window.RTCPeerConnection &&
  47032. ('receiver' in window.RTCTrackEvent.prototype) &&
  47033. // can't check 'transceiver' in window.RTCTrackEvent.prototype, as it is
  47034. // defined for some reason even when window.RTCTransceiver is not.
  47035. !window.RTCTransceiver) {
  47036. Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', {
  47037. get: function() {
  47038. return {receiver: this.receiver};
  47039. }
  47040. });
  47041. }
  47042. },
  47043. shimCreateOfferLegacy: function(window) {
  47044. var origCreateOffer = window.RTCPeerConnection.prototype.createOffer;
  47045. window.RTCPeerConnection.prototype.createOffer = function(offerOptions) {
  47046. var pc = this;
  47047. if (offerOptions) {
  47048. if (typeof offerOptions.offerToReceiveAudio !== 'undefined') {
  47049. // support bit values
  47050. offerOptions.offerToReceiveAudio = !!offerOptions.offerToReceiveAudio;
  47051. }
  47052. var audioTransceiver = pc.getTransceivers().find(function(transceiver) {
  47053. return transceiver.sender.track &&
  47054. transceiver.sender.track.kind === 'audio';
  47055. });
  47056. if (offerOptions.offerToReceiveAudio === false && audioTransceiver) {
  47057. if (audioTransceiver.direction === 'sendrecv') {
  47058. if (audioTransceiver.setDirection) {
  47059. audioTransceiver.setDirection('sendonly');
  47060. } else {
  47061. audioTransceiver.direction = 'sendonly';
  47062. }
  47063. } else if (audioTransceiver.direction === 'recvonly') {
  47064. if (audioTransceiver.setDirection) {
  47065. audioTransceiver.setDirection('inactive');
  47066. } else {
  47067. audioTransceiver.direction = 'inactive';
  47068. }
  47069. }
  47070. } else if (offerOptions.offerToReceiveAudio === true &&
  47071. !audioTransceiver) {
  47072. pc.addTransceiver('audio');
  47073. }
  47074. if (typeof offerOptions.offerToReceiveVideo !== 'undefined') {
  47075. // support bit values
  47076. offerOptions.offerToReceiveVideo = !!offerOptions.offerToReceiveVideo;
  47077. }
  47078. var videoTransceiver = pc.getTransceivers().find(function(transceiver) {
  47079. return transceiver.sender.track &&
  47080. transceiver.sender.track.kind === 'video';
  47081. });
  47082. if (offerOptions.offerToReceiveVideo === false && videoTransceiver) {
  47083. if (videoTransceiver.direction === 'sendrecv') {
  47084. videoTransceiver.setDirection('sendonly');
  47085. } else if (videoTransceiver.direction === 'recvonly') {
  47086. videoTransceiver.setDirection('inactive');
  47087. }
  47088. } else if (offerOptions.offerToReceiveVideo === true &&
  47089. !videoTransceiver) {
  47090. pc.addTransceiver('video');
  47091. }
  47092. }
  47093. return origCreateOffer.apply(pc, arguments);
  47094. };
  47095. }
  47096. };
  47097. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  47098. /***/ }),
  47099. /* 543 */
  47100. /***/ (function(module, exports, __webpack_require__) {
  47101. "use strict";
  47102. /*
  47103. * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
  47104. *
  47105. * Use of this source code is governed by a BSD-style license
  47106. * that can be found in the LICENSE file in the root of the source
  47107. * tree.
  47108. */
  47109. /* eslint-env node */
  47110. var SDPUtils = __webpack_require__(247);
  47111. var utils = __webpack_require__(25);
  47112. module.exports = {
  47113. shimRTCIceCandidate: function(window) {
  47114. // foundation is arbitrarily chosen as an indicator for full support for
  47115. // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface
  47116. if (!window.RTCIceCandidate || (window.RTCIceCandidate && 'foundation' in
  47117. window.RTCIceCandidate.prototype)) {
  47118. return;
  47119. }
  47120. var NativeRTCIceCandidate = window.RTCIceCandidate;
  47121. window.RTCIceCandidate = function(args) {
  47122. // Remove the a= which shouldn't be part of the candidate string.
  47123. if (typeof args === 'object' && args.candidate &&
  47124. args.candidate.indexOf('a=') === 0) {
  47125. args = JSON.parse(JSON.stringify(args));
  47126. args.candidate = args.candidate.substr(2);
  47127. }
  47128. if (args.candidate && args.candidate.length) {
  47129. // Augment the native candidate with the parsed fields.
  47130. var nativeCandidate = new NativeRTCIceCandidate(args);
  47131. var parsedCandidate = SDPUtils.parseCandidate(args.candidate);
  47132. var augmentedCandidate = Object.assign(nativeCandidate,
  47133. parsedCandidate);
  47134. // Add a serializer that does not serialize the extra attributes.
  47135. augmentedCandidate.toJSON = function() {
  47136. return {
  47137. candidate: augmentedCandidate.candidate,
  47138. sdpMid: augmentedCandidate.sdpMid,
  47139. sdpMLineIndex: augmentedCandidate.sdpMLineIndex,
  47140. usernameFragment: augmentedCandidate.usernameFragment,
  47141. };
  47142. };
  47143. return augmentedCandidate;
  47144. }
  47145. return new NativeRTCIceCandidate(args);
  47146. };
  47147. window.RTCIceCandidate.prototype = NativeRTCIceCandidate.prototype;
  47148. // Hook up the augmented candidate in onicecandidate and
  47149. // addEventListener('icecandidate', ...)
  47150. utils.wrapPeerConnectionEvent(window, 'icecandidate', function(e) {
  47151. if (e.candidate) {
  47152. Object.defineProperty(e, 'candidate', {
  47153. value: new window.RTCIceCandidate(e.candidate),
  47154. writable: 'false'
  47155. });
  47156. }
  47157. return e;
  47158. });
  47159. },
  47160. // shimCreateObjectURL must be called before shimSourceObject to avoid loop.
  47161. shimCreateObjectURL: function(window) {
  47162. var URL = window && window.URL;
  47163. if (!(typeof window === 'object' && window.HTMLMediaElement &&
  47164. 'srcObject' in window.HTMLMediaElement.prototype &&
  47165. URL.createObjectURL && URL.revokeObjectURL)) {
  47166. // Only shim CreateObjectURL using srcObject if srcObject exists.
  47167. return undefined;
  47168. }
  47169. var nativeCreateObjectURL = URL.createObjectURL.bind(URL);
  47170. var nativeRevokeObjectURL = URL.revokeObjectURL.bind(URL);
  47171. var streams = new Map(), newId = 0;
  47172. URL.createObjectURL = function(stream) {
  47173. if ('getTracks' in stream) {
  47174. var url = 'polyblob:' + (++newId);
  47175. streams.set(url, stream);
  47176. utils.deprecated('URL.createObjectURL(stream)',
  47177. 'elem.srcObject = stream');
  47178. return url;
  47179. }
  47180. return nativeCreateObjectURL(stream);
  47181. };
  47182. URL.revokeObjectURL = function(url) {
  47183. nativeRevokeObjectURL(url);
  47184. streams.delete(url);
  47185. };
  47186. var dsc = Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype,
  47187. 'src');
  47188. Object.defineProperty(window.HTMLMediaElement.prototype, 'src', {
  47189. get: function() {
  47190. return dsc.get.apply(this);
  47191. },
  47192. set: function(url) {
  47193. this.srcObject = streams.get(url) || null;
  47194. return dsc.set.apply(this, [url]);
  47195. }
  47196. });
  47197. var nativeSetAttribute = window.HTMLMediaElement.prototype.setAttribute;
  47198. window.HTMLMediaElement.prototype.setAttribute = function() {
  47199. if (arguments.length === 2 &&
  47200. ('' + arguments[0]).toLowerCase() === 'src') {
  47201. this.srcObject = streams.get(arguments[1]) || null;
  47202. }
  47203. return nativeSetAttribute.apply(this, arguments);
  47204. };
  47205. },
  47206. shimMaxMessageSize: function(window) {
  47207. if (window.RTCSctpTransport || !window.RTCPeerConnection) {
  47208. return;
  47209. }
  47210. var browserDetails = utils.detectBrowser(window);
  47211. if (!('sctp' in window.RTCPeerConnection.prototype)) {
  47212. Object.defineProperty(window.RTCPeerConnection.prototype, 'sctp', {
  47213. get: function() {
  47214. return typeof this._sctp === 'undefined' ? null : this._sctp;
  47215. }
  47216. });
  47217. }
  47218. var sctpInDescription = function(description) {
  47219. var sections = SDPUtils.splitSections(description.sdp);
  47220. sections.shift();
  47221. return sections.some(function(mediaSection) {
  47222. var mLine = SDPUtils.parseMLine(mediaSection);
  47223. return mLine && mLine.kind === 'application'
  47224. && mLine.protocol.indexOf('SCTP') !== -1;
  47225. });
  47226. };
  47227. var getRemoteFirefoxVersion = function(description) {
  47228. // TODO: Is there a better solution for detecting Firefox?
  47229. var match = description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);
  47230. if (match === null || match.length < 2) {
  47231. return -1;
  47232. }
  47233. var version = parseInt(match[1], 10);
  47234. // Test for NaN (yes, this is ugly)
  47235. return version !== version ? -1 : version;
  47236. };
  47237. var getCanSendMaxMessageSize = function(remoteIsFirefox) {
  47238. // Every implementation we know can send at least 64 KiB.
  47239. // Note: Although Chrome is technically able to send up to 256 KiB, the
  47240. // data does not reach the other peer reliably.
  47241. // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8419
  47242. var canSendMaxMessageSize = 65536;
  47243. if (browserDetails.browser === 'firefox') {
  47244. if (browserDetails.version < 57) {
  47245. if (remoteIsFirefox === -1) {
  47246. // FF < 57 will send in 16 KiB chunks using the deprecated PPID
  47247. // fragmentation.
  47248. canSendMaxMessageSize = 16384;
  47249. } else {
  47250. // However, other FF (and RAWRTC) can reassemble PPID-fragmented
  47251. // messages. Thus, supporting ~2 GiB when sending.
  47252. canSendMaxMessageSize = 2147483637;
  47253. }
  47254. } else if (browserDetails.version < 60) {
  47255. // Currently, all FF >= 57 will reset the remote maximum message size
  47256. // to the default value when a data channel is created at a later
  47257. // stage. :(
  47258. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831
  47259. canSendMaxMessageSize =
  47260. browserDetails.version === 57 ? 65535 : 65536;
  47261. } else {
  47262. // FF >= 60 supports sending ~2 GiB
  47263. canSendMaxMessageSize = 2147483637;
  47264. }
  47265. }
  47266. return canSendMaxMessageSize;
  47267. };
  47268. var getMaxMessageSize = function(description, remoteIsFirefox) {
  47269. // Note: 65536 bytes is the default value from the SDP spec. Also,
  47270. // every implementation we know supports receiving 65536 bytes.
  47271. var maxMessageSize = 65536;
  47272. // FF 57 has a slightly incorrect default remote max message size, so
  47273. // we need to adjust it here to avoid a failure when sending.
  47274. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1425697
  47275. if (browserDetails.browser === 'firefox'
  47276. && browserDetails.version === 57) {
  47277. maxMessageSize = 65535;
  47278. }
  47279. var match = SDPUtils.matchPrefix(description.sdp, 'a=max-message-size:');
  47280. if (match.length > 0) {
  47281. maxMessageSize = parseInt(match[0].substr(19), 10);
  47282. } else if (browserDetails.browser === 'firefox' &&
  47283. remoteIsFirefox !== -1) {
  47284. // If the maximum message size is not present in the remote SDP and
  47285. // both local and remote are Firefox, the remote peer can receive
  47286. // ~2 GiB.
  47287. maxMessageSize = 2147483637;
  47288. }
  47289. return maxMessageSize;
  47290. };
  47291. var origSetRemoteDescription =
  47292. window.RTCPeerConnection.prototype.setRemoteDescription;
  47293. window.RTCPeerConnection.prototype.setRemoteDescription = function() {
  47294. var pc = this;
  47295. pc._sctp = null;
  47296. if (sctpInDescription(arguments[0])) {
  47297. // Check if the remote is FF.
  47298. var isFirefox = getRemoteFirefoxVersion(arguments[0]);
  47299. // Get the maximum message size the local peer is capable of sending
  47300. var canSendMMS = getCanSendMaxMessageSize(isFirefox);
  47301. // Get the maximum message size of the remote peer.
  47302. var remoteMMS = getMaxMessageSize(arguments[0], isFirefox);
  47303. // Determine final maximum message size
  47304. var maxMessageSize;
  47305. if (canSendMMS === 0 && remoteMMS === 0) {
  47306. maxMessageSize = Number.POSITIVE_INFINITY;
  47307. } else if (canSendMMS === 0 || remoteMMS === 0) {
  47308. maxMessageSize = Math.max(canSendMMS, remoteMMS);
  47309. } else {
  47310. maxMessageSize = Math.min(canSendMMS, remoteMMS);
  47311. }
  47312. // Create a dummy RTCSctpTransport object and the 'maxMessageSize'
  47313. // attribute.
  47314. var sctp = {};
  47315. Object.defineProperty(sctp, 'maxMessageSize', {
  47316. get: function() {
  47317. return maxMessageSize;
  47318. }
  47319. });
  47320. pc._sctp = sctp;
  47321. }
  47322. return origSetRemoteDescription.apply(pc, arguments);
  47323. };
  47324. },
  47325. shimSendThrowTypeError: function(window) {
  47326. if (!(window.RTCPeerConnection &&
  47327. 'createDataChannel' in window.RTCPeerConnection.prototype)) {
  47328. return;
  47329. }
  47330. // Note: Although Firefox >= 57 has a native implementation, the maximum
  47331. // message size can be reset for all data channels at a later stage.
  47332. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831
  47333. function wrapDcSend(dc, pc) {
  47334. var origDataChannelSend = dc.send;
  47335. dc.send = function() {
  47336. var data = arguments[0];
  47337. var length = data.length || data.size || data.byteLength;
  47338. if (dc.readyState === 'open' &&
  47339. pc.sctp && length > pc.sctp.maxMessageSize) {
  47340. throw new TypeError('Message too large (can send a maximum of ' +
  47341. pc.sctp.maxMessageSize + ' bytes)');
  47342. }
  47343. return origDataChannelSend.apply(dc, arguments);
  47344. };
  47345. }
  47346. var origCreateDataChannel =
  47347. window.RTCPeerConnection.prototype.createDataChannel;
  47348. window.RTCPeerConnection.prototype.createDataChannel = function() {
  47349. var pc = this;
  47350. var dataChannel = origCreateDataChannel.apply(pc, arguments);
  47351. wrapDcSend(dataChannel, pc);
  47352. return dataChannel;
  47353. };
  47354. utils.wrapPeerConnectionEvent(window, 'datachannel', function(e) {
  47355. wrapDcSend(e.channel, e.target);
  47356. return e;
  47357. });
  47358. }
  47359. };
  47360. /***/ }),
  47361. /* 544 */
  47362. /***/ (function(module, exports, __webpack_require__) {
  47363. "use strict";
  47364. /* WEBPACK VAR INJECTION */(function(Promise) {
  47365. const eventing = __webpack_require__(5);
  47366. function isDomReady() {
  47367. // if there is no document, how is the document object model ready?
  47368. return typeof document === 'undefined' || document.readyState === 'complete' || document.readyState === 'interactive' && document.body;
  47369. }
  47370. let unloaded = false;
  47371. const domState = {
  47372. isDomLoaded: isDomReady,
  47373. isDomUnloaded() {
  47374. return unloaded;
  47375. },
  47376. whenUnloaded: new Promise(resolve => {
  47377. if (typeof window !== 'undefined') {
  47378. const unload = () => {
  47379. unloaded = true;
  47380. domState.emit('unload');
  47381. resolve();
  47382. };
  47383. window.addEventListener('unload', unload);
  47384. }
  47385. }),
  47386. whenLoaded: new Promise(resolve => {
  47387. if (isDomReady()) {
  47388. resolve();
  47389. return;
  47390. }
  47391. const load = () => {
  47392. document.removeEventListener('DOMContentLoaded', load);
  47393. document.removeEventListener('load', load);
  47394. domState.emit('load');
  47395. resolve();
  47396. };
  47397. document.addEventListener('DOMContentLoaded', load);
  47398. document.addEventListener('load', load);
  47399. })
  47400. };
  47401. eventing(domState);
  47402. module.exports = domState;
  47403. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  47404. /***/ }),
  47405. /* 545 */
  47406. /***/ (function(module, exports, __webpack_require__) {
  47407. var Stack = __webpack_require__(75),
  47408. assignMergeValue = __webpack_require__(251),
  47409. baseFor = __webpack_require__(219),
  47410. baseMergeDeep = __webpack_require__(546),
  47411. isObject = __webpack_require__(7),
  47412. keysIn = __webpack_require__(66),
  47413. safeGet = __webpack_require__(252);
  47414. /**
  47415. * The base implementation of `_.merge` without support for multiple sources.
  47416. *
  47417. * @private
  47418. * @param {Object} object The destination object.
  47419. * @param {Object} source The source object.
  47420. * @param {number} srcIndex The index of `source`.
  47421. * @param {Function} [customizer] The function to customize merged values.
  47422. * @param {Object} [stack] Tracks traversed source values and their merged
  47423. * counterparts.
  47424. */
  47425. function baseMerge(object, source, srcIndex, customizer, stack) {
  47426. if (object === source) {
  47427. return;
  47428. }
  47429. baseFor(source, function(srcValue, key) {
  47430. stack || (stack = new Stack);
  47431. if (isObject(srcValue)) {
  47432. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  47433. }
  47434. else {
  47435. var newValue = customizer
  47436. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  47437. : undefined;
  47438. if (newValue === undefined) {
  47439. newValue = srcValue;
  47440. }
  47441. assignMergeValue(object, key, newValue);
  47442. }
  47443. }, keysIn);
  47444. }
  47445. module.exports = baseMerge;
  47446. /***/ }),
  47447. /* 546 */
  47448. /***/ (function(module, exports, __webpack_require__) {
  47449. var assignMergeValue = __webpack_require__(251),
  47450. cloneBuffer = __webpack_require__(174),
  47451. cloneTypedArray = __webpack_require__(183),
  47452. copyArray = __webpack_require__(49),
  47453. initCloneObject = __webpack_require__(184),
  47454. isArguments = __webpack_require__(61),
  47455. isArray = __webpack_require__(9),
  47456. isArrayLikeObject = __webpack_require__(137),
  47457. isBuffer = __webpack_require__(62),
  47458. isFunction = __webpack_require__(13),
  47459. isObject = __webpack_require__(7),
  47460. isPlainObject = __webpack_require__(124),
  47461. isTypedArray = __webpack_require__(82),
  47462. safeGet = __webpack_require__(252),
  47463. toPlainObject = __webpack_require__(547);
  47464. /**
  47465. * A specialized version of `baseMerge` for arrays and objects which performs
  47466. * deep merges and tracks traversed objects enabling objects with circular
  47467. * references to be merged.
  47468. *
  47469. * @private
  47470. * @param {Object} object The destination object.
  47471. * @param {Object} source The source object.
  47472. * @param {string} key The key of the value to merge.
  47473. * @param {number} srcIndex The index of `source`.
  47474. * @param {Function} mergeFunc The function to merge values.
  47475. * @param {Function} [customizer] The function to customize assigned values.
  47476. * @param {Object} [stack] Tracks traversed source values and their merged
  47477. * counterparts.
  47478. */
  47479. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  47480. var objValue = safeGet(object, key),
  47481. srcValue = safeGet(source, key),
  47482. stacked = stack.get(srcValue);
  47483. if (stacked) {
  47484. assignMergeValue(object, key, stacked);
  47485. return;
  47486. }
  47487. var newValue = customizer
  47488. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  47489. : undefined;
  47490. var isCommon = newValue === undefined;
  47491. if (isCommon) {
  47492. var isArr = isArray(srcValue),
  47493. isBuff = !isArr && isBuffer(srcValue),
  47494. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  47495. newValue = srcValue;
  47496. if (isArr || isBuff || isTyped) {
  47497. if (isArray(objValue)) {
  47498. newValue = objValue;
  47499. }
  47500. else if (isArrayLikeObject(objValue)) {
  47501. newValue = copyArray(objValue);
  47502. }
  47503. else if (isBuff) {
  47504. isCommon = false;
  47505. newValue = cloneBuffer(srcValue, true);
  47506. }
  47507. else if (isTyped) {
  47508. isCommon = false;
  47509. newValue = cloneTypedArray(srcValue, true);
  47510. }
  47511. else {
  47512. newValue = [];
  47513. }
  47514. }
  47515. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  47516. newValue = objValue;
  47517. if (isArguments(objValue)) {
  47518. newValue = toPlainObject(objValue);
  47519. }
  47520. else if (!isObject(objValue) || isFunction(objValue)) {
  47521. newValue = initCloneObject(srcValue);
  47522. }
  47523. }
  47524. else {
  47525. isCommon = false;
  47526. }
  47527. }
  47528. if (isCommon) {
  47529. // Recursively merge objects and arrays (susceptible to call stack limits).
  47530. stack.set(srcValue, newValue);
  47531. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  47532. stack['delete'](srcValue);
  47533. }
  47534. assignMergeValue(object, key, newValue);
  47535. }
  47536. module.exports = baseMergeDeep;
  47537. /***/ }),
  47538. /* 547 */
  47539. /***/ (function(module, exports, __webpack_require__) {
  47540. var copyObject = __webpack_require__(38),
  47541. keysIn = __webpack_require__(66);
  47542. /**
  47543. * Converts `value` to a plain object flattening inherited enumerable string
  47544. * keyed properties of `value` to own properties of the plain object.
  47545. *
  47546. * @static
  47547. * @memberOf _
  47548. * @since 3.0.0
  47549. * @category Lang
  47550. * @param {*} value The value to convert.
  47551. * @returns {Object} Returns the converted plain object.
  47552. * @example
  47553. *
  47554. * function Foo() {
  47555. * this.b = 2;
  47556. * }
  47557. *
  47558. * Foo.prototype.c = 3;
  47559. *
  47560. * _.assign({ 'a': 1 }, new Foo);
  47561. * // => { 'a': 1, 'b': 2 }
  47562. *
  47563. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  47564. * // => { 'a': 1, 'b': 2, 'c': 3 }
  47565. */
  47566. function toPlainObject(value) {
  47567. return copyObject(value, keysIn(value));
  47568. }
  47569. module.exports = toPlainObject;
  47570. /***/ }),
  47571. /* 548 */
  47572. /***/ (function(module, exports, __webpack_require__) {
  47573. "use strict";
  47574. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  47575. /* eslint-disable no-underscore-dangle, no-confusing-arrow */
  47576. const assert = __webpack_require__(144);
  47577. const browserRejectsOptionalMandatory = __webpack_require__(253);
  47578. const capitalize = __webpack_require__(254);
  47579. const defaultLogging = __webpack_require__(1)('normalizeConstraintInput');
  47580. const validResolutions = {
  47581. '320x240': {
  47582. width: 320,
  47583. height: 240
  47584. },
  47585. '320x180': {
  47586. width: 320,
  47587. height: 180
  47588. },
  47589. '640x480': {
  47590. width: 640,
  47591. height: 480
  47592. },
  47593. '640x360': {
  47594. width: 640,
  47595. height: 360
  47596. },
  47597. '1280x720': {
  47598. width: 1280,
  47599. height: 720
  47600. },
  47601. '1280x960': {
  47602. width: 1280,
  47603. height: 960
  47604. }
  47605. };
  47606. const validFrameRates = [1, 7, 15, 30];
  47607. function getLogging(opt) {
  47608. return opt._inject && opt._inject.logging || defaultLogging;
  47609. }
  47610. function lookupParam(name, param, lookup, possibilities, logging) {
  47611. if (param === undefined) {
  47612. return undefined;
  47613. }
  47614. const result = lookup(param);
  47615. if (!result) {
  47616. logging.warn("Invalid " + name + " passed to the Publisher. Got: " + param + ", expecting one of " + possibilities);
  47617. }
  47618. return result;
  47619. }
  47620. function normalizeMediaParams(mediaType, opt) {
  47621. const logging = getLogging(opt);
  47622. const publish = (() => {
  47623. const param = opt["publish" + capitalize(mediaType)];
  47624. if (param !== undefined) {
  47625. return Boolean(param);
  47626. }
  47627. return true;
  47628. })();
  47629. let source = (() => {
  47630. const param = opt[mediaType + "Source"];
  47631. if (param === undefined) {
  47632. return true;
  47633. }
  47634. if (param === null || param === false) {
  47635. return false;
  47636. }
  47637. if (typeof param === 'object') {
  47638. if (opt["isCustom" + capitalize(mediaType) + "Track"]) {
  47639. return false;
  47640. }
  47641. if (typeof param.deviceId !== 'string') {
  47642. logging.warn("Invalid " + mediaType + "Source passed to Publisher. Expected either a device ID or " + 'device.');
  47643. return true;
  47644. }
  47645. return param.deviceId;
  47646. }
  47647. if (typeof param !== 'string') {
  47648. logging.warn("Ignoring invalid " + mediaType + "Source parameter");
  47649. return true;
  47650. }
  47651. return param;
  47652. })();
  47653. if (mediaType === 'audio' && opt.isScreenSharing && source !== false) {
  47654. if (opt.audioSource) {
  47655. getLogging(opt).warn('Invalid audioSource passed to Publisher - when using screen sharing no audioSource may be ' + 'used');
  47656. }
  47657. source = false;
  47658. }
  47659. return {
  47660. source,
  47661. publish
  47662. };
  47663. }
  47664. function fixChromeBug707118(env, frameRate) {
  47665. // OPENTOK-32592: 1fps with facetime camera causes chrome to lock up intermittently. Workaround
  47666. // is just to use 2fps instead for now.
  47667. // https://bugs.chromium.org/p/chromium/issues/detail?id=707118
  47668. if (env.name === 'Chrome' && env.userAgent.indexOf('Mac OS X') !== -1 && frameRate === 1) {
  47669. return 2;
  47670. }
  47671. return frameRate;
  47672. }
  47673. const validFacingModes = ['user', 'environment', 'left', 'right'];
  47674. const normaliseFacingMode = (facingMode, opt) => {
  47675. if (facingMode === undefined || validFacingModes.indexOf(facingMode) >= 0) {
  47676. return facingMode;
  47677. }
  47678. const logging = getLogging(opt); // Ignore facingMode if its defined but an invalid value
  47679. logging.warn("Invalid facingMode passed to Publisher. Expected one of: " + validFacingModes.join(', '));
  47680. return undefined;
  47681. };
  47682. module.exports = function normalizeConstraintInput(opt) {
  47683. const logging = getLogging(opt);
  47684. const env = opt.env || {};
  47685. const isScreenSharing = opt.isScreenSharing,
  47686. isCustomAudioTrack = opt.isCustomAudioTrack,
  47687. isCustomVideoTrack = opt.isCustomVideoTrack;
  47688. if (isScreenSharing && !browserRejectsOptionalMandatory) {
  47689. assert(opt.usingOptionalMandatoryStyle, 'Screensharing only uses optional-mandatory constraints right now');
  47690. }
  47691. let prefixedAudioConstraints;
  47692. if (opt.disableAudioProcessing && env.name === 'Firefox') {
  47693. prefixedAudioConstraints = {
  47694. mozAutoGainControl: false,
  47695. mozNoiseSupression: false
  47696. };
  47697. }
  47698. return {
  47699. isScreenSharing,
  47700. isCustomAudioTrack,
  47701. isCustomVideoTrack,
  47702. // These will be of the form { source: string | boolean, publish: boolean }
  47703. audio: normalizeMediaParams('audio', opt),
  47704. video: normalizeMediaParams('video', opt),
  47705. usingOptionalMandatoryStyle: opt.usingOptionalMandatoryStyle,
  47706. enableRenegotiation: opt.enableRenegotiation,
  47707. enableStereo: opt.enableStereo,
  47708. disableAudioProcessing: opt.disableAudioProcessing,
  47709. prefixedAudioConstraints,
  47710. videoDimensions: lookupParam('resolution', opt.resolution, param => validResolutions[param], "\"" + Object.keys(validResolutions).join('", "') + "\"", logging),
  47711. frameRate: fixChromeBug707118(env, lookupParam('frameRate', opt.frameRate, param => validFrameRates.indexOf(param) !== -1 ? param : undefined, validFrameRates.join(','), logging)),
  47712. maxResolution: function () {
  47713. if (opt.maxResolution === undefined) {
  47714. return isScreenSharing ? {
  47715. width: 1920,
  47716. height: 1920
  47717. } : undefined;
  47718. }
  47719. const result = {
  47720. width: opt.maxResolution.width,
  47721. height: opt.maxResolution.height
  47722. };
  47723. Object.keys(result).forEach(dimensionName => {
  47724. const dim = result[dimensionName];
  47725. if (typeof dim !== 'number' || dim > 1920) {
  47726. logging.warn("Invalid maxResolution passed to the Publisher. maxResolution." + dimensionName + " must be less than or equal to 1920");
  47727. result[dimensionName] = 1920;
  47728. }
  47729. });
  47730. return result;
  47731. }(),
  47732. facingMode: normaliseFacingMode(opt.facingMode, opt)
  47733. };
  47734. };
  47735. /***/ }),
  47736. /* 549 */
  47737. /***/ (function(module, exports, __webpack_require__) {
  47738. "use strict";
  47739. /*
  47740. object-assign
  47741. (c) Sindre Sorhus
  47742. @license MIT
  47743. */
  47744. /* eslint-disable no-unused-vars */
  47745. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  47746. var hasOwnProperty = Object.prototype.hasOwnProperty;
  47747. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  47748. function toObject(val) {
  47749. if (val === null || val === undefined) {
  47750. throw new TypeError('Object.assign cannot be called with null or undefined');
  47751. }
  47752. return Object(val);
  47753. }
  47754. function shouldUseNative() {
  47755. try {
  47756. if (!Object.assign) {
  47757. return false;
  47758. }
  47759. // Detect buggy property enumeration order in older V8 versions.
  47760. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  47761. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  47762. test1[5] = 'de';
  47763. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  47764. return false;
  47765. }
  47766. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  47767. var test2 = {};
  47768. for (var i = 0; i < 10; i++) {
  47769. test2['_' + String.fromCharCode(i)] = i;
  47770. }
  47771. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  47772. return test2[n];
  47773. });
  47774. if (order2.join('') !== '0123456789') {
  47775. return false;
  47776. }
  47777. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  47778. var test3 = {};
  47779. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  47780. test3[letter] = letter;
  47781. });
  47782. if (Object.keys(Object.assign({}, test3)).join('') !==
  47783. 'abcdefghijklmnopqrst') {
  47784. return false;
  47785. }
  47786. return true;
  47787. } catch (err) {
  47788. // We don't expect any of the above to throw, but better to be safe.
  47789. return false;
  47790. }
  47791. }
  47792. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  47793. var from;
  47794. var to = toObject(target);
  47795. var symbols;
  47796. for (var s = 1; s < arguments.length; s++) {
  47797. from = Object(arguments[s]);
  47798. for (var key in from) {
  47799. if (hasOwnProperty.call(from, key)) {
  47800. to[key] = from[key];
  47801. }
  47802. }
  47803. if (getOwnPropertySymbols) {
  47804. symbols = getOwnPropertySymbols(from);
  47805. for (var i = 0; i < symbols.length; i++) {
  47806. if (propIsEnumerable.call(from, symbols[i])) {
  47807. to[symbols[i]] = from[symbols[i]];
  47808. }
  47809. }
  47810. }
  47811. }
  47812. return to;
  47813. };
  47814. /***/ }),
  47815. /* 550 */
  47816. /***/ (function(module, exports, __webpack_require__) {
  47817. /* WEBPACK VAR INJECTION */(function(process, Promise) {// Copyright Joyent, Inc. and other Node contributors.
  47818. //
  47819. // Permission is hereby granted, free of charge, to any person obtaining a
  47820. // copy of this software and associated documentation files (the
  47821. // "Software"), to deal in the Software without restriction, including
  47822. // without limitation the rights to use, copy, modify, merge, publish,
  47823. // distribute, sublicense, and/or sell copies of the Software, and to permit
  47824. // persons to whom the Software is furnished to do so, subject to the
  47825. // following conditions:
  47826. //
  47827. // The above copyright notice and this permission notice shall be included
  47828. // in all copies or substantial portions of the Software.
  47829. //
  47830. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  47831. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  47832. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  47833. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  47834. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  47835. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  47836. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  47837. var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||
  47838. function getOwnPropertyDescriptors(obj) {
  47839. var keys = Object.keys(obj);
  47840. var descriptors = {};
  47841. for (var i = 0; i < keys.length; i++) {
  47842. descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
  47843. }
  47844. return descriptors;
  47845. };
  47846. var formatRegExp = /%[sdj%]/g;
  47847. exports.format = function(f) {
  47848. if (!isString(f)) {
  47849. var objects = [];
  47850. for (var i = 0; i < arguments.length; i++) {
  47851. objects.push(inspect(arguments[i]));
  47852. }
  47853. return objects.join(' ');
  47854. }
  47855. var i = 1;
  47856. var args = arguments;
  47857. var len = args.length;
  47858. var str = String(f).replace(formatRegExp, function(x) {
  47859. if (x === '%%') return '%';
  47860. if (i >= len) return x;
  47861. switch (x) {
  47862. case '%s': return String(args[i++]);
  47863. case '%d': return Number(args[i++]);
  47864. case '%j':
  47865. try {
  47866. return JSON.stringify(args[i++]);
  47867. } catch (_) {
  47868. return '[Circular]';
  47869. }
  47870. default:
  47871. return x;
  47872. }
  47873. });
  47874. for (var x = args[i]; i < len; x = args[++i]) {
  47875. if (isNull(x) || !isObject(x)) {
  47876. str += ' ' + x;
  47877. } else {
  47878. str += ' ' + inspect(x);
  47879. }
  47880. }
  47881. return str;
  47882. };
  47883. // Mark that a method should not be used.
  47884. // Returns a modified function which warns once by default.
  47885. // If --no-deprecation is set, then it is a no-op.
  47886. exports.deprecate = function(fn, msg) {
  47887. if (typeof process !== 'undefined' && process.noDeprecation === true) {
  47888. return fn;
  47889. }
  47890. // Allow for deprecating things in the process of starting up.
  47891. if (typeof process === 'undefined') {
  47892. return function() {
  47893. return exports.deprecate(fn, msg).apply(this, arguments);
  47894. };
  47895. }
  47896. var warned = false;
  47897. function deprecated() {
  47898. if (!warned) {
  47899. if (process.throwDeprecation) {
  47900. throw new Error(msg);
  47901. } else if (process.traceDeprecation) {
  47902. console.trace(msg);
  47903. } else {
  47904. console.error(msg);
  47905. }
  47906. warned = true;
  47907. }
  47908. return fn.apply(this, arguments);
  47909. }
  47910. return deprecated;
  47911. };
  47912. var debugs = {};
  47913. var debugEnviron;
  47914. exports.debuglog = function(set) {
  47915. if (isUndefined(debugEnviron))
  47916. debugEnviron = process.env.NODE_DEBUG || '';
  47917. set = set.toUpperCase();
  47918. if (!debugs[set]) {
  47919. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  47920. var pid = process.pid;
  47921. debugs[set] = function() {
  47922. var msg = exports.format.apply(exports, arguments);
  47923. console.error('%s %d: %s', set, pid, msg);
  47924. };
  47925. } else {
  47926. debugs[set] = function() {};
  47927. }
  47928. }
  47929. return debugs[set];
  47930. };
  47931. /**
  47932. * Echos the value of a value. Trys to print the value out
  47933. * in the best way possible given the different types.
  47934. *
  47935. * @param {Object} obj The object to print out.
  47936. * @param {Object} opts Optional options object that alters the output.
  47937. */
  47938. /* legacy: obj, showHidden, depth, colors*/
  47939. function inspect(obj, opts) {
  47940. // default options
  47941. var ctx = {
  47942. seen: [],
  47943. stylize: stylizeNoColor
  47944. };
  47945. // legacy...
  47946. if (arguments.length >= 3) ctx.depth = arguments[2];
  47947. if (arguments.length >= 4) ctx.colors = arguments[3];
  47948. if (isBoolean(opts)) {
  47949. // legacy...
  47950. ctx.showHidden = opts;
  47951. } else if (opts) {
  47952. // got an "options" object
  47953. exports._extend(ctx, opts);
  47954. }
  47955. // set default options
  47956. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  47957. if (isUndefined(ctx.depth)) ctx.depth = 2;
  47958. if (isUndefined(ctx.colors)) ctx.colors = false;
  47959. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  47960. if (ctx.colors) ctx.stylize = stylizeWithColor;
  47961. return formatValue(ctx, obj, ctx.depth);
  47962. }
  47963. exports.inspect = inspect;
  47964. // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  47965. inspect.colors = {
  47966. 'bold' : [1, 22],
  47967. 'italic' : [3, 23],
  47968. 'underline' : [4, 24],
  47969. 'inverse' : [7, 27],
  47970. 'white' : [37, 39],
  47971. 'grey' : [90, 39],
  47972. 'black' : [30, 39],
  47973. 'blue' : [34, 39],
  47974. 'cyan' : [36, 39],
  47975. 'green' : [32, 39],
  47976. 'magenta' : [35, 39],
  47977. 'red' : [31, 39],
  47978. 'yellow' : [33, 39]
  47979. };
  47980. // Don't use 'blue' not visible on cmd.exe
  47981. inspect.styles = {
  47982. 'special': 'cyan',
  47983. 'number': 'yellow',
  47984. 'boolean': 'yellow',
  47985. 'undefined': 'grey',
  47986. 'null': 'bold',
  47987. 'string': 'green',
  47988. 'date': 'magenta',
  47989. // "name": intentionally not styling
  47990. 'regexp': 'red'
  47991. };
  47992. function stylizeWithColor(str, styleType) {
  47993. var style = inspect.styles[styleType];
  47994. if (style) {
  47995. return '\u001b[' + inspect.colors[style][0] + 'm' + str +
  47996. '\u001b[' + inspect.colors[style][1] + 'm';
  47997. } else {
  47998. return str;
  47999. }
  48000. }
  48001. function stylizeNoColor(str, styleType) {
  48002. return str;
  48003. }
  48004. function arrayToHash(array) {
  48005. var hash = {};
  48006. array.forEach(function(val, idx) {
  48007. hash[val] = true;
  48008. });
  48009. return hash;
  48010. }
  48011. function formatValue(ctx, value, recurseTimes) {
  48012. // Provide a hook for user-specified inspect functions.
  48013. // Check that value is an object with an inspect function on it
  48014. if (ctx.customInspect &&
  48015. value &&
  48016. isFunction(value.inspect) &&
  48017. // Filter out the util module, it's inspect function is special
  48018. value.inspect !== exports.inspect &&
  48019. // Also filter out any prototype objects using the circular check.
  48020. !(value.constructor && value.constructor.prototype === value)) {
  48021. var ret = value.inspect(recurseTimes, ctx);
  48022. if (!isString(ret)) {
  48023. ret = formatValue(ctx, ret, recurseTimes);
  48024. }
  48025. return ret;
  48026. }
  48027. // Primitive types cannot have properties
  48028. var primitive = formatPrimitive(ctx, value);
  48029. if (primitive) {
  48030. return primitive;
  48031. }
  48032. // Look up the keys of the object.
  48033. var keys = Object.keys(value);
  48034. var visibleKeys = arrayToHash(keys);
  48035. if (ctx.showHidden) {
  48036. keys = Object.getOwnPropertyNames(value);
  48037. }
  48038. // IE doesn't make error fields non-enumerable
  48039. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  48040. if (isError(value)
  48041. && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  48042. return formatError(value);
  48043. }
  48044. // Some type of object without properties can be shortcutted.
  48045. if (keys.length === 0) {
  48046. if (isFunction(value)) {
  48047. var name = value.name ? ': ' + value.name : '';
  48048. return ctx.stylize('[Function' + name + ']', 'special');
  48049. }
  48050. if (isRegExp(value)) {
  48051. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  48052. }
  48053. if (isDate(value)) {
  48054. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  48055. }
  48056. if (isError(value)) {
  48057. return formatError(value);
  48058. }
  48059. }
  48060. var base = '', array = false, braces = ['{', '}'];
  48061. // Make Array say that they are Array
  48062. if (isArray(value)) {
  48063. array = true;
  48064. braces = ['[', ']'];
  48065. }
  48066. // Make functions say that they are functions
  48067. if (isFunction(value)) {
  48068. var n = value.name ? ': ' + value.name : '';
  48069. base = ' [Function' + n + ']';
  48070. }
  48071. // Make RegExps say that they are RegExps
  48072. if (isRegExp(value)) {
  48073. base = ' ' + RegExp.prototype.toString.call(value);
  48074. }
  48075. // Make dates with properties first say the date
  48076. if (isDate(value)) {
  48077. base = ' ' + Date.prototype.toUTCString.call(value);
  48078. }
  48079. // Make error with message first say the error
  48080. if (isError(value)) {
  48081. base = ' ' + formatError(value);
  48082. }
  48083. if (keys.length === 0 && (!array || value.length == 0)) {
  48084. return braces[0] + base + braces[1];
  48085. }
  48086. if (recurseTimes < 0) {
  48087. if (isRegExp(value)) {
  48088. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  48089. } else {
  48090. return ctx.stylize('[Object]', 'special');
  48091. }
  48092. }
  48093. ctx.seen.push(value);
  48094. var output;
  48095. if (array) {
  48096. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  48097. } else {
  48098. output = keys.map(function(key) {
  48099. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  48100. });
  48101. }
  48102. ctx.seen.pop();
  48103. return reduceToSingleString(output, base, braces);
  48104. }
  48105. function formatPrimitive(ctx, value) {
  48106. if (isUndefined(value))
  48107. return ctx.stylize('undefined', 'undefined');
  48108. if (isString(value)) {
  48109. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
  48110. .replace(/'/g, "\\'")
  48111. .replace(/\\"/g, '"') + '\'';
  48112. return ctx.stylize(simple, 'string');
  48113. }
  48114. if (isNumber(value))
  48115. return ctx.stylize('' + value, 'number');
  48116. if (isBoolean(value))
  48117. return ctx.stylize('' + value, 'boolean');
  48118. // For some reason typeof null is "object", so special case here.
  48119. if (isNull(value))
  48120. return ctx.stylize('null', 'null');
  48121. }
  48122. function formatError(value) {
  48123. return '[' + Error.prototype.toString.call(value) + ']';
  48124. }
  48125. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  48126. var output = [];
  48127. for (var i = 0, l = value.length; i < l; ++i) {
  48128. if (hasOwnProperty(value, String(i))) {
  48129. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  48130. String(i), true));
  48131. } else {
  48132. output.push('');
  48133. }
  48134. }
  48135. keys.forEach(function(key) {
  48136. if (!key.match(/^\d+$/)) {
  48137. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  48138. key, true));
  48139. }
  48140. });
  48141. return output;
  48142. }
  48143. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  48144. var name, str, desc;
  48145. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  48146. if (desc.get) {
  48147. if (desc.set) {
  48148. str = ctx.stylize('[Getter/Setter]', 'special');
  48149. } else {
  48150. str = ctx.stylize('[Getter]', 'special');
  48151. }
  48152. } else {
  48153. if (desc.set) {
  48154. str = ctx.stylize('[Setter]', 'special');
  48155. }
  48156. }
  48157. if (!hasOwnProperty(visibleKeys, key)) {
  48158. name = '[' + key + ']';
  48159. }
  48160. if (!str) {
  48161. if (ctx.seen.indexOf(desc.value) < 0) {
  48162. if (isNull(recurseTimes)) {
  48163. str = formatValue(ctx, desc.value, null);
  48164. } else {
  48165. str = formatValue(ctx, desc.value, recurseTimes - 1);
  48166. }
  48167. if (str.indexOf('\n') > -1) {
  48168. if (array) {
  48169. str = str.split('\n').map(function(line) {
  48170. return ' ' + line;
  48171. }).join('\n').substr(2);
  48172. } else {
  48173. str = '\n' + str.split('\n').map(function(line) {
  48174. return ' ' + line;
  48175. }).join('\n');
  48176. }
  48177. }
  48178. } else {
  48179. str = ctx.stylize('[Circular]', 'special');
  48180. }
  48181. }
  48182. if (isUndefined(name)) {
  48183. if (array && key.match(/^\d+$/)) {
  48184. return str;
  48185. }
  48186. name = JSON.stringify('' + key);
  48187. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  48188. name = name.substr(1, name.length - 2);
  48189. name = ctx.stylize(name, 'name');
  48190. } else {
  48191. name = name.replace(/'/g, "\\'")
  48192. .replace(/\\"/g, '"')
  48193. .replace(/(^"|"$)/g, "'");
  48194. name = ctx.stylize(name, 'string');
  48195. }
  48196. }
  48197. return name + ': ' + str;
  48198. }
  48199. function reduceToSingleString(output, base, braces) {
  48200. var numLinesEst = 0;
  48201. var length = output.reduce(function(prev, cur) {
  48202. numLinesEst++;
  48203. if (cur.indexOf('\n') >= 0) numLinesEst++;
  48204. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  48205. }, 0);
  48206. if (length > 60) {
  48207. return braces[0] +
  48208. (base === '' ? '' : base + '\n ') +
  48209. ' ' +
  48210. output.join(',\n ') +
  48211. ' ' +
  48212. braces[1];
  48213. }
  48214. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  48215. }
  48216. // NOTE: These type checking functions intentionally don't use `instanceof`
  48217. // because it is fragile and can be easily faked with `Object.create()`.
  48218. function isArray(ar) {
  48219. return Array.isArray(ar);
  48220. }
  48221. exports.isArray = isArray;
  48222. function isBoolean(arg) {
  48223. return typeof arg === 'boolean';
  48224. }
  48225. exports.isBoolean = isBoolean;
  48226. function isNull(arg) {
  48227. return arg === null;
  48228. }
  48229. exports.isNull = isNull;
  48230. function isNullOrUndefined(arg) {
  48231. return arg == null;
  48232. }
  48233. exports.isNullOrUndefined = isNullOrUndefined;
  48234. function isNumber(arg) {
  48235. return typeof arg === 'number';
  48236. }
  48237. exports.isNumber = isNumber;
  48238. function isString(arg) {
  48239. return typeof arg === 'string';
  48240. }
  48241. exports.isString = isString;
  48242. function isSymbol(arg) {
  48243. return typeof arg === 'symbol';
  48244. }
  48245. exports.isSymbol = isSymbol;
  48246. function isUndefined(arg) {
  48247. return arg === void 0;
  48248. }
  48249. exports.isUndefined = isUndefined;
  48250. function isRegExp(re) {
  48251. return isObject(re) && objectToString(re) === '[object RegExp]';
  48252. }
  48253. exports.isRegExp = isRegExp;
  48254. function isObject(arg) {
  48255. return typeof arg === 'object' && arg !== null;
  48256. }
  48257. exports.isObject = isObject;
  48258. function isDate(d) {
  48259. return isObject(d) && objectToString(d) === '[object Date]';
  48260. }
  48261. exports.isDate = isDate;
  48262. function isError(e) {
  48263. return isObject(e) &&
  48264. (objectToString(e) === '[object Error]' || e instanceof Error);
  48265. }
  48266. exports.isError = isError;
  48267. function isFunction(arg) {
  48268. return typeof arg === 'function';
  48269. }
  48270. exports.isFunction = isFunction;
  48271. function isPrimitive(arg) {
  48272. return arg === null ||
  48273. typeof arg === 'boolean' ||
  48274. typeof arg === 'number' ||
  48275. typeof arg === 'string' ||
  48276. typeof arg === 'symbol' || // ES6 symbol
  48277. typeof arg === 'undefined';
  48278. }
  48279. exports.isPrimitive = isPrimitive;
  48280. exports.isBuffer = __webpack_require__(551);
  48281. function objectToString(o) {
  48282. return Object.prototype.toString.call(o);
  48283. }
  48284. function pad(n) {
  48285. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  48286. }
  48287. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
  48288. 'Oct', 'Nov', 'Dec'];
  48289. // 26 Feb 16:19:34
  48290. function timestamp() {
  48291. var d = new Date();
  48292. var time = [pad(d.getHours()),
  48293. pad(d.getMinutes()),
  48294. pad(d.getSeconds())].join(':');
  48295. return [d.getDate(), months[d.getMonth()], time].join(' ');
  48296. }
  48297. // log is just a thin wrapper to console.log that prepends a timestamp
  48298. exports.log = function() {
  48299. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  48300. };
  48301. /**
  48302. * Inherit the prototype methods from one constructor into another.
  48303. *
  48304. * The Function.prototype.inherits from lang.js rewritten as a standalone
  48305. * function (not on Function.prototype). NOTE: If this file is to be loaded
  48306. * during bootstrapping this function needs to be rewritten using some native
  48307. * functions as prototype setup using normal JavaScript does not work as
  48308. * expected during bootstrapping (see mirror.js in r114903).
  48309. *
  48310. * @param {function} ctor Constructor function which needs to inherit the
  48311. * prototype.
  48312. * @param {function} superCtor Constructor function to inherit prototype from.
  48313. */
  48314. exports.inherits = __webpack_require__(552);
  48315. exports._extend = function(origin, add) {
  48316. // Don't do anything if add isn't an object
  48317. if (!add || !isObject(add)) return origin;
  48318. var keys = Object.keys(add);
  48319. var i = keys.length;
  48320. while (i--) {
  48321. origin[keys[i]] = add[keys[i]];
  48322. }
  48323. return origin;
  48324. };
  48325. function hasOwnProperty(obj, prop) {
  48326. return Object.prototype.hasOwnProperty.call(obj, prop);
  48327. }
  48328. var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;
  48329. exports.promisify = function promisify(original) {
  48330. if (typeof original !== 'function')
  48331. throw new TypeError('The "original" argument must be of type Function');
  48332. if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
  48333. var fn = original[kCustomPromisifiedSymbol];
  48334. if (typeof fn !== 'function') {
  48335. throw new TypeError('The "util.promisify.custom" argument must be of type Function');
  48336. }
  48337. Object.defineProperty(fn, kCustomPromisifiedSymbol, {
  48338. value: fn, enumerable: false, writable: false, configurable: true
  48339. });
  48340. return fn;
  48341. }
  48342. function fn() {
  48343. var promiseResolve, promiseReject;
  48344. var promise = new Promise(function (resolve, reject) {
  48345. promiseResolve = resolve;
  48346. promiseReject = reject;
  48347. });
  48348. var args = [];
  48349. for (var i = 0; i < arguments.length; i++) {
  48350. args.push(arguments[i]);
  48351. }
  48352. args.push(function (err, value) {
  48353. if (err) {
  48354. promiseReject(err);
  48355. } else {
  48356. promiseResolve(value);
  48357. }
  48358. });
  48359. try {
  48360. original.apply(this, args);
  48361. } catch (err) {
  48362. promiseReject(err);
  48363. }
  48364. return promise;
  48365. }
  48366. Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
  48367. if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {
  48368. value: fn, enumerable: false, writable: false, configurable: true
  48369. });
  48370. return Object.defineProperties(
  48371. fn,
  48372. getOwnPropertyDescriptors(original)
  48373. );
  48374. }
  48375. exports.promisify.custom = kCustomPromisifiedSymbol
  48376. function callbackifyOnRejected(reason, cb) {
  48377. // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).
  48378. // Because `null` is a special error value in callbacks which means "no error
  48379. // occurred", we error-wrap so the callback consumer can distinguish between
  48380. // "the promise rejected with null" or "the promise fulfilled with undefined".
  48381. if (!reason) {
  48382. var newReason = new Error('Promise was rejected with a falsy value');
  48383. newReason.reason = reason;
  48384. reason = newReason;
  48385. }
  48386. return cb(reason);
  48387. }
  48388. function callbackify(original) {
  48389. if (typeof original !== 'function') {
  48390. throw new TypeError('The "original" argument must be of type Function');
  48391. }
  48392. // We DO NOT return the promise as it gives the user a false sense that
  48393. // the promise is actually somehow related to the callback's execution
  48394. // and that the callback throwing will reject the promise.
  48395. function callbackified() {
  48396. var args = [];
  48397. for (var i = 0; i < arguments.length; i++) {
  48398. args.push(arguments[i]);
  48399. }
  48400. var maybeCb = args.pop();
  48401. if (typeof maybeCb !== 'function') {
  48402. throw new TypeError('The last argument must be of type Function');
  48403. }
  48404. var self = this;
  48405. var cb = function() {
  48406. return maybeCb.apply(self, arguments);
  48407. };
  48408. // In true node style we process the callback on `nextTick` with all the
  48409. // implications (stack, `uncaughtException`, `async_hooks`)
  48410. original.apply(this, args)
  48411. .then(function(ret) { process.nextTick(cb, null, ret) },
  48412. function(rej) { process.nextTick(callbackifyOnRejected, rej, cb) });
  48413. }
  48414. Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
  48415. Object.defineProperties(callbackified,
  48416. getOwnPropertyDescriptors(original));
  48417. return callbackified;
  48418. }
  48419. exports.callbackify = callbackify;
  48420. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(67), __webpack_require__(0)))
  48421. /***/ }),
  48422. /* 551 */
  48423. /***/ (function(module, exports) {
  48424. module.exports = function isBuffer(arg) {
  48425. return arg && typeof arg === 'object'
  48426. && typeof arg.copy === 'function'
  48427. && typeof arg.fill === 'function'
  48428. && typeof arg.readUInt8 === 'function';
  48429. }
  48430. /***/ }),
  48431. /* 552 */
  48432. /***/ (function(module, exports) {
  48433. if (typeof Object.create === 'function') {
  48434. // implementation from standard node.js 'util' module
  48435. module.exports = function inherits(ctor, superCtor) {
  48436. ctor.super_ = superCtor
  48437. ctor.prototype = Object.create(superCtor.prototype, {
  48438. constructor: {
  48439. value: ctor,
  48440. enumerable: false,
  48441. writable: true,
  48442. configurable: true
  48443. }
  48444. });
  48445. };
  48446. } else {
  48447. // old school shim for old browsers
  48448. module.exports = function inherits(ctor, superCtor) {
  48449. ctor.super_ = superCtor
  48450. var TempCtor = function () {}
  48451. TempCtor.prototype = superCtor.prototype
  48452. ctor.prototype = new TempCtor()
  48453. ctor.prototype.constructor = ctor
  48454. }
  48455. }
  48456. /***/ }),
  48457. /* 553 */
  48458. /***/ (function(module, exports, __webpack_require__) {
  48459. var createCaseFirst = __webpack_require__(554);
  48460. /**
  48461. * Converts the first character of `string` to upper case.
  48462. *
  48463. * @static
  48464. * @memberOf _
  48465. * @since 4.0.0
  48466. * @category String
  48467. * @param {string} [string=''] The string to convert.
  48468. * @returns {string} Returns the converted string.
  48469. * @example
  48470. *
  48471. * _.upperFirst('fred');
  48472. * // => 'Fred'
  48473. *
  48474. * _.upperFirst('FRED');
  48475. * // => 'FRED'
  48476. */
  48477. var upperFirst = createCaseFirst('toUpperCase');
  48478. module.exports = upperFirst;
  48479. /***/ }),
  48480. /* 554 */
  48481. /***/ (function(module, exports, __webpack_require__) {
  48482. var castSlice = __webpack_require__(555),
  48483. hasUnicode = __webpack_require__(256),
  48484. stringToArray = __webpack_require__(257),
  48485. toString = __webpack_require__(92);
  48486. /**
  48487. * Creates a function like `_.lowerFirst`.
  48488. *
  48489. * @private
  48490. * @param {string} methodName The name of the `String` case method to use.
  48491. * @returns {Function} Returns the new case function.
  48492. */
  48493. function createCaseFirst(methodName) {
  48494. return function(string) {
  48495. string = toString(string);
  48496. var strSymbols = hasUnicode(string)
  48497. ? stringToArray(string)
  48498. : undefined;
  48499. var chr = strSymbols
  48500. ? strSymbols[0]
  48501. : string.charAt(0);
  48502. var trailing = strSymbols
  48503. ? castSlice(strSymbols, 1).join('')
  48504. : string.slice(1);
  48505. return chr[methodName]() + trailing;
  48506. };
  48507. }
  48508. module.exports = createCaseFirst;
  48509. /***/ }),
  48510. /* 555 */
  48511. /***/ (function(module, exports, __webpack_require__) {
  48512. var baseSlice = __webpack_require__(255);
  48513. /**
  48514. * Casts `array` to a slice if it's needed.
  48515. *
  48516. * @private
  48517. * @param {Array} array The array to inspect.
  48518. * @param {number} start The start position.
  48519. * @param {number} [end=array.length] The end position.
  48520. * @returns {Array} Returns the cast slice.
  48521. */
  48522. function castSlice(array, start, end) {
  48523. var length = array.length;
  48524. end = end === undefined ? length : end;
  48525. return (!start && end >= length) ? array : baseSlice(array, start, end);
  48526. }
  48527. module.exports = castSlice;
  48528. /***/ }),
  48529. /* 556 */
  48530. /***/ (function(module, exports) {
  48531. /**
  48532. * Converts an ASCII `string` to an array.
  48533. *
  48534. * @private
  48535. * @param {string} string The string to convert.
  48536. * @returns {Array} Returns the converted array.
  48537. */
  48538. function asciiToArray(string) {
  48539. return string.split('');
  48540. }
  48541. module.exports = asciiToArray;
  48542. /***/ }),
  48543. /* 557 */
  48544. /***/ (function(module, exports) {
  48545. /** Used to compose unicode character classes. */
  48546. var rsAstralRange = '\\ud800-\\udfff',
  48547. rsComboMarksRange = '\\u0300-\\u036f',
  48548. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  48549. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  48550. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  48551. rsVarRange = '\\ufe0e\\ufe0f';
  48552. /** Used to compose unicode capture groups. */
  48553. var rsAstral = '[' + rsAstralRange + ']',
  48554. rsCombo = '[' + rsComboRange + ']',
  48555. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  48556. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  48557. rsNonAstral = '[^' + rsAstralRange + ']',
  48558. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  48559. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  48560. rsZWJ = '\\u200d';
  48561. /** Used to compose unicode regexes. */
  48562. var reOptMod = rsModifier + '?',
  48563. rsOptVar = '[' + rsVarRange + ']?',
  48564. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  48565. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  48566. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  48567. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  48568. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  48569. /**
  48570. * Converts a Unicode `string` to an array.
  48571. *
  48572. * @private
  48573. * @param {string} string The string to convert.
  48574. * @returns {Array} Returns the converted array.
  48575. */
  48576. function unicodeToArray(string) {
  48577. return string.match(reUnicode) || [];
  48578. }
  48579. module.exports = unicodeToArray;
  48580. /***/ }),
  48581. /* 558 */
  48582. /***/ (function(module, exports, __webpack_require__) {
  48583. "use strict";
  48584. module.exports = ['screen', 'window', 'tab', 'browser', 'application'];
  48585. /***/ }),
  48586. /* 559 */
  48587. /***/ (function(module, exports, __webpack_require__) {
  48588. "use strict";
  48589. const log = __webpack_require__(1);
  48590. const StaticConfig = __webpack_require__(28)();
  48591. const once = __webpack_require__(47);
  48592. const logLevels = __webpack_require__(127);
  48593. const some = __webpack_require__(561);
  48594. const map = __webpack_require__(564);
  48595. const PATH_TO_RELEASE_NOTES = '/opentok/webrtc/docs/js/release-notes.html';
  48596. const staticConfig = StaticConfig.onlyLocal();
  48597. const logging = log('setLogLevel');
  48598. const BANNER_HEADER = "\n \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\n\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u255D\n\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2554\u255D\n\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2588\u2588\u2557\n\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2557\n \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D";
  48599. const printHeader = once(() => {
  48600. logging.info("%c" + BANNER_HEADER, 'font-family: "Fire Code", Courier, "Courier New", Consolas, "DejaVu Sans Mono"');
  48601. logging.info("OpenTok JS SDK " + staticConfig.version);
  48602. logging.info("Release notes: " + staticConfig.websiteUrl + PATH_TO_RELEASE_NOTES);
  48603. logging.info("Known issues: " + staticConfig.websiteUrl + PATH_TO_RELEASE_NOTES + "l#knownIssues");
  48604. });
  48605. function setLogLevel(level) {
  48606. if (level === undefined || !some(logLevels, {
  48607. priority: level
  48608. }) && level !== 0) {
  48609. const validLevelDescription = map(logLevels, (x, key) => "OT." + key.toUpperCase() + " = " + x.priority).join(', ');
  48610. logging.error("level must be one of: OT.NONE = 0, " + validLevelDescription);
  48611. logging.warn('Using OT.WARN instead');
  48612. level = logLevels.warn.priority; // eslint-disable-line no-param-reassign
  48613. }
  48614. log.setLogLevel(level);
  48615. if (level >= logLevels.debug.priority) {
  48616. printHeader();
  48617. }
  48618. const link = 'https://www.npmjs.com/package/debug#browser-support';
  48619. logging.info("OpenTok JS SDK now uses the debug library. More info at " + link);
  48620. logging.info("Changed log level to: " + level);
  48621. return level;
  48622. } // set default level
  48623. setLogLevel(staticConfig.debug ? logLevels.debug.priority : logLevels.warn.priority);
  48624. module.exports = setLogLevel;
  48625. /**
  48626. * Sets the API log level.
  48627. * <p>
  48628. * Calling <code>OT.setLogLevel()</code> sets the log level for runtime log messages that
  48629. * are the OpenTok library generates. The default value for the log level is
  48630. * <code>OT.ERROR</code>.
  48631. * </p>
  48632. * <p>
  48633. * The OpenTok JavaScript library displays log messages in the debugger console (such as
  48634. * Firebug), if one exists.
  48635. * </p>
  48636. * <p>
  48637. * The following example logs the session ID to the console, by calling <code>OT.log()</code>.
  48638. * The code also logs an error message when it attempts to publish a stream before you have
  48639. * connected to the session (by calling <code>Session.connect()</code>).
  48640. * </p>
  48641. * <pre>
  48642. * OT.setLogLevel(OT.LOG);
  48643. * session = OT.initSession(sessionId);
  48644. * OT.log(sessionId);
  48645. * publisher = OT.initPublisher("publishContainer");
  48646. * session.publish(publisher);
  48647. * </pre>
  48648. *
  48649. * @param {Number} logLevel The degree of logging desired by the developer:
  48650. *
  48651. * <p>
  48652. * <ul>
  48653. * <li>
  48654. * <code>OT.NONE</code> &#151; API logging is disabled.
  48655. * </li>
  48656. * <li>
  48657. * <code>OT.ERROR</code> &#151; Logging of errors only.
  48658. * </li>
  48659. * <li>
  48660. * <code>OT.WARN</code> &#151; Logging of warnings and errors.
  48661. * </li>
  48662. * <li>
  48663. * <code>OT.INFO</code> &#151; Logging of other useful information, in addition to
  48664. * warnings and errors.
  48665. * </li>
  48666. * <li>
  48667. * <code>OT.LOG</code> &#151; Logging of <code>OT.log()</code> messages, in addition
  48668. * to OpenTok info, warning,
  48669. * and error messages.
  48670. * </li>
  48671. * <li>
  48672. * <code>OT.DEBUG</code> &#151; Fine-grained logging of all API actions, as well as
  48673. * <code>OT.log()</code> messages.
  48674. * </li>
  48675. * </ul>
  48676. * </p>
  48677. *
  48678. * @name OT.setLogLevel
  48679. * @memberof OT
  48680. * @function
  48681. * @see <a href="#log">OT.log()</a>
  48682. */
  48683. /**
  48684. * Sends a string to the debugger console. However, the function only logs to the console
  48685. * if you have set the log level to <code>OT.LOG</code> or <code>OT.DEBUG</code>,
  48686. * by calling <code>OT.setLogLevel(OT.LOG)</code> or <code>OT.setLogLevel(OT.DEBUG)</code>.
  48687. *
  48688. * @param {String} message The string to log.
  48689. *
  48690. * @name OT.log
  48691. * @memberof OT
  48692. * @function
  48693. * @see <a href="#setLogLevel">OT.setLogLevel()</a>
  48694. */
  48695. /***/ }),
  48696. /* 560 */
  48697. /***/ (function(module, exports, __webpack_require__) {
  48698. var toInteger = __webpack_require__(87);
  48699. /** Error message constants. */
  48700. var FUNC_ERROR_TEXT = 'Expected a function';
  48701. /**
  48702. * Creates a function that invokes `func`, with the `this` binding and arguments
  48703. * of the created function, while it's called less than `n` times. Subsequent
  48704. * calls to the created function return the result of the last `func` invocation.
  48705. *
  48706. * @static
  48707. * @memberOf _
  48708. * @since 3.0.0
  48709. * @category Function
  48710. * @param {number} n The number of calls at which `func` is no longer invoked.
  48711. * @param {Function} func The function to restrict.
  48712. * @returns {Function} Returns the new restricted function.
  48713. * @example
  48714. *
  48715. * jQuery(element).on('click', _.before(5, addContactToList));
  48716. * // => Allows adding up to 4 contacts to the list.
  48717. */
  48718. function before(n, func) {
  48719. var result;
  48720. if (typeof func != 'function') {
  48721. throw new TypeError(FUNC_ERROR_TEXT);
  48722. }
  48723. n = toInteger(n);
  48724. return function() {
  48725. if (--n > 0) {
  48726. result = func.apply(this, arguments);
  48727. }
  48728. if (n <= 1) {
  48729. func = undefined;
  48730. }
  48731. return result;
  48732. };
  48733. }
  48734. module.exports = before;
  48735. /***/ }),
  48736. /* 561 */
  48737. /***/ (function(module, exports, __webpack_require__) {
  48738. var arraySome = __webpack_require__(210),
  48739. baseIteratee = __webpack_require__(29),
  48740. baseSome = __webpack_require__(562),
  48741. isArray = __webpack_require__(9),
  48742. isIterateeCall = __webpack_require__(129);
  48743. /**
  48744. * Checks if `predicate` returns truthy for **any** element of `collection`.
  48745. * Iteration is stopped once `predicate` returns truthy. The predicate is
  48746. * invoked with three arguments: (value, index|key, collection).
  48747. *
  48748. * @static
  48749. * @memberOf _
  48750. * @since 0.1.0
  48751. * @category Collection
  48752. * @param {Array|Object} collection The collection to iterate over.
  48753. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  48754. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  48755. * @returns {boolean} Returns `true` if any element passes the predicate check,
  48756. * else `false`.
  48757. * @example
  48758. *
  48759. * _.some([null, 0, 'yes', false], Boolean);
  48760. * // => true
  48761. *
  48762. * var users = [
  48763. * { 'user': 'barney', 'active': true },
  48764. * { 'user': 'fred', 'active': false }
  48765. * ];
  48766. *
  48767. * // The `_.matches` iteratee shorthand.
  48768. * _.some(users, { 'user': 'barney', 'active': false });
  48769. * // => false
  48770. *
  48771. * // The `_.matchesProperty` iteratee shorthand.
  48772. * _.some(users, ['active', false]);
  48773. * // => true
  48774. *
  48775. * // The `_.property` iteratee shorthand.
  48776. * _.some(users, 'active');
  48777. * // => true
  48778. */
  48779. function some(collection, predicate, guard) {
  48780. var func = isArray(collection) ? arraySome : baseSome;
  48781. if (guard && isIterateeCall(collection, predicate, guard)) {
  48782. predicate = undefined;
  48783. }
  48784. return func(collection, baseIteratee(predicate, 3));
  48785. }
  48786. module.exports = some;
  48787. /***/ }),
  48788. /* 562 */
  48789. /***/ (function(module, exports, __webpack_require__) {
  48790. var baseEach = __webpack_require__(259);
  48791. /**
  48792. * The base implementation of `_.some` without support for iteratee shorthands.
  48793. *
  48794. * @private
  48795. * @param {Array|Object} collection The collection to iterate over.
  48796. * @param {Function} predicate The function invoked per iteration.
  48797. * @returns {boolean} Returns `true` if any element passes the predicate check,
  48798. * else `false`.
  48799. */
  48800. function baseSome(collection, predicate) {
  48801. var result;
  48802. baseEach(collection, function(value, index, collection) {
  48803. result = predicate(value, index, collection);
  48804. return !result;
  48805. });
  48806. return !!result;
  48807. }
  48808. module.exports = baseSome;
  48809. /***/ }),
  48810. /* 563 */
  48811. /***/ (function(module, exports, __webpack_require__) {
  48812. var isArrayLike = __webpack_require__(21);
  48813. /**
  48814. * Creates a `baseEach` or `baseEachRight` function.
  48815. *
  48816. * @private
  48817. * @param {Function} eachFunc The function to iterate over a collection.
  48818. * @param {boolean} [fromRight] Specify iterating from right to left.
  48819. * @returns {Function} Returns the new base function.
  48820. */
  48821. function createBaseEach(eachFunc, fromRight) {
  48822. return function(collection, iteratee) {
  48823. if (collection == null) {
  48824. return collection;
  48825. }
  48826. if (!isArrayLike(collection)) {
  48827. return eachFunc(collection, iteratee);
  48828. }
  48829. var length = collection.length,
  48830. index = fromRight ? length : -1,
  48831. iterable = Object(collection);
  48832. while ((fromRight ? index-- : ++index < length)) {
  48833. if (iteratee(iterable[index], index, iterable) === false) {
  48834. break;
  48835. }
  48836. }
  48837. return collection;
  48838. };
  48839. }
  48840. module.exports = createBaseEach;
  48841. /***/ }),
  48842. /* 564 */
  48843. /***/ (function(module, exports, __webpack_require__) {
  48844. var arrayMap = __webpack_require__(30),
  48845. baseIteratee = __webpack_require__(29),
  48846. baseMap = __webpack_require__(565),
  48847. isArray = __webpack_require__(9);
  48848. /**
  48849. * Creates an array of values by running each element in `collection` thru
  48850. * `iteratee`. The iteratee is invoked with three arguments:
  48851. * (value, index|key, collection).
  48852. *
  48853. * Many lodash methods are guarded to work as iteratees for methods like
  48854. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  48855. *
  48856. * The guarded methods are:
  48857. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  48858. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  48859. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  48860. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  48861. *
  48862. * @static
  48863. * @memberOf _
  48864. * @since 0.1.0
  48865. * @category Collection
  48866. * @param {Array|Object} collection The collection to iterate over.
  48867. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  48868. * @returns {Array} Returns the new mapped array.
  48869. * @example
  48870. *
  48871. * function square(n) {
  48872. * return n * n;
  48873. * }
  48874. *
  48875. * _.map([4, 8], square);
  48876. * // => [16, 64]
  48877. *
  48878. * _.map({ 'a': 4, 'b': 8 }, square);
  48879. * // => [16, 64] (iteration order is not guaranteed)
  48880. *
  48881. * var users = [
  48882. * { 'user': 'barney' },
  48883. * { 'user': 'fred' }
  48884. * ];
  48885. *
  48886. * // The `_.property` iteratee shorthand.
  48887. * _.map(users, 'user');
  48888. * // => ['barney', 'fred']
  48889. */
  48890. function map(collection, iteratee) {
  48891. var func = isArray(collection) ? arrayMap : baseMap;
  48892. return func(collection, baseIteratee(iteratee, 3));
  48893. }
  48894. module.exports = map;
  48895. /***/ }),
  48896. /* 565 */
  48897. /***/ (function(module, exports, __webpack_require__) {
  48898. var baseEach = __webpack_require__(259),
  48899. isArrayLike = __webpack_require__(21);
  48900. /**
  48901. * The base implementation of `_.map` without support for iteratee shorthands.
  48902. *
  48903. * @private
  48904. * @param {Array|Object} collection The collection to iterate over.
  48905. * @param {Function} iteratee The function invoked per iteration.
  48906. * @returns {Array} Returns the new mapped array.
  48907. */
  48908. function baseMap(collection, iteratee) {
  48909. var index = -1,
  48910. result = isArrayLike(collection) ? Array(collection.length) : [];
  48911. baseEach(collection, function(value, key, collection) {
  48912. result[++index] = iteratee(value, key, collection);
  48913. });
  48914. return result;
  48915. }
  48916. module.exports = baseMap;
  48917. /***/ }),
  48918. /* 566 */
  48919. /***/ (function(module, exports, __webpack_require__) {
  48920. "use strict";
  48921. // When setting the background image uri of a publisher or subscriber, we allow the use of a raw
  48922. // data blob of a png, which requires the prefix 'data:image/png;base64,'. This function
  48923. // encapsulates that transformation.
  48924. module.exports = function fixBackgroundImageURI(bgImgURI) {
  48925. if (bgImgURI.substr(0, 5) !== 'http:' && bgImgURI.substr(0, 6) !== 'https:' && bgImgURI.substr(0, 22) !== 'data:image/png;base64,') {
  48926. return "data:image/png;base64," + bgImgURI;
  48927. }
  48928. return bgImgURI;
  48929. };
  48930. /***/ }),
  48931. /* 567 */
  48932. /***/ (function(module, exports, __webpack_require__) {
  48933. "use strict";
  48934. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  48935. /* eslint-disable no-underscore-dangle, prefer-const */
  48936. const cloneDeep = __webpack_require__(50);
  48937. const logging = __webpack_require__(1)('Style');
  48938. module.exports = function Style(initalStyles, onStyleChange) {
  48939. const styleApi = this;
  48940. const _styles = {}; // Styles with null here means every value is valid for that style
  48941. const _validStyleValues = {
  48942. buttonDisplayMode: ['auto', 'mini', 'mini-auto', 'off', 'on'],
  48943. nameDisplayMode: ['auto', 'off', 'on'],
  48944. audioLevelDisplayMode: ['auto', 'off', 'on'],
  48945. showSettingsButton: [true, false],
  48946. showSpeakerButton: null,
  48947. showMicButton: [true, false],
  48948. backgroundImageURI: null,
  48949. showControlBar: [true, false],
  48950. // 'showArchiveStatus' is kept for backwards compatibility.
  48951. // 'archiveStatusDisplayMode' is the documented style name.
  48952. showArchiveStatus: [true, false],
  48953. archiveStatusDisplayMode: ['auto', 'off', 'on'],
  48954. videoDisabledDisplayMode: ['auto', 'off', 'on'],
  48955. audioBlockedDisplayMode: ['auto', 'off', 'on']
  48956. }; // Validates the style +key+ and also whether +value+ is valid for +key+
  48957. const isValidStyle = function isValidStyle(key, value) {
  48958. const valueSpec = _validStyleValues[key];
  48959. if (valueSpec === undefined) {
  48960. return false;
  48961. }
  48962. if (valueSpec === null) {
  48963. return true;
  48964. }
  48965. return valueSpec.indexOf(value) !== -1;
  48966. };
  48967. const castValue = function castValue(value) {
  48968. switch (value) {
  48969. case 'true':
  48970. return true;
  48971. case 'false':
  48972. return false;
  48973. default:
  48974. return value;
  48975. }
  48976. }; // Returns a copy of the styles.
  48977. styleApi.getAll = function () {
  48978. return cloneDeep(_styles);
  48979. };
  48980. styleApi.get = function (key) {
  48981. if (key) {
  48982. return _styles[key];
  48983. } // We haven't been asked for any specific key, just return the lot
  48984. return styleApi.getAll();
  48985. }; // *note:* this will not trigger onStyleChange if +silent+ is truthy
  48986. styleApi.setAll = function (newStyles, silent) {
  48987. Object.keys(newStyles).forEach(key => {
  48988. styleApi.set(key, newStyles[key], silent);
  48989. });
  48990. return styleApi;
  48991. }; // *note:* this will not trigger onStyleChange if +silent+ is truthy
  48992. styleApi.set = function (key, value, silent) {
  48993. logging.debug("setStyle: " + key.toString());
  48994. let oldValue;
  48995. const newValue = castValue(value);
  48996. if (!isValidStyle(key, newValue)) {
  48997. logging.warn("Style.set::Invalid style property passed " + key + " : " + newValue);
  48998. return styleApi;
  48999. }
  49000. oldValue = _styles[key];
  49001. if (newValue !== oldValue) {
  49002. _styles[key] = newValue;
  49003. if (!silent) {
  49004. onStyleChange(key, value, oldValue);
  49005. }
  49006. }
  49007. return styleApi;
  49008. };
  49009. if (initalStyles) {
  49010. styleApi.setAll(initalStyles, true);
  49011. }
  49012. };
  49013. /***/ }),
  49014. /* 568 */
  49015. /***/ (function(module, exports, __webpack_require__) {
  49016. "use strict";
  49017. const cloneDeep = __webpack_require__(50); // The backgroundImageURI of the styleHash object that we log to analytics needs to be stripped down
  49018. // because base64 data blobs are often very large and can be a privacy issue if taken from the
  49019. // user's camera.
  49020. module.exports = function styleHashLogFilter(styleHashInput) {
  49021. const styleHash = cloneDeep(styleHashInput);
  49022. if (styleHash.backgroundImageURI) {
  49023. const protocol = styleHash.backgroundImageURI.split(':')[0];
  49024. styleHash.backgroundImageURI = ['http', 'https', 'data'].indexOf(protocol) !== -1 ? protocol : 'other';
  49025. }
  49026. return styleHash;
  49027. };
  49028. /***/ }),
  49029. /* 569 */
  49030. /***/ (function(module, exports, __webpack_require__) {
  49031. "use strict";
  49032. const env = __webpack_require__(3); // TODO Remove all PeerConnection stuff, that belongs to the messaging layer not the Media layer.
  49033. // Indicates whether this client supports the PeerConnection
  49034. // API.
  49035. //
  49036. // Chrome Issues:
  49037. // * The explicit prototype.addStream check is because webkitRTCPeerConnection was
  49038. // partially implemented, but not functional, in Chrome 22.
  49039. //
  49040. // Firefox Issues:
  49041. // * No real support before Firefox 19
  49042. // * Firefox 19 has issues with generating Offers.
  49043. // * Firefox 20 doesn't interoperate with Chrome.
  49044. //
  49045. module.exports = () => {
  49046. if (env.name === 'Node') {
  49047. return false;
  49048. } else if (typeof (typeof window !== undefined ? window : global).webkitRTCPeerConnection === 'function' && !!(typeof window !== undefined ? window : global).webkitRTCPeerConnection.prototype.addStream) {
  49049. return true;
  49050. } else if (typeof (typeof window !== undefined ? window : global).RTCPeerConnection === 'function') {
  49051. return true;
  49052. } else if (typeof (typeof window !== undefined ? window : global).mozRTCPeerConnection === 'function' && env.version > 20.0) {
  49053. return true;
  49054. }
  49055. return false;
  49056. };
  49057. /***/ }),
  49058. /* 570 */
  49059. /***/ (function(module, exports, __webpack_require__) {
  49060. "use strict";
  49061. // Indicates if the client supports WebSockets.
  49062. module.exports = (typeof window !== undefined ? window : global).WebSocket !== undefined;
  49063. /***/ }),
  49064. /* 571 */
  49065. /***/ (function(module, exports) {
  49066. module.exports = "<div id=\"tb_alert\"><div id=\"section-normal-install\"><div>!</div><button role=\"OT_close\">&#x00D7;</button><h1 data-text=\"Incompatible Browser\">Incompatible Browser</h1><p>The video component of this application requires <a target=\"_blank\" href=\"https://www.google.com/chrome/\">Google Chrome</a> or <a target=\"_blank\" href=\"http://www.mozilla.org/firefox\">Firefox</a>.</p></div><div id=\"section-upgrade-install\"><div>!</div><button role=\"OT_close\">&#x00D7;</button><h1 data-text=\"Incompatible Browser\">Incompatible Browser</h1><p>The video component of this application requires a newer version of <a target=\"_blank\" href=\"https://www.google.com/chrome/\">Google Chrome</a> or <a target=\"_blank\" href=\"http://www.mozilla.org/firefox\">Firefox</a>.</p><p class=\"continue-text\"><a href=\"#\" role=\"OT_close\">Continue at my own risk.</a></p></div><div id=\"section-supported-mobile-browser\"><div>!</div><button role=\"OT_close\">&#x00D7;</button><h1 data-text=\"Incompatible Browser\">Incompatible Browser</h1><p>The video component of this application requires a newer version of <a target=\"_blank\" href=\"https://www.google.com.au/chrome/browser/mobile/\">Google Chrome</a>.</p><p class=\"continue-text\"><a href=\"#\" role=\"OT_close\">Continue at my own risk.</a></p></div><div id=\"section-mobile-browser\"><div>!</div><button role=\"OT_close\">&#x00D7;</button><h1 data-text=\"Incompatible Browser\">Incompatible Browser</h1><p>The video component of this application is not supported on your mobile device's browser at this time.</p></div></div>";
  49067. /***/ }),
  49068. /* 572 */
  49069. /***/ (function(module, exports, __webpack_require__) {
  49070. "use strict";
  49071. var _interopRequireDefault = __webpack_require__(2);
  49072. var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(55));
  49073. const Events = __webpack_require__(43);
  49074. module.exports = /*#__PURE__*/function (_Events) {
  49075. (0, _inheritsLoose2.default)(Modal, _Events);
  49076. function Modal(innerHTML, _temp) {
  49077. var _this;
  49078. let _ref = _temp === void 0 ? {} : _temp,
  49079. _ref$destroyOnClose = _ref.destroyOnClose,
  49080. destroyOnClose = _ref$destroyOnClose === void 0 ? true : _ref$destroyOnClose;
  49081. _this = _Events.call(this) || this;
  49082. _this.modalDiv = document.createElement('div');
  49083. _this.modalDiv.classList.add('OT_ModalDialog');
  49084. _this.modalDiv.innerHTML = innerHTML;
  49085. const closeBtnEls = _this.modalDiv.querySelectorAll('[role=OT_close]');
  49086. [].forEach.call(closeBtnEls, closeBtnEl => closeBtnEl.addEventListener('click', event => {
  49087. event.preventDefault();
  49088. _this.close();
  49089. }));
  49090. _this.close();
  49091. document.body.appendChild(_this.modalDiv);
  49092. if (destroyOnClose) {
  49093. _this.on('closed', () => _this.destroy());
  49094. }
  49095. return _this;
  49096. }
  49097. var _proto = Modal.prototype;
  49098. _proto.open = function open() {
  49099. this.modalDiv.style.display = 'block';
  49100. this.emit('opened');
  49101. };
  49102. _proto.close = function close() {
  49103. this.modalDiv.style.display = 'none';
  49104. this.emit('closed');
  49105. };
  49106. _proto.destroy = function destroy() {
  49107. this.modalDiv.innerHTML = '';
  49108. this.modalDiv.parentNode.removeChild(this.modalDiv);
  49109. this.emit('destroyed');
  49110. };
  49111. _proto.el = function el(query) {
  49112. return this.modalDiv.querySelector(query);
  49113. };
  49114. return Modal;
  49115. }(Events);
  49116. /***/ }),
  49117. /* 573 */
  49118. /***/ (function(module, exports, __webpack_require__) {
  49119. var getPrototypeOf = __webpack_require__(574);
  49120. var setPrototypeOf = __webpack_require__(262);
  49121. var isNativeFunction = __webpack_require__(575);
  49122. var construct = __webpack_require__(576);
  49123. function _wrapNativeSuper(Class) {
  49124. var _cache = typeof Map === "function" ? new Map() : undefined;
  49125. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  49126. if (Class === null || !isNativeFunction(Class)) return Class;
  49127. if (typeof Class !== "function") {
  49128. throw new TypeError("Super expression must either be null or a function");
  49129. }
  49130. if (typeof _cache !== "undefined") {
  49131. if (_cache.has(Class)) return _cache.get(Class);
  49132. _cache.set(Class, Wrapper);
  49133. }
  49134. function Wrapper() {
  49135. return construct(Class, arguments, getPrototypeOf(this).constructor);
  49136. }
  49137. Wrapper.prototype = Object.create(Class.prototype, {
  49138. constructor: {
  49139. value: Wrapper,
  49140. enumerable: false,
  49141. writable: true,
  49142. configurable: true
  49143. }
  49144. });
  49145. return setPrototypeOf(Wrapper, Class);
  49146. };
  49147. return _wrapNativeSuper(Class);
  49148. }
  49149. module.exports = _wrapNativeSuper;
  49150. /***/ }),
  49151. /* 574 */
  49152. /***/ (function(module, exports) {
  49153. function _getPrototypeOf(o) {
  49154. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  49155. return o.__proto__ || Object.getPrototypeOf(o);
  49156. };
  49157. return _getPrototypeOf(o);
  49158. }
  49159. module.exports = _getPrototypeOf;
  49160. /***/ }),
  49161. /* 575 */
  49162. /***/ (function(module, exports) {
  49163. function _isNativeFunction(fn) {
  49164. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  49165. }
  49166. module.exports = _isNativeFunction;
  49167. /***/ }),
  49168. /* 576 */
  49169. /***/ (function(module, exports, __webpack_require__) {
  49170. var setPrototypeOf = __webpack_require__(262);
  49171. function isNativeReflectConstruct() {
  49172. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  49173. if (Reflect.construct.sham) return false;
  49174. if (typeof Proxy === "function") return true;
  49175. try {
  49176. Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
  49177. return true;
  49178. } catch (e) {
  49179. return false;
  49180. }
  49181. }
  49182. function _construct(Parent, args, Class) {
  49183. if (isNativeReflectConstruct()) {
  49184. module.exports = _construct = Reflect.construct;
  49185. } else {
  49186. module.exports = _construct = function _construct(Parent, args, Class) {
  49187. var a = [null];
  49188. a.push.apply(a, args);
  49189. var Constructor = Function.bind.apply(Parent, a);
  49190. var instance = new Constructor();
  49191. if (Class) setPrototypeOf(instance, Class.prototype);
  49192. return instance;
  49193. };
  49194. }
  49195. return _construct.apply(null, arguments);
  49196. }
  49197. module.exports = _construct;
  49198. /***/ }),
  49199. /* 577 */
  49200. /***/ (function(module, exports, __webpack_require__) {
  49201. "use strict";
  49202. /* WEBPACK VAR INJECTION */(function(Promise) {
  49203. module.exports = (promise, onFinally) => {
  49204. onFinally = onFinally || (() => {});
  49205. return promise.then(val => new Promise(resolve => {
  49206. resolve(onFinally());
  49207. }).then(() => val), err => new Promise(resolve => {
  49208. resolve(onFinally());
  49209. }).then(() => {
  49210. throw err;
  49211. }));
  49212. };
  49213. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  49214. /***/ }),
  49215. /* 578 */
  49216. /***/ (function(module, exports, __webpack_require__) {
  49217. var castPath = __webpack_require__(52),
  49218. last = __webpack_require__(264),
  49219. parent = __webpack_require__(579),
  49220. toKey = __webpack_require__(41);
  49221. /**
  49222. * The base implementation of `_.unset`.
  49223. *
  49224. * @private
  49225. * @param {Object} object The object to modify.
  49226. * @param {Array|string} path The property path to unset.
  49227. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  49228. */
  49229. function baseUnset(object, path) {
  49230. path = castPath(path, object);
  49231. object = parent(object, path);
  49232. return object == null || delete object[toKey(last(path))];
  49233. }
  49234. module.exports = baseUnset;
  49235. /***/ }),
  49236. /* 579 */
  49237. /***/ (function(module, exports, __webpack_require__) {
  49238. var baseGet = __webpack_require__(91),
  49239. baseSlice = __webpack_require__(255);
  49240. /**
  49241. * Gets the parent value at `path` of `object`.
  49242. *
  49243. * @private
  49244. * @param {Object} object The object to query.
  49245. * @param {Array} path The path to get the parent value of.
  49246. * @returns {*} Returns the parent value.
  49247. */
  49248. function parent(object, path) {
  49249. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  49250. }
  49251. module.exports = parent;
  49252. /***/ }),
  49253. /* 580 */
  49254. /***/ (function(module, exports, __webpack_require__) {
  49255. var isPlainObject = __webpack_require__(124);
  49256. /**
  49257. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  49258. * objects.
  49259. *
  49260. * @private
  49261. * @param {*} value The value to inspect.
  49262. * @param {string} key The key of the property to inspect.
  49263. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  49264. */
  49265. function customOmitClone(value) {
  49266. return isPlainObject(value) ? undefined : value;
  49267. }
  49268. module.exports = customOmitClone;
  49269. /***/ }),
  49270. /* 581 */
  49271. /***/ (function(module, exports, __webpack_require__) {
  49272. var baseIteratee = __webpack_require__(29),
  49273. isArrayLike = __webpack_require__(21),
  49274. keys = __webpack_require__(27);
  49275. /**
  49276. * Creates a `_.find` or `_.findLast` function.
  49277. *
  49278. * @private
  49279. * @param {Function} findIndexFunc The function to find the collection index.
  49280. * @returns {Function} Returns the new find function.
  49281. */
  49282. function createFind(findIndexFunc) {
  49283. return function(collection, predicate, fromIndex) {
  49284. var iterable = Object(collection);
  49285. if (!isArrayLike(collection)) {
  49286. var iteratee = baseIteratee(predicate, 3);
  49287. collection = keys(collection);
  49288. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  49289. }
  49290. var index = findIndexFunc(collection, predicate, fromIndex);
  49291. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  49292. };
  49293. }
  49294. module.exports = createFind;
  49295. /***/ }),
  49296. /* 582 */
  49297. /***/ (function(module, exports, __webpack_require__) {
  49298. "use strict";
  49299. /* WEBPACK VAR INJECTION */(function(Promise) {
  49300. var _interopRequireDefault = __webpack_require__(2);
  49301. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  49302. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  49303. const createLogger = __webpack_require__(1);
  49304. const logger = createLogger('hasValidPeerConnection');
  49305. function checkPeerConnection(pc) {
  49306. return new Promise(resolve => {
  49307. pc.addEventListener('signalingstatechange', () => resolve(true));
  49308. pc.createOffer({
  49309. offerToReceiveAudio: 1
  49310. }).then(offer => pc.setLocalDescription(offer)).then(() => setTimeout(() => {
  49311. resolve(false);
  49312. }, 1000));
  49313. });
  49314. }
  49315. function hasValidPeerConnection(_x) {
  49316. return _hasValidPeerConnection.apply(this, arguments);
  49317. }
  49318. function _hasValidPeerConnection() {
  49319. _hasValidPeerConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(PeerConnection) {
  49320. var pc;
  49321. return _regenerator.default.wrap(function _callee$(_context) {
  49322. while (1) switch (_context.prev = _context.next) {
  49323. case 0:
  49324. _context.prev = 0;
  49325. pc = new PeerConnection({
  49326. iceServers: []
  49327. });
  49328. _context.next = 8;
  49329. break;
  49330. case 4:
  49331. _context.prev = 4;
  49332. _context.t0 = _context["catch"](0);
  49333. logger.error('Error occurred creating PeerConnection', _context.t0);
  49334. return _context.abrupt("return", false);
  49335. case 8:
  49336. _context.prev = 8;
  49337. _context.next = 11;
  49338. return checkPeerConnection(pc);
  49339. case 11:
  49340. _context.next = 18;
  49341. break;
  49342. case 13:
  49343. _context.prev = 13;
  49344. _context.t1 = _context["catch"](8);
  49345. logger.error('Error occurred checking the validity of the PeerConnection', _context.t1);
  49346. try {
  49347. pc.close();
  49348. } catch (e) {// ignore errors
  49349. }
  49350. return _context.abrupt("return", false);
  49351. case 18:
  49352. _context.prev = 18;
  49353. pc.close();
  49354. _context.next = 26;
  49355. break;
  49356. case 22:
  49357. _context.prev = 22;
  49358. _context.t2 = _context["catch"](18);
  49359. logger.error('Error occurred closing PeerConnection', _context.t2);
  49360. return _context.abrupt("return", false);
  49361. case 26:
  49362. return _context.abrupt("return", true);
  49363. case 27:
  49364. case "end":
  49365. return _context.stop();
  49366. }
  49367. }, _callee, null, [[0, 4], [8, 13], [18, 22]]);
  49368. }));
  49369. return _hasValidPeerConnection.apply(this, arguments);
  49370. }
  49371. module.exports = hasValidPeerConnection;
  49372. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  49373. /***/ }),
  49374. /* 583 */
  49375. /***/ (function(module, exports, __webpack_require__) {
  49376. /**
  49377. * Copyright (c) 2014-present, Facebook, Inc.
  49378. *
  49379. * This source code is licensed under the MIT license found in the
  49380. * LICENSE file in the root directory of this source tree.
  49381. */
  49382. // This method of obtaining a reference to the global object needs to be
  49383. // kept identical to the way it is obtained in runtime.js
  49384. var g = (function() {
  49385. return this || (typeof self === "object" && self);
  49386. })() || Function("return this")();
  49387. // Use `getOwnPropertyNames` because not all browsers support calling
  49388. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  49389. var hadRuntime = g.regeneratorRuntime &&
  49390. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  49391. // Save the old regeneratorRuntime in case it needs to be restored later.
  49392. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  49393. // Force reevalutation of runtime.js.
  49394. g.regeneratorRuntime = undefined;
  49395. module.exports = __webpack_require__(584);
  49396. if (hadRuntime) {
  49397. // Restore the original runtime.
  49398. g.regeneratorRuntime = oldRuntime;
  49399. } else {
  49400. // Remove the global property added by runtime.js.
  49401. try {
  49402. delete g.regeneratorRuntime;
  49403. } catch(e) {
  49404. g.regeneratorRuntime = undefined;
  49405. }
  49406. }
  49407. /***/ }),
  49408. /* 584 */
  49409. /***/ (function(module, exports, __webpack_require__) {
  49410. /* WEBPACK VAR INJECTION */(function(Promise) {/**
  49411. * Copyright (c) 2014-present, Facebook, Inc.
  49412. *
  49413. * This source code is licensed under the MIT license found in the
  49414. * LICENSE file in the root directory of this source tree.
  49415. */
  49416. !(function(global) {
  49417. "use strict";
  49418. var Op = Object.prototype;
  49419. var hasOwn = Op.hasOwnProperty;
  49420. var undefined; // More compressible than void 0.
  49421. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  49422. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  49423. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  49424. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  49425. var inModule = typeof module === "object";
  49426. var runtime = global.regeneratorRuntime;
  49427. if (runtime) {
  49428. if (inModule) {
  49429. // If regeneratorRuntime is defined globally and we're in a module,
  49430. // make the exports object identical to regeneratorRuntime.
  49431. module.exports = runtime;
  49432. }
  49433. // Don't bother evaluating the rest of this file if the runtime was
  49434. // already defined globally.
  49435. return;
  49436. }
  49437. // Define the runtime globally (as expected by generated code) as either
  49438. // module.exports (if we're in a module) or a new, empty object.
  49439. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  49440. function wrap(innerFn, outerFn, self, tryLocsList) {
  49441. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  49442. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  49443. var generator = Object.create(protoGenerator.prototype);
  49444. var context = new Context(tryLocsList || []);
  49445. // The ._invoke method unifies the implementations of the .next,
  49446. // .throw, and .return methods.
  49447. generator._invoke = makeInvokeMethod(innerFn, self, context);
  49448. return generator;
  49449. }
  49450. runtime.wrap = wrap;
  49451. // Try/catch helper to minimize deoptimizations. Returns a completion
  49452. // record like context.tryEntries[i].completion. This interface could
  49453. // have been (and was previously) designed to take a closure to be
  49454. // invoked without arguments, but in all the cases we care about we
  49455. // already have an existing method we want to call, so there's no need
  49456. // to create a new function object. We can even get away with assuming
  49457. // the method takes exactly one argument, since that happens to be true
  49458. // in every case, so we don't have to touch the arguments object. The
  49459. // only additional allocation required is the completion record, which
  49460. // has a stable shape and so hopefully should be cheap to allocate.
  49461. function tryCatch(fn, obj, arg) {
  49462. try {
  49463. return { type: "normal", arg: fn.call(obj, arg) };
  49464. } catch (err) {
  49465. return { type: "throw", arg: err };
  49466. }
  49467. }
  49468. var GenStateSuspendedStart = "suspendedStart";
  49469. var GenStateSuspendedYield = "suspendedYield";
  49470. var GenStateExecuting = "executing";
  49471. var GenStateCompleted = "completed";
  49472. // Returning this object from the innerFn has the same effect as
  49473. // breaking out of the dispatch switch statement.
  49474. var ContinueSentinel = {};
  49475. // Dummy constructor functions that we use as the .constructor and
  49476. // .constructor.prototype properties for functions that return Generator
  49477. // objects. For full spec compliance, you may wish to configure your
  49478. // minifier not to mangle the names of these two functions.
  49479. function Generator() {}
  49480. function GeneratorFunction() {}
  49481. function GeneratorFunctionPrototype() {}
  49482. // This is a polyfill for %IteratorPrototype% for environments that
  49483. // don't natively support it.
  49484. var IteratorPrototype = {};
  49485. IteratorPrototype[iteratorSymbol] = function () {
  49486. return this;
  49487. };
  49488. var getProto = Object.getPrototypeOf;
  49489. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  49490. if (NativeIteratorPrototype &&
  49491. NativeIteratorPrototype !== Op &&
  49492. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  49493. // This environment has a native %IteratorPrototype%; use it instead
  49494. // of the polyfill.
  49495. IteratorPrototype = NativeIteratorPrototype;
  49496. }
  49497. var Gp = GeneratorFunctionPrototype.prototype =
  49498. Generator.prototype = Object.create(IteratorPrototype);
  49499. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  49500. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  49501. GeneratorFunctionPrototype[toStringTagSymbol] =
  49502. GeneratorFunction.displayName = "GeneratorFunction";
  49503. // Helper for defining the .next, .throw, and .return methods of the
  49504. // Iterator interface in terms of a single ._invoke method.
  49505. function defineIteratorMethods(prototype) {
  49506. ["next", "throw", "return"].forEach(function(method) {
  49507. prototype[method] = function(arg) {
  49508. return this._invoke(method, arg);
  49509. };
  49510. });
  49511. }
  49512. runtime.isGeneratorFunction = function(genFun) {
  49513. var ctor = typeof genFun === "function" && genFun.constructor;
  49514. return ctor
  49515. ? ctor === GeneratorFunction ||
  49516. // For the native GeneratorFunction constructor, the best we can
  49517. // do is to check its .name property.
  49518. (ctor.displayName || ctor.name) === "GeneratorFunction"
  49519. : false;
  49520. };
  49521. runtime.mark = function(genFun) {
  49522. if (Object.setPrototypeOf) {
  49523. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  49524. } else {
  49525. genFun.__proto__ = GeneratorFunctionPrototype;
  49526. if (!(toStringTagSymbol in genFun)) {
  49527. genFun[toStringTagSymbol] = "GeneratorFunction";
  49528. }
  49529. }
  49530. genFun.prototype = Object.create(Gp);
  49531. return genFun;
  49532. };
  49533. // Within the body of any async function, `await x` is transformed to
  49534. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  49535. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  49536. // meant to be awaited.
  49537. runtime.awrap = function(arg) {
  49538. return { __await: arg };
  49539. };
  49540. function AsyncIterator(generator) {
  49541. function invoke(method, arg, resolve, reject) {
  49542. var record = tryCatch(generator[method], generator, arg);
  49543. if (record.type === "throw") {
  49544. reject(record.arg);
  49545. } else {
  49546. var result = record.arg;
  49547. var value = result.value;
  49548. if (value &&
  49549. typeof value === "object" &&
  49550. hasOwn.call(value, "__await")) {
  49551. return Promise.resolve(value.__await).then(function(value) {
  49552. invoke("next", value, resolve, reject);
  49553. }, function(err) {
  49554. invoke("throw", err, resolve, reject);
  49555. });
  49556. }
  49557. return Promise.resolve(value).then(function(unwrapped) {
  49558. // When a yielded Promise is resolved, its final value becomes
  49559. // the .value of the Promise<{value,done}> result for the
  49560. // current iteration.
  49561. result.value = unwrapped;
  49562. resolve(result);
  49563. }, function(error) {
  49564. // If a rejected Promise was yielded, throw the rejection back
  49565. // into the async generator function so it can be handled there.
  49566. return invoke("throw", error, resolve, reject);
  49567. });
  49568. }
  49569. }
  49570. var previousPromise;
  49571. function enqueue(method, arg) {
  49572. function callInvokeWithMethodAndArg() {
  49573. return new Promise(function(resolve, reject) {
  49574. invoke(method, arg, resolve, reject);
  49575. });
  49576. }
  49577. return previousPromise =
  49578. // If enqueue has been called before, then we want to wait until
  49579. // all previous Promises have been resolved before calling invoke,
  49580. // so that results are always delivered in the correct order. If
  49581. // enqueue has not been called before, then it is important to
  49582. // call invoke immediately, without waiting on a callback to fire,
  49583. // so that the async generator function has the opportunity to do
  49584. // any necessary setup in a predictable way. This predictability
  49585. // is why the Promise constructor synchronously invokes its
  49586. // executor callback, and why async functions synchronously
  49587. // execute code before the first await. Since we implement simple
  49588. // async functions in terms of async generators, it is especially
  49589. // important to get this right, even though it requires care.
  49590. previousPromise ? previousPromise.then(
  49591. callInvokeWithMethodAndArg,
  49592. // Avoid propagating failures to Promises returned by later
  49593. // invocations of the iterator.
  49594. callInvokeWithMethodAndArg
  49595. ) : callInvokeWithMethodAndArg();
  49596. }
  49597. // Define the unified helper method that is used to implement .next,
  49598. // .throw, and .return (see defineIteratorMethods).
  49599. this._invoke = enqueue;
  49600. }
  49601. defineIteratorMethods(AsyncIterator.prototype);
  49602. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  49603. return this;
  49604. };
  49605. runtime.AsyncIterator = AsyncIterator;
  49606. // Note that simple async functions are implemented on top of
  49607. // AsyncIterator objects; they just return a Promise for the value of
  49608. // the final result produced by the iterator.
  49609. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  49610. var iter = new AsyncIterator(
  49611. wrap(innerFn, outerFn, self, tryLocsList)
  49612. );
  49613. return runtime.isGeneratorFunction(outerFn)
  49614. ? iter // If outerFn is a generator, return the full iterator.
  49615. : iter.next().then(function(result) {
  49616. return result.done ? result.value : iter.next();
  49617. });
  49618. };
  49619. function makeInvokeMethod(innerFn, self, context) {
  49620. var state = GenStateSuspendedStart;
  49621. return function invoke(method, arg) {
  49622. if (state === GenStateExecuting) {
  49623. throw new Error("Generator is already running");
  49624. }
  49625. if (state === GenStateCompleted) {
  49626. if (method === "throw") {
  49627. throw arg;
  49628. }
  49629. // Be forgiving, per 25.3.3.3.3 of the spec:
  49630. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  49631. return doneResult();
  49632. }
  49633. context.method = method;
  49634. context.arg = arg;
  49635. while (true) {
  49636. var delegate = context.delegate;
  49637. if (delegate) {
  49638. var delegateResult = maybeInvokeDelegate(delegate, context);
  49639. if (delegateResult) {
  49640. if (delegateResult === ContinueSentinel) continue;
  49641. return delegateResult;
  49642. }
  49643. }
  49644. if (context.method === "next") {
  49645. // Setting context._sent for legacy support of Babel's
  49646. // function.sent implementation.
  49647. context.sent = context._sent = context.arg;
  49648. } else if (context.method === "throw") {
  49649. if (state === GenStateSuspendedStart) {
  49650. state = GenStateCompleted;
  49651. throw context.arg;
  49652. }
  49653. context.dispatchException(context.arg);
  49654. } else if (context.method === "return") {
  49655. context.abrupt("return", context.arg);
  49656. }
  49657. state = GenStateExecuting;
  49658. var record = tryCatch(innerFn, self, context);
  49659. if (record.type === "normal") {
  49660. // If an exception is thrown from innerFn, we leave state ===
  49661. // GenStateExecuting and loop back for another invocation.
  49662. state = context.done
  49663. ? GenStateCompleted
  49664. : GenStateSuspendedYield;
  49665. if (record.arg === ContinueSentinel) {
  49666. continue;
  49667. }
  49668. return {
  49669. value: record.arg,
  49670. done: context.done
  49671. };
  49672. } else if (record.type === "throw") {
  49673. state = GenStateCompleted;
  49674. // Dispatch the exception by looping back around to the
  49675. // context.dispatchException(context.arg) call above.
  49676. context.method = "throw";
  49677. context.arg = record.arg;
  49678. }
  49679. }
  49680. };
  49681. }
  49682. // Call delegate.iterator[context.method](context.arg) and handle the
  49683. // result, either by returning a { value, done } result from the
  49684. // delegate iterator, or by modifying context.method and context.arg,
  49685. // setting context.delegate to null, and returning the ContinueSentinel.
  49686. function maybeInvokeDelegate(delegate, context) {
  49687. var method = delegate.iterator[context.method];
  49688. if (method === undefined) {
  49689. // A .throw or .return when the delegate iterator has no .throw
  49690. // method always terminates the yield* loop.
  49691. context.delegate = null;
  49692. if (context.method === "throw") {
  49693. if (delegate.iterator.return) {
  49694. // If the delegate iterator has a return method, give it a
  49695. // chance to clean up.
  49696. context.method = "return";
  49697. context.arg = undefined;
  49698. maybeInvokeDelegate(delegate, context);
  49699. if (context.method === "throw") {
  49700. // If maybeInvokeDelegate(context) changed context.method from
  49701. // "return" to "throw", let that override the TypeError below.
  49702. return ContinueSentinel;
  49703. }
  49704. }
  49705. context.method = "throw";
  49706. context.arg = new TypeError(
  49707. "The iterator does not provide a 'throw' method");
  49708. }
  49709. return ContinueSentinel;
  49710. }
  49711. var record = tryCatch(method, delegate.iterator, context.arg);
  49712. if (record.type === "throw") {
  49713. context.method = "throw";
  49714. context.arg = record.arg;
  49715. context.delegate = null;
  49716. return ContinueSentinel;
  49717. }
  49718. var info = record.arg;
  49719. if (! info) {
  49720. context.method = "throw";
  49721. context.arg = new TypeError("iterator result is not an object");
  49722. context.delegate = null;
  49723. return ContinueSentinel;
  49724. }
  49725. if (info.done) {
  49726. // Assign the result of the finished delegate to the temporary
  49727. // variable specified by delegate.resultName (see delegateYield).
  49728. context[delegate.resultName] = info.value;
  49729. // Resume execution at the desired location (see delegateYield).
  49730. context.next = delegate.nextLoc;
  49731. // If context.method was "throw" but the delegate handled the
  49732. // exception, let the outer generator proceed normally. If
  49733. // context.method was "next", forget context.arg since it has been
  49734. // "consumed" by the delegate iterator. If context.method was
  49735. // "return", allow the original .return call to continue in the
  49736. // outer generator.
  49737. if (context.method !== "return") {
  49738. context.method = "next";
  49739. context.arg = undefined;
  49740. }
  49741. } else {
  49742. // Re-yield the result returned by the delegate method.
  49743. return info;
  49744. }
  49745. // The delegate iterator is finished, so forget it and continue with
  49746. // the outer generator.
  49747. context.delegate = null;
  49748. return ContinueSentinel;
  49749. }
  49750. // Define Generator.prototype.{next,throw,return} in terms of the
  49751. // unified ._invoke helper method.
  49752. defineIteratorMethods(Gp);
  49753. Gp[toStringTagSymbol] = "Generator";
  49754. // A Generator should always return itself as the iterator object when the
  49755. // @@iterator function is called on it. Some browsers' implementations of the
  49756. // iterator prototype chain incorrectly implement this, causing the Generator
  49757. // object to not be returned from this call. This ensures that doesn't happen.
  49758. // See https://github.com/facebook/regenerator/issues/274 for more details.
  49759. Gp[iteratorSymbol] = function() {
  49760. return this;
  49761. };
  49762. Gp.toString = function() {
  49763. return "[object Generator]";
  49764. };
  49765. function pushTryEntry(locs) {
  49766. var entry = { tryLoc: locs[0] };
  49767. if (1 in locs) {
  49768. entry.catchLoc = locs[1];
  49769. }
  49770. if (2 in locs) {
  49771. entry.finallyLoc = locs[2];
  49772. entry.afterLoc = locs[3];
  49773. }
  49774. this.tryEntries.push(entry);
  49775. }
  49776. function resetTryEntry(entry) {
  49777. var record = entry.completion || {};
  49778. record.type = "normal";
  49779. delete record.arg;
  49780. entry.completion = record;
  49781. }
  49782. function Context(tryLocsList) {
  49783. // The root entry object (effectively a try statement without a catch
  49784. // or a finally block) gives us a place to store values thrown from
  49785. // locations where there is no enclosing try statement.
  49786. this.tryEntries = [{ tryLoc: "root" }];
  49787. tryLocsList.forEach(pushTryEntry, this);
  49788. this.reset(true);
  49789. }
  49790. runtime.keys = function(object) {
  49791. var keys = [];
  49792. for (var key in object) {
  49793. keys.push(key);
  49794. }
  49795. keys.reverse();
  49796. // Rather than returning an object with a next method, we keep
  49797. // things simple and return the next function itself.
  49798. return function next() {
  49799. while (keys.length) {
  49800. var key = keys.pop();
  49801. if (key in object) {
  49802. next.value = key;
  49803. next.done = false;
  49804. return next;
  49805. }
  49806. }
  49807. // To avoid creating an additional object, we just hang the .value
  49808. // and .done properties off the next function object itself. This
  49809. // also ensures that the minifier will not anonymize the function.
  49810. next.done = true;
  49811. return next;
  49812. };
  49813. };
  49814. function values(iterable) {
  49815. if (iterable) {
  49816. var iteratorMethod = iterable[iteratorSymbol];
  49817. if (iteratorMethod) {
  49818. return iteratorMethod.call(iterable);
  49819. }
  49820. if (typeof iterable.next === "function") {
  49821. return iterable;
  49822. }
  49823. if (!isNaN(iterable.length)) {
  49824. var i = -1, next = function next() {
  49825. while (++i < iterable.length) {
  49826. if (hasOwn.call(iterable, i)) {
  49827. next.value = iterable[i];
  49828. next.done = false;
  49829. return next;
  49830. }
  49831. }
  49832. next.value = undefined;
  49833. next.done = true;
  49834. return next;
  49835. };
  49836. return next.next = next;
  49837. }
  49838. }
  49839. // Return an iterator with no values.
  49840. return { next: doneResult };
  49841. }
  49842. runtime.values = values;
  49843. function doneResult() {
  49844. return { value: undefined, done: true };
  49845. }
  49846. Context.prototype = {
  49847. constructor: Context,
  49848. reset: function(skipTempReset) {
  49849. this.prev = 0;
  49850. this.next = 0;
  49851. // Resetting context._sent for legacy support of Babel's
  49852. // function.sent implementation.
  49853. this.sent = this._sent = undefined;
  49854. this.done = false;
  49855. this.delegate = null;
  49856. this.method = "next";
  49857. this.arg = undefined;
  49858. this.tryEntries.forEach(resetTryEntry);
  49859. if (!skipTempReset) {
  49860. for (var name in this) {
  49861. // Not sure about the optimal order of these conditions:
  49862. if (name.charAt(0) === "t" &&
  49863. hasOwn.call(this, name) &&
  49864. !isNaN(+name.slice(1))) {
  49865. this[name] = undefined;
  49866. }
  49867. }
  49868. }
  49869. },
  49870. stop: function() {
  49871. this.done = true;
  49872. var rootEntry = this.tryEntries[0];
  49873. var rootRecord = rootEntry.completion;
  49874. if (rootRecord.type === "throw") {
  49875. throw rootRecord.arg;
  49876. }
  49877. return this.rval;
  49878. },
  49879. dispatchException: function(exception) {
  49880. if (this.done) {
  49881. throw exception;
  49882. }
  49883. var context = this;
  49884. function handle(loc, caught) {
  49885. record.type = "throw";
  49886. record.arg = exception;
  49887. context.next = loc;
  49888. if (caught) {
  49889. // If the dispatched exception was caught by a catch block,
  49890. // then let that catch block handle the exception normally.
  49891. context.method = "next";
  49892. context.arg = undefined;
  49893. }
  49894. return !! caught;
  49895. }
  49896. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  49897. var entry = this.tryEntries[i];
  49898. var record = entry.completion;
  49899. if (entry.tryLoc === "root") {
  49900. // Exception thrown outside of any try block that could handle
  49901. // it, so set the completion value of the entire function to
  49902. // throw the exception.
  49903. return handle("end");
  49904. }
  49905. if (entry.tryLoc <= this.prev) {
  49906. var hasCatch = hasOwn.call(entry, "catchLoc");
  49907. var hasFinally = hasOwn.call(entry, "finallyLoc");
  49908. if (hasCatch && hasFinally) {
  49909. if (this.prev < entry.catchLoc) {
  49910. return handle(entry.catchLoc, true);
  49911. } else if (this.prev < entry.finallyLoc) {
  49912. return handle(entry.finallyLoc);
  49913. }
  49914. } else if (hasCatch) {
  49915. if (this.prev < entry.catchLoc) {
  49916. return handle(entry.catchLoc, true);
  49917. }
  49918. } else if (hasFinally) {
  49919. if (this.prev < entry.finallyLoc) {
  49920. return handle(entry.finallyLoc);
  49921. }
  49922. } else {
  49923. throw new Error("try statement without catch or finally");
  49924. }
  49925. }
  49926. }
  49927. },
  49928. abrupt: function(type, arg) {
  49929. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  49930. var entry = this.tryEntries[i];
  49931. if (entry.tryLoc <= this.prev &&
  49932. hasOwn.call(entry, "finallyLoc") &&
  49933. this.prev < entry.finallyLoc) {
  49934. var finallyEntry = entry;
  49935. break;
  49936. }
  49937. }
  49938. if (finallyEntry &&
  49939. (type === "break" ||
  49940. type === "continue") &&
  49941. finallyEntry.tryLoc <= arg &&
  49942. arg <= finallyEntry.finallyLoc) {
  49943. // Ignore the finally entry if control is not jumping to a
  49944. // location outside the try/catch block.
  49945. finallyEntry = null;
  49946. }
  49947. var record = finallyEntry ? finallyEntry.completion : {};
  49948. record.type = type;
  49949. record.arg = arg;
  49950. if (finallyEntry) {
  49951. this.method = "next";
  49952. this.next = finallyEntry.finallyLoc;
  49953. return ContinueSentinel;
  49954. }
  49955. return this.complete(record);
  49956. },
  49957. complete: function(record, afterLoc) {
  49958. if (record.type === "throw") {
  49959. throw record.arg;
  49960. }
  49961. if (record.type === "break" ||
  49962. record.type === "continue") {
  49963. this.next = record.arg;
  49964. } else if (record.type === "return") {
  49965. this.rval = this.arg = record.arg;
  49966. this.method = "return";
  49967. this.next = "end";
  49968. } else if (record.type === "normal" && afterLoc) {
  49969. this.next = afterLoc;
  49970. }
  49971. return ContinueSentinel;
  49972. },
  49973. finish: function(finallyLoc) {
  49974. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  49975. var entry = this.tryEntries[i];
  49976. if (entry.finallyLoc === finallyLoc) {
  49977. this.complete(entry.completion, entry.afterLoc);
  49978. resetTryEntry(entry);
  49979. return ContinueSentinel;
  49980. }
  49981. }
  49982. },
  49983. "catch": function(tryLoc) {
  49984. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  49985. var entry = this.tryEntries[i];
  49986. if (entry.tryLoc === tryLoc) {
  49987. var record = entry.completion;
  49988. if (record.type === "throw") {
  49989. var thrown = record.arg;
  49990. resetTryEntry(entry);
  49991. }
  49992. return thrown;
  49993. }
  49994. }
  49995. // The context.catch method must only be called with a location
  49996. // argument that corresponds to a known catch block.
  49997. throw new Error("illegal catch attempt");
  49998. },
  49999. delegateYield: function(iterable, resultName, nextLoc) {
  50000. this.delegate = {
  50001. iterator: values(iterable),
  50002. resultName: resultName,
  50003. nextLoc: nextLoc
  50004. };
  50005. if (this.method === "next") {
  50006. // Deliberately forget the last sent value so that we don't
  50007. // accidentally pass it on to the delegate.
  50008. this.arg = undefined;
  50009. }
  50010. return ContinueSentinel;
  50011. }
  50012. };
  50013. })(
  50014. // In sloppy mode, unbound `this` refers to the global object, fallback to
  50015. // Function constructor if we're in global strict mode. That is sadly a form
  50016. // of indirect eval which violates Content Security Policy.
  50017. (function() {
  50018. return this || (typeof self === "object" && self);
  50019. })() || Function("return this")()
  50020. );
  50021. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  50022. /***/ }),
  50023. /* 585 */
  50024. /***/ (function(module, exports, __webpack_require__) {
  50025. "use strict";
  50026. /* WEBPACK VAR INJECTION */(function(Promise) {
  50027. const clone = __webpack_require__(35);
  50028. const env = __webpack_require__(3);
  50029. const filterIceServers = __webpack_require__(586);
  50030. const shouldUsePlanBSDP = __webpack_require__(100);
  50031. const logging = __webpack_require__(1)('createPeerConnection');
  50032. module.exports = function createPeerConnection(_ref) {
  50033. let window = _ref.window,
  50034. originalConfig = _ref.config,
  50035. constraints = _ref.constraints;
  50036. logging.debug('called');
  50037. const config = clone(originalConfig);
  50038. config.iceServers = filterIceServers(env, config.iceServers);
  50039. if (shouldUsePlanBSDP) {
  50040. config.sdpSemantics = 'plan-b';
  50041. }
  50042. const pc = new window.RTCPeerConnection(config, constraints);
  50043. return Promise.resolve(pc);
  50044. };
  50045. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  50046. /***/ }),
  50047. /* 586 */
  50048. /***/ (function(module, exports, __webpack_require__) {
  50049. "use strict";
  50050. const assign = __webpack_require__(6);
  50051. const omit = __webpack_require__(263);
  50052. const filters = {
  50053. Edge(iceServers) {
  50054. let foundTurn = false;
  50055. return iceServers.map(server => {
  50056. if (!server) {
  50057. return undefined;
  50058. }
  50059. const urls = server.urls || server.url && [server.url];
  50060. if (!urls) {
  50061. return undefined;
  50062. }
  50063. const filteredUrls = urls.filter(url => {
  50064. const turnOk = url.indexOf('turn:') === 0 && url.indexOf('transport=udp') !== -1 && url.indexOf('turn:[') === -1 && !foundTurn;
  50065. if (turnOk) {
  50066. foundTurn = true;
  50067. return true;
  50068. }
  50069. return url.indexOf('stun:') === 0;
  50070. });
  50071. if (filteredUrls.length === 0) {
  50072. return undefined;
  50073. }
  50074. return assign(omit(server, ['url', 'urls']), {
  50075. urls: filteredUrls
  50076. });
  50077. }).filter(server => server !== undefined);
  50078. },
  50079. Safari(iceServers) {
  50080. return iceServers.map(server => {
  50081. if (server.urls !== undefined && server.url === undefined) {
  50082. return server;
  50083. }
  50084. const urls = server.urls || server.url && [server.url];
  50085. return assign(omit(server, ['url', 'urls']), {
  50086. urls
  50087. });
  50088. });
  50089. }
  50090. };
  50091. module.exports = function filterIceServers(env, iceServers) {
  50092. let browserName = env.name;
  50093. if (env.isEdge) {
  50094. browserName = env.isLegacyEdge ? 'Edge' : 'ChromiumEdge';
  50095. }
  50096. const filter = filters[browserName];
  50097. if (filter) {
  50098. return filter(iceServers);
  50099. }
  50100. return iceServers;
  50101. };
  50102. /***/ }),
  50103. /* 587 */
  50104. /***/ (function(module, exports, __webpack_require__) {
  50105. "use strict";
  50106. const SDPHelpers = __webpack_require__(57);
  50107. const env = __webpack_require__(3);
  50108. const profiles = {
  50109. h264: {
  50110. baseline: '42001f',
  50111. constBaseline: '42e01f'
  50112. }
  50113. };
  50114. const replaceProfileId = (_ref) => {
  50115. let sdp = _ref.sdp,
  50116. from = _ref.from,
  50117. to = _ref.to;
  50118. return sdp.replace(new RegExp("^(a=fmtp:\\d+ .*profile-level-id=)" + from, 'gmi'), "$1" + to);
  50119. };
  50120. module.exports = {
  50121. local: {
  50122. offer: function offer(_temp, sdpParam) {
  50123. let _ref2 = _temp === void 0 ? {} : _temp,
  50124. simulcastStreams = _ref2.simulcastStreams,
  50125. audioBitrate = _ref2.audioBitrate,
  50126. _ref2$priorityVideoCo = _ref2.priorityVideoCodec,
  50127. priorityVideoCodec = _ref2$priorityVideoCo === void 0 ? '' : _ref2$priorityVideoCo,
  50128. _ref2$codecFlags = _ref2.codecFlags,
  50129. codecFlags = _ref2$codecFlags === void 0 ? {} : _ref2$codecFlags,
  50130. _ref2$enableStereo = _ref2.enableStereo,
  50131. enableStereo = _ref2$enableStereo === void 0 ? false : _ref2$enableStereo,
  50132. _ref2$replaceBaseline = _ref2.replaceBaselineProfile,
  50133. replaceBaselineProfile = _ref2$replaceBaseline === void 0 ? false : _ref2$replaceBaseline;
  50134. let sdp = sdpParam;
  50135. if (simulcastStreams > 1) {
  50136. sdp = SDPHelpers.enableSimulcast(sdp, simulcastStreams);
  50137. }
  50138. if (audioBitrate > 0) {
  50139. sdp = SDPHelpers.setAudioBitrate(sdp, audioBitrate);
  50140. }
  50141. sdp = SDPHelpers.modifyReceiveStereo(sdp, false);
  50142. sdp = SDPHelpers.modifySendStereo(sdp, Boolean(enableStereo));
  50143. if (!env.isLegacyEdge) {
  50144. Object.keys(codecFlags).filter(codec => codecFlags[codec] === false).forEach(codec => {
  50145. sdp = SDPHelpers.removeVideoCodec(sdp, codec);
  50146. });
  50147. }
  50148. if (priorityVideoCodec && !env.isLegacyEdge) {
  50149. sdp = SDPHelpers.reprioritizeVideoCodec(sdp, priorityVideoCodec, 'top');
  50150. } else if (priorityVideoCodec !== 'h264') {
  50151. sdp = SDPHelpers.reprioritizeVideoCodec(sdp, 'h264', 'bottom');
  50152. }
  50153. let remoteSdp = sdp;
  50154. if (replaceBaselineProfile) {
  50155. remoteSdp = replaceProfileId({
  50156. sdp: remoteSdp,
  50157. from: profiles.h264.baseline,
  50158. to: profiles.h264.constBaseline
  50159. });
  50160. }
  50161. return {
  50162. local: sdp,
  50163. remote: remoteSdp
  50164. };
  50165. },
  50166. answer: function answer(_temp2, sdpParam) {
  50167. let _ref3 = _temp2 === void 0 ? {} : _temp2,
  50168. audioBitrate = _ref3.audioBitrate,
  50169. codecFlags = _ref3.codecFlags,
  50170. _ref3$enableStereo = _ref3.enableStereo,
  50171. enableStereo = _ref3$enableStereo === void 0 ? false : _ref3$enableStereo,
  50172. _ref3$replaceBaseline = _ref3.replaceBaselineProfile,
  50173. replaceBaselineProfile = _ref3$replaceBaseline === void 0 ? false : _ref3$replaceBaseline;
  50174. let sdp = sdpParam;
  50175. if (audioBitrate > 0) {
  50176. sdp = SDPHelpers.setAudioBitrate(sdp, audioBitrate);
  50177. }
  50178. sdp = SDPHelpers.modifyReceiveStereo(sdp, Boolean(enableStereo));
  50179. sdp = SDPHelpers.modifySendStereo(sdp, false);
  50180. if (codecFlags) {
  50181. Object.keys(codecFlags).filter(codec => codecFlags[codec] === false).forEach(codec => {
  50182. sdp = SDPHelpers.removeVideoCodec(sdp, codec);
  50183. });
  50184. }
  50185. let remoteSdp = sdp;
  50186. if (replaceBaselineProfile) {
  50187. remoteSdp = replaceProfileId({
  50188. sdp: remoteSdp,
  50189. from: profiles.h264.baseline,
  50190. to: profiles.h264.constBaseline
  50191. });
  50192. }
  50193. return {
  50194. local: sdp,
  50195. remote: remoteSdp
  50196. };
  50197. }
  50198. },
  50199. remote: {
  50200. offer: (_ref4, sdpParam) => {
  50201. let _ref4$replaceBaseline = _ref4.replaceBaselineProfile,
  50202. replaceBaselineProfile = _ref4$replaceBaseline === void 0 ? false : _ref4$replaceBaseline;
  50203. let sdp = sdpParam;
  50204. if (sdp.indexOf('a=rtcp-fb') === -1) {
  50205. const rtcpFbLine = 'a=rtcp-fb:* ccm fir\r\na=rtcp-fb:* nack ';
  50206. sdp = sdp.replace(/^m=video(.*)$/gmi, "m=video$1\r\n" + rtcpFbLine);
  50207. }
  50208. if (replaceBaselineProfile) {
  50209. sdp = replaceProfileId({
  50210. sdp,
  50211. from: profiles.h264.constBaseline,
  50212. to: profiles.h264.baseline
  50213. });
  50214. }
  50215. return {
  50216. local: sdp
  50217. };
  50218. },
  50219. answer: function answer(_temp3, sdpParam) {
  50220. let _ref5 = _temp3 === void 0 ? {} : _temp3,
  50221. audioBitrate = _ref5.audioBitrate,
  50222. _ref5$replaceBaseline = _ref5.replaceBaselineProfile,
  50223. replaceBaselineProfile = _ref5$replaceBaseline === void 0 ? false : _ref5$replaceBaseline;
  50224. let sdp = sdpParam;
  50225. if (audioBitrate > 0) {
  50226. sdp = SDPHelpers.setAudioBitrate(sdp, audioBitrate);
  50227. }
  50228. if (replaceBaselineProfile) {
  50229. sdp = replaceProfileId({
  50230. sdp,
  50231. from: profiles.h264.constBaseline,
  50232. to: profiles.h264.baseline
  50233. });
  50234. }
  50235. return {
  50236. local: sdp
  50237. };
  50238. }
  50239. }
  50240. };
  50241. /***/ }),
  50242. /* 588 */
  50243. /***/ (function(module, exports, __webpack_require__) {
  50244. var Symbol = __webpack_require__(37),
  50245. copyArray = __webpack_require__(49),
  50246. getTag = __webpack_require__(39),
  50247. isArrayLike = __webpack_require__(21),
  50248. isString = __webpack_require__(589),
  50249. iteratorToArray = __webpack_require__(590),
  50250. mapToArray = __webpack_require__(211),
  50251. setToArray = __webpack_require__(90),
  50252. stringToArray = __webpack_require__(257),
  50253. values = __webpack_require__(267);
  50254. /** `Object#toString` result references. */
  50255. var mapTag = '[object Map]',
  50256. setTag = '[object Set]';
  50257. /** Built-in value references. */
  50258. var symIterator = Symbol ? Symbol.iterator : undefined;
  50259. /**
  50260. * Converts `value` to an array.
  50261. *
  50262. * @static
  50263. * @since 0.1.0
  50264. * @memberOf _
  50265. * @category Lang
  50266. * @param {*} value The value to convert.
  50267. * @returns {Array} Returns the converted array.
  50268. * @example
  50269. *
  50270. * _.toArray({ 'a': 1, 'b': 2 });
  50271. * // => [1, 2]
  50272. *
  50273. * _.toArray('abc');
  50274. * // => ['a', 'b', 'c']
  50275. *
  50276. * _.toArray(1);
  50277. * // => []
  50278. *
  50279. * _.toArray(null);
  50280. * // => []
  50281. */
  50282. function toArray(value) {
  50283. if (!value) {
  50284. return [];
  50285. }
  50286. if (isArrayLike(value)) {
  50287. return isString(value) ? stringToArray(value) : copyArray(value);
  50288. }
  50289. if (symIterator && value[symIterator]) {
  50290. return iteratorToArray(value[symIterator]());
  50291. }
  50292. var tag = getTag(value),
  50293. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  50294. return func(value);
  50295. }
  50296. module.exports = toArray;
  50297. /***/ }),
  50298. /* 589 */
  50299. /***/ (function(module, exports, __webpack_require__) {
  50300. var baseGetTag = __webpack_require__(26),
  50301. isArray = __webpack_require__(9),
  50302. isObjectLike = __webpack_require__(14);
  50303. /** `Object#toString` result references. */
  50304. var stringTag = '[object String]';
  50305. /**
  50306. * Checks if `value` is classified as a `String` primitive or object.
  50307. *
  50308. * @static
  50309. * @since 0.1.0
  50310. * @memberOf _
  50311. * @category Lang
  50312. * @param {*} value The value to check.
  50313. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  50314. * @example
  50315. *
  50316. * _.isString('abc');
  50317. * // => true
  50318. *
  50319. * _.isString(1);
  50320. * // => false
  50321. */
  50322. function isString(value) {
  50323. return typeof value == 'string' ||
  50324. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  50325. }
  50326. module.exports = isString;
  50327. /***/ }),
  50328. /* 590 */
  50329. /***/ (function(module, exports) {
  50330. /**
  50331. * Converts `iterator` to an array.
  50332. *
  50333. * @private
  50334. * @param {Object} iterator The iterator to convert.
  50335. * @returns {Array} Returns the converted array.
  50336. */
  50337. function iteratorToArray(iterator) {
  50338. var data,
  50339. result = [];
  50340. while (!(data = iterator.next()).done) {
  50341. result.push(data.value);
  50342. }
  50343. return result;
  50344. }
  50345. module.exports = iteratorToArray;
  50346. /***/ }),
  50347. /* 591 */
  50348. /***/ (function(module, exports, __webpack_require__) {
  50349. var arrayMap = __webpack_require__(30);
  50350. /**
  50351. * The base implementation of `_.values` and `_.valuesIn` which creates an
  50352. * array of `object` property values corresponding to the property names
  50353. * of `props`.
  50354. *
  50355. * @private
  50356. * @param {Object} object The object to query.
  50357. * @param {Array} props The property names to get values for.
  50358. * @returns {Object} Returns the array of property values.
  50359. */
  50360. function baseValues(object, props) {
  50361. return arrayMap(props, function(key) {
  50362. return object[key];
  50363. });
  50364. }
  50365. module.exports = baseValues;
  50366. /***/ }),
  50367. /* 592 */
  50368. /***/ (function(module, exports, __webpack_require__) {
  50369. "use strict";
  50370. /* WEBPACK VAR INJECTION */(function(Promise) {
  50371. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  50372. /* eslint-disable no-underscore-dangle */
  50373. const promisify = __webpack_require__(593);
  50374. /*
  50375. * Process incoming Ice Candidates from a remote connection.
  50376. *
  50377. * @constructor
  50378. * @private
  50379. *
  50380. * @param {PeerConection} peerConnection The PeerConnection we want to add the
  50381. * Ice Candidates to.
  50382. *
  50383. * @description The Ice Candidates cannot be processed until the PeerConnection
  50384. * has local and remote descriptions, if candidates are added too early they
  50385. * will be put in a pending list. Once the PeerConnection is ready the pending
  50386. * candidates will be applied.
  50387. *
  50388. * **note:** We assume that the PeerConnection has implemented the promisified
  50389. * versions of addIceCandidate.
  50390. *
  50391. *
  50392. * @example
  50393. *
  50394. * const iceProcessor = new IceCandidateProcessor(pc);
  50395. * iceProcessor.process(iceMessage1);
  50396. * iceProcessor.process(iceMessage2);
  50397. * iceProcessor.process(iceMessage3);
  50398. *
  50399. *
  50400. */
  50401. const IceCandidateProcessor = function IceCandidateProcessor(peerConnection) {
  50402. this.pending = [];
  50403. this._processBinding = this.maybeProcessPending.bind(this);
  50404. if (peerConnection) {
  50405. this.setPeerConnection(peerConnection);
  50406. }
  50407. };
  50408. IceCandidateProcessor.prototype.setPeerConnection = function setPeerConnection(peerConnection) {
  50409. if (this.pc) {
  50410. throw new Error('Peer connection already set');
  50411. }
  50412. this.pc = peerConnection;
  50413. this._forwardIceCandidate = promisify(this.pc, 'addIceCandidate');
  50414. this.pc.addEventListener('signalingstatechange', this._processBinding);
  50415. this.maybeProcessPending();
  50416. };
  50417. /**
  50418. * Returns true if the PeerConnection is ready to accept IceCandidates.
  50419. *
  50420. * @return {Boolean} True if IceCandidates can be applied, false otherwise
  50421. *
  50422. * @method #canAddCandidates
  50423. * @memberof IceCandidateProcessor
  50424. *
  50425. */
  50426. IceCandidateProcessor.prototype.canAddCandidates = function canAddCandidates() {
  50427. // localDescription and removeDescription are nullable, so you would expect
  50428. // that they would be null when those descriptions have not yet been applied
  50429. // Chrome (as of 48) seems to instead give you a RTCSessionDescription with
  50430. // type and sdp properties set to "".
  50431. //
  50432. // Because of this we need to ensure that type exists and contains something.
  50433. //
  50434. // We first check that the peer connection is not closed to prevent
  50435. // Firefox from throwing an InvalidStateError. See OPENTOK-29358
  50436. //
  50437. return !!(this.pc && this.pc.iceConnectionState !== 'closed' && this.pc.remoteDescription && this.pc.remoteDescription.type && this.pc.localDescription && this.pc.localDescription.type);
  50438. };
  50439. /**
  50440. * Add an RTCIceCandidate to the PeerConnection. If the PeerConnection is ready
  50441. * it will be applied immediately, otherwise it will be buffered until later.
  50442. *
  50443. * @param {RTCIceCandidate} iceCandidate The candidate to add.
  50444. *
  50445. * @returns {Promise} A promise that is resolved when the candidate is applied.
  50446. *
  50447. * @method #addIceCandidate
  50448. * @memberof IceCandidateProcessor
  50449. *
  50450. */
  50451. IceCandidateProcessor.prototype.addIceCandidate = function addIceCandidate(iceCandidate) {
  50452. if (this.canAddCandidates()) {
  50453. return this._forwardIceCandidate(iceCandidate);
  50454. }
  50455. const pending = this.pending;
  50456. return new Promise((resolve, reject) => {
  50457. pending.push({
  50458. iceCandidate,
  50459. resolve,
  50460. reject
  50461. });
  50462. });
  50463. };
  50464. /**
  50465. * Called to attempt to process any pending candidates.
  50466. *
  50467. * @description This will be called automatically when needed so there's no
  50468. * reason to call it yourself. You totally could, but surely you have better
  50469. * things to do?
  50470. *
  50471. * @param {RTCIceCandidate} iceCandidate The candidate to add.
  50472. *
  50473. * @returns {Promise} A promise that is resolved when the candidate is applied.
  50474. *
  50475. * @method #addIceCandidate
  50476. * @memberof IceCandidateProcessor
  50477. *
  50478. */
  50479. IceCandidateProcessor.prototype.maybeProcessPending = function maybeProcessPending() {
  50480. if (this.canAddCandidates()) {
  50481. this.process();
  50482. }
  50483. };
  50484. IceCandidateProcessor.prototype.process = function process() {
  50485. while (this.pending.length) {
  50486. const pending = this.pending.shift();
  50487. this._forwardIceCandidate(pending.iceCandidate).then(pending.resolve).catch(pending.reject);
  50488. }
  50489. };
  50490. IceCandidateProcessor.prototype.destroy = function destroy() {
  50491. if (this.pc) {
  50492. this.pc.removeEventListener('signalingstatechange', this._processBinding);
  50493. }
  50494. this._processBinding = null;
  50495. this.pc = null;
  50496. };
  50497. module.exports = IceCandidateProcessor;
  50498. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  50499. /***/ }),
  50500. /* 593 */
  50501. /***/ (function(module, exports, __webpack_require__) {
  50502. "use strict";
  50503. /* WEBPACK VAR INJECTION */(function(Promise) {
  50504. // Adapts a function that returns or promise or takes success and error
  50505. // callbacks, and returns a function that always returns a promise.
  50506. // This is used to provide backwards compatibility for WebRTC implementations,
  50507. // which used to use success and error callbacks, and now return promises.
  50508. module.exports = function promisify(context, methodName) {
  50509. const method = context[methodName];
  50510. return function (input) {
  50511. return new Promise((resolve, reject) => {
  50512. const result = method.apply(context, [input, resolve, reject]);
  50513. if (result && typeof result.then === 'function') {
  50514. resolve(result);
  50515. }
  50516. });
  50517. };
  50518. };
  50519. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  50520. /***/ }),
  50521. /* 594 */
  50522. /***/ (function(module, exports, __webpack_require__) {
  50523. "use strict";
  50524. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  50525. /* eslint-disable no-param-reassign */
  50526. const applySdpTransform = __webpack_require__(151);
  50527. const env = __webpack_require__(3);
  50528. const logging = __webpack_require__(1)('offerProcessor');
  50529. const SDPHelpers = __webpack_require__(57);
  50530. const testSupportVideo = __webpack_require__(595); // Attempt to completely process +offer+. This will:
  50531. // * set the offer as the remote description
  50532. // * create an answer and
  50533. // * set the new answer as the location description
  50534. //
  50535. // If there are no issues, the +success+ callback will be executed on completion.
  50536. // Errors during any step will result in the +failure+ callback being executed.
  50537. //
  50538. module.exports = function offerProcessor(peerConnection, RTCPeerConnection, RTCSessionDescription, NativeRTCSessionDescription, sdpTransforms, offer, codecFlags, p2p, success, failure, onVideoSupported, replaceBaselineProfile) {
  50539. const generateErrorCallback = (message, prefix) => errorReason => {
  50540. logging.error(message);
  50541. logging.error(errorReason);
  50542. if (failure) {
  50543. failure(message, errorReason, prefix);
  50544. }
  50545. };
  50546. const setLocalDescription = answer => {
  50547. const enableStereo = SDPHelpers.hasSendStereo(offer.sdp);
  50548. const audioBitrate = SDPHelpers.getAudioBitrate(offer.sdp);
  50549. const transformedSdp = applySdpTransform(sdpTransforms, 'local', 'answer', {
  50550. enableStereo,
  50551. audioBitrate,
  50552. replaceBaselineProfile,
  50553. codecFlags
  50554. }, answer.sdp);
  50555. const newLocalAnswer = new NativeRTCSessionDescription({
  50556. type: answer.type,
  50557. sdp: transformedSdp.local
  50558. });
  50559. const newRemoteAnswer = {
  50560. type: answer.type,
  50561. sdp: transformedSdp.remote
  50562. };
  50563. return peerConnection.setLocalDescription(newLocalAnswer).then(() => success(newRemoteAnswer)).catch(generateErrorCallback('Error while setting LocalDescription', 'SetLocalDescription'));
  50564. };
  50565. const createAnswer = () => peerConnection.createAnswer().then(setLocalDescription).catch(generateErrorCallback('Error while setting createAnswer', 'CreateAnswer'));
  50566. const newOffer = new NativeRTCSessionDescription({
  50567. type: offer.type,
  50568. sdp: applySdpTransform(sdpTransforms, 'remote', 'offer', {
  50569. replaceBaselineProfile
  50570. }, offer.sdp).local
  50571. });
  50572. const errorCallback = generateErrorCallback('Error while setting RemoteDescription', 'SetRemoteDescription');
  50573. const finalOfferPromise = testSupportVideo(newOffer, p2p, env, RTCPeerConnection, RTCSessionDescription).then(() => {
  50574. onVideoSupported(true);
  50575. return newOffer;
  50576. }).catch(err => {
  50577. onVideoSupported(false);
  50578. if (!SDPHelpers.hasMediaType(newOffer.sdp, 'audio')) {
  50579. throw new Error('Unsupported video without audio for fallback');
  50580. }
  50581. logging.debug('Couldn\'t set remote description', newOffer, err, ', trying without video');
  50582. const offerWithoutVideo = new NativeRTCSessionDescription({
  50583. type: offer.type,
  50584. sdp: SDPHelpers.disableMediaType(newOffer.sdp, 'video')
  50585. });
  50586. logging.debug('offer without video', offerWithoutVideo.sdp);
  50587. return offerWithoutVideo;
  50588. });
  50589. return finalOfferPromise.then(finalOffer => peerConnection.setRemoteDescription(finalOffer)).then(createAnswer).catch(errorCallback);
  50590. };
  50591. /***/ }),
  50592. /* 595 */
  50593. /***/ (function(module, exports, __webpack_require__) {
  50594. "use strict";
  50595. /* WEBPACK VAR INJECTION */(function(Promise) {
  50596. const shouldUsePlabBSDP = __webpack_require__(100);
  50597. const testSupportVideo = (remoteDesc, p2p, env, RTCPeerConnection, RTCSessionDescription) => {
  50598. if (!RTCPeerConnection) {
  50599. return Promise.resolve(true);
  50600. }
  50601. const pcConfig = {
  50602. iceServers: []
  50603. };
  50604. if (shouldUsePlabBSDP) {
  50605. pcConfig.sdpSemantics = 'plan-b';
  50606. }
  50607. const testPc = new RTCPeerConnection(pcConfig);
  50608. const cleanup = () => {
  50609. try {
  50610. testPc.close();
  50611. } catch (e) {} // eslint-disable-line no-empty
  50612. };
  50613. return testPc.setRemoteDescription(new RTCSessionDescription(remoteDesc)).then(() => {
  50614. cleanup();
  50615. }).catch(err => {
  50616. cleanup();
  50617. throw err;
  50618. });
  50619. };
  50620. module.exports = testSupportVideo;
  50621. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  50622. /***/ }),
  50623. /* 596 */
  50624. /***/ (function(module, exports, __webpack_require__) {
  50625. "use strict";
  50626. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  50627. /* eslint-disable no-restricted-syntax, no-prototype-builtins */
  50628. const find = __webpack_require__(58);
  50629. const DataChannel = __webpack_require__(597); // Contains a collection of DataChannels for a particular RTCPeerConnection
  50630. //
  50631. // @param [RTCPeerConnection] pc A native peer connection object
  50632. //
  50633. // @constructor
  50634. // @private
  50635. //
  50636. module.exports = function PeerConnectionChannels(pc) {
  50637. // / Private Data
  50638. let channels = [];
  50639. const api = {};
  50640. let lastQos = {
  50641. sentMessages: 0,
  50642. recvMessages: 0
  50643. }; // / Private API
  50644. const remove = function remove(channel) {
  50645. channels.filter(c => channel !== c);
  50646. };
  50647. const add = function add(nativeChannel) {
  50648. const channel = new DataChannel(nativeChannel);
  50649. channels.push(channel);
  50650. channel.on('close', () => {
  50651. remove(channel);
  50652. });
  50653. return channel;
  50654. }; // / Public API
  50655. api.add = function (label, options) {
  50656. return add(pc.createDataChannel(label, options));
  50657. };
  50658. api.addMany = function (newChannels) {
  50659. for (const label in newChannels) {
  50660. if (newChannels.hasOwnProperty(label)) {
  50661. api.add(label, newChannels[label]);
  50662. }
  50663. }
  50664. };
  50665. api.get = function (label, options) {
  50666. return find(channels, channel => channel.equals(label, options));
  50667. };
  50668. api.getOrAdd = function (label, options) {
  50669. let channel = api.get(label, options);
  50670. if (!channel) {
  50671. channel = api.add(label, options);
  50672. }
  50673. return channel;
  50674. };
  50675. api.getQosData = function () {
  50676. const qosData = {
  50677. sentMessages: 0,
  50678. recvMessages: 0
  50679. };
  50680. channels.forEach(channel => {
  50681. qosData.sentMessages += channel.getQosData().sentMessages;
  50682. qosData.recvMessages += channel.getQosData().recvMessages;
  50683. });
  50684. return qosData;
  50685. };
  50686. api.sampleQos = function () {
  50687. const newQos = api.getQosData();
  50688. const sampleQos = {
  50689. sentMessages: newQos.sentMessages - lastQos.sentMessages,
  50690. recvMessages: newQos.recvMessages - lastQos.recvMessages
  50691. };
  50692. lastQos = newQos;
  50693. return sampleQos;
  50694. };
  50695. api.destroy = function () {
  50696. channels.forEach(channel => {
  50697. channel.close();
  50698. });
  50699. channels = [];
  50700. }; // / Init
  50701. pc.addEventListener('datachannel', event => {
  50702. add(event.channel);
  50703. });
  50704. return api;
  50705. };
  50706. /***/ }),
  50707. /* 597 */
  50708. /***/ (function(module, exports, __webpack_require__) {
  50709. "use strict";
  50710. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  50711. /* eslint-disable no-cond-assign, no-underscore-dangle, no-restricted-syntax */
  50712. /* eslint-disable no-prototype-builtins */
  50713. const eventing = __webpack_require__(5);
  50714. const logging = __webpack_require__(1)('DataChannel'); // Wraps up a native RTCDataChannelEvent object for the message event. This is
  50715. // so we never accidentally leak the native DataChannel.
  50716. //
  50717. // @constructor
  50718. // @private
  50719. //
  50720. //
  50721. const DataChannelMessageEvent = function DataChannelMessageEvent(event) {
  50722. this.data = event.data;
  50723. this.source = event.source;
  50724. this.lastEventId = event.lastEventId;
  50725. this.origin = event.origin;
  50726. this.timeStamp = event.timeStamp;
  50727. this.type = event.type;
  50728. this.ports = event.ports;
  50729. this.path = event.path;
  50730. }; // DataChannel is a wrapper of the native browser RTCDataChannel object.
  50731. //
  50732. // It exposes an interface that is very similar to the native one except
  50733. // for the following differences:
  50734. // * eventing is handled in a way that is consistent with the OpenTok API
  50735. // * calls to the send method that occur before the channel is open will be
  50736. // buffered until the channel is open (as opposed to throwing an exception)
  50737. //
  50738. // By design, there is (almost) no direct access to the native object. This is to ensure
  50739. // that we can control the underlying implementation as needed.
  50740. //
  50741. // NOTE: IT TURNS OUT THAT FF HASN'T IMPLEMENT THE LATEST PUBLISHED DATACHANNELS
  50742. // SPEC YET, SO THE INFO ABOUT maxRetransmitTime AND maxRetransmits IS WRONG. INSTEAD
  50743. // THERE IS A SINGLE PROPERTY YOU PROVIDE WHEN CREATING THE CHANNEL WHICH CONTROLS WHETHER
  50744. // THE CHANNEL IS RELAIBLE OF NOT.
  50745. //
  50746. // Two properties that will have a large bearing on channel behaviour are maxRetransmitTime
  50747. // and maxRetransmits. Descriptions of those properties are below. They are set when creating
  50748. // the initial native RTCDataChannel.
  50749. //
  50750. // maxRetransmitTime of type unsigned short, readonly , nullable
  50751. // The RTCDataChannel.maxRetransmitTime attribute returns the length of the time global
  50752. // (in milliseconds) during which retransmissions may occur in unreliable mode, or null if
  50753. // unset. The attribute MUST return the value to which it was set when the RTCDataChannel was
  50754. // created.
  50755. //
  50756. // maxRetransmits of type unsigned short, readonly , nullable
  50757. // The RTCDataChannel.maxRetransmits attribute returns the maximum number of retransmissions
  50758. // that are attempted in unreliable mode, or null if unset. The attribute MUST return the value
  50759. // to which it was set when the RTCDataChannel was created.
  50760. //
  50761. // @reference http://www.w3.org/TR/webrtc/#peer-to-peer-data-api
  50762. //
  50763. // @param [RTCDataChannel] dataChannel A native data channel.
  50764. //
  50765. //
  50766. // @constructor
  50767. // @private
  50768. //
  50769. module.exports = function DataChannel(dataChannel) {
  50770. const api = {}; // / Private Data
  50771. const bufferedMessages = [];
  50772. const qosData = {
  50773. sentMessages: 0,
  50774. recvMessages: 0
  50775. }; // / Private API
  50776. const bufferMessage = function bufferMessage(data) {
  50777. bufferedMessages.push(data);
  50778. return api;
  50779. };
  50780. const sendMessage = function sendMessage(data) {
  50781. dataChannel.send(data);
  50782. qosData.sentMessages++;
  50783. return api;
  50784. };
  50785. const flushBufferedMessages = function flushBufferedMessages() {
  50786. let data;
  50787. while (data = bufferedMessages.shift()) {
  50788. api.send(data);
  50789. }
  50790. };
  50791. const onOpen = function onOpen() {
  50792. api.send = sendMessage;
  50793. flushBufferedMessages();
  50794. };
  50795. const onClose = function onClose(event) {
  50796. api.send = bufferMessage;
  50797. api.trigger('close', event);
  50798. };
  50799. const onError = function onError(event) {
  50800. logging.error(event);
  50801. };
  50802. const onMessage = function onMessage(domEvent) {
  50803. const event = new DataChannelMessageEvent(domEvent);
  50804. qosData.recvMessages++;
  50805. api.trigger('message', event);
  50806. }; // / Public API
  50807. eventing(api, true);
  50808. api.label = dataChannel.label;
  50809. api.id = dataChannel.id; // api.maxRetransmitTime = dataChannel.maxRetransmitTime;
  50810. // api.maxRetransmits = dataChannel.maxRetransmits;
  50811. api.reliable = dataChannel.reliable;
  50812. api.negotiated = dataChannel.negotiated;
  50813. api.ordered = dataChannel.ordered;
  50814. api.protocol = dataChannel.protocol;
  50815. api._channel = dataChannel;
  50816. api.close = function () {
  50817. dataChannel.close();
  50818. };
  50819. api.equals = function (label, options) {
  50820. if (api.label !== label) {
  50821. return false;
  50822. }
  50823. for (const key in options) {
  50824. if (options.hasOwnProperty(key)) {
  50825. if (api[key] !== options[key]) {
  50826. return false;
  50827. }
  50828. }
  50829. }
  50830. return true;
  50831. };
  50832. api.getQosData = function () {
  50833. return qosData;
  50834. }; // Send initially just buffers all messages until
  50835. // the channel is open.
  50836. api.send = bufferMessage; // / Init
  50837. dataChannel.addEventListener('open', onOpen, false);
  50838. dataChannel.addEventListener('close', onClose, false);
  50839. dataChannel.addEventListener('error', onError, false);
  50840. dataChannel.addEventListener('message', onMessage, false);
  50841. return api;
  50842. };
  50843. /***/ }),
  50844. /* 598 */
  50845. /***/ (function(module, exports, __webpack_require__) {
  50846. "use strict";
  50847. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  50848. /* eslint-disable no-param-reassign */
  50849. const assign = __webpack_require__(6);
  50850. const applySdpTransform = __webpack_require__(151);
  50851. const logging = __webpack_require__(1)('subscribeProcessor'); // Attempt to completely process a subscribe message. This will:
  50852. // * create an Offer
  50853. // * set the new offer as the location description
  50854. //
  50855. // If there are no issues, the Promise will resolve on completion.
  50856. // Errors during any step will result in the Promise being rejected.
  50857. //
  50858. module.exports = function subscribeProcessor(_ref) {
  50859. let peerConnection = _ref.peerConnection,
  50860. NativeRTCSessionDescription = _ref.NativeRTCSessionDescription,
  50861. sdpTransforms = _ref.sdpTransforms,
  50862. simulcastStreams = _ref.simulcastStreams,
  50863. offerOverrides = _ref.offerOverrides,
  50864. offerConstraints = _ref.offerConstraints,
  50865. replaceBaselineProfile = _ref.replaceBaselineProfile;
  50866. const generateErrorCallback = (message, prefix) => errorReason => {
  50867. logging.error(message, errorReason);
  50868. const error = new Error(message);
  50869. error.reason = errorReason;
  50870. error.prefix = prefix;
  50871. throw error;
  50872. };
  50873. const setLocalDescription = offer => {
  50874. logging.debug('subscribeProcessor: offer created', offer);
  50875. const transformedSdp = applySdpTransform(sdpTransforms, 'local', 'offer', assign({
  50876. simulcastStreams,
  50877. replaceBaselineProfile
  50878. }, offerOverrides), offer.sdp);
  50879. const newLocalOffer = new NativeRTCSessionDescription({
  50880. type: offer.type,
  50881. sdp: transformedSdp.local
  50882. });
  50883. const newRemoteOffer = new NativeRTCSessionDescription({
  50884. type: offer.type,
  50885. sdp: transformedSdp.remote
  50886. });
  50887. logging.debug('subscribeProcessor: setting local description');
  50888. return peerConnection.setLocalDescription(newLocalOffer).then(() => newRemoteOffer, generateErrorCallback('Error while setting LocalDescription', 'SetLocalDescription'));
  50889. };
  50890. logging.debug('subscribeProcessor: creating offer');
  50891. return peerConnection.createOffer(offerConstraints).then(setLocalDescription, generateErrorCallback('Error while creating Offer', 'CreateOffer')).then(offer => ({
  50892. sdp: offer.sdp,
  50893. type: offer.type
  50894. }));
  50895. };
  50896. /***/ }),
  50897. /* 599 */
  50898. /***/ (function(module, exports, __webpack_require__) {
  50899. "use strict";
  50900. exports.__esModule = true;
  50901. exports.parseStatsOldAPI = parseStatsOldAPI;
  50902. exports.parseStatsNewAPI = parseStatsNewAPI;
  50903. exports.default = parseQOS;
  50904. function _createForOfIteratorHelperLoose(o) { var i = 0; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } i = o[Symbol.iterator](); return i.next.bind(i); }
  50905. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  50906. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  50907. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  50908. /* eslint-disable no-param-reassign, no-void, no-use-before-define, one-var */
  50909. /* eslint-disable no-restricted-syntax, no-prototype-builtins, no-underscore-dangle */
  50910. const OTHelpers = __webpack_require__(4);
  50911. const logging = __webpack_require__(1)('QoS');
  50912. const sdpHelpers = __webpack_require__(57);
  50913. const getProtocolFromPriority = __webpack_require__(269);
  50914. const getLocalRelayProtocol = __webpack_require__(600);
  50915. const requiredPublisherKeys = ['audioCodec', 'audioSentBytes', 'audioSentPackets', 'audioSentPacketsLost', 'videoCodec', 'videoHeight', 'videoHeightInput', 'videoSentBytes', 'videoFrameRateSent', 'videoSentPackets', 'videoRtt', 'videoSentPacketsLost', 'videoWidthInput', 'videoWidth'];
  50916. const requiredSubscriberKeys = ['audioCodec', 'audioRecvBytes', 'audioRecvPackets', 'audioRecvPacketsLost', 'videoCodec', 'videoHeight', 'videoRecvBytes', 'videoRecvPackets', 'videoRecvPacketsLost', 'videoFrameRateReceived', 'videoRtt', 'videoWidth']; // There are two implementations of stats parsing in this file.
  50917. // 1. For Chrome: Chrome is currently using an older version of the API
  50918. // 2. For Firefox: FF is using a version that looks a lot closer to the
  50919. // current spec.
  50920. //
  50921. // I've attempted to keep the implementations from sharing any code,
  50922. // accordingly you'll notice a bunch of duplication between them.
  50923. //
  50924. // This is acceptable as the goal is to be able to remove each implementation
  50925. // as it's no longer needed without any risk of affecting the others. If there
  50926. // was shared code between them then each removal would require an audit of
  50927. // all the others.
  50928. const rawStatsHandler = (pc, stats) => logging.debug("Raw stats for peer conn " + pc.id + ":", stats);
  50929. const getAddress = res => {
  50930. const port = res.portNumber || res.port;
  50931. const ip = res.ipAddress || res.address || res.ip;
  50932. return ip + ":" + port;
  50933. }; // Get Stats using the older API. Used by all current versions
  50934. // of Chrome.
  50935. function parseStatsOldAPI(peerConnection, prevStats, currentStats, isPublisher, completion) {
  50936. /* this parses a result if there it contains the video bitrate */
  50937. const parseVideoStats = result => {
  50938. if (Number(result.stat('googFrameRateSent')) > 0) {
  50939. currentStats.videoSentBytes = Number(result.stat('bytesSent'));
  50940. currentStats.videoSentPackets = Number(result.stat('packetsSent'));
  50941. currentStats.videoSentPacketsLost = Number(result.stat('packetsLost'));
  50942. currentStats.videoRtt = Number(result.stat('googRtt'));
  50943. currentStats.videoFrameRate = Number(result.stat('googFrameRateInput'));
  50944. currentStats.videoWidth = Number(result.stat('googFrameWidthSent'));
  50945. currentStats.videoHeight = Number(result.stat('googFrameHeightSent'));
  50946. currentStats.videoFrameRateSent = Number(result.stat('googFrameRateSent'));
  50947. currentStats.videoWidthInput = Number(result.stat('googFrameWidthInput'));
  50948. currentStats.videoHeightInput = Number(result.stat('googFrameHeightInput'));
  50949. currentStats.videoCodec = result.stat('googCodecName');
  50950. } else if (Number(result.stat('googFrameRateReceived')) > 0) {
  50951. currentStats.videoRecvBytes = Number(result.stat('bytesReceived'));
  50952. currentStats.videoRecvPackets = Number(result.stat('packetsReceived'));
  50953. currentStats.videoRecvPacketsLost = Number(result.stat('packetsLost'));
  50954. currentStats.videoFrameRate = Number(result.stat('googFrameRateOutput'));
  50955. currentStats.videoFrameRateReceived = Number(result.stat('googFrameRateReceived'));
  50956. currentStats.videoFrameRateDecoded = Number(result.stat('googFrameRateDecoded'));
  50957. currentStats.videoWidth = Number(result.stat('googFrameWidthReceived'));
  50958. currentStats.videoHeight = Number(result.stat('googFrameHeightReceived'));
  50959. currentStats.videoCodec = result.stat('googCodecName');
  50960. }
  50961. return null;
  50962. };
  50963. const parseAudioStats = result => {
  50964. if (Number(result.stat('audioInputLevel')) > 0) {
  50965. currentStats.audioSentPackets = Number(result.stat('packetsSent'));
  50966. currentStats.audioSentPacketsLost = Number(result.stat('packetsLost'));
  50967. currentStats.audioSentBytes = Number(result.stat('bytesSent'));
  50968. currentStats.audioCodec = result.stat('googCodecName');
  50969. currentStats.audioRtt = Number(result.stat('googRtt'));
  50970. } else if (Number(result.stat('audioOutputLevel')) > 0) {
  50971. currentStats.audioRecvPackets = Number(result.stat('packetsReceived'));
  50972. currentStats.audioRecvPacketsLost = Number(result.stat('packetsLost'));
  50973. currentStats.audioRecvBytes = Number(result.stat('bytesReceived'));
  50974. currentStats.audioCodec = result.stat('googCodecName');
  50975. }
  50976. };
  50977. const parseStatsReports = stats => {
  50978. if (stats.result) {
  50979. const resultList = stats.result();
  50980. rawStatsHandler(peerConnection, resultList);
  50981. const getCandidate = (type, fromStat) => resultList.filter(x => x.id === fromStat.stat(type))[0];
  50982. const getLocalCandidate = fromStat => getCandidate('localCandidateId', fromStat);
  50983. const getRemoteCandidate = fromStat => getCandidate('remoteCandidateId', fromStat);
  50984. for (let resultIndex = 0; resultIndex < resultList.length; resultIndex++) {
  50985. const result = resultList[resultIndex];
  50986. if (result.stat) {
  50987. if (result.stat('googActiveConnection') === 'true') {
  50988. if (result.stat('googChannelId').indexOf('audio') > -1) {
  50989. currentStats.audioLocalAddress = result.stat('googLocalAddress');
  50990. currentStats.audioRemoteAddress = result.stat('googRemoteAddress');
  50991. currentStats.audioLocalCandidateType = result.stat('googLocalCandidateType');
  50992. currentStats.audioRemoteCandidateType = result.stat('googRemoteCandidateType');
  50993. currentStats.audioTransportType = result.stat('googTransportType');
  50994. currentStats.audioLocalRelayProtocol = getProtocolFromPriority(getLocalCandidate(result).stat('priority'));
  50995. currentStats.audioRemoteRelayProtocol = getProtocolFromPriority(getRemoteCandidate(result).stat('priority'));
  50996. } else if (result.stat('googChannelId').indexOf('video') > -1) {
  50997. currentStats.videoLocalAddress = result.stat('googLocalAddress');
  50998. currentStats.videoRemoteAddress = result.stat('googRemoteAddress');
  50999. currentStats.videoLocalCandidateType = result.stat('googLocalCandidateType');
  51000. currentStats.videoRemoteCandidateType = result.stat('googRemoteCandidateType');
  51001. currentStats.videoTransportType = result.stat('googTransportType');
  51002. currentStats.videoLocalRelayProtocol = getProtocolFromPriority(getLocalCandidate(result).stat('priority'));
  51003. currentStats.videoRemoteRelayProtocol = getProtocolFromPriority(getRemoteCandidate(result).stat('priority'));
  51004. }
  51005. }
  51006. parseAudioStats(result);
  51007. parseVideoStats(result);
  51008. }
  51009. } // For audio-video publishers in Chrome, there are no corresponding video reports for these
  51010. if ('videoCodec' in currentStats && !currentStats.videoLocalAddress) {
  51011. ['LocalAddress', 'RemoteAddress', 'LocalCandidateType', 'RemoteCandidateType', 'TransportType', 'LocalRelayProtocol', 'RemoteRelayProtocol'].forEach(keySuffix => {
  51012. currentStats["video" + keySuffix] = currentStats["audio" + keySuffix];
  51013. });
  51014. }
  51015. }
  51016. completion(null, currentStats);
  51017. };
  51018. peerConnection.getStats(parseStatsReports);
  51019. } // Get Stats using the newer API.
  51020. function parseStatsNewAPI(peerConnection, prevStats, currentStats, isPublisher, completion) {
  51021. const onStatsError = function onStatsError(error) {
  51022. completion(error);
  51023. };
  51024. const parseAudioStats = (result, strippedType) => {
  51025. if (strippedType === 'outboundrtp') {
  51026. currentStats.audioSentPackets = result.packetsSent;
  51027. currentStats.audioSentPacketsLost = result.packetsLost;
  51028. currentStats.audioSentBytes = result.bytesSent;
  51029. } else if (strippedType === 'inboundrtp') {
  51030. currentStats.audioRecvPackets = result.packetsReceived;
  51031. currentStats.audioRecvPacketsLost = result.packetsLost;
  51032. currentStats.audioRecvBytes = result.bytesReceived;
  51033. } // OPENTOK-36308 Safari doesn't have audioCodec but on the publisher side it can be mapped
  51034. // to the SDP. On the subscriber side, currentStats.audioCodec will remain undefined, and
  51035. // will be set (possibly incorrectly) by picking the first rtpmap line out of the SDP.
  51036. if (undefined === currentStats.audioCodec && ['Safari'].indexOf(OTHelpers.env.name) !== -1 && undefined !== result.codecId) {
  51037. const _ref = peerConnection.remoteDescription.type === 'answer' ? peerConnection.remoteDescription : peerConnection.localDescription,
  51038. sdp = _ref.sdp;
  51039. const lastIndex = result.codecId.lastIndexOf('_');
  51040. const codecsAndCodecMap = sdpHelpers.getCodecsAndCodecMap(sdp, 'audio');
  51041. if (lastIndex !== -1 && codecsAndCodecMap !== undefined) {
  51042. currentStats.audioCodec = codecsAndCodecMap.codecMap[result.codecId.substring(lastIndex + 1)];
  51043. }
  51044. }
  51045. };
  51046. const parseVideoStats = (result, strippedType) => {
  51047. let haveBytes = false;
  51048. if (strippedType === 'outboundrtp') {
  51049. currentStats.videoSentPackets = result.packetsSent;
  51050. currentStats.videoSentPacketsLost = result.packetsLost;
  51051. currentStats.videoSentBytes = result.bytesSent;
  51052. haveBytes = currentStats.videoSentBytes > 0;
  51053. } else if (strippedType === 'inboundrtp') {
  51054. currentStats.videoRecvPackets = result.packetsReceived;
  51055. currentStats.videoRecvPacketsLost = result.packetsLost;
  51056. currentStats.videoRecvBytes = result.bytesReceived;
  51057. haveBytes = currentStats.videoRecvBytes > 0;
  51058. }
  51059. if (typeof result.framerateMean === 'number') {
  51060. if (haveBytes) {
  51061. currentStats.videoFrameRate = Number(result.framerateMean);
  51062. } else {
  51063. currentStats.videoFrameRate = 0;
  51064. }
  51065. } // OPENTOK-36308 Safari doesn't have videoCodec but on the publisher side it can be mapped
  51066. // to the SDP. On the subscriber side, currentStats.videoCodec will remain undefined, and
  51067. // will be set (possibly incorrectly) by picking the first rtpmap line out of the SDP.
  51068. if (undefined === currentStats.videoCodec && ['Safari'].indexOf(OTHelpers.env.name) !== -1 && undefined !== result.codecId) {
  51069. const _ref2 = peerConnection.remoteDescription.type === 'answer' ? peerConnection.remoteDescription : peerConnection.localDescription,
  51070. sdp = _ref2.sdp;
  51071. const lastIndex = result.codecId.lastIndexOf('_');
  51072. const codecsAndCodecMap = sdpHelpers.getCodecsAndCodecMap(sdp, 'video');
  51073. if (lastIndex !== -1 && codecsAndCodecMap !== undefined) {
  51074. currentStats.videoCodec = codecsAndCodecMap.codecMap[result.codecId.substring(lastIndex + 1)];
  51075. }
  51076. }
  51077. };
  51078. peerConnection.getStats(null).then(stats => {
  51079. let localCandidateType, remoteCandidateType, localAddress, localRelayProtocol, remoteAddress, transportType, frameWidth, frameHeight; // Converts `Inbound-RTP` to `inboundrtp`
  51080. const getStrippedType = type => type.toLowerCase().replace(/[^a-z]/g, '');
  51081. const statsLoop = res => {
  51082. const strippedType = getStrippedType(res.type);
  51083. const lowercaseId = res.id.toLowerCase();
  51084. if (/(in|out)boundrtp$/.test(strippedType)) {
  51085. // Media type may be mapped to either `id` or `kind`
  51086. const isRtp = /rtp/.test(lowercaseId);
  51087. const isAudioRtp = isRtp && /audio/.test(lowercaseId);
  51088. const isVideoRtp = isRtp && /video/.test(lowercaseId);
  51089. const isAudio = isAudioRtp || res.kind === 'audio';
  51090. const isVideo = isVideoRtp || res.kind === 'video';
  51091. if (isAudio) {
  51092. parseAudioStats(res, strippedType);
  51093. } else if (isVideo) {
  51094. parseVideoStats(res, strippedType);
  51095. }
  51096. if (res.hasOwnProperty('roundTripTime')) {
  51097. const type = res.mediaType || res.kind; // roundTripTime comes on the rtcp stats and so won't be caught above
  51098. if (type === 'video') {
  51099. currentStats.videoRtt = res.roundTripTime;
  51100. } else if (type === 'audio') {
  51101. currentStats.audioRtt = res.roundTripTime;
  51102. }
  51103. }
  51104. if (strippedType === 'remoteinboundrtp') {
  51105. if (res.hasOwnProperty('packetsLost')) {
  51106. const kind = res.kind;
  51107. const key = kind + "SentPacketsLost";
  51108. currentStats[key] = res.packetsLost;
  51109. }
  51110. }
  51111. } else if (strippedType === 'transport') {
  51112. const selectedCandidatePairId = res.selectedCandidatePairId;
  51113. if (selectedCandidatePairId) {
  51114. localRelayProtocol = getLocalRelayProtocol(selectedCandidatePairId, stats);
  51115. }
  51116. } else if (strippedType === 'localcandidate') {
  51117. localCandidateType = res.candidateType;
  51118. localAddress = getAddress(res);
  51119. transportType = res.protocol || res.transport;
  51120. } else if (strippedType === 'remotecandidate') {
  51121. remoteCandidateType = res.candidateType;
  51122. remoteAddress = getAddress(res);
  51123. } else if (strippedType === 'track' && lowercaseId.indexOf('video') !== 0) {
  51124. frameWidth = res.frameWidth;
  51125. frameHeight = res.frameHeight;
  51126. if (typeof res.framesPerSecond === 'number') {
  51127. currentStats.videoFrameRate = res.framesPerSecond;
  51128. }
  51129. if (typeof res.framesSent === 'number') {
  51130. currentStats.videoFrameRateSent = res.framesSent;
  51131. }
  51132. if (typeof res.framesReceived === 'number') {
  51133. currentStats.videoFramesReceived = res.framesReceived;
  51134. }
  51135. } else if (strippedType === 'candidatepair') {
  51136. if (res.hasOwnProperty('currentRoundTripTime')) {
  51137. const transportId = res.transportId,
  51138. currentRoundTripTime = res.currentRoundTripTime; // Most browsers map transport to media type
  51139. if (/audio/.test(transportId)) {
  51140. currentStats.audioRtt = currentRoundTripTime;
  51141. } else if (/^RTCTransport/.test(transportId)) {
  51142. // Safari doesn't map transportId to media types
  51143. currentStats.audioRtt = currentRoundTripTime;
  51144. currentStats.videoRtt = currentRoundTripTime;
  51145. }
  51146. }
  51147. } else if (strippedType === 'mediasource') {
  51148. if (res.hasOwnProperty('framesPerSecond')) {
  51149. currentStats.videoFrameRate = res.framesPerSecond;
  51150. }
  51151. if (res.hasOwnProperty('width')) {
  51152. currentStats.videoWidthInput = res.width;
  51153. }
  51154. if (res.hasOwnProperty('height')) {
  51155. currentStats.videoHeightInput = res.height;
  51156. }
  51157. }
  51158. }; // Firefox <= 45 can't use for of loop OPENTOK-32755
  51159. if (typeof stats[Symbol.iterator] === 'function') {
  51160. rawStatsHandler(peerConnection, Array.from(stats));
  51161. for (var _iterator = _createForOfIteratorHelperLoose(stats), _step; !(_step = _iterator()).done;) {
  51162. const el = _step.value;
  51163. const res = Array.isArray(el) ? el[1] : el;
  51164. statsLoop(res);
  51165. }
  51166. } else {
  51167. rawStatsHandler(peerConnection, stats);
  51168. for (const key in stats) {
  51169. if (stats.hasOwnProperty(key)) {
  51170. statsLoop(stats[key]);
  51171. }
  51172. }
  51173. }
  51174. if (currentStats.audioRecvBytes || currentStats.audioSentBytes) {
  51175. currentStats.audioLocalCandidateType = localCandidateType;
  51176. currentStats.audioLocalAddress = localAddress;
  51177. currentStats.audioRemoteCandidateType = remoteCandidateType;
  51178. currentStats.audioRemoteAddress = remoteAddress;
  51179. currentStats.audioTransportType = transportType;
  51180. currentStats.audioLocalRelayProtocol = localRelayProtocol;
  51181. if (currentStats.audioCodec === undefined) {
  51182. const _ref3 = peerConnection.remoteDescription.type === 'answer' ? peerConnection.remoteDescription : peerConnection.localDescription,
  51183. sdp = _ref3.sdp;
  51184. const codecs = sdpHelpers.getCodecs(sdp, 'audio');
  51185. currentStats.audioCodec = codecs[0];
  51186. }
  51187. }
  51188. if (currentStats.videoRecvBytes || currentStats.videoSentBytes) {
  51189. currentStats.videoLocalCandidateType = localCandidateType;
  51190. currentStats.videoLocalAddress = localAddress;
  51191. currentStats.videoRemoteCandidateType = remoteCandidateType;
  51192. currentStats.videoRemoteAddress = remoteAddress;
  51193. currentStats.videoTransportType = transportType;
  51194. currentStats.videoLocalRelayProtocol = localRelayProtocol;
  51195. if (currentStats.videoCodec === undefined) {
  51196. const _ref4 = peerConnection.remoteDescription.type === 'answer' ? peerConnection.remoteDescription : peerConnection.localDescription,
  51197. sdp = _ref4.sdp;
  51198. const codecs = sdpHelpers.getCodecs(sdp, 'video');
  51199. currentStats.videoCodec = codecs[0];
  51200. }
  51201. }
  51202. extendStats(currentStats, isPublisher);
  51203. currentStats.videoWidth = currentStats.videoWidth || frameWidth;
  51204. currentStats.videoHeight = currentStats.videoHeight || frameHeight;
  51205. completion(null, currentStats);
  51206. }).catch(onStatsError);
  51207. }
  51208. function parseQOS(peerConnection, prevStats, currentStats, isPublisher, completion) {
  51209. const _OTHelpers$env = OTHelpers.env,
  51210. browser = _OTHelpers$env.name,
  51211. version = _OTHelpers$env.version; // Chrome deprecated legacy callback-based API in M76
  51212. // https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/discuss-webrtc/MfoWbfi_8GI/Hi5K51XXAAAJ
  51213. const useOldApi = browser === 'Chrome' && version < 76;
  51214. if (useOldApi) {
  51215. return parseStatsOldAPI(peerConnection, prevStats, currentStats, isPublisher, completion);
  51216. }
  51217. return parseStatsNewAPI(peerConnection, prevStats, currentStats, isPublisher, completion);
  51218. }
  51219. function extendStats(stats, isPublisher) {
  51220. const requiredKeys = isPublisher ? requiredPublisherKeys : requiredSubscriberKeys;
  51221. requiredKeys.forEach(key => {
  51222. if (!stats.hasOwnProperty(key)) {
  51223. stats[key] = null;
  51224. }
  51225. });
  51226. }
  51227. /***/ }),
  51228. /* 600 */
  51229. /***/ (function(module, exports, __webpack_require__) {
  51230. "use strict";
  51231. const getProtocolFromPriority = __webpack_require__(269);
  51232. module.exports = (selectedCandidatePairId, stats) => {
  51233. let localRelayProtocol = '';
  51234. if (!selectedCandidatePairId || !stats) {
  51235. return localRelayProtocol;
  51236. }
  51237. const activeCandidatePair = stats.get(selectedCandidatePairId);
  51238. if (activeCandidatePair) {
  51239. const localCandidateId = activeCandidatePair.localCandidateId;
  51240. if (localCandidateId) {
  51241. const localCandidate = stats.get(localCandidateId);
  51242. if (localCandidate) {
  51243. const relayProtocol = localCandidate.relayProtocol,
  51244. priority = localCandidate.priority;
  51245. if (relayProtocol) {
  51246. const RELAY_PROTOCOL = relayProtocol.toUpperCase();
  51247. localRelayProtocol = "TURN/" + RELAY_PROTOCOL;
  51248. } else {
  51249. localRelayProtocol = getProtocolFromPriority(priority);
  51250. }
  51251. }
  51252. }
  51253. }
  51254. return localRelayProtocol;
  51255. };
  51256. /***/ }),
  51257. /* 601 */
  51258. /***/ (function(module, exports, __webpack_require__) {
  51259. "use strict";
  51260. var _interopRequireDefault = __webpack_require__(2);
  51261. exports.__esModule = true;
  51262. exports.default = void 0;
  51263. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  51264. let TruthyChangeCounter = /*#__PURE__*/function () {
  51265. function TruthyChangeCounter() {
  51266. (0, _defineProperty2.default)(this, "value", null);
  51267. (0, _defineProperty2.default)(this, "changeCount", 0);
  51268. }
  51269. var _proto = TruthyChangeCounter.prototype;
  51270. _proto.onValue = function onValue(newValue) {
  51271. if (!newValue) {
  51272. return;
  51273. }
  51274. if (newValue !== this.value) {
  51275. if (this.value) {
  51276. this.changeCount += 1;
  51277. }
  51278. this.value = newValue;
  51279. }
  51280. };
  51281. return TruthyChangeCounter;
  51282. }();
  51283. exports.default = TruthyChangeCounter;
  51284. /***/ }),
  51285. /* 602 */
  51286. /***/ (function(module, exports, __webpack_require__) {
  51287. var isObject = __webpack_require__(7),
  51288. now = __webpack_require__(603),
  51289. toNumber = __webpack_require__(207);
  51290. /** Error message constants. */
  51291. var FUNC_ERROR_TEXT = 'Expected a function';
  51292. /* Built-in method references for those with the same name as other `lodash` methods. */
  51293. var nativeMax = Math.max,
  51294. nativeMin = Math.min;
  51295. /**
  51296. * Creates a debounced function that delays invoking `func` until after `wait`
  51297. * milliseconds have elapsed since the last time the debounced function was
  51298. * invoked. The debounced function comes with a `cancel` method to cancel
  51299. * delayed `func` invocations and a `flush` method to immediately invoke them.
  51300. * Provide `options` to indicate whether `func` should be invoked on the
  51301. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  51302. * with the last arguments provided to the debounced function. Subsequent
  51303. * calls to the debounced function return the result of the last `func`
  51304. * invocation.
  51305. *
  51306. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  51307. * invoked on the trailing edge of the timeout only if the debounced function
  51308. * is invoked more than once during the `wait` timeout.
  51309. *
  51310. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  51311. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  51312. *
  51313. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  51314. * for details over the differences between `_.debounce` and `_.throttle`.
  51315. *
  51316. * @static
  51317. * @memberOf _
  51318. * @since 0.1.0
  51319. * @category Function
  51320. * @param {Function} func The function to debounce.
  51321. * @param {number} [wait=0] The number of milliseconds to delay.
  51322. * @param {Object} [options={}] The options object.
  51323. * @param {boolean} [options.leading=false]
  51324. * Specify invoking on the leading edge of the timeout.
  51325. * @param {number} [options.maxWait]
  51326. * The maximum time `func` is allowed to be delayed before it's invoked.
  51327. * @param {boolean} [options.trailing=true]
  51328. * Specify invoking on the trailing edge of the timeout.
  51329. * @returns {Function} Returns the new debounced function.
  51330. * @example
  51331. *
  51332. * // Avoid costly calculations while the window size is in flux.
  51333. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  51334. *
  51335. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  51336. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  51337. * 'leading': true,
  51338. * 'trailing': false
  51339. * }));
  51340. *
  51341. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  51342. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  51343. * var source = new EventSource('/stream');
  51344. * jQuery(source).on('message', debounced);
  51345. *
  51346. * // Cancel the trailing debounced invocation.
  51347. * jQuery(window).on('popstate', debounced.cancel);
  51348. */
  51349. function debounce(func, wait, options) {
  51350. var lastArgs,
  51351. lastThis,
  51352. maxWait,
  51353. result,
  51354. timerId,
  51355. lastCallTime,
  51356. lastInvokeTime = 0,
  51357. leading = false,
  51358. maxing = false,
  51359. trailing = true;
  51360. if (typeof func != 'function') {
  51361. throw new TypeError(FUNC_ERROR_TEXT);
  51362. }
  51363. wait = toNumber(wait) || 0;
  51364. if (isObject(options)) {
  51365. leading = !!options.leading;
  51366. maxing = 'maxWait' in options;
  51367. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  51368. trailing = 'trailing' in options ? !!options.trailing : trailing;
  51369. }
  51370. function invokeFunc(time) {
  51371. var args = lastArgs,
  51372. thisArg = lastThis;
  51373. lastArgs = lastThis = undefined;
  51374. lastInvokeTime = time;
  51375. result = func.apply(thisArg, args);
  51376. return result;
  51377. }
  51378. function leadingEdge(time) {
  51379. // Reset any `maxWait` timer.
  51380. lastInvokeTime = time;
  51381. // Start the timer for the trailing edge.
  51382. timerId = setTimeout(timerExpired, wait);
  51383. // Invoke the leading edge.
  51384. return leading ? invokeFunc(time) : result;
  51385. }
  51386. function remainingWait(time) {
  51387. var timeSinceLastCall = time - lastCallTime,
  51388. timeSinceLastInvoke = time - lastInvokeTime,
  51389. timeWaiting = wait - timeSinceLastCall;
  51390. return maxing
  51391. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  51392. : timeWaiting;
  51393. }
  51394. function shouldInvoke(time) {
  51395. var timeSinceLastCall = time - lastCallTime,
  51396. timeSinceLastInvoke = time - lastInvokeTime;
  51397. // Either this is the first call, activity has stopped and we're at the
  51398. // trailing edge, the system time has gone backwards and we're treating
  51399. // it as the trailing edge, or we've hit the `maxWait` limit.
  51400. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  51401. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  51402. }
  51403. function timerExpired() {
  51404. var time = now();
  51405. if (shouldInvoke(time)) {
  51406. return trailingEdge(time);
  51407. }
  51408. // Restart the timer.
  51409. timerId = setTimeout(timerExpired, remainingWait(time));
  51410. }
  51411. function trailingEdge(time) {
  51412. timerId = undefined;
  51413. // Only invoke if we have `lastArgs` which means `func` has been
  51414. // debounced at least once.
  51415. if (trailing && lastArgs) {
  51416. return invokeFunc(time);
  51417. }
  51418. lastArgs = lastThis = undefined;
  51419. return result;
  51420. }
  51421. function cancel() {
  51422. if (timerId !== undefined) {
  51423. clearTimeout(timerId);
  51424. }
  51425. lastInvokeTime = 0;
  51426. lastArgs = lastCallTime = lastThis = timerId = undefined;
  51427. }
  51428. function flush() {
  51429. return timerId === undefined ? result : trailingEdge(now());
  51430. }
  51431. function debounced() {
  51432. var time = now(),
  51433. isInvoking = shouldInvoke(time);
  51434. lastArgs = arguments;
  51435. lastThis = this;
  51436. lastCallTime = time;
  51437. if (isInvoking) {
  51438. if (timerId === undefined) {
  51439. return leadingEdge(lastCallTime);
  51440. }
  51441. if (maxing) {
  51442. // Handle invocations in a tight loop.
  51443. clearTimeout(timerId);
  51444. timerId = setTimeout(timerExpired, wait);
  51445. return invokeFunc(lastCallTime);
  51446. }
  51447. }
  51448. if (timerId === undefined) {
  51449. timerId = setTimeout(timerExpired, wait);
  51450. }
  51451. return result;
  51452. }
  51453. debounced.cancel = cancel;
  51454. debounced.flush = flush;
  51455. return debounced;
  51456. }
  51457. module.exports = debounce;
  51458. /***/ }),
  51459. /* 603 */
  51460. /***/ (function(module, exports, __webpack_require__) {
  51461. var root = __webpack_require__(10);
  51462. /**
  51463. * Gets the timestamp of the number of milliseconds that have elapsed since
  51464. * the Unix epoch (1 January 1970 00:00:00 UTC).
  51465. *
  51466. * @static
  51467. * @memberOf _
  51468. * @since 2.4.0
  51469. * @category Date
  51470. * @returns {number} Returns the timestamp.
  51471. * @example
  51472. *
  51473. * _.defer(function(stamp) {
  51474. * console.log(_.now() - stamp);
  51475. * }, _.now());
  51476. * // => Logs the number of milliseconds it took for the deferred invocation.
  51477. */
  51478. var now = function() {
  51479. return root.Date.now();
  51480. };
  51481. module.exports = now;
  51482. /***/ }),
  51483. /* 604 */
  51484. /***/ (function(module, exports, __webpack_require__) {
  51485. "use strict";
  51486. /* eslint-disable global-require */
  51487. const once = __webpack_require__(47); // Indicates whether this client needs its H264 profiles to be swapped
  51488. // Currently this is just Chrome on Android (OPENTOK-34457)
  51489. // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8584
  51490. exports.check = function (deps) {
  51491. if (deps === void 0) {
  51492. deps = {};
  51493. }
  51494. const env = deps.env || __webpack_require__(3);
  51495. return env.name === 'Chrome' && env.userAgent.toLowerCase().indexOf('android') > -1 && env.version < 65;
  51496. };
  51497. exports.once = once(() => exports.check());
  51498. /***/ }),
  51499. /* 605 */
  51500. /***/ (function(module, exports, __webpack_require__) {
  51501. "use strict";
  51502. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  51503. /* eslint-disable one-var, no-underscore-dangle, no-mixed-operators, no-param-reassign */
  51504. const Widget = __webpack_require__(34);
  51505. const OTHelpers = __webpack_require__(4); // Archving Chrome Widget
  51506. //
  51507. // mode (String)
  51508. // Whether to display the archving widget. Possible values are: "on" (the status is displayed
  51509. // when archiving and briefly when archving ends) and "off" (the status is not displayed)
  51510. // Whether to display the archving widget. Possible values are: "auto" (the name is displayed
  51511. // when the status is first displayed and when the user mouses over the display),
  51512. // "off" (the name is not displayed), and "on" (the name is displayed).
  51513. //
  51514. // displays a name
  51515. // can be shown/hidden
  51516. // can be destroyed
  51517. module.exports = function Archiving(options) {
  51518. let _lightBox, _light, _text, _textNode, renderStageDelayedAction;
  51519. const self = this;
  51520. let _archiving = options.archiving;
  51521. const _archivingStarted = options.archivingStarted || 'Archiving on';
  51522. const _archivingEnded = options.archivingEnded || 'Archiving off';
  51523. let _initialState = true;
  51524. const renderText = function renderText(text) {
  51525. _textNode.nodeValue = text;
  51526. _lightBox.setAttribute('title', text);
  51527. };
  51528. const renderStage = function renderStage() {
  51529. if (renderStageDelayedAction) {
  51530. clearTimeout(renderStageDelayedAction);
  51531. renderStageDelayedAction = null;
  51532. }
  51533. if (_archiving) {
  51534. OTHelpers.addClass(_light, 'OT_active');
  51535. } else {
  51536. OTHelpers.removeClass(_light, 'OT_active');
  51537. }
  51538. OTHelpers.removeClass(self.domElement, "OT_archiving-" + (!_archiving ? 'on' : 'off'));
  51539. OTHelpers.addClass(self.domElement, "OT_archiving-" + (_archiving ? 'on' : 'off'));
  51540. if (options.show && _archiving) {
  51541. renderText(_archivingStarted);
  51542. OTHelpers.addClass(_text, 'OT_mode-on');
  51543. OTHelpers.removeClass(_text, 'OT_mode-auto');
  51544. self.setDisplayMode('on');
  51545. renderStageDelayedAction = setTimeout(() => {
  51546. OTHelpers.addClass(_text, 'OT_mode-auto');
  51547. OTHelpers.removeClass(_text, 'OT_mode-on');
  51548. }, 5000);
  51549. } else if (options.show && !_initialState) {
  51550. OTHelpers.addClass(_text, 'OT_mode-on');
  51551. OTHelpers.removeClass(_text, 'OT_mode-auto');
  51552. self.setDisplayMode('on');
  51553. renderText(_archivingEnded);
  51554. renderStageDelayedAction = setTimeout(() => {
  51555. self.setDisplayMode('off');
  51556. }, 5000);
  51557. } else {
  51558. self.setDisplayMode('off');
  51559. }
  51560. }; // Mixin common widget behaviour
  51561. Widget(this, {
  51562. mode: _archiving && options.show && 'on' || 'off',
  51563. nodeName: 'h1',
  51564. htmlAttributes: {
  51565. className: 'OT_archiving OT_edge-bar-item OT_edge-bottom'
  51566. },
  51567. onCreate() {
  51568. _lightBox = OTHelpers.createElement('div', {
  51569. className: 'OT_archiving-light-box'
  51570. }, '');
  51571. _light = OTHelpers.createElement('div', {
  51572. className: 'OT_archiving-light'
  51573. }, '');
  51574. _lightBox.appendChild(_light);
  51575. _text = OTHelpers.createElement('div', {
  51576. className: 'OT_archiving-status OT_mode-on OT_edge-bar-item OT_edge-bottom'
  51577. }, '');
  51578. _textNode = document.createTextNode('');
  51579. _text.appendChild(_textNode);
  51580. self.domElement.appendChild(_lightBox);
  51581. self.domElement.appendChild(_text);
  51582. renderStage();
  51583. }
  51584. });
  51585. this.setShowArchiveStatus = function (show) {
  51586. options.show = show;
  51587. if (self.domElement) {
  51588. renderStage.call(self);
  51589. }
  51590. };
  51591. this.setArchiving = function (status) {
  51592. _archiving = status;
  51593. _initialState = false;
  51594. if (self.domElement) {
  51595. renderStage.call(self);
  51596. }
  51597. };
  51598. };
  51599. /***/ }),
  51600. /* 606 */
  51601. /***/ (function(module, exports, __webpack_require__) {
  51602. "use strict";
  51603. /* WEBPACK VAR INJECTION */(function(Promise) {
  51604. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  51605. /* eslint-disable no-param-reassign, global-require, one-var, prefer-const */
  51606. /* eslint-disable no-restricted-syntax, no-prototype-builtins, no-continue */
  51607. const assign = __webpack_require__(6);
  51608. const isObject = __webpack_require__(7);
  51609. const promiseDelay = __webpack_require__(277);
  51610. const trackUsage = __webpack_require__(607);
  51611. const AnalyticsHelper = __webpack_require__(54);
  51612. const OTErrorClass = __webpack_require__(33);
  51613. const eventing = __webpack_require__(5);
  51614. module.exports = function getUserMediaFactory(deps) {
  51615. if (deps === void 0) {
  51616. deps = {};
  51617. }
  51618. const env = deps.env || __webpack_require__(3);
  51619. const Errors = deps.Errors || __webpack_require__(8);
  51620. const otError = deps.otError || __webpack_require__(12)();
  51621. const logging = deps.logging || __webpack_require__(1)('getUserMedia');
  51622. const createSerialPromiseQueue = __webpack_require__(608);
  51623. const screenSharing = deps.screenSharing || __webpack_require__(156)();
  51624. const getDisplayMediaExtensionHelper = deps.getDisplayMediaExtensionHelper || __webpack_require__(278);
  51625. const customGetUserMedia = deps.customGetUserMedia;
  51626. const windowMock = deps.global || (typeof window !== undefined ? window : global);
  51627. /** @type {AnalyticsHelper} */
  51628. const analytics = deps.analytics || new AnalyticsHelper();
  51629. const navigator = windowMock.navigator,
  51630. location = windowMock.location; // This waits to call getUserMedia() until after the access allowed db is closed
  51631. const queue = createSerialPromiseQueue();
  51632. const getGetUserMediaFn = () => {
  51633. if (customGetUserMedia) {
  51634. return customGetUserMedia;
  51635. }
  51636. if (navigator.mediaDevices) {
  51637. var _context;
  51638. return (_context = navigator.mediaDevices).getUserMedia.bind(_context);
  51639. }
  51640. return undefined;
  51641. };
  51642. const throttledGetUserMedia = function throttledGetUserMedia() {
  51643. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  51644. args[_key] = arguments[_key];
  51645. }
  51646. const gum = getGetUserMediaFn();
  51647. if (!gum) {
  51648. return Promise.reject(new Error('Cannot find getUserMedia'));
  51649. }
  51650. return queue(() => gum(...args));
  51651. };
  51652. const getGetDisplayMediaFn = () => {
  51653. if (customGetUserMedia) {
  51654. return customGetUserMedia;
  51655. }
  51656. if (navigator.mediaDevices && navigator.getDisplayMedia) {
  51657. return navigator.getDisplayMedia.bind(navigator);
  51658. }
  51659. if (navigator.mediaDevices && navigator.mediaDevices.getDisplayMedia) {
  51660. var _context2;
  51661. return (_context2 = navigator.mediaDevices).getDisplayMedia.bind(_context2);
  51662. }
  51663. return undefined;
  51664. };
  51665. const throttledGetDisplayMedia = function throttledGetDisplayMedia() {
  51666. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  51667. args[_key2] = arguments[_key2];
  51668. }
  51669. const gdm = getGetDisplayMediaFn();
  51670. if (gdm) {
  51671. return queue(() => gdm(...args));
  51672. }
  51673. return Promise.reject(new Error('Cannot find getDisplayMedia'));
  51674. };
  51675. const vendorToOTErrorDetails = (() => {
  51676. const userMediaAccessDenied = {
  51677. name: Errors.USER_MEDIA_ACCESS_DENIED,
  51678. message: 'End-user denied permission to hardware devices'
  51679. };
  51680. const notSupported = {
  51681. name: Errors.NOT_SUPPORTED,
  51682. message: 'A constraint specified is not supported by the browser.'
  51683. };
  51684. const constraintsNotSatisfied = {
  51685. name: Errors.CONSTRAINTS_NOT_SATISFIED,
  51686. message: 'It\'s not possible to satisfy one or more constraints ' + 'passed into the getUserMedia function'
  51687. };
  51688. const noDevicesFound = {
  51689. name: Errors.NO_DEVICES_FOUND,
  51690. message: 'No voice or video input devices are available on this machine.'
  51691. };
  51692. const hardwareUnavailable = {
  51693. name: Errors.HARDWARE_UNAVAILABLE,
  51694. message: 'The selected voice or video devices are unavailable. Verify ' + 'that the chosen devices are not in use by another application.'
  51695. };
  51696. const screenCaptureError = {
  51697. name: Errors.UNABLE_TO_CAPTURE_SCREEN,
  51698. message: 'Unable to capture screen. Unknown error occurred'
  51699. };
  51700. const abortError = {
  51701. name: Errors.UNABLE_TO_CAPTURE_MEDIA,
  51702. message: 'Unable to capture media. Unknown error occurred'
  51703. }; // Mozilla error strings and the equivalent W3C names. NOT_SUPPORTED_ERROR does not
  51704. // exist in the spec right now, so we'll include Mozilla's error description.
  51705. // Chrome TrackStartError is triggered when the camera is already used by another app (Windows)
  51706. const errorMap = {
  51707. // Spec:
  51708. AbortError: abortError,
  51709. NotAllowedError: userMediaAccessDenied,
  51710. NotFoundError: noDevicesFound,
  51711. NotReadableError: hardwareUnavailable,
  51712. OverconstrainedError: constraintsNotSatisfied,
  51713. SecurityError: assign({}, userMediaAccessDenied, {
  51714. message: 'End-user denied permission to hardware devices or user media' + ' support may be disabled on this page'
  51715. }),
  51716. TypeError: constraintsNotSatisfied,
  51717. // Old errors, probably not used anymore. @todo log usage to be removed.
  51718. PermissionDeniedError: userMediaAccessDenied,
  51719. PermissionDismissedError: userMediaAccessDenied,
  51720. NotSupportedError: notSupported,
  51721. ConstraintNotSatisfiedError: constraintsNotSatisfied,
  51722. MandatoryUnsatisfiedError: constraintsNotSatisfied,
  51723. OverConstrainedError: constraintsNotSatisfied,
  51724. DevicesNotFoundError: noDevicesFound,
  51725. NoDevicesFoundError: noDevicesFound,
  51726. HardwareUnavailableError: hardwareUnavailable,
  51727. SourceUnavailableError: hardwareUnavailable,
  51728. TrackStartError: hardwareUnavailable,
  51729. ScreenCaptureError: screenCaptureError,
  51730. TabCaptureError: screenCaptureError
  51731. }; // track usage of the following keys so we know if they are still being used
  51732. // and by which browsers/ operating systems.
  51733. trackUsage({
  51734. objectToTrack: errorMap,
  51735. keys: ['PermissionDeniedError', 'PermissionDismissedError', 'NotSupportedError', 'ConstraintNotSatisfiedError', 'MandatoryUnsatisfiedError', 'OverConstrainedError', 'DevicesNotFoundError', 'NoDevicesFoundError', 'HardwareUnavailableError', 'SourceUnavailableError', 'TrackStartError', 'ScreenCaptureError', 'TabCaptureError'],
  51736. onUsage(key) {
  51737. analytics.logEvent({
  51738. action: 'DeprecatedPropertyUsage:getUserMedia:errorMap',
  51739. variation: 'Event',
  51740. payload: {
  51741. key
  51742. }
  51743. });
  51744. }
  51745. });
  51746. return errorMap;
  51747. })(); // Map vendor error strings to errors we emit
  51748. const errorFromVendorNameAndMessage = (vendorErrorName, message) => {
  51749. let name = vendorErrorName;
  51750. if (name === 'AbortError' && typeof message === 'string' && message.match(/(screen|tab).?capture/i)) {
  51751. name = 'ScreenCaptureError';
  51752. }
  51753. const otErrorDetails = vendorToOTErrorDetails[name];
  51754. if (otErrorDetails) {
  51755. const error = otError(otErrorDetails.name, new Error(otErrorDetails.message + " (getUserMedia error: " + vendorErrorName + ")"));
  51756. error.originalMessage = message;
  51757. return error;
  51758. }
  51759. const error = new Error("Unknown error while getting user media: " + vendorErrorName);
  51760. error.originalMessage = message;
  51761. return error;
  51762. }; // Parse and normalise a getUserMedia error event from Chrome or Mozilla
  51763. // @ref http://dev.w3.org/2011/webrtc/editor/getusermedia.html#idl-def-NavigatorUserMediaError
  51764. const parseErrorEvent = event => {
  51765. if (isObject(event) && event.name) {
  51766. let name = event.name,
  51767. message = event.message;
  51768. if (message === 'Cannot find getUserMedia' || message === 'Cannot find getDisplayMedia') {
  51769. if (env.name === 'Chrome' && env.version > 73 && windowMock.location.protocol !== 'https:') {
  51770. name = 'NotAllowedError';
  51771. } else {
  51772. name = 'NotSupportedError';
  51773. }
  51774. } // Errors in Safari have incorrect name property
  51775. // See https://bugs.webkit.org/show_bug.cgi?id=180777
  51776. if (env.name === 'Safari' && name === 'Error') {
  51777. const protoName = Object.prototype.toString.call(event);
  51778. const matches = protoName.match(/^\[object (\w+Error)\]$/);
  51779. if (matches) {
  51780. name = matches[1];
  51781. }
  51782. }
  51783. const error = errorFromVendorNameAndMessage(name, message);
  51784. error.constraintName = event.constraint || event.constraintName;
  51785. if (!(error instanceof OTErrorClass)) {
  51786. analytics.logEvent({
  51787. action: 'UnexpectedError:getUserMedia:parseErrorEvent',
  51788. variation: 'Event',
  51789. payload: {
  51790. name: error.name,
  51791. message: error.message,
  51792. originalMessage: error.originalMessage
  51793. }
  51794. });
  51795. }
  51796. return error;
  51797. }
  51798. if (typeof event === 'string') {
  51799. const error = errorFromVendorNameAndMessage(event);
  51800. analytics.logEvent({
  51801. action: 'CheckUnreachable:getUserMedia:parseErrorEvent',
  51802. variation: 'Event',
  51803. payload: {
  51804. info: 'error is string',
  51805. error: event
  51806. }
  51807. });
  51808. return error;
  51809. }
  51810. analytics.logEvent({
  51811. action: 'CheckUnreachable:getUserMedia:parseErrorEvent',
  51812. variation: 'Event',
  51813. payload: {
  51814. info: 'error was not string or object with name property',
  51815. error: event
  51816. }
  51817. });
  51818. return new Error('Unknown error type while getting media');
  51819. }; // Validates a Hash of getUserMedia constraints. Currently we only
  51820. // check to see if there is at least one non-false constraint.
  51821. const areInvalidConstraints = function areInvalidConstraints(constraints) {
  51822. if (!constraints || !isObject(constraints)) {
  51823. return true;
  51824. }
  51825. for (const key in constraints) {
  51826. if (!constraints.hasOwnProperty(key)) {
  51827. continue;
  51828. }
  51829. if (constraints[key]) {
  51830. return false;
  51831. }
  51832. }
  51833. return true;
  51834. }; // A wrapper for the builtin navigator.getUserMedia. In addition to the usual
  51835. // getUserMedia behaviour, this helper method also accepts a accessDialogOpened
  51836. // and accessDialogClosed callback.
  51837. //
  51838. // @memberof OTHelpers
  51839. // @private
  51840. //
  51841. // @param {Object} constraints
  51842. // A dictionary of constraints to pass to getUserMedia. See
  51843. // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#idl-def-MediaStreamConstraints
  51844. // in the Media Capture and Streams spec for more info.
  51845. //
  51846. // @param {function} success
  51847. // Called when getUserMedia completes successfully. The callback will be passed a WebRTC
  51848. // Stream object.
  51849. //
  51850. // @param {function} failure
  51851. // Called when getUserMedia fails to access a user stream. It will be passed an object
  51852. // with a code property representing the error that occurred.
  51853. //
  51854. // @param {function} accessDialogOpened
  51855. // Called when the access allow/deny dialog is opened.
  51856. //
  51857. // @param {function} accessDialogClosed
  51858. // Called when the access allow/deny dialog is closed.
  51859. //
  51860. // @param {function} accessDenied
  51861. // Called when access is denied to the camera/mic. This will be either because
  51862. // the user has clicked deny or because a particular origin is permanently denied.
  51863. //
  51864. return function (constraints, isScreenSharing) {
  51865. if (isScreenSharing === void 0) {
  51866. isScreenSharing = false;
  51867. }
  51868. logging.debug('getUserMedia wrapper called with', constraints);
  51869. if (areInvalidConstraints(constraints)) {
  51870. // All constraints are false, we don't allow this. This may be valid later
  51871. // depending on how/if we integrate data channels.
  51872. logging.error('Couldn\'t get UserMedia: All constraints were false');
  51873. return eventing(Promise.reject(otError(Errors.NO_VALID_CONSTRAINTS, new Error('Video and Audio was disabled, you need to enable at least one'))));
  51874. }
  51875. const getMedia = isScreenSharing && getDisplayMediaExtensionHelper.isSupportedInThisBrowser ? throttledGetDisplayMedia : throttledGetUserMedia;
  51876. const throttledRequest = eventing(getMedia(constraints).catch(browserError => {
  51877. // This also restores bluebird's ability to check we handle the error since we ignored
  51878. // it when creating `finalized` above.
  51879. const error = parseErrorEvent(browserError);
  51880. if (error.name === Errors.UNABLE_TO_CAPTURE_SCREEN) {
  51881. return new Promise((resolve, reject) => {
  51882. screenSharing.checkCapability(response => {
  51883. if (response.extensionRequired === 'chrome') {
  51884. if (response.extensionRegistered && !response.extensionInstalled) {
  51885. const newErr = otError(Errors.SCREEN_SHARING_EXTENSION_NOT_INSTALLED, error);
  51886. newErr.message = 'Screen sharing extension not installed see https://tokbox.com/developer/guides/screen-sharing/js/#chrome-extension';
  51887. reject(newErr);
  51888. } else if (!response.extensionRegistered) {
  51889. const newErr = otError(Errors.SCREEN_SHARING_EXTENSION_NOT_REGISTERED, error);
  51890. newErr.message = 'Screen sharing extension not registered see https://tokbox.com/developer/guides/screen-sharing/js/#chrome-extension';
  51891. reject(newErr);
  51892. }
  51893. } else {
  51894. reject(error);
  51895. }
  51896. });
  51897. });
  51898. }
  51899. throw error;
  51900. }).then(stream => {
  51901. logging.debug('got stream:', {
  51902. stream,
  51903. tracks: stream.getTracks(),
  51904. trackLabels: stream.getTracks().map(track => track.label)
  51905. });
  51906. return stream;
  51907. })); // The 'remember me' functionality of WebRTC only functions over HTTPS, if
  51908. // we aren't on HTTPS then we should definitely be displaying the access
  51909. // dialog.
  51910. //
  51911. // If we are on HTTPS, we'll wait 500ms to see if we get a stream
  51912. // immediately. If we do then the user had clicked 'remember me'. Otherwise
  51913. // we assume that the accessAllowed dialog is visible.
  51914. //
  51915. // Otherwise, we still wait 100ms to give the client a chance to bind to the
  51916. // event.
  51917. //
  51918. // @todo benchmark and see if 500ms is a reasonable number. It seems like
  51919. // we should know a lot quicker.
  51920. //
  51921. const dialogOpenedDelay = location.protocol.indexOf('https') !== -1 ? 500 : 100;
  51922. let waitingForStream = true;
  51923. const setWaitingForStreamFalse = () => {
  51924. waitingForStream = false;
  51925. };
  51926. throttledRequest.then(setWaitingForStreamFalse, setWaitingForStreamFalse);
  51927. promiseDelay(dialogOpenedDelay).then(() => {
  51928. if (!waitingForStream) {
  51929. return;
  51930. }
  51931. const closeDialog = () => throttledRequest.emit('accessDialogClosed');
  51932. throttledRequest.emit('accessDialogOpened');
  51933. throttledRequest.then(closeDialog, closeDialog);
  51934. });
  51935. return throttledRequest;
  51936. };
  51937. };
  51938. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  51939. /***/ }),
  51940. /* 607 */
  51941. /***/ (function(module, exports, __webpack_require__) {
  51942. "use strict";
  51943. module.exports = function (_temp) {
  51944. let _ref = _temp === void 0 ? {} : _temp,
  51945. objectToTrack = _ref.objectToTrack,
  51946. keys = _ref.keys,
  51947. onUsage = _ref.onUsage;
  51948. if (!Array.isArray(keys) && keys !== undefined) {
  51949. throw new Error('keys must be an array, or undefined');
  51950. }
  51951. if (typeof onUsage !== 'function') {
  51952. throw new Error('onUsage must be a function');
  51953. }
  51954. if (objectToTrack == null) {
  51955. throw new Error('Expected objectToTrack to be a trackable object');
  51956. }
  51957. Object.keys(objectToTrack).forEach(key => {
  51958. if (keys !== undefined && keys.indexOf(key) === -1) {
  51959. return;
  51960. }
  51961. let value = objectToTrack[key];
  51962. Object.defineProperty(objectToTrack, key, {
  51963. get() {
  51964. onUsage(key);
  51965. return value;
  51966. },
  51967. set(newValue) {
  51968. value = newValue;
  51969. onUsage(key, value);
  51970. },
  51971. enumerable: true
  51972. });
  51973. });
  51974. };
  51975. /***/ }),
  51976. /* 608 */
  51977. /***/ (function(module, exports, __webpack_require__) {
  51978. "use strict";
  51979. /* WEBPACK VAR INJECTION */(function(Promise) {
  51980. var _interopRequireDefault = __webpack_require__(2);
  51981. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  51982. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  51983. module.exports = () => {
  51984. const queue = [];
  51985. let processing = false;
  51986. const processQueue = /*#__PURE__*/function () {
  51987. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  51988. var _queue$shift, fn, resolve, reject;
  51989. return _regenerator.default.wrap(function _callee$(_context) {
  51990. while (1) switch (_context.prev = _context.next) {
  51991. case 0:
  51992. if (!processing) {
  51993. _context.next = 2;
  51994. break;
  51995. }
  51996. return _context.abrupt("return");
  51997. case 2:
  51998. processing = true;
  51999. case 3:
  52000. if (!queue.length) {
  52001. _context.next = 18;
  52002. break;
  52003. }
  52004. _queue$shift = queue.shift(), fn = _queue$shift.fn, resolve = _queue$shift.resolve, reject = _queue$shift.reject;
  52005. _context.prev = 5;
  52006. _context.t0 = resolve;
  52007. _context.next = 9;
  52008. return fn();
  52009. case 9:
  52010. _context.t1 = _context.sent;
  52011. (0, _context.t0)(_context.t1);
  52012. _context.next = 16;
  52013. break;
  52014. case 13:
  52015. _context.prev = 13;
  52016. _context.t2 = _context["catch"](5);
  52017. reject(_context.t2);
  52018. case 16:
  52019. _context.next = 3;
  52020. break;
  52021. case 18:
  52022. processing = false;
  52023. case 19:
  52024. case "end":
  52025. return _context.stop();
  52026. }
  52027. }, _callee, null, [[5, 13]]);
  52028. }));
  52029. return function processQueue() {
  52030. return _ref.apply(this, arguments);
  52031. };
  52032. }();
  52033. return fn => {
  52034. const result = new Promise((resolve, reject) => {
  52035. queue.push({
  52036. fn,
  52037. resolve,
  52038. reject
  52039. });
  52040. });
  52041. processQueue();
  52042. return result;
  52043. };
  52044. };
  52045. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  52046. /***/ }),
  52047. /* 609 */
  52048. /***/ (function(module, exports, __webpack_require__) {
  52049. "use strict";
  52050. const env = __webpack_require__(3);
  52051. const _require = __webpack_require__(610),
  52052. isCallbackBasedAPI = _require.isCallbackBasedAPI;
  52053. let desktopCapturer = null; // Legacy versions of Electron have a callback-based method
  52054. const getSourcesUsingCallback = (opts, callback) => {
  52055. desktopCapturer.getSources(opts, callback);
  52056. }; // More recent versions of Electron has a promise-based method
  52057. const getSourcesUsingPromise = (opts, callback) => {
  52058. desktopCapturer.getSources(opts).then(sources => {
  52059. callback(undefined, sources);
  52060. }, callback);
  52061. };
  52062. const getSourcesAdapter = () => isCallbackBasedAPI ? getSourcesUsingCallback : getSourcesUsingPromise;
  52063. const getSourcesWrapper = (source, callback) => {
  52064. const getSources = getSourcesAdapter();
  52065. getSources({
  52066. types: [source]
  52067. }, (error, sources) => {
  52068. if (error) {
  52069. callback(error);
  52070. return;
  52071. } // For now just pick the first source. In future we need to implement a selection
  52072. // dialog.
  52073. const foundSource = sources[0];
  52074. if (!foundSource) {
  52075. callback(new Error('Could not find Electron source for screensharing'));
  52076. return;
  52077. }
  52078. const constraints = {
  52079. audio: false,
  52080. video: {
  52081. mandatory: {
  52082. chromeMediaSource: source,
  52083. chromeMediaSourceId: foundSource.id
  52084. }
  52085. }
  52086. };
  52087. callback(undefined, constraints);
  52088. });
  52089. };
  52090. module.exports = function electronExtensionHelperFactory(deps) {
  52091. if (deps === void 0) {
  52092. deps = {};
  52093. }
  52094. try {
  52095. // Using a dynamic require here because that's the way we get desktopCapturer in electron, and
  52096. // that's not something to bundle in.
  52097. // We are requiring electron here to see if it's available, it's intentionally not packaged
  52098. // and not listed in the package.json for this repository. It is expected to be found only if
  52099. // we are running inside an Electron application.
  52100. const req = (() => {
  52101. // We need to search for the require function either in the current
  52102. // global or, if its a window, one of its parents. This is necessary
  52103. // in case OT is used from within an iframe (like our integration
  52104. // tests).
  52105. let current = (typeof window !== undefined ? window : global);
  52106. while (typeof current.require !== 'function' && current.parent && current.parent !== current) {
  52107. current = current.parent;
  52108. }
  52109. return current.require;
  52110. })();
  52111. desktopCapturer = deps.desktopCapturer || ( // Don't try to import unless in electron environment, else `require` will
  52112. // dispatch an error message if `electron` is not found
  52113. env.isElectron ? req('electron').desktopCapturer : null);
  52114. } catch (e) {// Ignore
  52115. }
  52116. return {
  52117. isSupportedInThisBrowser: desktopCapturer !== null,
  52118. autoRegisters: true,
  52119. extensionRequired: false,
  52120. getConstraintsShowsPermissionUI: false,
  52121. sources: {
  52122. screen: true,
  52123. application: true,
  52124. window: true,
  52125. browser: true
  52126. },
  52127. register: () => ({
  52128. isInstalled: callback => callback(true),
  52129. getConstraints(source, constraints, callback) {
  52130. getSourcesWrapper(source, callback);
  52131. }
  52132. })
  52133. };
  52134. };
  52135. /***/ }),
  52136. /* 610 */
  52137. /***/ (function(module, exports, __webpack_require__) {
  52138. "use strict";
  52139. const env = __webpack_require__(3); // Callback-based API was removed in ElectronJS 7, which corresponds to
  52140. // Chrome 78
  52141. const isCallbackBasedAPI = env.version < 78;
  52142. const isPromiseBasedAPI = !isCallbackBasedAPI;
  52143. module.exports = {
  52144. isCallbackBasedAPI,
  52145. isPromiseBasedAPI
  52146. };
  52147. /***/ }),
  52148. /* 611 */
  52149. /***/ (function(module, exports, __webpack_require__) {
  52150. "use strict";
  52151. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  52152. /* eslint-disable no-param-reassign, no-void */
  52153. const env = __webpack_require__(3);
  52154. const haveGetDisplayMedia = __webpack_require__(154).default;
  52155. const isSupportedInThisBrowser = () => {
  52156. const isFirefox = env.isFirefox;
  52157. if (!isFirefox) {
  52158. return false;
  52159. } // Don't use plugin if getDisplayMedia is supported
  52160. return !haveGetDisplayMedia;
  52161. };
  52162. module.exports = {
  52163. isSupportedInThisBrowser: isSupportedInThisBrowser(),
  52164. autoRegisters: true,
  52165. extensionRequired: false,
  52166. extensionInstalled: false,
  52167. getConstraintsShowsPermissionUI: false,
  52168. sources: {
  52169. screen: true,
  52170. application: false,
  52171. window: true,
  52172. browser: false
  52173. },
  52174. register() {
  52175. return {
  52176. isInstalled(callback) {
  52177. // The extension sets window.OTScreenSharing in pages loaded from a matching domain
  52178. callback(typeof OTScreenSharing === 'object');
  52179. },
  52180. getConstraints(source, constraints, callback) {
  52181. constraints.video = {
  52182. mediaSource: source
  52183. }; // copy constraints under the video object and removed them from the root constraint object
  52184. if (constraints.browserWindow) {
  52185. constraints.video.browserWindow = constraints.browserWindow;
  52186. delete constraints.browserWindow;
  52187. }
  52188. if (typeof constraints.scrollWithPage !== 'undefined') {
  52189. constraints.video.scrollWithPage = constraints.scrollWithPage;
  52190. delete constraints.scrollWithPage;
  52191. }
  52192. callback(void 0, constraints);
  52193. }
  52194. };
  52195. }
  52196. };
  52197. /***/ }),
  52198. /* 612 */
  52199. /***/ (function(module, exports, __webpack_require__) {
  52200. "use strict";
  52201. var _interopRequireDefault = __webpack_require__(2);
  52202. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  52203. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  52204. var _extends2 = _interopRequireDefault(__webpack_require__(23));
  52205. const _require = __webpack_require__(613),
  52206. normaliseOptions = _require.normaliseOptions;
  52207. const _require2 = __webpack_require__(279),
  52208. isMediaStreamTrack = _require2.isMediaStreamTrack;
  52209. /* eslint-disable global-require */
  52210. const assert = __webpack_require__(144);
  52211. const assign = __webpack_require__(6);
  52212. const defaults = __webpack_require__(133);
  52213. const promiseEndeavour = __webpack_require__(280).default;
  52214. const Errors = __webpack_require__(8);
  52215. const pick = __webpack_require__(42);
  52216. const otError = __webpack_require__(12);
  52217. const eventing = __webpack_require__(5);
  52218. const isScreenSharingSource = __webpack_require__(258);
  52219. const env = __webpack_require__(3);
  52220. const GET_USER_ABORT_ERROR_MSG = 'getUserMedia request was aborted';
  52221. module.exports = function processPubOptionsFactory(deps) {
  52222. if (deps === void 0) {
  52223. deps = {};
  52224. }
  52225. ['deviceHelpers', 'getUserMediaHelper'].forEach(key => {
  52226. assert(deps[key], key + " dependency must be injected into processPubOptions");
  52227. });
  52228. const generateConstraintInfo = deps.generateConstraintInfo || __webpack_require__(250);
  52229. const windowMock = deps.global || (typeof window !== undefined ? window : global);
  52230. const logging = deps.logging || __webpack_require__(1)('processPubOptions');
  52231. const navigator = deps.navigator || windowMock.navigator;
  52232. const screenSharing = deps.screenSharing || __webpack_require__(156)();
  52233. const isiOS = deps.isiOS || __webpack_require__(157);
  52234. const usingOptionalMandatoryStyle = __webpack_require__(614)({
  52235. navigator: navigator || {}
  52236. });
  52237. const _deps = deps,
  52238. deviceHelpers = _deps.deviceHelpers,
  52239. getUserMediaHelper = _deps.getUserMediaHelper;
  52240. return (originalOptions, logPrefix, shouldStop) => {
  52241. const options = normaliseOptions(originalOptions, logPrefix, logging);
  52242. const isScreenSharing = isScreenSharingSource(options.videoSource);
  52243. const isCustomAudioTrack = isMediaStreamTrack(options.audioSource);
  52244. const isCustomVideoTrack = isMediaStreamTrack(options.videoSource); // getUserMedia is required if either audio or video is: a) not custom and b) not disabled
  52245. const isAudioGumRequired = !isCustomAudioTrack && options.audioSource !== null;
  52246. const isVideoGumRequired = !isCustomVideoTrack && options.videoSource !== null;
  52247. const isGumRequired = isAudioGumRequired || isVideoGumRequired; // We display audio level and allow audio fallback if we're not screensharing
  52248. // or if we're screensharing but with a custom audio track
  52249. // @todo shouldn't this take into consideration if we have audio as well?
  52250. const shouldAllowAudio = !isScreenSharing || isCustomAudioTrack;
  52251. const properties = defaults(options, {
  52252. mirror: !isScreenSharing && !isCustomVideoTrack,
  52253. publishAudio: true,
  52254. publishVideo: true,
  52255. showControls: true,
  52256. fitMode: isScreenSharing ? 'contain' : 'cover',
  52257. audioFallbackEnabled: shouldAllowAudio,
  52258. insertDefaultUI: true,
  52259. enableRenegotiation: false,
  52260. enableStereo: false,
  52261. disableAudioProcessing: false
  52262. });
  52263. if (properties.name) {
  52264. properties.name = String(properties.name);
  52265. }
  52266. if (!properties.constraints) {
  52267. const constraintInfo = generateConstraintInfo((0, _extends2.default)({
  52268. isScreenSharing,
  52269. isCustomAudioTrack,
  52270. isCustomVideoTrack
  52271. }, pick(properties, ['audioSource', 'publishAudio', 'videoSource', 'publishVideo', 'resolution', 'maxResolution', 'frameRate', 'facingMode', 'enableRenegotiation', 'enableStereo', 'disableAudioProcessing']), {
  52272. env,
  52273. usingOptionalMandatoryStyle: usingOptionalMandatoryStyle(isScreenSharing)
  52274. }));
  52275. assign(properties, constraintInfo);
  52276. } else {
  52277. logging.warn(logPrefix + ": You have passed your own constraints not using ours");
  52278. }
  52279. const processedOptions = {
  52280. isScreenSharing,
  52281. isCustomAudioTrack,
  52282. isCustomVideoTrack,
  52283. shouldAllowAudio,
  52284. properties
  52285. };
  52286. eventing(processedOptions);
  52287. processedOptions.getUserMedia = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
  52288. var onAccessDialogOpened, onAccessDialogClosed, stream, devices, constraints, IOS_NEW_WINDOW_BUG, tryGetUserMedia;
  52289. return _regenerator.default.wrap(function _callee2$(_context2) {
  52290. while (1) switch (_context2.prev = _context2.next) {
  52291. case 0:
  52292. onAccessDialogOpened = function onAccessDialogOpened() {
  52293. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  52294. args[_key] = arguments[_key];
  52295. }
  52296. return processedOptions.emit('accessDialogOpened', ...args);
  52297. };
  52298. onAccessDialogClosed = function onAccessDialogClosed() {
  52299. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  52300. args[_key2] = arguments[_key2];
  52301. }
  52302. return processedOptions.emit('accessDialogClosed', ...args);
  52303. };
  52304. if (isGumRequired) {
  52305. _context2.next = 7;
  52306. break;
  52307. }
  52308. stream = new windowMock.MediaStream();
  52309. if (isCustomAudioTrack) {
  52310. stream.addTrack(options.audioSource);
  52311. }
  52312. if (isCustomVideoTrack) {
  52313. stream.addTrack(options.videoSource);
  52314. }
  52315. return _context2.abrupt("return", stream);
  52316. case 7:
  52317. if (!isScreenSharing) {
  52318. _context2.next = 15;
  52319. break;
  52320. }
  52321. _context2.next = 10;
  52322. return screenSharing.getConstraints({
  52323. onAccessDialogOpened,
  52324. onAccessDialogClosed,
  52325. videoSource: options.videoSource,
  52326. constraints: properties.constraints
  52327. });
  52328. case 10:
  52329. properties.constraints = _context2.sent;
  52330. if (!shouldStop()) {
  52331. _context2.next = 13;
  52332. break;
  52333. }
  52334. throw otError(Errors.CANCEL, new Error(GET_USER_ABORT_ERROR_MSG));
  52335. case 13:
  52336. _context2.next = 25;
  52337. break;
  52338. case 15:
  52339. _context2.next = 17;
  52340. return deviceHelpers.shouldAskForDevices();
  52341. case 17:
  52342. devices = _context2.sent;
  52343. if (!shouldStop()) {
  52344. _context2.next = 20;
  52345. break;
  52346. }
  52347. throw otError(Errors.CANCEL, new Error(GET_USER_ABORT_ERROR_MSG));
  52348. case 20:
  52349. logging.debug(logPrefix + ": shouldAskForDevices:", devices);
  52350. if (!devices.video) {
  52351. logging.warn(logPrefix + ": Setting video constraint to false, there are no video sources");
  52352. properties.constraints.video = false;
  52353. }
  52354. if (!devices.audio) {
  52355. logging.warn(logPrefix + ": Setting audio constraint to false, there are no audio sources");
  52356. properties.constraints.audio = false;
  52357. } // @todo this side effect needs to go...
  52358. processedOptions.videoDevices = devices.videoDevices;
  52359. processedOptions.audioDevices = devices.audioDevices;
  52360. case 25:
  52361. constraints = properties.constraints;
  52362. logging.debug(logPrefix + ": onConstraintsFound", constraints);
  52363. if (!shouldStop()) {
  52364. _context2.next = 29;
  52365. break;
  52366. }
  52367. throw otError(Errors.CANCEL, new Error(GET_USER_ABORT_ERROR_MSG));
  52368. case 29:
  52369. IOS_NEW_WINDOW_BUG = 'Failed to acquire functional stream, this might be caused by ' + 'the following iOS bug: https://bugs.webkit.org/show_bug.cgi?id=188088';
  52370. tryGetUserMedia = /*#__PURE__*/function () {
  52371. var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  52372. var gumRequest, stream, error;
  52373. return _regenerator.default.wrap(function _callee$(_context) {
  52374. while (1) switch (_context.prev = _context.next) {
  52375. case 0:
  52376. gumRequest = getUserMediaHelper(constraints, isScreenSharing);
  52377. gumRequest.on('accessDialogOpened', onAccessDialogOpened);
  52378. gumRequest.on('accessDialogClosed', onAccessDialogClosed);
  52379. _context.prev = 3;
  52380. _context.next = 6;
  52381. return gumRequest;
  52382. case 6:
  52383. stream = _context.sent;
  52384. if (!(isiOS() && properties.publishVideo && stream.getVideoTracks().length && stream.getVideoTracks()[0].readyState === 'ended')) {
  52385. _context.next = 11;
  52386. break;
  52387. }
  52388. stream.getTracks().forEach(track => track.stop());
  52389. error = new Error(IOS_NEW_WINDOW_BUG);
  52390. throw error;
  52391. case 11:
  52392. return _context.abrupt("return", stream);
  52393. case 14:
  52394. _context.prev = 14;
  52395. _context.t0 = _context["catch"](3);
  52396. if (!(isiOS() && _context.t0.name === Errors.HARDWARE_UNAVAILABLE)) {
  52397. _context.next = 18;
  52398. break;
  52399. }
  52400. throw new Error(IOS_NEW_WINDOW_BUG);
  52401. case 18:
  52402. throw _context.t0;
  52403. case 19:
  52404. _context.prev = 19;
  52405. // Wait a little bit before we clean up the event handlers
  52406. // to give 'accessDialogClosed' a chance to fire
  52407. setTimeout(() => {
  52408. gumRequest.off('accessDialogOpened', onAccessDialogOpened);
  52409. gumRequest.off('accessDialogClosed', onAccessDialogClosed);
  52410. });
  52411. return _context.finish(19);
  52412. case 22:
  52413. case "end":
  52414. return _context.stop();
  52415. }
  52416. }, _callee, null, [[3, 14, 19, 22]]);
  52417. }));
  52418. return function tryGetUserMedia() {
  52419. return _ref2.apply(this, arguments);
  52420. };
  52421. }();
  52422. _context2.next = 33;
  52423. return promiseEndeavour(tryGetUserMedia, (err, attempt) => {
  52424. if (err.message === IOS_NEW_WINDOW_BUG && attempt === 1 && !shouldStop()) {
  52425. // Detected the iOS new window bug. Need try again.
  52426. // https://tokbox.atlassian.net/browse/OPENTOK-37691
  52427. // https://bugs.webkit.org/show_bug.cgi?id=188088
  52428. // Fixed 4th Dec 2018 - unsure which Safari versions are fixed
  52429. return 1000;
  52430. }
  52431. return false;
  52432. })();
  52433. case 33:
  52434. stream = _context2.sent;
  52435. if (!shouldStop()) {
  52436. _context2.next = 37;
  52437. break;
  52438. }
  52439. stream.getTracks().forEach(track => {
  52440. track.stop();
  52441. });
  52442. throw otError(Errors.CANCEL, new Error(GET_USER_ABORT_ERROR_MSG));
  52443. case 37:
  52444. if (isCustomAudioTrack) {
  52445. stream.addTrack(options.audioSource);
  52446. }
  52447. if (isCustomVideoTrack) {
  52448. stream.addTrack(options.videoSource);
  52449. }
  52450. return _context2.abrupt("return", stream);
  52451. case 40:
  52452. case "end":
  52453. return _context2.stop();
  52454. }
  52455. }, _callee2);
  52456. }));
  52457. return processedOptions;
  52458. };
  52459. };
  52460. /***/ }),
  52461. /* 613 */
  52462. /***/ (function(module, exports, __webpack_require__) {
  52463. "use strict";
  52464. const _require = __webpack_require__(279),
  52465. isMediaStreamTrack = _require.isMediaStreamTrack;
  52466. const clone = __webpack_require__(35);
  52467. const env = __webpack_require__(3);
  52468. const normaliseOptions = (originalOptions, logPrefix, logging) => {
  52469. const options = originalOptions && typeof originalOptions === 'object' ? clone(originalOptions) : {};
  52470. if (options.audioSource === false) {
  52471. options.audioSource = null;
  52472. }
  52473. if (options.videoSource === false) {
  52474. options.videoSource = null;
  52475. } // Ignore minVideoBitrate if it's defined but not a positive number
  52476. if (options.minVideoBitrate !== undefined && !(typeof options.minVideoBitrate === 'number' && options.minVideoBitrate > 0)) {
  52477. logging.warn(logPrefix + ": Invalid minVideoBitrate in publisher properties. minVideoBitrate must " + 'be a positive number');
  52478. delete options.minVideoBitrate;
  52479. } // Ignore audioBitrate if it's defined but not between 6kb and 510kb
  52480. if (options.audioBitrate !== undefined && !(options.audioBitrate >= 6 * 1000 && options.audioBitrate <= 510 * 1000)) {
  52481. logging.warn(logPrefix + ": Invalid audioBitrate in publisher properties. audioBitrate must " + ("be a number between " + 6 * 1000 + " and " + 510 * 1000 + " bits per second"));
  52482. delete options.audioBitrate;
  52483. } // Crashes in FF45-46 and fails to publish in FF47-48
  52484. if (env.name === 'Firefox' && env.version < 49) {
  52485. const label = 'Firefox 48 and below';
  52486. if (isMediaStreamTrack(options.audioSource)) {
  52487. options.audioSource = null;
  52488. logging.warn(logPrefix + ": Cannot use custom tracks with " + label + ". Setting audioSource to null");
  52489. }
  52490. if (isMediaStreamTrack(options.videoSource)) {
  52491. options.videoSource = null;
  52492. logging.warn(logPrefix + ": Cannot use custom tracks with " + label + ". Setting videoSource to null");
  52493. }
  52494. }
  52495. return options;
  52496. };
  52497. exports.normaliseOptions = normaliseOptions;
  52498. /***/ }),
  52499. /* 614 */
  52500. /***/ (function(module, exports, __webpack_require__) {
  52501. "use strict";
  52502. const _require = __webpack_require__(3),
  52503. name = _require.name,
  52504. version = _require.version;
  52505. const browserRejectsOptionalMandatory = __webpack_require__(253);
  52506. module.exports = function usingOptionalMandatoryStyleFactory(_temp) {
  52507. let _ref = _temp === void 0 ? {} : _temp,
  52508. _ref$navigator = _ref.navigator,
  52509. navigator = _ref$navigator === void 0 ? window.navigator : _ref$navigator;
  52510. return function usingOptionalMandatoryStyle(isScreenSharing) {
  52511. return (// screen sharing should not be optionalMandatory in later chome or FF or chromium edge
  52512. // see https://bugzilla.mozilla.org/show_bug.cgi?id=1321221 for firefox getDisplayMedia
  52513. // see https://w3c.github.io/mediacapture-screen-share/#displaymediastreamconstraints for updated getDisplayMedia
  52514. // see https://blog.addpipe.com/standards-compliant-screen-capture-in-chrome-72/ chrome constraint info
  52515. isScreenSharing && !browserRejectsOptionalMandatory || // Internet Explorer
  52516. !(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) || // Chrome <=60 doesn't accept ideal constraints and advanced
  52517. // constraints are ignored by Firefox and broken by adapter.js
  52518. // so we revert to optional/mandatory style. This has been
  52519. // updated in Chrome 61.
  52520. // See OPENTOK-32149, OPENTOK-32129 and OPENTOK-32655
  52521. // Fixed in adapter.js: https://github.com/webrtc/adapter/issues/553
  52522. name === 'Chrome' && version < 61
  52523. );
  52524. };
  52525. };
  52526. /***/ }),
  52527. /* 615 */
  52528. /***/ (function(module, exports, __webpack_require__) {
  52529. "use strict";
  52530. /* eslint-disable global-require */
  52531. module.exports = function getUserMediaFactory(deps) {
  52532. if (deps === void 0) {
  52533. deps = {};
  52534. }
  52535. ['processPubOptions'].forEach(key => {
  52536. if (!deps[key]) {
  52537. throw new Error(key + " dependency must be injected into OT.getUserMedia");
  52538. }
  52539. });
  52540. const logging = deps.logging || __webpack_require__(1)('getUserMedia');
  52541. const _deps = deps,
  52542. processPubOptions = _deps.processPubOptions;
  52543. /**
  52544. * Gets a MediaStream object that uses a microphone and camera as the audio and video source.
  52545. * This method returns a promise that is resolved when the user has granted permission to
  52546. * use the camera or microphone (or both) and the MediaStream object is available. The
  52547. * promise is rejected if there is an error in getting the media or if the end user denies
  52548. * access to the camera or microphone.
  52549. * <p>
  52550. * You can use this method to get MediaStreamTrack objects to pass into the
  52551. * <code>audioSource</code> and <code>videoSource</code> options of the
  52552. * <a href="OT.html#initPublisher">OT.initPublisher()</a> method. For example, call this method
  52553. * to get a MediaStream that uses the microphone and camera as the audio and video sources. Then
  52554. * you can call <code>getVideoTracks()[0]</code> on the MediaStream object to get a video
  52555. * MediaStreamTrack object for the camera's video. You can then add the video MediaStreamTrack
  52556. * as a source for an HTML Video element, draw that Video element into an HTML Canvas element, and
  52557. * apply video filters or effects to the Canvas. Then you can call the <code>captureStream()</code>
  52558. * method of the HTMLCanvasElement object to get a MediaStream object and call
  52559. * <code>getVideoTracks()[0]</code> on the MediaStream object to get a video MediaStreamTrack
  52560. * object (with the video filters or effects applied). Finally, you can use the video
  52561. * MediaStreamTrack object as the <code>videoSource</code> property of the options you pass
  52562. * into <code>OT.initPublisher()</code>. The OpenTok Publisher will use the
  52563. * video track (with the filters and effects applied) as the video source.
  52564. * </p>
  52565. *
  52566. * @param {Object} options <p>(optional) Defines settings for the MediaStream object.
  52567. * The options are the same as those defined for the
  52568. * <a href="OT.html#initPublisher">OT.initPublisher()</a> method. However, only the following
  52569. * properties apply for <code>OT.getUserMedia()</code>:
  52570. * </p>
  52571. * <p>
  52572. * <ul>
  52573. * <li><code>audioSource</code></li>
  52574. * <li><code>enableStereo</code></li>
  52575. * <li><code>disableAudioProcessing</code></li>
  52576. * <li><code>facingMode</code></li>
  52577. * <li><code>frameRate</code></li>
  52578. * <li><code>maxResolution</code></li>
  52579. * <li><code>resolution</code></li>
  52580. * <li><code>videoSource</code></li>
  52581. * </ul>
  52582. * </p>
  52583. *
  52584. * @return {Promise} A promise that is resolved when the user has granted permission to
  52585. * use the camera or microphone (or both) and the MediaStream object is available. The
  52586. * promise is rejected if there is an error in getting the media, if the end user denies
  52587. * access to the camera or microphone, or if the method is called on Internet Explorer.
  52588. *
  52589. * @see The options (especially <code>audioSource</code> and <code>videoSource</code>) of the
  52590. * <a href="OT.html#initPublisher">OT.initPublisher()</a> method
  52591. *
  52592. * @method OT.getUserMedia
  52593. * @memberof OT
  52594. */
  52595. const getUserMedia = function getUserMedia(pubOptions) {
  52596. if (pubOptions === void 0) {
  52597. pubOptions = {};
  52598. }
  52599. const processedOptions = processPubOptions(pubOptions, 'OT.getUserMedia', () => false);
  52600. return processedOptions.getUserMedia().catch(err => {
  52601. logging.error("OT.getUserMedia failed to getUserMedia: " + err);
  52602. throw err;
  52603. });
  52604. };
  52605. return getUserMedia;
  52606. };
  52607. /***/ }),
  52608. /* 616 */
  52609. /***/ (function(module, exports, __webpack_require__) {
  52610. "use strict";
  52611. module.exports = function destroyObj(name, obj) {
  52612. const throwErr = (action, key) => () => {
  52613. throw new Error("Cannot " + action + " " + key + ", " + name + " is destroyed");
  52614. };
  52615. Object.keys(obj).forEach(key => {
  52616. if (typeof obj[key] === 'function') {
  52617. // eslint-disable-next-line no-param-reassign
  52618. obj[key] = throwErr('call', key);
  52619. } else {
  52620. Object.defineProperty(obj, key, {
  52621. get: throwErr('get', key),
  52622. set: throwErr('set', key)
  52623. });
  52624. }
  52625. });
  52626. };
  52627. /***/ }),
  52628. /* 617 */
  52629. /***/ (function(module, exports, __webpack_require__) {
  52630. "use strict";
  52631. /* eslint-disable no-underscore-dangle */
  52632. module.exports = el => {
  52633. if ('srcObject' in el) {
  52634. return;
  52635. }
  52636. const URL = window && window.URL;
  52637. if ('srcObject' in window.HTMLMediaElement.prototype) {
  52638. return;
  52639. } // Shim the srcObject property, once, when HTMLMediaElement is found.
  52640. Object.defineProperty(el, 'srcObject', {
  52641. get() {
  52642. return this._srcObject;
  52643. },
  52644. set(stream) {
  52645. const self = this; // Use _srcObject as a private property for this shim
  52646. this._srcObject = stream;
  52647. if (this.src) {
  52648. URL.revokeObjectURL(this.src);
  52649. }
  52650. if (!stream) {
  52651. this.src = '';
  52652. return undefined;
  52653. }
  52654. this.src = URL.createObjectURL(stream); // We need to recreate the blob url when a track is added or
  52655. // removed. Doing it manually since we want to avoid a recursion.
  52656. stream.addEventListener('addtrack', () => {
  52657. if (self.src) {
  52658. URL.revokeObjectURL(self.src);
  52659. }
  52660. self.src = URL.createObjectURL(stream);
  52661. });
  52662. stream.addEventListener('removetrack', () => {
  52663. if (self.src) {
  52664. URL.revokeObjectURL(self.src);
  52665. }
  52666. self.src = URL.createObjectURL(stream);
  52667. });
  52668. return this._srcObject;
  52669. }
  52670. });
  52671. };
  52672. /***/ }),
  52673. /* 618 */
  52674. /***/ (function(module, exports, __webpack_require__) {
  52675. "use strict";
  52676. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  52677. /* eslint-disable no-underscore-dangle, no-param-reassign */
  52678. const defineProperties = __webpack_require__(102);
  52679. const OTHelpers = __webpack_require__(4);
  52680. const VideoOrientationTransforms = {
  52681. 0: 'rotate(0deg)',
  52682. 270: 'rotate(90deg)',
  52683. 90: 'rotate(-90deg)',
  52684. 180: 'rotate(180deg)'
  52685. }; // A mixin to create the orientation API implementation on +self+
  52686. // +getDomElementCallback+ is a function that the mixin will call when it wants to
  52687. // get the native Dom element for +self+.
  52688. //
  52689. // +initialOrientation+ sets the initial orientation (shockingly), it's currently unused
  52690. // so the initial value is actually undefined.
  52691. //
  52692. module.exports = function canBeOrientatedMixin(self, getDomElementCallback, initialOrientation) {
  52693. let _orientation = initialOrientation;
  52694. defineProperties(self, {
  52695. isRotated: {
  52696. get() {
  52697. return this.orientation() && (this.orientation().videoOrientation === 270 || this.orientation().videoOrientation === 90);
  52698. }
  52699. },
  52700. // @todo I don't think we need vendor prefixes at all anymore.
  52701. orientation: {
  52702. get() {
  52703. return _orientation;
  52704. },
  52705. set(orientation) {
  52706. _orientation = orientation;
  52707. const transform = VideoOrientationTransforms[orientation.videoOrientation] || VideoOrientationTransforms.ROTATED_NORMAL;
  52708. switch (OTHelpers.env.name) {
  52709. case 'Chrome':
  52710. case 'Safari':
  52711. getDomElementCallback().style.webkitTransform = transform;
  52712. break;
  52713. default:
  52714. // The standard version, just Firefox, Opera, and Edge
  52715. getDomElementCallback().style.transform = transform;
  52716. }
  52717. self.trigger('orientationChanged', _orientation);
  52718. }
  52719. },
  52720. // see https://wiki.mozilla.org/WebAPI/AudioChannels
  52721. // The audioChannelType is currently only available in Firefox. This property returns
  52722. // "unknown" in other browser. The related HTML tag attribute is "mozaudiochannel"
  52723. audioChannelType: {
  52724. get() {
  52725. if ('mozAudioChannelType' in this.domElement) {
  52726. return this.domElement.mozAudioChannelType;
  52727. }
  52728. return 'unknown';
  52729. },
  52730. set(type) {
  52731. if ('mozAudioChannelType' in this.domElement) {
  52732. this.domElement.mozAudioChannelType = type;
  52733. }
  52734. }
  52735. }
  52736. });
  52737. };
  52738. /***/ }),
  52739. /* 619 */
  52740. /***/ (function(module, exports, __webpack_require__) {
  52741. "use strict";
  52742. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  52743. /* eslint-disable no-use-before-define */
  52744. module.exports = function listenForTracksEndedFactory() {
  52745. function isEveryTrackEnded(stream) {
  52746. return stream.getTracks().every(track => track.readyState === 'ended');
  52747. }
  52748. return function listenForTracksEnded(stream, onAllEnded, onSingleEnded) {
  52749. const tracks = [];
  52750. function singleTrackEndedHandler(event) {
  52751. // We wait a fraction of a second for all ended events to be emitted before
  52752. // determining if all tracks have ended or just a subset of them.
  52753. setTimeout(() => {
  52754. if (!tracks.length) {
  52755. return;
  52756. }
  52757. if (isEveryTrackEnded(stream)) {
  52758. removeAllTrackListeners();
  52759. if (typeof onAllEnded === 'function') {
  52760. onAllEnded();
  52761. }
  52762. } else {
  52763. const track = event.target;
  52764. removeTrackListener(track);
  52765. if (typeof onSingleEnded === 'function') {
  52766. onSingleEnded(track);
  52767. }
  52768. }
  52769. }, 100);
  52770. }
  52771. function removeTrackListener(track) {
  52772. if (track.removeEventListener) {
  52773. track.removeEventListener('ended', singleTrackEndedHandler);
  52774. }
  52775. if (track.onended === singleTrackEndedHandler) {
  52776. track.onended = null; // eslint-disable-line no-param-reassign
  52777. }
  52778. const index = tracks.indexOf(track);
  52779. if (index >= 0) {
  52780. tracks.splice(index, 1);
  52781. }
  52782. }
  52783. function removeAllTrackListeners() {
  52784. tracks.slice().forEach(removeTrackListener);
  52785. }
  52786. function addTrackListeners() {
  52787. stream.getTracks().forEach(track => {
  52788. tracks.push(track);
  52789. track.onended = singleTrackEndedHandler; // eslint-disable-line no-param-reassign
  52790. if (track.addEventListener) {
  52791. track.addEventListener('ended', singleTrackEndedHandler);
  52792. }
  52793. });
  52794. }
  52795. addTrackListeners();
  52796. return {
  52797. stop: removeAllTrackListeners,
  52798. refresh: () => {
  52799. removeAllTrackListeners();
  52800. addTrackListeners();
  52801. }
  52802. };
  52803. };
  52804. };
  52805. /***/ }),
  52806. /* 620 */
  52807. /***/ (function(module, exports, __webpack_require__) {
  52808. var baseAssignValue = __webpack_require__(60),
  52809. baseForOwn = __webpack_require__(93),
  52810. baseIteratee = __webpack_require__(29);
  52811. /**
  52812. * Creates an object with the same keys as `object` and values generated
  52813. * by running each own enumerable string keyed property of `object` thru
  52814. * `iteratee`. The iteratee is invoked with three arguments:
  52815. * (value, key, object).
  52816. *
  52817. * @static
  52818. * @memberOf _
  52819. * @since 2.4.0
  52820. * @category Object
  52821. * @param {Object} object The object to iterate over.
  52822. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  52823. * @returns {Object} Returns the new mapped object.
  52824. * @see _.mapKeys
  52825. * @example
  52826. *
  52827. * var users = {
  52828. * 'fred': { 'user': 'fred', 'age': 40 },
  52829. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  52830. * };
  52831. *
  52832. * _.mapValues(users, function(o) { return o.age; });
  52833. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  52834. *
  52835. * // The `_.property` iteratee shorthand.
  52836. * _.mapValues(users, 'age');
  52837. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  52838. */
  52839. function mapValues(object, iteratee) {
  52840. var result = {};
  52841. iteratee = baseIteratee(iteratee, 3);
  52842. baseForOwn(object, function(value, key, object) {
  52843. baseAssignValue(result, key, iteratee(value, key, object));
  52844. });
  52845. return result;
  52846. }
  52847. module.exports = mapValues;
  52848. /***/ }),
  52849. /* 621 */
  52850. /***/ (function(module, exports, __webpack_require__) {
  52851. "use strict";
  52852. /*
  52853. * Installs a watcher that will calls the given callback if the audio acquisition seems to not
  52854. * work porperly.
  52855. *
  52856. * It waits 3 seconds and poll getStats to find any sign of audio bytes sent. If it can't find any
  52857. * it signals the anomaly by executing the given function.
  52858. *
  52859. * @param {function(cb: function(DOMError, Array<RTCStats>))} getStats
  52860. * the function to call to get the stats
  52861. * @param {function} warningCb to be called when a potential problem is detected
  52862. * @returns {function} cancel the watch
  52863. */
  52864. module.exports = function watchAudioAcquisition(getStats, warningCb) {
  52865. // detection of Chrome failure to acquire audio
  52866. // inspired by https://medium.com/the-making-of-appear-in/working-around-webrtc-bugs-d4f6fdb763f
  52867. const to = setTimeout(() => {
  52868. getStats((error, rtcStatsItems) => {
  52869. if (error) {
  52870. return;
  52871. }
  52872. for (let idxStats = 0; idxStats < rtcStatsItems.length; idxStats += 1) {
  52873. const rtcStats = rtcStatsItems[idxStats];
  52874. if (rtcStats.id.indexOf('_send') !== -1 && rtcStats.type === 'ssrc' && rtcStats.mediaType === 'audio' && parseInt(rtcStats.bytesSent, 10) === 0) {
  52875. // abnormal condition detected
  52876. warningCb();
  52877. }
  52878. }
  52879. });
  52880. }, 3000);
  52881. return function cancel() {
  52882. clearTimeout(to);
  52883. };
  52884. };
  52885. /***/ }),
  52886. /* 622 */
  52887. /***/ (function(module, exports, __webpack_require__) {
  52888. "use strict";
  52889. /* WEBPACK VAR INJECTION */(function(Promise) {
  52890. /* eslint-disable global-require */
  52891. const Analytics = __webpack_require__(54);
  52892. const defaultAnalytics = new Analytics();
  52893. module.exports = function reportIssueFactory(deps) {
  52894. if (deps === void 0) {
  52895. deps = {};
  52896. }
  52897. /** @type defaultAnalytics */
  52898. const analytics = deps.analytics || defaultAnalytics;
  52899. const errors = deps.errors || __webpack_require__(8);
  52900. const ExceptionCodes = deps.ExceptionCodes || __webpack_require__(11);
  52901. const otError = deps.otError || __webpack_require__(12)();
  52902. const sessionObjects = deps.sessionObjects || __webpack_require__(22);
  52903. const uuid = deps.uuid || __webpack_require__(15);
  52904. /**
  52905. * Report that your app experienced an issue. You can use the issue ID with
  52906. * <a href="http://tokbox.com/developer/tools/Inspector">Inspector</a> or when discussing
  52907. * an issue with the TokBox support team.
  52908. *
  52909. * @param completionHandler {Function} A function that is called when the call to this method
  52910. * succeeds or fails. This function has two parameters. The first parameter is an
  52911. * <a href="Error.html">Error</a> object that is set when the call to the
  52912. * <code>reportIssue()</code> method fails (for example, if the client is not connected to the
  52913. * network) or <code>null</code> when the call to the <code>reportIssue()</code> method succeeds.
  52914. * The second parameter is set to the report ID (a unique string) when the call succeeds.
  52915. *
  52916. * @method OT.reportIssue
  52917. * @memberof OT
  52918. */
  52919. return function reportIssue(completionHandler) {
  52920. if (completionHandler === void 0) {
  52921. completionHandler = () => {};
  52922. }
  52923. const reportIssueId = uuid();
  52924. function onDone(err) {
  52925. if (err) {
  52926. completionHandler(otError(errors.REPORT_ISSUE_FAILED, new Error('Error calling OT.reportIssue(). Check the client\'s network connection.'), ExceptionCodes.REPORT_ISSUE_ERROR));
  52927. } else {
  52928. completionHandler(null, reportIssueId);
  52929. }
  52930. }
  52931. if (sessionObjects.sessions.length() === 0) {
  52932. analytics.logEvent({
  52933. action: 'ReportIssue',
  52934. variation: 'Event',
  52935. payload: {
  52936. reportIssueId
  52937. }
  52938. }, null, onDone);
  52939. } else {
  52940. Promise.all(sessionObjects.sessions.map(session => session.reportIssue({
  52941. id: reportIssueId
  52942. }))).then(() => onDone(), err => onDone(err));
  52943. }
  52944. };
  52945. };
  52946. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  52947. /***/ }),
  52948. /* 623 */
  52949. /***/ (function(module, exports, __webpack_require__) {
  52950. "use strict";
  52951. // Test via a getter in the options object to see if the passive property is accessed
  52952. // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
  52953. module.exports = (_ref) => {
  52954. let window = _ref.window;
  52955. let supportsPassive = false;
  52956. try {
  52957. const opts = Object.defineProperty({}, 'passive', {
  52958. get() {
  52959. supportsPassive = true;
  52960. }
  52961. });
  52962. window.addEventListener('testPassive', null, opts);
  52963. window.removeEventListener('testPassive', null, opts);
  52964. } catch (e) {} // eslint-disable-line no-empty
  52965. return supportsPassive;
  52966. };
  52967. /***/ }),
  52968. /* 624 */
  52969. /***/ (function(module, exports, __webpack_require__) {
  52970. "use strict";
  52971. module.exports = function iOSVersion() {
  52972. const match = navigator.userAgent.match(/OS (\d+_\d+) like Mac/);
  52973. if (match === null || !match[1]) {
  52974. return undefined;
  52975. }
  52976. return match[1].replace('_', '.');
  52977. };
  52978. /***/ }),
  52979. /* 625 */
  52980. /***/ (function(module, exports, __webpack_require__) {
  52981. "use strict";
  52982. // Matches 1, 0.3, 1.1.1, 4.1.5.7, etc.
  52983. const versionRegex = /^[0-9]+(\.[0-9]+)*$/;
  52984. /**
  52985. * versionGreaterThan - Returns true if version1 is greater than version2
  52986. *
  52987. * @param {String} version1 The version to compare from
  52988. * @param {String} version2 The version to compare to
  52989. *
  52990. */
  52991. module.exports = function versionGreaterThan(version1, version2) {
  52992. if (!versionRegex.test(version1) || !versionRegex.test(version2)) {
  52993. throw new Error('could not recognize version');
  52994. }
  52995. const v1 = String(version1).split('.').map(Number);
  52996. const v2 = String(version2).split('.').map(Number); // There is a way to nicely compare arrays of different lengths, but in our case, if there is a
  52997. // mismatch, it indicates something went wrong. So we throw instead.
  52998. if (v1.length !== v2.length) {
  52999. throw new Error('versions must be same length');
  53000. }
  53001. const len = v1.length;
  53002. for (let i = 0; i < len; i += 1) {
  53003. // Continue until we find a pair that doesn't match.
  53004. // The first mismatched pair determines the overall result.
  53005. if (v1[i] !== v2[i]) {
  53006. return v1[i] > v2[i];
  53007. }
  53008. } // If all the pieces are equal, then the versions should be equal.
  53009. if (version1 !== version2) {
  53010. throw new Error('versions should be equal');
  53011. } // And since they're equal, version1 is not greater than version2.
  53012. return false;
  53013. };
  53014. /***/ }),
  53015. /* 626 */
  53016. /***/ (function(module, exports, __webpack_require__) {
  53017. "use strict";
  53018. Object.defineProperty(exports, "__esModule", {
  53019. value: true
  53020. });
  53021. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  53022. var _CancellationError = __webpack_require__(287);
  53023. var _CancellationError2 = _interopRequireDefault(_CancellationError);
  53024. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  53025. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53026. var noop = function noop() {};
  53027. var Cancellation = function () {
  53028. function Cancellation() {
  53029. _classCallCheck(this, Cancellation);
  53030. this.internalIsCanceled = false;
  53031. this.listeners = [];
  53032. }
  53033. _createClass(Cancellation, [{
  53034. key: 'isCanceled',
  53035. /**
  53036. * Returns `true` if cancellation has been requested; otherwise, returns `false`.
  53037. */
  53038. value: function isCanceled() {
  53039. return this.internalIsCanceled;
  53040. }
  53041. /**
  53042. * Issues a cancellation request.
  53043. *
  53044. * It is safe to call this method multiple times since all but the first call are ignored.
  53045. */
  53046. }, {
  53047. key: 'cancel',
  53048. value: function cancel() {
  53049. // Return if cancellation has already been requested.
  53050. if (this.internalIsCanceled) {
  53051. return;
  53052. }
  53053. this.internalIsCanceled = true;
  53054. // Notify and remove listeners
  53055. this.listeners.forEach(function (listener) {
  53056. return listener();
  53057. });
  53058. this.listeners = null;
  53059. }
  53060. /**
  53061. * Throws a `CancellationError` if cancellation has been requested.
  53062. */
  53063. }, {
  53064. key: 'throwIfCanceled',
  53065. value: function throwIfCanceled() {
  53066. if (this.internalIsCanceled) {
  53067. throw new _CancellationError2.default('Operation has been canceled.');
  53068. }
  53069. }
  53070. /**
  53071. * Adds a listener to be notified when cancellation is requested.
  53072. *
  53073. * @param {Function} listener The function to be called when cancellation is requested.
  53074. * @returns {Function} A function that, when called, removes the listener.
  53075. */
  53076. }, {
  53077. key: 'onCancel',
  53078. value: function onCancel(listener) {
  53079. var _this = this;
  53080. if (this.internalIsCanceled) {
  53081. return noop;
  53082. }
  53083. this.listeners.push(listener);
  53084. return function () {
  53085. if (_this.listeners) {
  53086. var index = _this.listeners.indexOf(listener);
  53087. if (index !== -1) {
  53088. _this.listeners.splice(index, 1);
  53089. }
  53090. }
  53091. };
  53092. }
  53093. /**
  53094. * Creates a child `Cancellation` object.
  53095. *
  53096. * @returns {Cancellation}
  53097. */
  53098. }, {
  53099. key: 'fork',
  53100. value: function fork() {
  53101. if (this.internalIsCanceled) {
  53102. return Cancellation.CANCELED;
  53103. }
  53104. var child = new Cancellation();
  53105. this.onCancel(function () {
  53106. return child.cancel();
  53107. });
  53108. return child;
  53109. }
  53110. }]);
  53111. return Cancellation;
  53112. }();
  53113. /*
  53114. * A `Cancellation` object that is already in the canceled state.
  53115. */
  53116. exports.default = Cancellation;
  53117. Cancellation.CANCELED = new Cancellation();
  53118. Cancellation.CANCELED.internalIsCanceled = true;
  53119. /***/ }),
  53120. /* 627 */
  53121. /***/ (function(module, exports, __webpack_require__) {
  53122. "use strict";
  53123. /* WEBPACK VAR INJECTION */(function(Promise) {
  53124. const eventHelper = __webpack_require__(59);
  53125. const promiseFinally = __webpack_require__(288).default;
  53126. const pTimeout = __webpack_require__(149); // eslint-disable-next-line no-unused-vars
  53127. const typeVideoElementFacade = __webpack_require__(104)();
  53128. /**
  53129. * Returns a Promise that will resolve when the video resolution is greater than
  53130. * 2 in either dimension, or a timeout occurs.
  53131. *
  53132. * @param {typeVideoElementFacade} videoElementFacade
  53133. * @param {Number} timeoutMs
  53134. *
  53135. * @returns Promise<Boolean> true if resolution succeeded, false otherwise
  53136. */
  53137. function waitForCorrectResolution(videoElementFacade, timeoutMs) {
  53138. const videoElementFacadeEvents = eventHelper(videoElementFacade);
  53139. const promise = new Promise(resolve => {
  53140. const checkResolution = () => {
  53141. if (videoElementFacade.videoWidth() > 2 || videoElementFacade.videoHeight() > 2) {
  53142. resolve(true);
  53143. }
  53144. };
  53145. videoElementFacadeEvents.on('videoDimensionsChanged', checkResolution);
  53146. checkResolution();
  53147. });
  53148. return promiseFinally(pTimeout(promise, timeoutMs, () => false), () => videoElementFacadeEvents.removeAll());
  53149. }
  53150. module.exports = waitForCorrectResolution;
  53151. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  53152. /***/ }),
  53153. /* 628 */
  53154. /***/ (function(module, exports, __webpack_require__) {
  53155. "use strict";
  53156. /* WEBPACK VAR INJECTION */(function(Promise) {
  53157. const eventHelper = __webpack_require__(59);
  53158. const promiseFinally = __webpack_require__(288).default;
  53159. const pTimeout = __webpack_require__(149); // eslint-disable-next-line no-unused-vars
  53160. const typeVideoElementFacade = __webpack_require__(104)();
  53161. /**
  53162. * Wait for the video to be playing
  53163. *
  53164. * @param {typeVideoElementFacade} videoElementFacade
  53165. * @param {Number} maxWaitTime
  53166. *
  53167. * @returns Promise<Boolean> true if we think the video is playing, false if we timeout
  53168. */
  53169. function waitForVideoToBePlaying(videoElementFacade, maxWaitTime) {
  53170. if (maxWaitTime === void 0) {
  53171. maxWaitTime = 5000;
  53172. }
  53173. const videoElementFacadeEvents = eventHelper(videoElementFacade);
  53174. const promise = new Promise(resolve => {
  53175. videoElementFacadeEvents.on('timeupdate', resolve);
  53176. videoElementFacadeEvents.on('loadedmetadata', resolve);
  53177. });
  53178. return promiseFinally(pTimeout(promise, maxWaitTime, () => false), () => videoElementFacadeEvents.removeAll());
  53179. }
  53180. module.exports = waitForVideoToBePlaying;
  53181. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  53182. /***/ }),
  53183. /* 629 */
  53184. /***/ (function(module, exports, __webpack_require__) {
  53185. "use strict";
  53186. const log = __webpack_require__(1)('WidgetView:fixMini');
  53187. const miniWidth = 128;
  53188. const miniHeight = 128;
  53189. const microWidth = 64;
  53190. const microHeight = 64;
  53191. module.exports = function fixMini(
  53192. /** @type {HTMLElement} */
  53193. container) {
  53194. const clientWidth = container.clientWidth,
  53195. clientHeight = container.clientHeight;
  53196. container.classList.remove('OT_micro');
  53197. container.classList.remove('OT_mini');
  53198. if (clientWidth < microWidth || clientHeight < microHeight) {
  53199. container.classList.add('OT_micro');
  53200. log.debug('OT_micro class added', {
  53201. clientWidth,
  53202. clientHeight,
  53203. microWidth,
  53204. microHeight
  53205. });
  53206. }
  53207. if (clientWidth < miniWidth || clientHeight < miniHeight) {
  53208. container.classList.add('OT_mini');
  53209. log.debug('OT_mini class added', {
  53210. clientWidth,
  53211. clientHeight,
  53212. miniWidth,
  53213. miniHeight
  53214. });
  53215. }
  53216. };
  53217. /***/ }),
  53218. /* 630 */
  53219. /***/ (function(module, exports, __webpack_require__) {
  53220. "use strict";
  53221. const uuid = __webpack_require__(15);
  53222. module.exports = function getOrCreateContainer(elementOrDomId, insertMode) {
  53223. /** @type {HTMLElement} */
  53224. let container;
  53225. let domId;
  53226. if (elementOrDomId && elementOrDomId.nodeName) {
  53227. // It looks like we were given a DOM element. Grab the id or generate
  53228. // one if it doesn't have one.
  53229. container = elementOrDomId;
  53230. if (!container.getAttribute('id') || container.getAttribute('id').length === 0) {
  53231. container.setAttribute('id', "OT_" + uuid());
  53232. }
  53233. domId = container.getAttribute('id');
  53234. } else if (elementOrDomId) {
  53235. // We may have got an id, try and get it's DOM element.
  53236. container = document.getElementById(elementOrDomId);
  53237. if (container) {
  53238. domId = elementOrDomId;
  53239. }
  53240. }
  53241. if (!domId) {
  53242. domId = "OT_" + uuid().replace(/-/g, '_');
  53243. }
  53244. if (!container) {
  53245. container = document.createElement('div');
  53246. container.id = domId;
  53247. container.setAttribute('id', domId);
  53248. container.style.backgroundColor = '#000000';
  53249. document.body.appendChild(container);
  53250. return container;
  53251. }
  53252. const placeHolder = document.createElement('div');
  53253. placeHolder.id = "OT_" + uuid();
  53254. switch (insertMode) {
  53255. case 'append':
  53256. container.appendChild(placeHolder);
  53257. return placeHolder;
  53258. case 'before':
  53259. container.parentNode.insertBefore(placeHolder, container);
  53260. return placeHolder;
  53261. case 'after':
  53262. container.parentNode.insertBefore(placeHolder, container.nextSibling);
  53263. return placeHolder;
  53264. case 'replace':
  53265. default:
  53266. while (container.firstChild) {
  53267. container.removeChild(container.firstChild);
  53268. }
  53269. return container;
  53270. }
  53271. };
  53272. /***/ }),
  53273. /* 631 */
  53274. /***/ (function(module, exports, __webpack_require__) {
  53275. "use strict";
  53276. module.exports = function ensureCSSUnit(measurement, defaultUnit) {
  53277. if (defaultUnit === void 0) {
  53278. defaultUnit = 'px';
  53279. }
  53280. if (String(parseFloat(measurement, 10)) === String(measurement).trim()) {
  53281. return "" + String(measurement).trim() + defaultUnit;
  53282. }
  53283. return measurement;
  53284. };
  53285. /***/ }),
  53286. /* 632 */
  53287. /***/ (function(module, exports, __webpack_require__) {
  53288. "use strict";
  53289. /* WEBPACK VAR INJECTION */(function(Promise) {
  53290. const IntervalRunner = __webpack_require__(71);
  53291. module.exports = function waitUntil(predicate, _temp) {
  53292. let _ref = _temp === void 0 ? {} : _temp,
  53293. _ref$frequency = _ref.frequency,
  53294. frequency = _ref$frequency === void 0 ? 60 : _ref$frequency,
  53295. _ref$timeout = _ref.timeout,
  53296. timeout = _ref$timeout === void 0 ? 2000 : _ref$timeout;
  53297. return new Promise((resolve, reject) => {
  53298. let timeoutTimerId;
  53299. const intervalRunner = new IntervalRunner(() => {
  53300. function tryPredicate() {
  53301. try {
  53302. return predicate();
  53303. } catch (e) {
  53304. console.error('waitUntil encountered an error calling predicate', e);
  53305. return false;
  53306. }
  53307. }
  53308. if (tryPredicate()) {
  53309. clearTimeout(timeoutTimerId);
  53310. intervalRunner.stop();
  53311. resolve();
  53312. }
  53313. }, frequency);
  53314. timeoutTimerId = setTimeout(() => {
  53315. intervalRunner.stop();
  53316. reject(new Error('TIMEOUT'));
  53317. }, timeout);
  53318. intervalRunner.start();
  53319. });
  53320. };
  53321. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  53322. /***/ }),
  53323. /* 633 */
  53324. /***/ (function(module, exports, __webpack_require__) {
  53325. "use strict";
  53326. const otError = __webpack_require__(12)();
  53327. const Errors = __webpack_require__(8);
  53328. const ExceptionCodes = __webpack_require__(11);
  53329. module.exports = err => {
  53330. if (String(err.code) === '404') {
  53331. return otError(Errors.STREAM_NOT_FOUND, new Error('stream not found'), ExceptionCodes.UNABLE_TO_SUBSCRIBE);
  53332. }
  53333. if (String(err.code) === '409') {
  53334. return otError(Errors.STREAM_LIMIT_EXCEEDED, new Error('The limit for concurrent streams in the session has been reached'), ExceptionCodes.STREAM_LIMIT_EXCEEDED);
  53335. }
  53336. return otError(Errors.UNABLE_TO_SUBSCRIBE, new Error("subscriberCreate failed with unexpected code " + err.code + ": " + err.message), ExceptionCodes.UNEXPECTED_SERVER_RESPONSE);
  53337. };
  53338. /***/ }),
  53339. /* 634 */
  53340. /***/ (function(module, exports, __webpack_require__) {
  53341. "use strict";
  53342. const eventNames = __webpack_require__(24);
  53343. const now = __webpack_require__(46);
  53344. const RafRunner = __webpack_require__(101);
  53345. const Events = __webpack_require__(20)();
  53346. module.exports = (_ref) => {
  53347. let subscriber = _ref.subscriber,
  53348. audioLevelSampler = _ref.audioLevelSampler;
  53349. let loudness = 0;
  53350. let loudnessLastAccess;
  53351. const audioLevelRunner = new RafRunner(() => {
  53352. const listenerCount = subscriber.listenerCount(eventNames.AUDIO_LEVEL_UPDATED);
  53353. const shouldStopWatchingAudio = () => now() - loudnessLastAccess > 10000 && listenerCount === 0;
  53354. if (shouldStopWatchingAudio()) {
  53355. audioLevelRunner.stop();
  53356. return;
  53357. }
  53358. loudness = audioLevelSampler.sample();
  53359. if (listenerCount > 0) {
  53360. // dispatch this old event if someone is listening...
  53361. subscriber.dispatchEvent(new Events.AudioLevelUpdatedEvent(loudness));
  53362. }
  53363. });
  53364. Object.defineProperty(subscriber, 'loudness', {
  53365. get() {
  53366. audioLevelRunner.start();
  53367. loudnessLastAccess = now();
  53368. return loudness;
  53369. },
  53370. set() {
  53371. throw new TypeError('Cannot set readonly property loudness');
  53372. }
  53373. });
  53374. if (subscriber.listenerCount(eventNames.AUDIO_LEVEL_UPDATED)) {
  53375. audioLevelRunner.start();
  53376. }
  53377. subscriber.on('audioLevelUpdated:added', () => {
  53378. audioLevelRunner.start();
  53379. });
  53380. subscriber.once(eventNames.SUBSCRIBER_DESTROYED, () => {
  53381. audioLevelRunner.stop();
  53382. });
  53383. return {
  53384. destroy() {
  53385. audioLevelSampler.destroy();
  53386. audioLevelRunner.stop();
  53387. }
  53388. };
  53389. };
  53390. /***/ }),
  53391. /* 635 */
  53392. /***/ (function(module, exports, __webpack_require__) {
  53393. "use strict";
  53394. const env = __webpack_require__(3); // @todo can we test for this instead?
  53395. module.exports = () => ['Chrome', 'Opera', 'Safari'].indexOf(env.name) > -1;
  53396. /***/ }),
  53397. /* 636 */
  53398. /***/ (function(module, exports, __webpack_require__) {
  53399. "use strict";
  53400. const _require = __webpack_require__(3),
  53401. name = _require.name; // @todo can we test for these?
  53402. module.exports = () => ['Firefox', 'Safari', 'Edge', 'Chrome', 'Opera'].indexOf(name) > -1;
  53403. /***/ }),
  53404. /* 637 */
  53405. /***/ (function(module, exports, __webpack_require__) {
  53406. "use strict";
  53407. const Widget = __webpack_require__(34);
  53408. const OTHelpers = __webpack_require__(4);
  53409. module.exports = function VideoDisabledIndicator(options) {
  53410. let videoDisabled = false;
  53411. let warning = false;
  53412. const updateClasses = function (element) {
  53413. const shouldDisplay = ['auto', 'on'].indexOf(this.getDisplayMode()) > -1;
  53414. OTHelpers.removeClass(element, 'OT_video-disabled OT_video-disabled-warning OT_active');
  53415. if (!shouldDisplay) {
  53416. return;
  53417. }
  53418. if (videoDisabled) {
  53419. OTHelpers.addClass(element, 'OT_video-disabled');
  53420. } else if (warning) {
  53421. OTHelpers.addClass(element, 'OT_video-disabled-warning');
  53422. }
  53423. OTHelpers.addClass(element, 'OT_active');
  53424. }.bind(this);
  53425. this.disableVideo = function (value) {
  53426. videoDisabled = value;
  53427. if (value === true) {
  53428. warning = false;
  53429. }
  53430. updateClasses(this.domElement);
  53431. };
  53432. this.setWarning = function (value) {
  53433. warning = value;
  53434. updateClasses(this.domElement);
  53435. }; // Mixin common widget behaviour
  53436. Widget(this, {
  53437. mode: options.mode || 'auto',
  53438. nodeName: 'div',
  53439. htmlAttributes: {
  53440. className: 'OT_video-disabled-indicator'
  53441. }
  53442. });
  53443. const parentSetDisplayMode = this.setDisplayMode.bind(this);
  53444. this.setDisplayMode = function (mode) {
  53445. parentSetDisplayMode(mode);
  53446. updateClasses(this.domElement);
  53447. };
  53448. };
  53449. /***/ }),
  53450. /* 638 */
  53451. /***/ (function(module, exports, __webpack_require__) {
  53452. "use strict";
  53453. const Widget = __webpack_require__(34);
  53454. const OTHelpers = __webpack_require__(4);
  53455. module.exports = function AudioBlockedIndicator(options) {
  53456. let audioBlocked = false;
  53457. const updateClasses = element => {
  53458. const shouldDisplay = ['auto', 'on'].indexOf(this.getDisplayMode()) > -1;
  53459. OTHelpers.removeClass(element, ['OT_audio-blocked', 'OT_active'].join(' '));
  53460. if (!shouldDisplay) {
  53461. return;
  53462. }
  53463. if (audioBlocked) {
  53464. OTHelpers.addClass(element, 'OT_audio-blocked');
  53465. }
  53466. OTHelpers.addClass(element, 'OT_active');
  53467. };
  53468. this.setAudioBlocked = value => {
  53469. audioBlocked = value;
  53470. updateClasses(this.domElement);
  53471. }; // Mixin common widget behaviour
  53472. Widget(this, {
  53473. mode: options.mode || 'auto',
  53474. nodeName: 'div',
  53475. htmlAttributes: {
  53476. className: 'OT_audio-blocked-indicator'
  53477. }
  53478. });
  53479. const parentSetDisplayMode = this.setDisplayMode.bind(this);
  53480. this.setDisplayMode = mode => {
  53481. parentSetDisplayMode(mode);
  53482. updateClasses(this.domElement);
  53483. };
  53484. };
  53485. /***/ }),
  53486. /* 639 */
  53487. /***/ (function(module, exports, __webpack_require__) {
  53488. "use strict";
  53489. const Widget = __webpack_require__(34);
  53490. const OTHelpers = __webpack_require__(4);
  53491. module.exports = function VideoUnsupportedIndicator(options) {
  53492. let videoUnsupported = false;
  53493. const updateClasses = element => {
  53494. const shouldDisplay = ['auto', 'on'].indexOf(this.getDisplayMode()) > -1;
  53495. OTHelpers.removeClass(element, ['OT_active'].join(' '));
  53496. if (!shouldDisplay || !videoUnsupported) {
  53497. return;
  53498. }
  53499. OTHelpers.addClass(element, 'OT_active');
  53500. };
  53501. this.setVideoUnsupported = value => {
  53502. videoUnsupported = value;
  53503. updateClasses(this.domElement);
  53504. }; // Mixin common widget behaviour
  53505. Widget(this, {
  53506. mode: options.mode || 'auto',
  53507. nodeName: 'div',
  53508. htmlAttributes: {
  53509. className: 'OT_video-unsupported'
  53510. },
  53511. htmlContent: '<div class="OT_video-unsupported-bar"></div>' + '<div class="OT_video-unsupported-img"></div>' + '<span class="OT_video-unsupported-text">' + 'Video format not supported' + '</span>'
  53512. });
  53513. const parentSetDisplayMode = this.setDisplayMode.bind(this);
  53514. this.setDisplayMode = mode => {
  53515. parentSetDisplayMode(mode);
  53516. updateClasses(this.domElement);
  53517. };
  53518. };
  53519. /***/ }),
  53520. /* 640 */
  53521. /***/ (function(module, exports, __webpack_require__) {
  53522. "use strict";
  53523. const pick = __webpack_require__(42);
  53524. const assign = __webpack_require__(6);
  53525. const find = __webpack_require__(58);
  53526. const getStatsHelpers = __webpack_require__(72);
  53527. const watchFrameRate = function watchFrameRate(getStats, delay) {
  53528. if (delay === void 0) {
  53529. delay = 5000;
  53530. }
  53531. let timeoutId;
  53532. let destroyed = false;
  53533. const lastStat = {};
  53534. const getVideoTrackStat = function getVideoTrackStat(stats) {
  53535. if (stats === void 0) {
  53536. stats = [];
  53537. }
  53538. return find(stats, stat => getStatsHelpers.isVideoTrackStat(stat));
  53539. };
  53540. const calculateFrameRate = function calculateFrameRate(_temp) {
  53541. let _ref = _temp === void 0 ? {} : _temp,
  53542. timestamp = _ref.timestamp,
  53543. framesDecoded = _ref.framesDecoded;
  53544. if (framesDecoded >= lastStat.framesDecoded && timestamp > lastStat.timestamp) {
  53545. return (framesDecoded - lastStat.framesDecoded) / ((timestamp - lastStat.timestamp) / 1000);
  53546. }
  53547. return 0;
  53548. };
  53549. (function query() {
  53550. if (destroyed) {
  53551. return;
  53552. }
  53553. getStats((error, stats) => {
  53554. if (destroyed) {
  53555. return;
  53556. }
  53557. if (!error) {
  53558. const stat = getVideoTrackStat(stats);
  53559. if (stat) {
  53560. assign(lastStat, pick(stat, ['timestamp', 'framesDecoded']));
  53561. } else if (!lastStat.timestamp) {
  53562. assign(lastStat, {
  53563. timestamp: Date.now(),
  53564. framesDecoded: 0
  53565. });
  53566. }
  53567. }
  53568. timeoutId = setTimeout(query, delay);
  53569. });
  53570. })();
  53571. return {
  53572. getFrameRateFromStats(stats) {
  53573. const stat = getVideoTrackStat(stats);
  53574. return calculateFrameRate(stat);
  53575. },
  53576. destroy() {
  53577. destroyed = true;
  53578. if (timeoutId) {
  53579. clearTimeout(timeoutId);
  53580. timeoutId = null;
  53581. }
  53582. }
  53583. };
  53584. };
  53585. module.exports = watchFrameRate;
  53586. /***/ }),
  53587. /* 641 */
  53588. /***/ (function(module, exports, __webpack_require__) {
  53589. "use strict";
  53590. module.exports = (_ref) => {
  53591. let connectivityState = _ref.connectivityState,
  53592. onWarning = _ref.onWarning,
  53593. onTimeout = _ref.onTimeout,
  53594. warningMs = _ref.warningMs,
  53595. timeoutMs = _ref.timeoutMs;
  53596. const timeoutIds = [];
  53597. const cancelBindGuards = () => {
  53598. timeoutIds.forEach(timeoutId => clearTimeout(timeoutId));
  53599. };
  53600. connectivityState.observe({
  53601. onEnterConnecting() {
  53602. timeoutIds.push(setTimeout(onWarning, warningMs), setTimeout(onTimeout, timeoutMs));
  53603. },
  53604. onEnterConnected: cancelBindGuards,
  53605. onEnterDisconnected: cancelBindGuards
  53606. });
  53607. };
  53608. /***/ }),
  53609. /* 642 */
  53610. /***/ (function(module, exports, __webpack_require__) {
  53611. "use strict";
  53612. const StateMachine = __webpack_require__(292); // @todo The big plan for connectivityState is to eventually use the state transitions to do
  53613. // what is necessary rather than have it duplicated and possible differences and mistakes
  53614. // around what is to occur when different states occur. Things like calling subscribeComplete
  53615. // logging, calling disconnect or destroy, should all be driven by the state of the connection
  53616. module.exports = (_ref) => {
  53617. let onInvalidTransition = _ref.onInvalidTransition;
  53618. return new StateMachine({
  53619. init: 'disconnected',
  53620. transitions: [{
  53621. name: 'beginConnect',
  53622. from: 'disconnected',
  53623. to: 'connecting'
  53624. }, {
  53625. name: 'connect',
  53626. from: 'connecting',
  53627. to: 'connected'
  53628. }, {
  53629. name: 'fail',
  53630. from: ['connecting', 'connected'],
  53631. to: 'disconnected'
  53632. }, {
  53633. name: 'cancel',
  53634. from: ['connecting', 'connected'],
  53635. to: 'disconnected'
  53636. }, {
  53637. name: 'disconnect',
  53638. from: ['connecting', 'connected'],
  53639. to: 'disconnected'
  53640. }],
  53641. methods: {
  53642. onInvalidTransition
  53643. }
  53644. });
  53645. };
  53646. /***/ }),
  53647. /* 643 */
  53648. /***/ (function(module, exports, __webpack_require__) {
  53649. "use strict";
  53650. const IntervalRunner = __webpack_require__(71);
  53651. module.exports = (_ref) => {
  53652. let connectivityState = _ref.connectivityState,
  53653. logAttempt = _ref.logAttempt;
  53654. const connectivityAttemptPinger = new IntervalRunner(logAttempt, 1 / 5, 6);
  53655. connectivityState.observe({
  53656. onEnterConnecting() {
  53657. connectivityAttemptPinger.start();
  53658. },
  53659. onEnterDisconnected() {
  53660. connectivityAttemptPinger.stop();
  53661. },
  53662. onEnterConnected() {
  53663. connectivityAttemptPinger.stop();
  53664. }
  53665. });
  53666. };
  53667. /***/ }),
  53668. /* 644 */
  53669. /***/ (function(module, exports) {
  53670. function _objectWithoutPropertiesLoose(source, excluded) {
  53671. if (source == null) return {};
  53672. var target = {};
  53673. var sourceKeys = Object.keys(source);
  53674. var key, i;
  53675. for (i = 0; i < sourceKeys.length; i++) {
  53676. key = sourceKeys[i];
  53677. if (excluded.indexOf(key) >= 0) continue;
  53678. target[key] = source[key];
  53679. }
  53680. return target;
  53681. }
  53682. module.exports = _objectWithoutPropertiesLoose;
  53683. /***/ }),
  53684. /* 645 */
  53685. /***/ (function(module, exports, __webpack_require__) {
  53686. "use strict";
  53687. module.exports = (peerConnection, activeState) => {
  53688. const videoSender = peerConnection.getSenders().find((_ref) => {
  53689. let track = _ref.track;
  53690. return track.kind === 'video';
  53691. });
  53692. const parameters = videoSender.getParameters();
  53693. parameters.encodings.forEach(encoding => {
  53694. // eslint-disable-next-line no-param-reassign
  53695. encoding.active = activeState;
  53696. });
  53697. videoSender.setParameters(parameters);
  53698. };
  53699. /***/ }),
  53700. /* 646 */
  53701. /***/ (function(module, exports, __webpack_require__) {
  53702. "use strict";
  53703. // We whitelist property keys for logging purposes
  53704. const pick = __webpack_require__(42);
  53705. module.exports = x => pick(x, ['audioDeviceId', 'audioFallbackEnabled', 'audioSource', 'channels', 'classNames', 'constraints', 'disableAudioProcessing', 'enableRenegotiation', 'enableStereo', 'facingMode', 'fitMode', 'frameRate', 'height', 'insertDefaultUI', 'insertMode', 'audioBitrate', 'maxResolution', 'minVideoBitrate', 'mirror', 'name', 'publishAudio', 'publishVideo', 'resolution', 'showControls', 'style', 'videoDeviceId', 'videoDimensions', 'videoSource', 'width']);
  53706. /***/ }),
  53707. /* 647 */
  53708. /***/ (function(module, exports, __webpack_require__) {
  53709. "use strict";
  53710. const eventNames = __webpack_require__(24);
  53711. const now = __webpack_require__(46);
  53712. const RafRunner = __webpack_require__(101);
  53713. const Events = __webpack_require__(20)();
  53714. module.exports = (_ref) => {
  53715. let publisher = _ref.publisher,
  53716. widgetView = _ref.widgetView;
  53717. let loudness = 0;
  53718. let loudnessLastAccess;
  53719. const audioLevelRunner = new RafRunner(() => {
  53720. const listenerCount = publisher.listenerCount(eventNames.AUDIO_LEVEL_UPDATED);
  53721. const shouldStopWatchingAudio = () => now() - loudnessLastAccess > 10000 && listenerCount === 0;
  53722. if (shouldStopWatchingAudio()) {
  53723. audioLevelRunner.stop();
  53724. return;
  53725. }
  53726. const video = widgetView && widgetView.video();
  53727. if (video) {
  53728. const audioInputLevel = video.getAudioInputLevel();
  53729. loudness = audioInputLevel;
  53730. if (listenerCount > 0) {
  53731. // dispatch this old event if someone is listening...
  53732. publisher.dispatchEvent(new Events.AudioLevelUpdatedEvent(audioInputLevel));
  53733. }
  53734. }
  53735. });
  53736. Object.defineProperty(publisher, 'loudness', {
  53737. get() {
  53738. audioLevelRunner.start();
  53739. loudnessLastAccess = now();
  53740. return loudness;
  53741. },
  53742. set() {
  53743. throw new TypeError('Cannot set readonly property loudness');
  53744. }
  53745. });
  53746. if (publisher.listenerCount(eventNames.AUDIO_LEVEL_UPDATED)) {
  53747. audioLevelRunner.start();
  53748. }
  53749. publisher.on('audioLevelUpdated:added', () => {
  53750. audioLevelRunner.start();
  53751. });
  53752. publisher.once(eventNames.PUBLISHER_DESTROYED, () => {
  53753. audioLevelRunner.stop();
  53754. });
  53755. };
  53756. /***/ }),
  53757. /* 648 */
  53758. /***/ (function(module, exports, __webpack_require__) {
  53759. "use strict";
  53760. var _interopRequireDefault = __webpack_require__(2);
  53761. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  53762. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  53763. // Block subsequent calls to an async function until the previous call has completed
  53764. // Throws an error if you call the function too soon.
  53765. module.exports = function blockCallsUntilComplete(fn) {
  53766. let blocked = false;
  53767. return /*#__PURE__*/function () {
  53768. var _blocker = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  53769. var _len,
  53770. args,
  53771. _key,
  53772. _args = arguments;
  53773. return _regenerator.default.wrap(function _callee$(_context) {
  53774. while (1) switch (_context.prev = _context.next) {
  53775. case 0:
  53776. if (!blocked) {
  53777. _context.next = 2;
  53778. break;
  53779. }
  53780. throw new Error('The previous call to this function has not yet completed.');
  53781. case 2:
  53782. blocked = true;
  53783. _context.prev = 3;
  53784. for (_len = _args.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  53785. args[_key] = _args[_key];
  53786. }
  53787. _context.next = 7;
  53788. return fn.call(this, ...args);
  53789. case 7:
  53790. return _context.abrupt("return", _context.sent);
  53791. case 8:
  53792. _context.prev = 8;
  53793. blocked = false;
  53794. return _context.finish(8);
  53795. case 11:
  53796. case "end":
  53797. return _context.stop();
  53798. }
  53799. }, _callee, this, [[3,, 8, 11]]);
  53800. }));
  53801. function blocker() {
  53802. return _blocker.apply(this, arguments);
  53803. }
  53804. return blocker;
  53805. }();
  53806. };
  53807. /***/ }),
  53808. /* 649 */
  53809. /***/ (function(module, exports, __webpack_require__) {
  53810. "use strict";
  53811. const otError = __webpack_require__(12)();
  53812. const Errors = __webpack_require__(8);
  53813. module.exports = function createCanvasVideoTrack(dimensions) {
  53814. const canvas = document.createElement('canvas');
  53815. if (!canvas.captureStream) {
  53816. throw otError(Errors.NOT_SUPPORTED, new Error('Your browser does not support HTMLCanvasElement.captureStream()'));
  53817. }
  53818. canvas.width = dimensions.width;
  53819. canvas.height = dimensions.height;
  53820. canvas.getContext('2d').fillRect(0, 0, 1, 1);
  53821. const _canvas$captureStream = canvas.captureStream().getVideoTracks(),
  53822. canvasTrack = _canvas$captureStream[0];
  53823. canvasTrack.isCreatedCanvas = true; // we never actually intend to send frames from the canvas so it gets disabled
  53824. canvasTrack.enabled = false;
  53825. return canvasTrack;
  53826. };
  53827. /***/ }),
  53828. /* 650 */
  53829. /***/ (function(module, exports, __webpack_require__) {
  53830. var baseFindKey = __webpack_require__(651),
  53831. baseForOwn = __webpack_require__(93),
  53832. baseIteratee = __webpack_require__(29);
  53833. /**
  53834. * This method is like `_.find` except that it returns the key of the first
  53835. * element `predicate` returns truthy for instead of the element itself.
  53836. *
  53837. * @static
  53838. * @memberOf _
  53839. * @since 1.1.0
  53840. * @category Object
  53841. * @param {Object} object The object to inspect.
  53842. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  53843. * @returns {string|undefined} Returns the key of the matched element,
  53844. * else `undefined`.
  53845. * @example
  53846. *
  53847. * var users = {
  53848. * 'barney': { 'age': 36, 'active': true },
  53849. * 'fred': { 'age': 40, 'active': false },
  53850. * 'pebbles': { 'age': 1, 'active': true }
  53851. * };
  53852. *
  53853. * _.findKey(users, function(o) { return o.age < 40; });
  53854. * // => 'barney' (iteration order is not guaranteed)
  53855. *
  53856. * // The `_.matches` iteratee shorthand.
  53857. * _.findKey(users, { 'age': 1, 'active': true });
  53858. * // => 'pebbles'
  53859. *
  53860. * // The `_.matchesProperty` iteratee shorthand.
  53861. * _.findKey(users, ['active', false]);
  53862. * // => 'fred'
  53863. *
  53864. * // The `_.property` iteratee shorthand.
  53865. * _.findKey(users, 'active');
  53866. * // => 'barney'
  53867. */
  53868. function findKey(object, predicate) {
  53869. return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);
  53870. }
  53871. module.exports = findKey;
  53872. /***/ }),
  53873. /* 651 */
  53874. /***/ (function(module, exports) {
  53875. /**
  53876. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  53877. * without support for iteratee shorthands, which iterates over `collection`
  53878. * using `eachFunc`.
  53879. *
  53880. * @private
  53881. * @param {Array|Object} collection The collection to inspect.
  53882. * @param {Function} predicate The function invoked per iteration.
  53883. * @param {Function} eachFunc The function to iterate over `collection`.
  53884. * @returns {*} Returns the found element or its key, else `undefined`.
  53885. */
  53886. function baseFindKey(collection, predicate, eachFunc) {
  53887. var result;
  53888. eachFunc(collection, function(value, key, collection) {
  53889. if (predicate(value, key, collection)) {
  53890. result = key;
  53891. return false;
  53892. }
  53893. });
  53894. return result;
  53895. }
  53896. module.exports = baseFindKey;
  53897. /***/ }),
  53898. /* 652 */
  53899. /***/ (function(module, exports, __webpack_require__) {
  53900. "use strict";
  53901. /* WEBPACK VAR INJECTION */(function(Promise) {
  53902. const SDPHelpers = __webpack_require__(57);
  53903. const shouldUsePlanBSDP = __webpack_require__(100);
  53904. module.exports = (_ref) => {
  53905. let RTCPeerConnection = _ref.RTCPeerConnection,
  53906. env = _ref.env,
  53907. stream = _ref.stream,
  53908. codecFlags = _ref.codecFlags;
  53909. if (env.isLegacyEdge) {
  53910. // Edge supports all codecs and the following test doesn't work
  53911. return true;
  53912. }
  53913. let localPc;
  53914. let remotePc;
  53915. const cleanup = () => {
  53916. try {
  53917. localPc.close();
  53918. } catch (e) {} // eslint-disable-line no-empty
  53919. try {
  53920. remotePc.close();
  53921. } catch (e) {} // eslint-disable-line no-empty
  53922. localPc = null;
  53923. remotePc = null;
  53924. };
  53925. try {
  53926. const pcConfig = {
  53927. iceServers: []
  53928. };
  53929. if (shouldUsePlanBSDP) {
  53930. pcConfig.sdpSemantics = 'plan-b';
  53931. }
  53932. localPc = new RTCPeerConnection(pcConfig);
  53933. remotePc = new RTCPeerConnection(pcConfig);
  53934. localPc.addStream(stream);
  53935. } catch (e) {
  53936. cleanup();
  53937. return Promise.resolve(false);
  53938. }
  53939. return localPc.createOffer().then(offer => {
  53940. const newOffer = {
  53941. type: offer.type,
  53942. sdp: offer.sdp
  53943. };
  53944. Object.keys(codecFlags).forEach(codec => {
  53945. if (!codecFlags[codec]) {
  53946. newOffer.sdp = SDPHelpers.removeVideoCodec(newOffer.sdp, codec);
  53947. }
  53948. });
  53949. return remotePc.setRemoteDescription(newOffer);
  53950. }).then(() => true).catch(() => false).then(result => {
  53951. cleanup();
  53952. return result;
  53953. });
  53954. };
  53955. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  53956. /***/ }),
  53957. /* 653 */
  53958. /***/ (function(module, exports, __webpack_require__) {
  53959. "use strict";
  53960. const _require = __webpack_require__(8),
  53961. INVALID_PARAMETER = _require.INVALID_PARAMETER;
  53962. module.exports = (_ref) => {
  53963. let otError = _ref.otError;
  53964. return config => {
  53965. if (!config) {
  53966. return;
  53967. }
  53968. const check = (cond, msg) => {
  53969. if (!cond) {
  53970. throw otError(INVALID_PARAMETER, new Error("iceConfig invalid: " + msg));
  53971. }
  53972. };
  53973. if ('includeServers' in config) {
  53974. check(['all', 'custom'].indexOf(config.includeServers) !== -1, '.includeServers must be all or custom');
  53975. }
  53976. if ('transportPolicy' in config) {
  53977. check(['all', 'relay'].indexOf(config.transportPolicy) !== -1, '.transportPolicy must be all or relay');
  53978. }
  53979. check(Array.isArray(config.customServers), '.customServers must be an array');
  53980. config.customServers.forEach(server => {
  53981. check(server.urls || !('url' in server), 'ice servers need .urls, not .url');
  53982. check(typeof server.urls === 'string' || Array.isArray(server.urls), 'ice server .urls must be a string or an array');
  53983. check(!server.username || typeof server.username === 'string', 'ice server .username must be a string if present');
  53984. check(!server.credential || typeof server.credential === 'string', 'ice server .credential must be a string if present');
  53985. });
  53986. };
  53987. };
  53988. /***/ }),
  53989. /* 654 */
  53990. /***/ (function(module, exports, __webpack_require__) {
  53991. "use strict";
  53992. const ExceptionCodes = __webpack_require__(11);
  53993. module.exports = function convertAnvilErrorCode(code) {
  53994. switch (code) {
  53995. case ExceptionCodes.AUTHENTICATION_ERROR:
  53996. case ExceptionCodes.INVALID_SESSION_ID:
  53997. case ExceptionCodes.TERMS_OF_SERVICE_FAILURE:
  53998. case ExceptionCodes.UNEXPECTED_SERVER_RESPONSE:
  53999. return code;
  54000. case ExceptionCodes.ANVIL_EMPTY_RESPONSE_BODY:
  54001. case ExceptionCodes.ANVIL_CONNECT_FAILED:
  54002. return ExceptionCodes.CONNECT_FAILED;
  54003. case ExceptionCodes.ANVIL_BADLY_FORMED_RESPONSE:
  54004. case ExceptionCodes.ANVIL_INVALID_HTTP_STATUS:
  54005. case ExceptionCodes.ANVIL_XDOMAIN_OR_PARSING_ERROR:
  54006. case ExceptionCodes.ANVIL_UNKNOWN_HTTP_ERROR:
  54007. case ExceptionCodes.ANVIL_UNEXPECTED_ERROR_CODE:
  54008. default:
  54009. return ExceptionCodes.UNEXPECTED_SERVER_RESPONSE;
  54010. }
  54011. };
  54012. /***/ }),
  54013. /* 655 */
  54014. /***/ (function(module, exports, __webpack_require__) {
  54015. "use strict";
  54016. /* WEBPACK VAR INJECTION */(function(Promise) {
  54017. var _interopRequireDefault = __webpack_require__(2);
  54018. exports.__esModule = true;
  54019. exports.default = RaptorSocketFactory;
  54020. var _isFunction = _interopRequireDefault(__webpack_require__(13));
  54021. var _assign = _interopRequireDefault(__webpack_require__(6));
  54022. var _once = _interopRequireDefault(__webpack_require__(47));
  54023. var _uuid = _interopRequireDefault(__webpack_require__(15));
  54024. var _serializeMessage = _interopRequireDefault(__webpack_require__(299));
  54025. var _defaultRumorSocket = _interopRequireDefault(__webpack_require__(656));
  54026. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  54027. /* eslint-disable no-param-reassign, global-require, one-var, no-underscore-dangle */
  54028. /* eslint-disable prefer-rest-params, prefer-const, no-shadow, max-len */
  54029. function RaptorSocketFactory(deps) {
  54030. if (deps === void 0) {
  54031. deps = {};
  54032. }
  54033. const convertRumorError = deps.convertRumorError || __webpack_require__(297);
  54034. const Dispatcher = deps.Dispatcher || __webpack_require__(301);
  54035. const ExceptionCodes = deps.ExceptionCodes || __webpack_require__(11);
  54036. const hasIceRestartsCapability = deps.hasIceRestartsCapability || __webpack_require__(298);
  54037. const hasRenegotiationCapability = deps.hasRenegotiationCapability || __webpack_require__(672);
  54038. const logging = deps.logging || __webpack_require__(1)('RaptorSocket');
  54039. const RaptorMessage = deps.Message || __webpack_require__(302);
  54040. const OTHelpers = deps.OTHelpers || __webpack_require__(4);
  54041. const RumorSocket = deps.RumorSocket || (0, _defaultRumorSocket.default)();
  54042. const Signal = deps.Signal || __webpack_require__(303);
  54043. const SignalError = deps.SignalError || __webpack_require__(677); // The Dispatcher bit is purely to make testing simpler, it defaults to a new Dispatcher so in
  54044. // normal operation you would omit it.
  54045. const RaptorSocket = function RaptorSocket(connectionId, widgetId, messagingSocketUrl, symphonyUrl, dispatcher, analytics, requestedCapabilities) {
  54046. var _this = this;
  54047. if (requestedCapabilities === void 0) {
  54048. requestedCapabilities = [];
  54049. }
  54050. let _apiKey, _sessionId, _token, _completion, _p2p, _messagingServer, _rumorErrored;
  54051. const _states = ['disconnected', 'connecting', 'connected', 'error', 'disconnecting'];
  54052. const _dispatcher = dispatcher || new Dispatcher(); // // Private API
  54053. const setState = OTHelpers.statable(this, _states, 'disconnected');
  54054. const logAnalyticsEvent = function logAnalyticsEvent(opt) {
  54055. if (!opt.action || !opt.variation) {
  54056. logging.debug('Expected action and variation');
  54057. }
  54058. analytics.logEvent((0, _assign.default)({
  54059. sessionId: _sessionId,
  54060. partnerId: _apiKey,
  54061. p2p: _p2p,
  54062. messagingServer: _messagingServer,
  54063. connectionId
  54064. }, opt));
  54065. };
  54066. const onConnectComplete = function onConnectComplete() {
  54067. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  54068. args[_key] = arguments[_key];
  54069. }
  54070. const error = args[0];
  54071. if (error) {
  54072. setState('error');
  54073. } else {
  54074. setState('connected');
  54075. }
  54076. _completion(...args);
  54077. };
  54078. const onClose = err => {
  54079. let reason = 'clientDisconnected';
  54080. if (!this.is('disconnecting') && _rumorErrored) {
  54081. reason = 'networkDisconnected';
  54082. }
  54083. if (err && err.code === 4001) {
  54084. reason = 'networkTimedout';
  54085. }
  54086. setState('disconnected');
  54087. _dispatcher.onClose(reason);
  54088. };
  54089. const onError = err => {
  54090. _rumorErrored = true;
  54091. logging.error(err);
  54092. }; // @todo what does having an error mean? Are they always fatal? Are we disconnected now?
  54093. const onReconnecting = () => {
  54094. _dispatcher.onReconnecting();
  54095. };
  54096. const onReconnected = () => {
  54097. logAnalyticsEvent({
  54098. action: 'Reconnect',
  54099. variation: 'Success',
  54100. retries: this._rumor.reconnectRetriesCount(),
  54101. messageQueueSize: this._rumor.messageQueueSize(),
  54102. socketId: this.socketId
  54103. });
  54104. _dispatcher.onReconnected();
  54105. };
  54106. const onReconnectAttempt = () => {
  54107. logAnalyticsEvent({
  54108. action: 'Reconnect',
  54109. variation: 'Attempt',
  54110. retries: this._rumor.reconnectRetriesCount(),
  54111. messageQueueSize: this._rumor.messageQueueSize(),
  54112. socketId: this.socketId
  54113. });
  54114. };
  54115. const onReconnectFailure = error => {
  54116. if (error.message === 'connectionLimitExceeded') {
  54117. error.code = ExceptionCodes.CONNECTION_LIMIT_EXCEEDED;
  54118. }
  54119. error.reason = 'ConnectToSession';
  54120. const converted = convertRumorError(error);
  54121. logAnalyticsEvent({
  54122. action: 'Reconnect',
  54123. variation: 'Failure',
  54124. failureReason: error.reason,
  54125. failureCode: converted.code,
  54126. failureMessage: converted.message,
  54127. messageQueueSize: this._rumor.messageQueueSize(),
  54128. socketId: this.socketId
  54129. });
  54130. }; // // Public API
  54131. Object.defineProperty(this, 'socketId', {
  54132. get() {
  54133. return this._rumor.socketID;
  54134. }
  54135. });
  54136. this.connect = function connect(token, sessionInfo, opt, completion) {
  54137. if (!this.is('disconnected', 'error')) {
  54138. logging.warn('Cannot connect the Raptor Socket as it is currently connected. You should ' + 'disconnect first.');
  54139. return;
  54140. }
  54141. setState('connecting');
  54142. _apiKey = sessionInfo.partnerId;
  54143. _sessionId = sessionInfo.sessionId;
  54144. _p2p = sessionInfo.p2pEnabled;
  54145. _messagingServer = sessionInfo.messagingServer;
  54146. _token = token;
  54147. _completion = completion;
  54148. const rumorChannel = "/v2/partner/" + _apiKey + "/session/" + _sessionId;
  54149. this._rumor = new RaptorSocket.RumorSocket({
  54150. messagingURL: messagingSocketUrl,
  54151. notifyDisconnectAddress: symphonyUrl,
  54152. connectionId,
  54153. enableReconnection: sessionInfo.reconnection
  54154. });
  54155. this._rumor.on('close', onClose);
  54156. this._rumor.on('error', onError);
  54157. this._rumor.on('reconnecting', onReconnecting);
  54158. this._rumor.on('reconnectAttempt', onReconnectAttempt);
  54159. this._rumor.on('reconnectFailure', onReconnectFailure);
  54160. this._rumor.on('reconnected', onReconnected);
  54161. this._rumor.on('message', _dispatcher.dispatch.bind(_dispatcher));
  54162. const onStartupError = error => {
  54163. onConnectComplete({
  54164. reason: 'WebSocketConnection',
  54165. code: error.code,
  54166. message: error.message
  54167. });
  54168. };
  54169. this._rumor.once('error', onStartupError);
  54170. this._rumor.once('open', () => {
  54171. this._rumor.removeListener('error', onStartupError);
  54172. logging.debug("connected. Subscribing to " + rumorChannel + " on " + messagingSocketUrl);
  54173. this._rumor.subscribe([rumorChannel]);
  54174. const capabilities = requestedCapabilities;
  54175. const supportRenegotiation = (RaptorSocket.hasIceRestartsCapability() || RaptorSocket.hasRenegotiationCapability()) && sessionInfo.renegotiation;
  54176. if (supportRenegotiation) {
  54177. capabilities.push('renegotiation');
  54178. capabilities.push('regeneration');
  54179. } // connect to session
  54180. const connectMessage = RaptorMessage.connections.create({
  54181. apiKey: _apiKey,
  54182. sessionId: _sessionId,
  54183. connectionId: this._rumor.id,
  54184. connectionEventsSuppressed: opt.connectionEventsSuppressed,
  54185. capabilities
  54186. });
  54187. const futureOwnConnection = new Promise(resolve => {
  54188. const processConnectionCreated = message => {
  54189. if (message.id === this._rumor.id) {
  54190. resolve(message);
  54191. dispatcher.off('connection#created', processConnectionCreated);
  54192. }
  54193. };
  54194. dispatcher.on('connection#created', processConnectionCreated);
  54195. });
  54196. this.publish(connectMessage, {
  54197. 'X-TB-TOKEN-AUTH': _token
  54198. }, true, (error, reply) => {
  54199. if (error) {
  54200. if (error.message === 'connectionLimitExceeded') {
  54201. error.code = ExceptionCodes.CONNECTION_LIMIT_EXCEEDED;
  54202. }
  54203. onConnectComplete({
  54204. reason: 'ConnectToSession',
  54205. code: error.code,
  54206. message: error.message,
  54207. socketId: this.socketId
  54208. });
  54209. return;
  54210. }
  54211. const replyData = reply && reply.data ? JSON.parse(reply.data) : null;
  54212. if (replyData) {
  54213. if (!replyData.connection || replyData.connection.length === 0) {
  54214. replyData.connection = [];
  54215. if (Array.isArray(replyData.stream)) {
  54216. replyData.stream.forEach((_ref) => {
  54217. let connection = _ref.connection;
  54218. return replyData.connection.push(connection);
  54219. });
  54220. }
  54221. }
  54222. }
  54223. const onSessionState = (error, sessionState) => {
  54224. if (error) {
  54225. onConnectComplete({
  54226. reason: 'GetSessionState',
  54227. code: error.code,
  54228. message: error.message,
  54229. socketId: this.socketId
  54230. });
  54231. } else {
  54232. onConnectComplete(undefined, sessionState);
  54233. }
  54234. };
  54235. futureOwnConnection.then(ownConnection => {
  54236. // in the case of not receiving our own connection, we add it here.
  54237. // this is important under connectionEventSuppressed as rumor does
  54238. // not give us our own connection in the initial ack to our connect
  54239. // message
  54240. if (!replyData.connection.some(conn => conn.id === ownConnection.id)) {
  54241. replyData.connection.unshift(ownConnection);
  54242. }
  54243. const transactionId = (0, _uuid.default)();
  54244. _dispatcher.registerCallback(transactionId, onSessionState);
  54245. _dispatcher.emit('session#read', replyData, transactionId);
  54246. });
  54247. });
  54248. });
  54249. };
  54250. this.disconnect = function () {
  54251. if (this.is('disconnected')) {
  54252. return;
  54253. }
  54254. setState('disconnecting');
  54255. this._rumor.disconnect();
  54256. }; // Publishes +message+ to the Symphony app server.
  54257. //
  54258. // The completion handler is optional, as is the headers
  54259. // dict, but if you provide the completion handler it must
  54260. // be the last argument.
  54261. //
  54262. this.publish = function (message, headers, retryAfterReconnect, completion) {
  54263. completion = completion || function () {};
  54264. const completionOnce = (0, _once.default)(completion);
  54265. const transactionId = (0, _uuid.default)();
  54266. logging.debug("Publish (ID:" + transactionId + ") " + message);
  54267. if (this._rumor.readyState !== RumorSocket.OPEN || this._rumor.reconnecting && !retryAfterReconnect) {
  54268. // TODO: This duplicates the same logic in rumor.
  54269. const error = new Error('Not connected.');
  54270. error.code = 500;
  54271. completionOnce(error);
  54272. logging.error('cannot publish until the socket is connected.');
  54273. return undefined;
  54274. }
  54275. _dispatcher.registerCallback(transactionId, completionOnce);
  54276. this._rumor.publish([symphonyUrl], message, (0, _assign.default)({}, headers, {
  54277. 'Content-Type': 'application/x-raptor+v2',
  54278. 'TRANSACTION-ID': transactionId,
  54279. 'X-TB-FROM-ADDRESS': this._rumor.id
  54280. }), retryAfterReconnect, function (err) {
  54281. // We want to propagate errors from rumor here. In particular, errors
  54282. // related to not receiving a reply due to disconnection. However, when
  54283. // a reply is received, the dispatcher may transform the reply, and may
  54284. // generate an error that would not be recognized here. This isn't the
  54285. // only awkward outcome related to the dispatcher design, and there are
  54286. // plans to address this technical debt: OPENTOK-27994.
  54287. if (err) {
  54288. completionOnce(...arguments);
  54289. }
  54290. });
  54291. return transactionId;
  54292. };
  54293. /**
  54294. * Like publish, but automaitcally serializes the message parameter
  54295. */
  54296. this.send = function (message, headers, retryAfterReconnect, completion) {
  54297. if (retryAfterReconnect === void 0) {
  54298. retryAfterReconnect = true;
  54299. }
  54300. if (completion === void 0) {
  54301. completion = () => {};
  54302. }
  54303. _this.publish((0, _serializeMessage.default)(message), headers, retryAfterReconnect, completion);
  54304. }; // Register a new stream against _sessionId
  54305. this.streamCreate = function (name, streamId, audioFallbackEnabled, channels, minBitrate, maxBitrate, completion) {
  54306. const message = RaptorMessage.streams.create(_apiKey, _sessionId, streamId, name, audioFallbackEnabled, channels, minBitrate, maxBitrate);
  54307. this.publish(message, {}, true, (error, message) => {
  54308. completion(error, streamId, message);
  54309. });
  54310. };
  54311. this.streamDestroy = function (streamId) {
  54312. this.publish(RaptorMessage.streams.destroy(_apiKey, _sessionId, streamId), {}, true);
  54313. };
  54314. this.streamChannelUpdate = function (streamId, channelId, attributes) {
  54315. this.publish(RaptorMessage.streamChannels.update(_apiKey, _sessionId, streamId, channelId, attributes), {}, true);
  54316. };
  54317. this.subscriberCreate = function (streamId, subscriberId, channelsToSubscribeTo, completion) {
  54318. this.publish(RaptorMessage.subscribers.create(_apiKey, _sessionId, streamId, subscriberId, this._rumor.id, channelsToSubscribeTo), {}, true, completion);
  54319. };
  54320. this.subscriberDestroy = function (streamId, subscriberId) {
  54321. this.publish(RaptorMessage.subscribers.destroy(_apiKey, _sessionId, streamId, subscriberId), {}, true);
  54322. };
  54323. this.subscriberUpdate = function (streamId, subscriberId, attributes) {
  54324. this.publish(RaptorMessage.subscribers.update(_apiKey, _sessionId, streamId, subscriberId, attributes), {}, true);
  54325. };
  54326. this.subscriberChannelUpdate = function (streamId, subscriberId, channelId, attributes) {
  54327. this.publish(RaptorMessage.subscriberChannels.update(_apiKey, _sessionId, streamId, subscriberId, channelId, attributes), {}, true);
  54328. };
  54329. this.forceDisconnect = function (connectionIdToDisconnect, completion) {
  54330. this.publish(RaptorMessage.connections.destroy({
  54331. apiKey: _apiKey,
  54332. sessionId: _sessionId,
  54333. connectionId: connectionIdToDisconnect
  54334. }), {}, true, completion);
  54335. };
  54336. this.forceUnpublish = function (streamIdToUnpublish, completion) {
  54337. this.publish(RaptorMessage.streams.destroy(_apiKey, _sessionId, streamIdToUnpublish), {}, true, completion);
  54338. };
  54339. this.signal = function (options, completion, logEventFn) {
  54340. const signal = new Signal(_sessionId, this._rumor.id, options || {});
  54341. if (!signal.valid) {
  54342. if (completion && (0, _isFunction.default)(completion)) {
  54343. completion(new SignalError(signal.error.code, signal.error.reason), signal.toHash());
  54344. }
  54345. return;
  54346. }
  54347. this.publish(signal.toRaptorMessage(), {}, signal.retryAfterReconnect, err => {
  54348. let error, errorCode, errorMessage;
  54349. const expectedErrorCodes = [400, 403, 404, 413, 500];
  54350. if (err) {
  54351. if (err.code && expectedErrorCodes.indexOf(err.code) > -1) {
  54352. errorCode = err.code;
  54353. errorMessage = err.message;
  54354. } else {
  54355. errorCode = ExceptionCodes.UNEXPECTED_SERVER_RESPONSE;
  54356. errorMessage = 'Unexpected server response. Try this operation again later.';
  54357. }
  54358. error = new SignalError(errorCode, errorMessage);
  54359. } else {
  54360. const typeStr = signal.data ? typeof signal.data : null;
  54361. logEventFn('signal', 'send', {
  54362. type: typeStr
  54363. });
  54364. }
  54365. if (completion && (0, _isFunction.default)(completion)) {
  54366. completion(error, signal.toHash());
  54367. }
  54368. });
  54369. };
  54370. this.id = function () {
  54371. return this._rumor && this._rumor.id;
  54372. };
  54373. };
  54374. RaptorSocket.hasIceRestartsCapability = hasIceRestartsCapability;
  54375. RaptorSocket.hasRenegotiationCapability = hasRenegotiationCapability;
  54376. RaptorSocket.RumorSocket = RumorSocket;
  54377. return RaptorSocket;
  54378. }
  54379. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0)))
  54380. /***/ }),
  54381. /* 656 */
  54382. /***/ (function(module, exports, __webpack_require__) {
  54383. "use strict";
  54384. var _interopRequireDefault = __webpack_require__(2);
  54385. exports.__esModule = true;
  54386. exports.default = defaultRumorSocket;
  54387. var _events = _interopRequireDefault(__webpack_require__(43));
  54388. var _createCounter = _interopRequireDefault(__webpack_require__(657));
  54389. var _log = _interopRequireDefault(__webpack_require__(1));
  54390. var _ReconnectableSocket = _interopRequireDefault(__webpack_require__(658));
  54391. var _RumorSocket = _interopRequireDefault(__webpack_require__(663));
  54392. var _WebSocket = _interopRequireDefault(__webpack_require__(668));
  54393. /* eslint-disable no-underscore-dangle */
  54394. function defaultRumorSocket(_temp) {
  54395. let _ref = _temp === void 0 ? {} : _temp,
  54396. _ref$WebSocket = _ref.WebSocket,
  54397. WebSocket = _ref$WebSocket === void 0 ? _WebSocket.default : _ref$WebSocket;
  54398. const allocateId = (0, _createCounter.default)();
  54399. const ReconnectableSocket = (0, _ReconnectableSocket.default)({
  54400. EventEmitter: _events.default,
  54401. WebSocket,
  54402. logging: _log.default,
  54403. allocateId
  54404. });
  54405. const RumorSocket = (0, _RumorSocket.default)({
  54406. EventEmitter: _events.default,
  54407. ReconnectableSocket,
  54408. logging: _log.default,
  54409. allocateId
  54410. });
  54411. return RumorSocket;
  54412. }
  54413. /***/ }),
  54414. /* 657 */
  54415. /***/ (function(module, exports, __webpack_require__) {
  54416. "use strict";
  54417. exports.__esModule = true;
  54418. exports.default = createCounter;
  54419. function createCounter() {
  54420. let current = 0;
  54421. return () => {
  54422. current += 1;
  54423. return current;
  54424. };
  54425. }
  54426. /***/ }),
  54427. /* 658 */
  54428. /***/ (function(module, exports, __webpack_require__) {
  54429. "use strict";
  54430. var _interopRequireDefault = __webpack_require__(2);
  54431. exports.__esModule = true;
  54432. exports.default = void 0;
  54433. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  54434. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  54435. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(152));
  54436. var _createClass2 = _interopRequireDefault(__webpack_require__(40));
  54437. var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(55));
  54438. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  54439. var _logEvents = _interopRequireDefault(__webpack_require__(300));
  54440. var _socketCloseCodes = __webpack_require__(73);
  54441. var _Timer = _interopRequireDefault(__webpack_require__(659));
  54442. var _eventHelper = _interopRequireDefault(__webpack_require__(59));
  54443. var _createReadyStateMachine = _interopRequireDefault(__webpack_require__(660));
  54444. var _drainWebSocket = _interopRequireDefault(__webpack_require__(662));
  54445. /* eslint-disable no-underscore-dangle, no-constant-condition */
  54446. const removeReturnVal = fn => function () {
  54447. fn(...arguments);
  54448. };
  54449. const isValidCode = code => code === 1000 || code >= 3000 && code <= 4999;
  54450. const CLOSE_TIMEOUT = _socketCloseCodes.codes.CLOSE_TIMEOUT;
  54451. var _default = (_ref) => {
  54452. var _class, _temp;
  54453. let EventEmitter = _ref.EventEmitter,
  54454. WebSocket = _ref.WebSocket,
  54455. logging = _ref.logging,
  54456. allocateId = _ref.allocateId,
  54457. _ref$BUFFER_DRAIN_INT = _ref.BUFFER_DRAIN_INTERVAL,
  54458. BUFFER_DRAIN_INTERVAL = _ref$BUFFER_DRAIN_INT === void 0 ? 100 : _ref$BUFFER_DRAIN_INT,
  54459. _ref$BUFFER_DRAIN_MAX = _ref.BUFFER_DRAIN_MAX_RETRIES,
  54460. BUFFER_DRAIN_MAX_RETRIES = _ref$BUFFER_DRAIN_MAX === void 0 ? 10 : _ref$BUFFER_DRAIN_MAX;
  54461. return _temp = _class = /*#__PURE__*/function (_EventEmitter) {
  54462. (0, _inheritsLoose2.default)(ReconnectableSocket, _EventEmitter);
  54463. (0, _createClass2.default)(ReconnectableSocket, [{
  54464. key: "url",
  54465. get: function get() {
  54466. return typeof this._url === 'function' ? this._url() : this._url;
  54467. }
  54468. }, {
  54469. key: "reconnecting",
  54470. get: function get() {
  54471. return this.readyStateMachine.state === 'reconnecting';
  54472. }
  54473. }, {
  54474. key: "binaryType",
  54475. get: function get() {
  54476. return this._webSocket.binaryType;
  54477. }
  54478. }, {
  54479. key: "bufferedAmount",
  54480. get: function get() {
  54481. return this._webSocket.bufferedAmount;
  54482. }
  54483. }, {
  54484. key: "protocol",
  54485. get: function get() {
  54486. return this._webSocket.protocol;
  54487. }
  54488. }, {
  54489. key: "extensions",
  54490. get: function get() {
  54491. return this._webSocket.extensions;
  54492. }
  54493. }, {
  54494. key: "readyState",
  54495. get: function get() {
  54496. const STATE_MAP = {
  54497. reconnecting: ReconnectableSocket.OPEN,
  54498. open: ReconnectableSocket.OPEN,
  54499. closing: ReconnectableSocket.CLOSING,
  54500. closed: ReconnectableSocket.CLOSED,
  54501. connecting: ReconnectableSocket.CONNECTING
  54502. };
  54503. return STATE_MAP[this.readyStateMachine.state];
  54504. }
  54505. }]);
  54506. function ReconnectableSocket(opt) {
  54507. var _this;
  54508. const _ref2 = typeof opt === 'string' ? {
  54509. url: opt
  54510. } : opt,
  54511. url = _ref2.url,
  54512. _ref2$connectTimeout = _ref2.connectTimeout,
  54513. connectTimeout = _ref2$connectTimeout === void 0 ? 15000 : _ref2$connectTimeout,
  54514. _ref2$pingThreshold = _ref2.pingThreshold,
  54515. pingThreshold = _ref2$pingThreshold === void 0 ? 3000 : _ref2$pingThreshold,
  54516. _ref2$pingWarningDela = _ref2.pingWarningDelay,
  54517. pingWarningDelay = _ref2$pingWarningDela === void 0 ? 100 : _ref2$pingWarningDela,
  54518. _ref2$disconnectThres = _ref2.disconnectThreshold,
  54519. disconnectThreshold = _ref2$disconnectThres === void 0 ? 5900 : _ref2$disconnectThres,
  54520. _ref2$reconnectMaxDur = _ref2.reconnectMaxDuration,
  54521. reconnectMaxDuration = _ref2$reconnectMaxDur === void 0 ? 60000 : _ref2$reconnectMaxDur;
  54522. if (!url) {
  54523. throw new Error('Must provide url');
  54524. }
  54525. _this = _EventEmitter.call(this) || this;
  54526. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_url", void 0);
  54527. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_id", allocateId());
  54528. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_logger", logging("ReconnectableSocket:" + _this._id));
  54529. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_webSocket", void 0);
  54530. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_connectTimer", void 0);
  54531. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_pingTimer", void 0);
  54532. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_pingWarningTimer", void 0);
  54533. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_disconnectTimer", void 0);
  54534. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_queuedMessages", []);
  54535. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_draining", false);
  54536. _this.readyStateMachine = (0, _createReadyStateMachine.default)({
  54537. reconnectMaxDuration,
  54538. CLOSED: ReconnectableSocket.CLOSED,
  54539. CLOSING: ReconnectableSocket.CLOSING
  54540. });
  54541. _this._url = url;
  54542. (0, _logEvents.default)({
  54543. logger: _this._logger,
  54544. obj: (0, _assertThisInitialized2.default)(_this),
  54545. eventNames: ['error', 'open', 'message', 'needsPing', 'reconnecting', 'reconnectAttempt', 'reconnectFailure', 'reconnected', 'close']
  54546. });
  54547. _this.readyStateMachine.observe('onEnterOpen', (_ref3) => {
  54548. let from = _ref3.from;
  54549. _this._resetPingTimers();
  54550. _this._resetDisconnectTimer();
  54551. _this._connectTimer.clear();
  54552. if (from === 'reconnecting') {
  54553. _this._queuedMessages.forEach(msg => _this.send(msg, true));
  54554. _this._queuedMessages = [];
  54555. _this.emit('reconnected');
  54556. } else {
  54557. _this.emit('open');
  54558. }
  54559. });
  54560. _this.readyStateMachine.observe('onEnterClosed', (_, error) => {
  54561. _this.emit('close', error);
  54562. });
  54563. _this.readyStateMachine.observe('onEnterClosing', removeReturnVal( /*#__PURE__*/function () {
  54564. var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref4, _ref5) {
  54565. var from, code, reason;
  54566. return _regenerator.default.wrap(function _callee$(_context) {
  54567. while (1) switch (_context.prev = _context.next) {
  54568. case 0:
  54569. from = _ref4.from;
  54570. code = _ref5.code, reason = _ref5.reason;
  54571. _this._clearTimers();
  54572. _context.next = 5;
  54573. return _this._clearSocket({
  54574. drain: from === 'open',
  54575. code,
  54576. reason
  54577. });
  54578. case 5:
  54579. if (from === 'reconnecting') {
  54580. _this.emit('reconnectFailure', {
  54581. code,
  54582. reason
  54583. });
  54584. }
  54585. setTimeout(() => {
  54586. _this.readyStateMachine.closed({
  54587. code,
  54588. reason
  54589. });
  54590. });
  54591. case 7:
  54592. case "end":
  54593. return _context.stop();
  54594. }
  54595. }, _callee);
  54596. }));
  54597. return function (_x, _x2) {
  54598. return _ref6.apply(this, arguments);
  54599. };
  54600. }()));
  54601. _this.readyStateMachine.observe('onEnterReconnecting', () => {
  54602. _this.emit('reconnecting');
  54603. });
  54604. _this.readyStateMachine.observe('onDisconnect', removeReturnVal( /*#__PURE__*/function () {
  54605. var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref7, _ref8) {
  54606. var from, to, code, reason;
  54607. return _regenerator.default.wrap(function _callee2$(_context2) {
  54608. while (1) switch (_context2.prev = _context2.next) {
  54609. case 0:
  54610. from = _ref7.from, to = _ref7.to;
  54611. code = _ref8.code, reason = _ref8.reason;
  54612. if (!(to === 'reconnecting')) {
  54613. _context2.next = 10;
  54614. break;
  54615. }
  54616. if (!_this._draining) {
  54617. _context2.next = 5;
  54618. break;
  54619. }
  54620. return _context2.abrupt("return");
  54621. case 5:
  54622. _this._clearTimers();
  54623. _this.emit('reconnectAttempt');
  54624. _context2.next = 9;
  54625. return _this._clearSocket({
  54626. drain: from === 'open',
  54627. code,
  54628. reason
  54629. });
  54630. case 9:
  54631. _this._createSocket();
  54632. case 10:
  54633. case "end":
  54634. return _context2.stop();
  54635. }
  54636. }, _callee2);
  54637. }));
  54638. return function (_x3, _x4) {
  54639. return _ref9.apply(this, arguments);
  54640. };
  54641. }()));
  54642. const createTimer = (name, duration) => new _Timer.default({
  54643. name,
  54644. duration,
  54645. logger: _this._logger
  54646. });
  54647. _this._connectTimer = createTimer('connect', connectTimeout);
  54648. _this._pingTimer = createTimer('ping', pingThreshold);
  54649. _this._pingWarningTimer = createTimer('pingWarning', pingWarningDelay);
  54650. _this._disconnectTimer = createTimer('disconnect', disconnectThreshold);
  54651. _this._createSocket();
  54652. return _this;
  54653. }
  54654. var _proto = ReconnectableSocket.prototype;
  54655. _proto._createSocket = function _createSocket() {
  54656. const ws = new WebSocket(this.url);
  54657. ws.binaryType = 'arraybuffer';
  54658. const wsEvents = (0, _eventHelper.default)(ws);
  54659. wsEvents.on('open', () => {
  54660. this.readyStateMachine.open();
  54661. });
  54662. wsEvents.on('close', (_ref10) => {
  54663. let code = _ref10.code,
  54664. reason = _ref10.reason;
  54665. this.readyStateMachine.disconnect({
  54666. code,
  54667. reason
  54668. });
  54669. });
  54670. wsEvents.on('error', event => {
  54671. this.emit('error', event);
  54672. });
  54673. wsEvents.on('message', event => {
  54674. if (this.readyState !== ReconnectableSocket.CLOSING) {
  54675. // Without this you can receive a message while we are closing the socket and we end up
  54676. // trying to reconnect again afterwards
  54677. this._resetDisconnectTimer();
  54678. }
  54679. this.emit('message', event);
  54680. });
  54681. this._webSocket = ws;
  54682. this._webSocketEvents = wsEvents;
  54683. this._connectTimer.reset(() => {
  54684. const closeData = {
  54685. code: CLOSE_TIMEOUT,
  54686. reason: 'Timeout while opening connection'
  54687. };
  54688. const error = new Error(closeData.reason);
  54689. error.code = CLOSE_TIMEOUT;
  54690. this.emit('error', error);
  54691. this.readyStateMachine.disconnect(closeData);
  54692. });
  54693. };
  54694. _proto._clearSocket = /*#__PURE__*/function () {
  54695. var _clearSocket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_temp2) {
  54696. var _ref11, _ref11$drain, drain, code, reason;
  54697. return _regenerator.default.wrap(function _callee3$(_context3) {
  54698. while (1) switch (_context3.prev = _context3.next) {
  54699. case 0:
  54700. _ref11 = _temp2 === void 0 ? {} : _temp2, _ref11$drain = _ref11.drain, drain = _ref11$drain === void 0 ? false : _ref11$drain, code = _ref11.code, reason = _ref11.reason;
  54701. this._draining = true;
  54702. if (this._webSocketEvents) {
  54703. this._webSocketEvents.removeAll();
  54704. }
  54705. if (!(this._webSocket.readyState !== ReconnectableSocket.CLOSED)) {
  54706. _context3.next = 8;
  54707. break;
  54708. }
  54709. if (!drain) {
  54710. _context3.next = 7;
  54711. break;
  54712. }
  54713. _context3.next = 7;
  54714. return (0, _drainWebSocket.default)(this._webSocket, {
  54715. BUFFER_DRAIN_INTERVAL,
  54716. BUFFER_DRAIN_MAX_RETRIES
  54717. });
  54718. case 7:
  54719. try {
  54720. if (!isValidCode(code) || code === undefined && reason === undefined) {
  54721. // because IE
  54722. this._webSocket.close();
  54723. } else {
  54724. this._webSocket.close(code, reason);
  54725. }
  54726. } catch (err) {
  54727. logging.error('Could not close websocket', err);
  54728. }
  54729. case 8:
  54730. this._draining = false;
  54731. case 9:
  54732. case "end":
  54733. return _context3.stop();
  54734. }
  54735. }, _callee3, this);
  54736. }));
  54737. function _clearSocket(_x5) {
  54738. return _clearSocket2.apply(this, arguments);
  54739. }
  54740. return _clearSocket;
  54741. }();
  54742. _proto.send = function send(data, retryAfterReconnect) {
  54743. if (retryAfterReconnect === void 0) {
  54744. retryAfterReconnect = true;
  54745. }
  54746. // send deviates from WebSocket a little in that it returns a status instead of nothing.
  54747. if (this.readyState === ReconnectableSocket.OPEN) {
  54748. this._resetPingTimers();
  54749. }
  54750. const sendMessage = () => {
  54751. try {
  54752. this._webSocket.send(data);
  54753. return 'sent';
  54754. } catch (err) {
  54755. if (this._webSocket.readyState === WebSocket.OPEN) {
  54756. // On the other hand, there is a known bug in Firefox where .send throws an exception
  54757. // even though it's open:
  54758. // https://bugzilla.mozilla.org/show_bug.cgi?id=1204727
  54759. this._logger.debug('webSocket.send threw exception even though it was open:', err);
  54760. return 'dropped';
  54761. }
  54762. throw err;
  54763. }
  54764. };
  54765. if (this.readyStateMachine.state === 'reconnecting') {
  54766. // the old socket is still open, let's send the message there as well.
  54767. if (this._webSocket.readyState === WebSocket.OPEN) {
  54768. try {
  54769. sendMessage();
  54770. } catch (err) {// but lets ignore any errors so that we can queue it as wel
  54771. }
  54772. }
  54773. if (retryAfterReconnect) {
  54774. this._queuedMessages.push(data);
  54775. return 'queued';
  54776. }
  54777. this._logger.debug('Dropping message during reconnection since retryAfterReconnect is false:', data);
  54778. return 'dropped';
  54779. }
  54780. return sendMessage();
  54781. };
  54782. _proto.close = function close(code, reason) {
  54783. if (this.readyState === ReconnectableSocket.CLOSING) {
  54784. throw new Error('Can not call close on a closing ReconnectableSocket');
  54785. }
  54786. if (this.readyState === ReconnectableSocket.CLOSED) {
  54787. throw new Error('Can not call close on an already closed ReconnectableSocket');
  54788. }
  54789. this.readyStateMachine.close({
  54790. code,
  54791. reason
  54792. });
  54793. };
  54794. _proto._resetPingTimers = function _resetPingTimers() {
  54795. this._pingWarningTimer.clear();
  54796. this._pingTimer.reset(() => {
  54797. this._pingWarningTimer.reset(() => {
  54798. this._logger.warn('Did not send message after needsPing event. Other side may ' + 'disconnect.');
  54799. });
  54800. this.emit('needsPing');
  54801. });
  54802. };
  54803. _proto._resetDisconnectTimer = function _resetDisconnectTimer() {
  54804. this._disconnectTimer.reset(() => this.readyStateMachine.disconnect({
  54805. code: CLOSE_TIMEOUT,
  54806. reason: 'No activity'
  54807. }));
  54808. };
  54809. _proto._clearTimers = function _clearTimers() {
  54810. [this._disconnectTimer, this._connectTimer, this._pingTimer, this._pingWarningTimer].forEach(timer => timer.clear());
  54811. };
  54812. return ReconnectableSocket;
  54813. }(EventEmitter), (0, _defineProperty2.default)(_class, "CONNECTING", WebSocket.CONNECTING), (0, _defineProperty2.default)(_class, "OPEN", WebSocket.OPEN), (0, _defineProperty2.default)(_class, "CLOSING", WebSocket.CLOSING), (0, _defineProperty2.default)(_class, "CLOSED", WebSocket.CLOSED), _temp;
  54814. };
  54815. exports.default = _default;
  54816. /***/ }),
  54817. /* 659 */
  54818. /***/ (function(module, exports, __webpack_require__) {
  54819. "use strict";
  54820. var _interopRequireDefault = __webpack_require__(2);
  54821. exports.__esModule = true;
  54822. exports.default = void 0;
  54823. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  54824. // Tracks one timer so that when you reset it you can't accidentally get multiple timers.
  54825. let Timer = /*#__PURE__*/function () {
  54826. function Timer(_ref) {
  54827. let name = _ref.name,
  54828. logger = _ref.logger,
  54829. duration = _ref.duration;
  54830. (0, _defineProperty2.default)(this, "name", void 0);
  54831. (0, _defineProperty2.default)(this, "logger", void 0);
  54832. (0, _defineProperty2.default)(this, "duration", void 0);
  54833. (0, _defineProperty2.default)(this, "currId", void 0);
  54834. this.name = name;
  54835. this.logger = logger;
  54836. this.duration = duration;
  54837. }
  54838. var _proto = Timer.prototype;
  54839. _proto.reset = function reset(callback) {
  54840. this.clear();
  54841. const id = setTimeout(() => {
  54842. if (this.currId === undefined) {
  54843. // This shouldn't be necessary, except for this bug in jasmine's fake clock:
  54844. // https://github.com/jasmine/jasmine/issues/1426
  54845. return;
  54846. }
  54847. this.logger.spam(this.name + " timer with id " + this.currId + " expired, entering callback");
  54848. this.currId = undefined;
  54849. callback();
  54850. }, this.duration);
  54851. this.currId = id;
  54852. this.logger.spam("Started " + this.name + " timer with id " + this.currId + ", expires in " + (this.duration + "ms"));
  54853. };
  54854. _proto.clear = function clear() {
  54855. if (this.currId === undefined) {
  54856. return;
  54857. }
  54858. clearTimeout(this.currId);
  54859. this.logger.spam("Cleared " + this.name + " timer with id " + this.currId);
  54860. this.currId = undefined;
  54861. };
  54862. _proto.isRunning = function isRunning() {
  54863. return this.currId !== undefined;
  54864. };
  54865. return Timer;
  54866. }();
  54867. exports.default = Timer;
  54868. /***/ }),
  54869. /* 660 */
  54870. /***/ (function(module, exports, __webpack_require__) {
  54871. "use strict";
  54872. var _interopRequireDefault = __webpack_require__(2);
  54873. exports.__esModule = true;
  54874. exports.default = void 0;
  54875. var _javascriptStateMachine = _interopRequireDefault(__webpack_require__(292));
  54876. var _elapsed = _interopRequireDefault(__webpack_require__(661));
  54877. var _socketCloseCodes = __webpack_require__(73);
  54878. var _log = _interopRequireDefault(__webpack_require__(1));
  54879. const logger = (0, _log.default)('ReconnectableSocketStateMachine');
  54880. const CLOSE_UNSUPPORTED = _socketCloseCodes.codes.CLOSE_UNSUPPORTED,
  54881. CLOSE_UNEXPECTED_CONDITION = _socketCloseCodes.codes.CLOSE_UNEXPECTED_CONDITION;
  54882. var _default = (_ref) => {
  54883. let reconnectMaxDuration = _ref.reconnectMaxDuration,
  54884. CLOSED = _ref.CLOSED,
  54885. CLOSING = _ref.CLOSING;
  54886. let hasReconnectMaxDurationElapsed;
  54887. function handleDisconnect(_ref2) {
  54888. let code = _ref2.code;
  54889. if (this.state === 'open' || !hasReconnectMaxDurationElapsed) {
  54890. hasReconnectMaxDurationElapsed = (0, _elapsed.default)(reconnectMaxDuration);
  54891. }
  54892. const shouldReconnect = reconnectMaxDuration > 0 && !hasReconnectMaxDurationElapsed() && [CLOSE_UNSUPPORTED, CLOSE_UNEXPECTED_CONDITION].indexOf(code) === -1 && [CLOSED, CLOSING].indexOf(this.readyState) === -1;
  54893. if (shouldReconnect) {
  54894. return 'reconnecting';
  54895. }
  54896. return 'closing';
  54897. }
  54898. return new _javascriptStateMachine.default({
  54899. init: 'connecting',
  54900. methods: {
  54901. onInvalidTransition(transition, from, to) {
  54902. logger.error('Invalid state transition', {
  54903. transition,
  54904. from,
  54905. to
  54906. });
  54907. }
  54908. },
  54909. transitions: [{
  54910. name: 'open',
  54911. from: ['connecting', 'reconnecting'],
  54912. to: 'open'
  54913. }, {
  54914. name: 'close',
  54915. from: ['connecting', 'reconnecting', 'open'],
  54916. to: 'closing'
  54917. }, {
  54918. name: 'closed',
  54919. from: 'closing',
  54920. to: 'closed'
  54921. }, {
  54922. name: 'disconnect',
  54923. from: ['reconnecting', 'open', 'connecting'],
  54924. to: handleDisconnect
  54925. }]
  54926. });
  54927. };
  54928. exports.default = _default;
  54929. /***/ }),
  54930. /* 661 */
  54931. /***/ (function(module, exports, __webpack_require__) {
  54932. "use strict";
  54933. module.exports = timeInMilliseconds => {
  54934. let hasElapsed = false;
  54935. setTimeout(() => {
  54936. hasElapsed = true;
  54937. }, timeInMilliseconds);
  54938. return () => hasElapsed;
  54939. };
  54940. /***/ }),
  54941. /* 662 */
  54942. /***/ (function(module, exports, __webpack_require__) {
  54943. "use strict";
  54944. var _interopRequireDefault = __webpack_require__(2);
  54945. exports.__esModule = true;
  54946. exports.default = void 0;
  54947. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  54948. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  54949. var _promiseDelay = _interopRequireDefault(__webpack_require__(277));
  54950. var _default = /*#__PURE__*/function () {
  54951. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(webSocket, _temp) {
  54952. var _ref2, _ref2$BUFFER_DRAIN_IN, BUFFER_DRAIN_INTERVAL, _ref2$BUFFER_DRAIN_MA, BUFFER_DRAIN_MAX_RETRIES, attemptNo;
  54953. return _regenerator.default.wrap(function _callee$(_context) {
  54954. while (1) switch (_context.prev = _context.next) {
  54955. case 0:
  54956. _ref2 = _temp === void 0 ? {} : _temp, _ref2$BUFFER_DRAIN_IN = _ref2.BUFFER_DRAIN_INTERVAL, BUFFER_DRAIN_INTERVAL = _ref2$BUFFER_DRAIN_IN === void 0 ? 100 : _ref2$BUFFER_DRAIN_IN, _ref2$BUFFER_DRAIN_MA = _ref2.BUFFER_DRAIN_MAX_RETRIES, BUFFER_DRAIN_MAX_RETRIES = _ref2$BUFFER_DRAIN_MA === void 0 ? 10 : _ref2$BUFFER_DRAIN_MA;
  54957. attemptNo = 0;
  54958. case 2:
  54959. if (!(attemptNo < BUFFER_DRAIN_MAX_RETRIES)) {
  54960. _context.next = 10;
  54961. break;
  54962. }
  54963. if (!(webSocket.bufferedAmount === 0)) {
  54964. _context.next = 5;
  54965. break;
  54966. }
  54967. return _context.abrupt("break", 10);
  54968. case 5:
  54969. _context.next = 7;
  54970. return (0, _promiseDelay.default)(BUFFER_DRAIN_INTERVAL);
  54971. case 7:
  54972. attemptNo += 1;
  54973. _context.next = 2;
  54974. break;
  54975. case 10:
  54976. case "end":
  54977. return _context.stop();
  54978. }
  54979. }, _callee);
  54980. }));
  54981. return function (_x, _x2) {
  54982. return _ref.apply(this, arguments);
  54983. };
  54984. }();
  54985. exports.default = _default;
  54986. /***/ }),
  54987. /* 663 */
  54988. /***/ (function(module, exports, __webpack_require__) {
  54989. "use strict";
  54990. var _interopRequireWildcard = __webpack_require__(105);
  54991. var _interopRequireDefault = __webpack_require__(2);
  54992. exports.__esModule = true;
  54993. exports.default = void 0;
  54994. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(152));
  54995. var _createClass2 = _interopRequireDefault(__webpack_require__(40));
  54996. var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(55));
  54997. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  54998. var _uuid = _interopRequireDefault(__webpack_require__(15));
  54999. var _logEvents = _interopRequireDefault(__webpack_require__(300));
  55000. var _RumorMessage = _interopRequireDefault(__webpack_require__(664));
  55001. var RumorMessageTypes = _interopRequireWildcard(__webpack_require__(166));
  55002. var _SocketError = _interopRequireDefault(__webpack_require__(667));
  55003. var _socketCloseCodes = __webpack_require__(73);
  55004. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  55005. /* eslint-disable no-underscore-dangle */
  55006. var _default = (_ref) => {
  55007. var _class, _temp;
  55008. let EventEmitter = _ref.EventEmitter,
  55009. ReconnectableSocket = _ref.ReconnectableSocket,
  55010. logging = _ref.logging,
  55011. allocateId = _ref.allocateId;
  55012. return _temp = _class = /*#__PURE__*/function (_EventEmitter) {
  55013. (0, _inheritsLoose2.default)(RumorSocket, _EventEmitter);
  55014. (0, _createClass2.default)(RumorSocket, [{
  55015. key: "readyState",
  55016. get: function get() {
  55017. return this._socket ? this._socket.readyState : ReconnectableSocket.CONNECTING;
  55018. }
  55019. }, {
  55020. key: "reconnecting",
  55021. get: function get() {
  55022. return this._opened && this._socket && this._socket.reconnecting;
  55023. } // Messages which have not yet been acknowledged
  55024. }]);
  55025. function RumorSocket(_ref2) {
  55026. var _this;
  55027. let messagingURL = _ref2.messagingURL,
  55028. notifyDisconnectAddress = _ref2.notifyDisconnectAddress,
  55029. connectionId = _ref2.connectionId,
  55030. enableReconnection = _ref2.enableReconnection,
  55031. _ref2$pingThreshold = _ref2.pingThreshold,
  55032. pingThreshold = _ref2$pingThreshold === void 0 ? 2000 : _ref2$pingThreshold,
  55033. _ref2$disconnectThres = _ref2.disconnectThreshold,
  55034. disconnectThreshold = _ref2$disconnectThres === void 0 ? (enableReconnection ? 3 : 25) * pingThreshold - 100 : _ref2$disconnectThres,
  55035. _ref2$reconnectMaxDur = _ref2.reconnectMaxDuration,
  55036. reconnectMaxDuration = _ref2$reconnectMaxDur === void 0 ? enableReconnection ? 60000 : 0 : _ref2$reconnectMaxDur;
  55037. _this = _EventEmitter.call(this) || this;
  55038. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "url", void 0);
  55039. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "id", void 0);
  55040. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_opened", false);
  55041. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_socket", void 0);
  55042. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_reconnectAttempts", 0);
  55043. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_socketID", (0, _uuid.default)());
  55044. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_receivedTransactionIDs", []);
  55045. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_notifyDisconnectAddress", void 0);
  55046. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_enableReconnection", void 0);
  55047. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_pendingMessages", []);
  55048. (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_logger", logging("RumorSocket:" + allocateId()));
  55049. (0, _logEvents.default)({
  55050. logger: _this._logger,
  55051. obj: (0, _assertThisInitialized2.default)(_this),
  55052. eventNames: ['open', 'message', 'error', 'reconnecting', 'reconnectAttempt', 'reconnectFailure', 'reconnected', 'close']
  55053. });
  55054. _this.url = messagingURL;
  55055. _this.id = connectionId;
  55056. _this._notifyDisconnectAddress = notifyDisconnectAddress;
  55057. _this._enableReconnection = enableReconnection;
  55058. _this.on('error', socketError => {
  55059. _this._logger.error(socketError.message);
  55060. });
  55061. try {
  55062. _this._socket = new ReconnectableSocket({
  55063. url: () => !_this._enableReconnection ? _this.url : [_this.url, _this.url.indexOf('?') >= 0 ? '&' : '?', "socketId=" + _this._socketID, _this._socket && _this._socket.reconnecting ? '&reconnect=true' : '', "&attempt=" + (0, _uuid.default)()].join(''),
  55064. pingThreshold,
  55065. disconnectThreshold,
  55066. reconnectMaxDuration
  55067. });
  55068. } catch (e) {
  55069. _this._logger.error(e);
  55070. _this.emit('error', new _SocketError.default(_socketCloseCodes.codes.CLOSE_CONNECT_EXCEPTION));
  55071. }
  55072. const onOpen = () => {
  55073. _this._opened = true;
  55074. _this._socket.send(_RumorMessage.default.Connect(_this.id, notifyDisconnectAddress).serialize());
  55075. _this.emit('open', _this.id);
  55076. };
  55077. _this._socket.once('open', onOpen);
  55078. _this._socket.on('message', event => _this._receiveMessage(event));
  55079. _this._socket.once('close', closeEvent => {
  55080. _this._logger.debug("ReconnectableSocket closed (code: " + closeEvent.code + ")");
  55081. _this._clearPendingMessages(); // We don't emit an error for these close codes because they are normal and TIMEOUT has a
  55082. // dedicated error and we would duplicate it here.
  55083. const CLOSE_NORMAL = _socketCloseCodes.codes.CLOSE_NORMAL,
  55084. CLOSE_GOING_AWAY = _socketCloseCodes.codes.CLOSE_GOING_AWAY,
  55085. CLOSE_TIMEOUT = _socketCloseCodes.codes.CLOSE_TIMEOUT;
  55086. if ([CLOSE_NORMAL, CLOSE_GOING_AWAY, CLOSE_TIMEOUT].indexOf(closeEvent.code) === -1) {
  55087. _this.emit('error', new _SocketError.default(closeEvent.code, closeEvent.reason || closeEvent.message));
  55088. }
  55089. _this.emit('close', closeEvent);
  55090. });
  55091. _this._socket.on('error', (_ref3) => {
  55092. let code = _ref3.code;
  55093. return _this.emit('error', new _SocketError.default(code));
  55094. });
  55095. _this._socket.on('needsPing', () => {
  55096. _this._socket.send(_RumorMessage.default.Ping().serialize());
  55097. });
  55098. _this._socket.on('reconnecting', () => {
  55099. if (!_this._opened) {
  55100. return;
  55101. } // ignore reconnect events when we haven't opened yet
  55102. _this._clearPendingMessagesWhichShouldntRetry();
  55103. _this.emit('reconnecting');
  55104. _this._reconnectAttempts = 0;
  55105. });
  55106. _this._socket.on('reconnectAttempt', () => {
  55107. if (!_this._opened) {
  55108. return;
  55109. } // ignore reconnect events when we haven't opened yet
  55110. _this._reconnectAttempts += 1; // TODO: Although this should be ok if the socket is already closed since ReconnectableSocket
  55111. // will just drop it due to retryAfterReconnect=false, it should be tested.
  55112. _this._socket.send(_RumorMessage.default.Disconnect('1').serialize(), false);
  55113. _this.emit('reconnectAttempt');
  55114. });
  55115. _this._socket.on('reconnected', () => {
  55116. if (!_this._opened) {
  55117. onOpen();
  55118. return;
  55119. } // ignore reconnect events when we haven't opened yet
  55120. // Resend pending messages (unacknowledged messages)
  55121. _this._pendingMessages.forEach(msg => {
  55122. _this._socket.send(msg.rumorMessage.serialize());
  55123. });
  55124. _this.emit('reconnected');
  55125. });
  55126. _this._socket.on('reconnectFailure', () => {
  55127. if (!_this._opened) {
  55128. return;
  55129. } // ignore reconnect events when we haven't opened yet
  55130. _this._logger.debug('Reconnecting failed as connectivity was not restored within ' + (reconnectMaxDuration + "ms")); // TODO: This was picked when porting over the old code, but we should be able to set use a
  55131. // better code and message here.
  55132. _this.emit('reconnectFailure', new _SocketError.default());
  55133. });
  55134. return _this;
  55135. }
  55136. var _proto = RumorSocket.prototype;
  55137. _proto._clearPendingMessagesWhichShouldntRetry = function _clearPendingMessagesWhichShouldntRetry() {
  55138. const messagesToClear = this._pendingMessages.filter(message => !message.retryAfterReconnect);
  55139. this._pendingMessages = this._pendingMessages.filter(message => message.retryAfterReconnect);
  55140. messagesToClear.forEach(message => {
  55141. const error = new Error('Not connected.');
  55142. error.code = 500;
  55143. message.completion(error);
  55144. });
  55145. };
  55146. _proto._clearPendingMessages = function _clearPendingMessages() {
  55147. this._pendingMessages.forEach(message => {
  55148. const error = new Error('Not connected.');
  55149. error.code = 500;
  55150. message.completion(error);
  55151. });
  55152. this._pendingMessages = [];
  55153. };
  55154. _proto._sendAck = function _sendAck(msg) {
  55155. this._socket.send(_RumorMessage.default.Status([msg.fromAddress], {
  55156. 'TRANSACTION-ID': msg.headers['TRANSACTION-ID'],
  55157. 'X-TB-FROM-ADDRESS': this.id
  55158. }).serialize());
  55159. };
  55160. _proto._receiveMessage = function _receiveMessage(messageEvent) {
  55161. const msg = _RumorMessage.default.deserialize(messageEvent.data);
  55162. if (msg.type === RumorMessageTypes.PONG) {
  55163. return;
  55164. }
  55165. this._logger.debug('Received:', msg);
  55166. if (msg.transactionId) {
  55167. // remove pending message
  55168. this._pendingMessages = this._pendingMessages.filter(pendingMessage => {
  55169. if (pendingMessage.rumorMessage.transactionId === msg.transactionId) {
  55170. this._logger.debug('Marking', msg.transactionId, ' as received');
  55171. pendingMessage.completion(undefined, msg);
  55172. }
  55173. return pendingMessage.rumorMessage.transactionId !== msg.transactionId;
  55174. });
  55175. }
  55176. if (msg.transactionId && msg.type !== RumorMessageTypes.STATUS) {
  55177. // 1) ack it!
  55178. this._sendAck(msg); // Have we seen this transaction before?
  55179. if (this._receivedTransactionIDs.indexOf(msg.transactionId) >= 0) {
  55180. // We've handled this transactionId before, but the ACK
  55181. // must have been lost. That's ok, we've told the server
  55182. // so we can just ignore this message now.
  55183. return;
  55184. }
  55185. this._receivedTransactionIDs.push(msg.transactionId);
  55186. }
  55187. this.emit('message', msg);
  55188. };
  55189. _proto.publish = function publish(topics, message, headers, retryAfterReconnect, completion) {
  55190. if (completion === void 0) {
  55191. completion = () => {};
  55192. }
  55193. // TODO: Instead of completion, sending a message should return an event emitter which emits:
  55194. // - sent: if connected, emitted on next tick, if reconnecting, emitted on reconnected
  55195. // - ack: received ack for this message from server
  55196. // - error: won't receive ack (not connected / dropped)
  55197. // Also should have .status obtained from ReconnectableSocket.send
  55198. const rumorMessage = _RumorMessage.default.Publish(topics, message, headers); // We always use retryAfterReconnect=false on ReconnectableSocket because rumor does additional
  55199. // retries based on the ack status of messages which ReconnectableSocket doesn't know about,
  55200. // and we don't want these retry strategies to conflict.
  55201. const status = this._socket.send(rumorMessage.serialize(), false);
  55202. if (status === 'dropped' && !retryAfterReconnect) {
  55203. const error = new Error('Not connected.');
  55204. error.code = 500;
  55205. completion(error);
  55206. return;
  55207. }
  55208. this._pendingMessages.push({
  55209. rumorMessage,
  55210. retryAfterReconnect,
  55211. completion
  55212. });
  55213. };
  55214. _proto.subscribe = function subscribe(topics) {
  55215. this._socket.send(_RumorMessage.default.Subscribe(topics).serialize());
  55216. };
  55217. _proto.unsubscribe = function unsubscribe(topics) {
  55218. this._socket.send(_RumorMessage.default.Unsubscribe(topics).serialize());
  55219. };
  55220. _proto.disconnect = function disconnect() {
  55221. if (this.readyState === RumorSocket.OPEN) {
  55222. this._socket.send(_RumorMessage.default.Disconnect().serialize());
  55223. }
  55224. if (this._socket.readyState !== ReconnectableSocket.CLOSED && this._socket.readyState !== ReconnectableSocket.CLOSING) {
  55225. const CLOSE_NORMAL = _socketCloseCodes.codes.CLOSE_NORMAL;
  55226. this._socket.close(CLOSE_NORMAL, _socketCloseCodes.messages[CLOSE_NORMAL]);
  55227. }
  55228. };
  55229. _proto.status = function status(toAddress, transactionId) {
  55230. this._socket.send(_RumorMessage.default.Status(toAddress, {
  55231. 'TRANSACTION-ID': transactionId,
  55232. 'X-TB-FROM-ADDRESS': this.id
  55233. }).serialize());
  55234. };
  55235. _proto.reconnectRetriesCount = function reconnectRetriesCount() {
  55236. return this._reconnectAttempts;
  55237. };
  55238. _proto.messageQueueSize = function messageQueueSize() {
  55239. return this._pendingMessages.length;
  55240. } // This could do with some reconciliation. Also with logger name now.
  55241. ;
  55242. (0, _createClass2.default)(RumorSocket, [{
  55243. key: "socketID",
  55244. get: function get() {
  55245. return this._socketID;
  55246. }
  55247. }]);
  55248. return RumorSocket;
  55249. }(EventEmitter), (0, _defineProperty2.default)(_class, "CONNECTING", ReconnectableSocket.CONNECTING), (0, _defineProperty2.default)(_class, "OPEN", ReconnectableSocket.OPEN), (0, _defineProperty2.default)(_class, "CLOSING", ReconnectableSocket.CLOSING), (0, _defineProperty2.default)(_class, "CLOSED", ReconnectableSocket.CLOSED), _temp;
  55250. };
  55251. exports.default = _default;
  55252. /***/ }),
  55253. /* 664 */
  55254. /***/ (function(module, exports, __webpack_require__) {
  55255. "use strict";
  55256. var _interopRequireWildcard = __webpack_require__(105);
  55257. var _interopRequireDefault = __webpack_require__(2);
  55258. exports.__esModule = true;
  55259. exports.default = void 0;
  55260. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  55261. var _uuid = _interopRequireDefault(__webpack_require__(15));
  55262. var _encoding = __webpack_require__(665);
  55263. var RumorMessageTypes = _interopRequireWildcard(__webpack_require__(166));
  55264. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  55265. /* eslint-disable one-var, no-restricted-syntax, no-prototype-builtins */
  55266. /* eslint-disable no-continue, prefer-const, no-bitwise, no-mixed-operators, no-param-reassign */
  55267. const toArrayBuffer = buffer => {
  55268. const ab = new ArrayBuffer(buffer.length);
  55269. const view = new Uint8Array(ab);
  55270. for (let i = 0; i < buffer.length; ++i) {
  55271. view[i] = buffer[i];
  55272. }
  55273. return ab;
  55274. }; // @references
  55275. // * https://tbwiki.tokbox.com/index.php/Rumor_Message_Packet
  55276. // * https://tbwiki.tokbox.com/index.php/Rumor_Protocol
  55277. //
  55278. let RumorMessage = /*#__PURE__*/function () {
  55279. function RumorMessage(type, toAddress, headers, data) {
  55280. (0, _defineProperty2.default)(this, "type", void 0);
  55281. (0, _defineProperty2.default)(this, "toAddress", void 0);
  55282. (0, _defineProperty2.default)(this, "headers", void 0);
  55283. (0, _defineProperty2.default)(this, "data", void 0);
  55284. this.type = type;
  55285. this.toAddress = toAddress;
  55286. this.headers = headers;
  55287. this.data = data;
  55288. this.fromAddress = this.headers['X-TB-FROM-ADDRESS'];
  55289. this.transactionId = this.headers['TRANSACTION-ID'];
  55290. this.status = this.headers.STATUS; // Only status messages will have a status header. So a missing status header
  55291. // does not indicate an eror.
  55292. this.isError = this.status && this.status[0] !== '2';
  55293. }
  55294. var _proto = RumorMessage.prototype;
  55295. _proto.serialize = function serialize() {
  55296. let strArray, dataView, i, j;
  55297. let offset = 8;
  55298. let cBuf = 7;
  55299. const address = [];
  55300. const headerKey = [];
  55301. const headerVal = []; // The number of addresses
  55302. cBuf++; // Write out the address.
  55303. for (i = 0; i < this.toAddress.length; i++) {
  55304. /* jshint newcap:false */
  55305. address.push(new _encoding.TextEncoder('utf-8').encode(this.toAddress[i]));
  55306. cBuf += 2;
  55307. cBuf += address[i].length;
  55308. } // The number of parameters
  55309. cBuf++; // Write out the params
  55310. i = 0;
  55311. for (const key in this.headers) {
  55312. // eslint-disable-line one-var
  55313. if (!this.headers.hasOwnProperty(key)) {
  55314. continue;
  55315. }
  55316. headerKey.push(new _encoding.TextEncoder('utf-8').encode(key));
  55317. headerVal.push(new _encoding.TextEncoder('utf-8').encode(this.headers[key]));
  55318. cBuf += 4;
  55319. cBuf += headerKey[i].length;
  55320. cBuf += headerVal[i].length;
  55321. i++;
  55322. }
  55323. dataView = new _encoding.TextEncoder('utf-8').encode(this.data);
  55324. cBuf += dataView.length; // Let's allocate a binary blob of this size
  55325. const buffer = new ArrayBuffer(cBuf);
  55326. const uint8View = new Uint8Array(buffer, 0, cBuf); // We don't include the header in the lenght.
  55327. cBuf -= 4; // Write out size (in network order)
  55328. uint8View[0] = (cBuf & 0xFF000000) >>> 24;
  55329. uint8View[1] = (cBuf & 0x00FF0000) >>> 16;
  55330. uint8View[2] = (cBuf & 0x0000FF00) >>> 8;
  55331. uint8View[3] = (cBuf & 0x000000FF) >>> 0; // Write out reserved bytes
  55332. uint8View[4] = 0;
  55333. uint8View[5] = 0; // Write out message type
  55334. uint8View[6] = this.type;
  55335. uint8View[7] = this.toAddress.length; // Now just copy over the encoded values..
  55336. for (i = 0; i < address.length; i++) {
  55337. strArray = address[i];
  55338. uint8View[offset++] = strArray.length >> 8 & 0xFF;
  55339. uint8View[offset++] = strArray.length >> 0 & 0xFF;
  55340. for (j = 0; j < strArray.length; j++) {
  55341. uint8View[offset++] = strArray[j];
  55342. }
  55343. }
  55344. uint8View[offset++] = headerKey.length; // Write out the params
  55345. for (i = 0; i < headerKey.length; i++) {
  55346. strArray = headerKey[i];
  55347. uint8View[offset++] = strArray.length >> 8 & 0xFF;
  55348. uint8View[offset++] = strArray.length >> 0 & 0xFF;
  55349. for (j = 0; j < strArray.length; j++) {
  55350. uint8View[offset++] = strArray[j];
  55351. }
  55352. strArray = headerVal[i];
  55353. uint8View[offset++] = strArray.length >> 8 & 0xFF;
  55354. uint8View[offset++] = strArray.length >> 0 & 0xFF;
  55355. for (j = 0; j < strArray.length; j++) {
  55356. uint8View[offset++] = strArray[j];
  55357. }
  55358. } // And finally the data
  55359. for (i = 0; i < dataView.length; i++) {
  55360. uint8View[offset++] = dataView[i];
  55361. }
  55362. return buffer;
  55363. };
  55364. RumorMessage.deserialize = function deserialize(buffer) {
  55365. if ((typeof window !== undefined ? window : global).Buffer && (typeof window !== undefined ? window : global).Buffer.isBuffer(buffer)) {
  55366. buffer = toArrayBuffer(buffer);
  55367. }
  55368. let type, strView, headerlen, headers, keyStr, valStr, length, i;
  55369. let offset = 8;
  55370. const uint8View = new Uint8Array(buffer);
  55371. type = uint8View[6];
  55372. const address = [];
  55373. for (i = 0; i < uint8View[7]; i++) {
  55374. length = uint8View[offset++] << 8;
  55375. length += uint8View[offset++];
  55376. strView = new Uint8Array(buffer, offset, length);
  55377. /* jshint newcap:false */
  55378. address[i] = new _encoding.TextDecoder('utf-8').decode(strView);
  55379. offset += length;
  55380. }
  55381. headerlen = uint8View[offset++];
  55382. headers = {};
  55383. for (i = 0; i < headerlen; i++) {
  55384. length = uint8View[offset++] << 8;
  55385. length += uint8View[offset++];
  55386. strView = new Uint8Array(buffer, offset, length);
  55387. keyStr = new _encoding.TextDecoder('utf-8').decode(strView);
  55388. offset += length;
  55389. length = uint8View[offset++] << 8;
  55390. length += uint8View[offset++];
  55391. strView = new Uint8Array(buffer, offset, length);
  55392. valStr = new _encoding.TextDecoder('utf-8').decode(strView);
  55393. headers[keyStr] = valStr;
  55394. offset += length;
  55395. }
  55396. const dataView = new Uint8Array(buffer, offset);
  55397. const data = new _encoding.TextDecoder('utf-8').decode(dataView);
  55398. return new RumorMessage(type, address, headers, data);
  55399. };
  55400. RumorMessage.Connect = function Connect(uniqueId, notifyDisconnectAddress) {
  55401. const headers = {
  55402. uniqueId,
  55403. 'TRANSACTION-ID': (0, _uuid.default)(),
  55404. notifyDisconnectAddress
  55405. };
  55406. return new RumorMessage(RumorMessageTypes.CONNECT, [], headers, '');
  55407. };
  55408. RumorMessage.Disconnect = function Disconnect(reconnect) {
  55409. return new RumorMessage(RumorMessageTypes.DISCONNECT, [], {
  55410. reconnect
  55411. }, '');
  55412. };
  55413. RumorMessage.Subscribe = function Subscribe(topics) {
  55414. return new RumorMessage(RumorMessageTypes.SUBSCRIBE, topics, {}, '');
  55415. };
  55416. RumorMessage.Unsubscribe = function Unsubscribe(topics) {
  55417. return new RumorMessage(RumorMessageTypes.UNSUBSCRIBE, topics, {}, '');
  55418. };
  55419. RumorMessage.Publish = function Publish(topics, message, headers) {
  55420. return new RumorMessage(RumorMessageTypes.MESSAGE, topics, headers || {}, message || '');
  55421. };
  55422. RumorMessage.Status = function Status(topics, headers) {
  55423. return new RumorMessage(RumorMessageTypes.STATUS, topics, headers || {}, '');
  55424. } // This message is used to implement keepalives on the persistent
  55425. // socket connection between the client and server. Every time the
  55426. // client sends a PING to the server, the server will respond with
  55427. // a PONG.
  55428. ;
  55429. RumorMessage.Ping = function Ping() {
  55430. return new RumorMessage(RumorMessageTypes.PING, [], {}, '');
  55431. };
  55432. return RumorMessage;
  55433. }();
  55434. exports.default = RumorMessage;
  55435. /***/ }),
  55436. /* 665 */
  55437. /***/ (function(module, exports, __webpack_require__) {
  55438. "use strict";
  55439. var _interopRequireWildcard = __webpack_require__(105);
  55440. exports.__esModule = true;
  55441. exports.TextDecoder = exports.TextEncoder = void 0;
  55442. var TextEncoding = _interopRequireWildcard(__webpack_require__(666));
  55443. // Unfortunately it looks like the text-encoding module always returns its implementations of
  55444. // TextEncoder and TextDecoder, so we wrap it here to expose the global (window) ones, if available.
  55445. const TextEncoder = (typeof window !== undefined ? window : global).TextEncoder || TextEncoding.TextEncoder;
  55446. exports.TextEncoder = TextEncoder;
  55447. const TextDecoder = (typeof window !== undefined ? window : global).TextDecoder || TextEncoding.TextDecoder;
  55448. exports.TextDecoder = TextDecoder;
  55449. /***/ }),
  55450. /* 666 */
  55451. /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
  55452. "use strict";
  55453. __webpack_require__.r(__webpack_exports__);
  55454. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEncoder", function() { return TextEncoder; });
  55455. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDecoder", function() { return TextDecoder; });
  55456. // This is free and unencumbered software released into the public domain.
  55457. // See LICENSE.md for more information.
  55458. //
  55459. // Utilities
  55460. //
  55461. /**
  55462. * @param {number} a The number to test.
  55463. * @param {number} min The minimum value in the range, inclusive.
  55464. * @param {number} max The maximum value in the range, inclusive.
  55465. * @return {boolean} True if a >= min and a <= max.
  55466. */
  55467. function inRange(a, min, max) {
  55468. return min <= a && a <= max;
  55469. }
  55470. /**
  55471. * @param {*} o
  55472. * @return {Object}
  55473. */
  55474. function ToDictionary(o) {
  55475. if (o === undefined) return {};
  55476. if (o === Object(o)) return o;
  55477. throw TypeError('Could not convert argument to dictionary');
  55478. }
  55479. /**
  55480. * @param {string} string Input string of UTF-16 code units.
  55481. * @return {!Array.<number>} Code points.
  55482. */
  55483. function stringToCodePoints(string) {
  55484. // https://heycam.github.io/webidl/#dfn-obtain-unicode
  55485. // 1. Let S be the DOMString value.
  55486. var s = String(string);
  55487. // 2. Let n be the length of S.
  55488. var n = s.length;
  55489. // 3. Initialize i to 0.
  55490. var i = 0;
  55491. // 4. Initialize U to be an empty sequence of Unicode characters.
  55492. var u = [];
  55493. // 5. While i < n:
  55494. while (i < n) {
  55495. // 1. Let c be the code unit in S at index i.
  55496. var c = s.charCodeAt(i);
  55497. // 2. Depending on the value of c:
  55498. // c < 0xD800 or c > 0xDFFF
  55499. if (c < 0xD800 || c > 0xDFFF) {
  55500. // Append to U the Unicode character with code point c.
  55501. u.push(c);
  55502. }
  55503. // 0xDC00 ≤ c ≤ 0xDFFF
  55504. else if (0xDC00 <= c && c <= 0xDFFF) {
  55505. // Append to U a U+FFFD REPLACEMENT CHARACTER.
  55506. u.push(0xFFFD);
  55507. }
  55508. // 0xD800 ≤ c ≤ 0xDBFF
  55509. else if (0xD800 <= c && c <= 0xDBFF) {
  55510. // 1. If i = n−1, then append to U a U+FFFD REPLACEMENT
  55511. // CHARACTER.
  55512. if (i === n - 1) {
  55513. u.push(0xFFFD);
  55514. }
  55515. // 2. Otherwise, i < n−1:
  55516. else {
  55517. // 1. Let d be the code unit in S at index i+1.
  55518. var d = string.charCodeAt(i + 1);
  55519. // 2. If 0xDC00 ≤ d ≤ 0xDFFF, then:
  55520. if (0xDC00 <= d && d <= 0xDFFF) {
  55521. // 1. Let a be c & 0x3FF.
  55522. var a = c & 0x3FF;
  55523. // 2. Let b be d & 0x3FF.
  55524. var b = d & 0x3FF;
  55525. // 3. Append to U the Unicode character with code point
  55526. // 2^16+2^10*a+b.
  55527. u.push(0x10000 + (a << 10) + b);
  55528. // 4. Set i to i+1.
  55529. i += 1;
  55530. }
  55531. // 3. Otherwise, d < 0xDC00 or d > 0xDFFF. Append to U a
  55532. // U+FFFD REPLACEMENT CHARACTER.
  55533. else {
  55534. u.push(0xFFFD);
  55535. }
  55536. }
  55537. }
  55538. // 3. Set i to i+1.
  55539. i += 1;
  55540. }
  55541. // 6. Return U.
  55542. return u;
  55543. }
  55544. /**
  55545. * @param {!Array.<number>} code_points Array of code points.
  55546. * @return {string} string String of UTF-16 code units.
  55547. */
  55548. function codePointsToString(code_points) {
  55549. var s = '';
  55550. for (var i = 0; i < code_points.length; ++i) {
  55551. var cp = code_points[i];
  55552. if (cp <= 0xFFFF) {
  55553. s += String.fromCharCode(cp);
  55554. } else {
  55555. cp -= 0x10000;
  55556. s += String.fromCharCode((cp >> 10) + 0xD800,
  55557. (cp & 0x3FF) + 0xDC00);
  55558. }
  55559. }
  55560. return s;
  55561. }
  55562. //
  55563. // Implementation of Encoding specification
  55564. // https://encoding.spec.whatwg.org/
  55565. //
  55566. //
  55567. // 3. Terminology
  55568. //
  55569. /**
  55570. * End-of-stream is a special token that signifies no more tokens
  55571. * are in the stream.
  55572. * @const
  55573. */ var end_of_stream = -1;
  55574. /**
  55575. * A stream represents an ordered sequence of tokens.
  55576. *
  55577. * @constructor
  55578. * @param {!(Array.<number>|Uint8Array)} tokens Array of tokens that provide the
  55579. * stream.
  55580. */
  55581. function Stream(tokens) {
  55582. /** @type {!Array.<number>} */
  55583. this.tokens = [].slice.call(tokens);
  55584. }
  55585. Stream.prototype = {
  55586. /**
  55587. * @return {boolean} True if end-of-stream has been hit.
  55588. */
  55589. endOfStream: function() {
  55590. return !this.tokens.length;
  55591. },
  55592. /**
  55593. * When a token is read from a stream, the first token in the
  55594. * stream must be returned and subsequently removed, and
  55595. * end-of-stream must be returned otherwise.
  55596. *
  55597. * @return {number} Get the next token from the stream, or
  55598. * end_of_stream.
  55599. */
  55600. read: function() {
  55601. if (!this.tokens.length)
  55602. return end_of_stream;
  55603. return this.tokens.shift();
  55604. },
  55605. /**
  55606. * When one or more tokens are prepended to a stream, those tokens
  55607. * must be inserted, in given order, before the first token in the
  55608. * stream.
  55609. *
  55610. * @param {(number|!Array.<number>)} token The token(s) to prepend to the stream.
  55611. */
  55612. prepend: function(token) {
  55613. if (Array.isArray(token)) {
  55614. var tokens = /**@type {!Array.<number>}*/(token);
  55615. while (tokens.length)
  55616. this.tokens.unshift(tokens.pop());
  55617. } else {
  55618. this.tokens.unshift(token);
  55619. }
  55620. },
  55621. /**
  55622. * When one or more tokens are pushed to a stream, those tokens
  55623. * must be inserted, in given order, after the last token in the
  55624. * stream.
  55625. *
  55626. * @param {(number|!Array.<number>)} token The tokens(s) to prepend to the stream.
  55627. */
  55628. push: function(token) {
  55629. if (Array.isArray(token)) {
  55630. var tokens = /**@type {!Array.<number>}*/(token);
  55631. while (tokens.length)
  55632. this.tokens.push(tokens.shift());
  55633. } else {
  55634. this.tokens.push(token);
  55635. }
  55636. }
  55637. };
  55638. //
  55639. // 4. Encodings
  55640. //
  55641. // 4.1 Encoders and decoders
  55642. /** @const */
  55643. var finished = -1;
  55644. /**
  55645. * @param {boolean} fatal If true, decoding errors raise an exception.
  55646. * @param {number=} opt_code_point Override the standard fallback code point.
  55647. * @return {number} The code point to insert on a decoding error.
  55648. */
  55649. function decoderError(fatal, opt_code_point) {
  55650. if (fatal)
  55651. throw TypeError('Decoder error');
  55652. return opt_code_point || 0xFFFD;
  55653. }
  55654. /** @interface */
  55655. function Decoder() {}
  55656. Decoder.prototype = {
  55657. /**
  55658. * @param {Stream} stream The stream of bytes being decoded.
  55659. * @param {number} bite The next byte read from the stream.
  55660. * @return {?(number|!Array.<number>)} The next code point(s)
  55661. * decoded, or null if not enough data exists in the input
  55662. * stream to decode a complete code point, or |finished|.
  55663. */
  55664. handler: function(stream, bite) {}
  55665. };
  55666. /** @interface */
  55667. function Encoder() {}
  55668. Encoder.prototype = {
  55669. /**
  55670. * @param {Stream} stream The stream of code points being encoded.
  55671. * @param {number} code_point Next code point read from the stream.
  55672. * @return {(number|!Array.<number>)} Byte(s) to emit, or |finished|.
  55673. */
  55674. handler: function(stream, code_point) {}
  55675. };
  55676. //
  55677. // 7. API
  55678. //
  55679. /** @const */ var DEFAULT_ENCODING = 'utf-8';
  55680. // 7.1 Interface TextDecoder
  55681. /**
  55682. * @constructor
  55683. * @param {string=} encoding The label of the encoding;
  55684. * defaults to 'utf-8'.
  55685. * @param {Object=} options
  55686. */
  55687. function TextDecoder(encoding, options) {
  55688. if (!(this instanceof TextDecoder)) {
  55689. return new TextDecoder(encoding, options);
  55690. }
  55691. encoding = encoding !== undefined ? String(encoding).toLowerCase() : DEFAULT_ENCODING;
  55692. if (encoding !== DEFAULT_ENCODING) {
  55693. throw new Error('Encoding not supported. Only utf-8 is supported');
  55694. }
  55695. options = ToDictionary(options);
  55696. /** @private @type {boolean} */
  55697. this._streaming = false;
  55698. /** @private @type {boolean} */
  55699. this._BOMseen = false;
  55700. /** @private @type {?Decoder} */
  55701. this._decoder = null;
  55702. /** @private @type {boolean} */
  55703. this._fatal = Boolean(options['fatal']);
  55704. /** @private @type {boolean} */
  55705. this._ignoreBOM = Boolean(options['ignoreBOM']);
  55706. Object.defineProperty(this, 'encoding', {value: 'utf-8'});
  55707. Object.defineProperty(this, 'fatal', {value: this._fatal});
  55708. Object.defineProperty(this, 'ignoreBOM', {value: this._ignoreBOM});
  55709. }
  55710. TextDecoder.prototype = {
  55711. /**
  55712. * @param {ArrayBufferView=} input The buffer of bytes to decode.
  55713. * @param {Object=} options
  55714. * @return {string} The decoded string.
  55715. */
  55716. decode: function decode(input, options) {
  55717. var bytes;
  55718. if (typeof input === 'object' && input instanceof ArrayBuffer) {
  55719. bytes = new Uint8Array(input);
  55720. } else if (typeof input === 'object' && 'buffer' in input &&
  55721. input.buffer instanceof ArrayBuffer) {
  55722. bytes = new Uint8Array(input.buffer,
  55723. input.byteOffset,
  55724. input.byteLength);
  55725. } else {
  55726. bytes = new Uint8Array(0);
  55727. }
  55728. options = ToDictionary(options);
  55729. if (!this._streaming) {
  55730. this._decoder = new UTF8Decoder({fatal: this._fatal});
  55731. this._BOMseen = false;
  55732. }
  55733. this._streaming = Boolean(options['stream']);
  55734. var input_stream = new Stream(bytes);
  55735. var code_points = [];
  55736. /** @type {?(number|!Array.<number>)} */
  55737. var result;
  55738. while (!input_stream.endOfStream()) {
  55739. result = this._decoder.handler(input_stream, input_stream.read());
  55740. if (result === finished)
  55741. break;
  55742. if (result === null)
  55743. continue;
  55744. if (Array.isArray(result))
  55745. code_points.push.apply(code_points, /**@type {!Array.<number>}*/(result));
  55746. else
  55747. code_points.push(result);
  55748. }
  55749. if (!this._streaming) {
  55750. do {
  55751. result = this._decoder.handler(input_stream, input_stream.read());
  55752. if (result === finished)
  55753. break;
  55754. if (result === null)
  55755. continue;
  55756. if (Array.isArray(result))
  55757. code_points.push.apply(code_points, /**@type {!Array.<number>}*/(result));
  55758. else
  55759. code_points.push(result);
  55760. } while (!input_stream.endOfStream());
  55761. this._decoder = null;
  55762. }
  55763. if (code_points.length) {
  55764. // If encoding is one of utf-8, utf-16be, and utf-16le, and
  55765. // ignore BOM flag and BOM seen flag are unset, run these
  55766. // subsubsteps:
  55767. if (['utf-8'].indexOf(this.encoding) !== -1 &&
  55768. !this._ignoreBOM && !this._BOMseen) {
  55769. // If token is U+FEFF, set BOM seen flag.
  55770. if (code_points[0] === 0xFEFF) {
  55771. this._BOMseen = true;
  55772. code_points.shift();
  55773. } else {
  55774. // Otherwise, if token is not end-of-stream, set BOM seen
  55775. // flag and append token to output.
  55776. this._BOMseen = true;
  55777. }
  55778. }
  55779. }
  55780. return codePointsToString(code_points);
  55781. }
  55782. };
  55783. // 7.2 Interface TextEncoder
  55784. /**
  55785. * @constructor
  55786. * @param {string=} encoding The label of the encoding;
  55787. * defaults to 'utf-8'.
  55788. * @param {Object=} options
  55789. */
  55790. function TextEncoder(encoding, options) {
  55791. if (!(this instanceof TextEncoder))
  55792. return new TextEncoder(encoding, options);
  55793. encoding = encoding !== undefined ? String(encoding).toLowerCase() : DEFAULT_ENCODING;
  55794. if (encoding !== DEFAULT_ENCODING) {
  55795. throw new Error('Encoding not supported. Only utf-8 is supported');
  55796. }
  55797. options = ToDictionary(options);
  55798. /** @private @type {boolean} */
  55799. this._streaming = false;
  55800. /** @private @type {?Encoder} */
  55801. this._encoder = null;
  55802. /** @private @type {{fatal: boolean}} */
  55803. this._options = {fatal: Boolean(options['fatal'])};
  55804. Object.defineProperty(this, 'encoding', {value: 'utf-8'});
  55805. }
  55806. TextEncoder.prototype = {
  55807. /**
  55808. * @param {string=} opt_string The string to encode.
  55809. * @param {Object=} options
  55810. * @return {Uint8Array} Encoded bytes, as a Uint8Array.
  55811. */
  55812. encode: function encode(opt_string, options) {
  55813. opt_string = opt_string ? String(opt_string) : '';
  55814. options = ToDictionary(options);
  55815. // NOTE: This option is nonstandard. None of the encodings
  55816. // permitted for encoding (i.e. UTF-8, UTF-16) are stateful,
  55817. // so streaming is not necessary.
  55818. if (!this._streaming)
  55819. this._encoder = new UTF8Encoder(this._options);
  55820. this._streaming = Boolean(options['stream']);
  55821. var bytes = [];
  55822. var input_stream = new Stream(stringToCodePoints(opt_string));
  55823. /** @type {?(number|!Array.<number>)} */
  55824. var result;
  55825. while (!input_stream.endOfStream()) {
  55826. result = this._encoder.handler(input_stream, input_stream.read());
  55827. if (result === finished)
  55828. break;
  55829. if (Array.isArray(result))
  55830. bytes.push.apply(bytes, /**@type {!Array.<number>}*/(result));
  55831. else
  55832. bytes.push(result);
  55833. }
  55834. if (!this._streaming) {
  55835. while (true) {
  55836. result = this._encoder.handler(input_stream, input_stream.read());
  55837. if (result === finished)
  55838. break;
  55839. if (Array.isArray(result))
  55840. bytes.push.apply(bytes, /**@type {!Array.<number>}*/(result));
  55841. else
  55842. bytes.push(result);
  55843. }
  55844. this._encoder = null;
  55845. }
  55846. return new Uint8Array(bytes);
  55847. }
  55848. };
  55849. //
  55850. // 8. The encoding
  55851. //
  55852. // 8.1 utf-8
  55853. /**
  55854. * @constructor
  55855. * @implements {Decoder}
  55856. * @param {{fatal: boolean}} options
  55857. */
  55858. function UTF8Decoder(options) {
  55859. var fatal = options.fatal;
  55860. // utf-8's decoder's has an associated utf-8 code point, utf-8
  55861. // bytes seen, and utf-8 bytes needed (all initially 0), a utf-8
  55862. // lower boundary (initially 0x80), and a utf-8 upper boundary
  55863. // (initially 0xBF).
  55864. var /** @type {number} */ utf8_code_point = 0,
  55865. /** @type {number} */ utf8_bytes_seen = 0,
  55866. /** @type {number} */ utf8_bytes_needed = 0,
  55867. /** @type {number} */ utf8_lower_boundary = 0x80,
  55868. /** @type {number} */ utf8_upper_boundary = 0xBF;
  55869. /**
  55870. * @param {Stream} stream The stream of bytes being decoded.
  55871. * @param {number} bite The next byte read from the stream.
  55872. * @return {?(number|!Array.<number>)} The next code point(s)
  55873. * decoded, or null if not enough data exists in the input
  55874. * stream to decode a complete code point.
  55875. */
  55876. this.handler = function(stream, bite) {
  55877. // 1. If byte is end-of-stream and utf-8 bytes needed is not 0,
  55878. // set utf-8 bytes needed to 0 and return error.
  55879. if (bite === end_of_stream && utf8_bytes_needed !== 0) {
  55880. utf8_bytes_needed = 0;
  55881. return decoderError(fatal);
  55882. }
  55883. // 2. If byte is end-of-stream, return finished.
  55884. if (bite === end_of_stream)
  55885. return finished;
  55886. // 3. If utf-8 bytes needed is 0, based on byte:
  55887. if (utf8_bytes_needed === 0) {
  55888. // 0x00 to 0x7F
  55889. if (inRange(bite, 0x00, 0x7F)) {
  55890. // Return a code point whose value is byte.
  55891. return bite;
  55892. }
  55893. // 0xC2 to 0xDF
  55894. if (inRange(bite, 0xC2, 0xDF)) {
  55895. // Set utf-8 bytes needed to 1 and utf-8 code point to byte
  55896. // − 0xC0.
  55897. utf8_bytes_needed = 1;
  55898. utf8_code_point = bite - 0xC0;
  55899. }
  55900. // 0xE0 to 0xEF
  55901. else if (inRange(bite, 0xE0, 0xEF)) {
  55902. // 1. If byte is 0xE0, set utf-8 lower boundary to 0xA0.
  55903. if (bite === 0xE0)
  55904. utf8_lower_boundary = 0xA0;
  55905. // 2. If byte is 0xED, set utf-8 upper boundary to 0x9F.
  55906. if (bite === 0xED)
  55907. utf8_upper_boundary = 0x9F;
  55908. // 3. Set utf-8 bytes needed to 2 and utf-8 code point to
  55909. // byte − 0xE0.
  55910. utf8_bytes_needed = 2;
  55911. utf8_code_point = bite - 0xE0;
  55912. }
  55913. // 0xF0 to 0xF4
  55914. else if (inRange(bite, 0xF0, 0xF4)) {
  55915. // 1. If byte is 0xF0, set utf-8 lower boundary to 0x90.
  55916. if (bite === 0xF0)
  55917. utf8_lower_boundary = 0x90;
  55918. // 2. If byte is 0xF4, set utf-8 upper boundary to 0x8F.
  55919. if (bite === 0xF4)
  55920. utf8_upper_boundary = 0x8F;
  55921. // 3. Set utf-8 bytes needed to 3 and utf-8 code point to
  55922. // byte − 0xF0.
  55923. utf8_bytes_needed = 3;
  55924. utf8_code_point = bite - 0xF0;
  55925. }
  55926. // Otherwise
  55927. else {
  55928. // Return error.
  55929. return decoderError(fatal);
  55930. }
  55931. // Then (byte is in the range 0xC2 to 0xF4) set utf-8 code
  55932. // point to utf-8 code point << (6 × utf-8 bytes needed) and
  55933. // return continue.
  55934. utf8_code_point = utf8_code_point << (6 * utf8_bytes_needed);
  55935. return null;
  55936. }
  55937. // 4. If byte is not in the range utf-8 lower boundary to utf-8
  55938. // upper boundary, run these substeps:
  55939. if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) {
  55940. // 1. Set utf-8 code point, utf-8 bytes needed, and utf-8
  55941. // bytes seen to 0, set utf-8 lower boundary to 0x80, and set
  55942. // utf-8 upper boundary to 0xBF.
  55943. utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0;
  55944. utf8_lower_boundary = 0x80;
  55945. utf8_upper_boundary = 0xBF;
  55946. // 2. Prepend byte to stream.
  55947. stream.prepend(bite);
  55948. // 3. Return error.
  55949. return decoderError(fatal);
  55950. }
  55951. // 5. Set utf-8 lower boundary to 0x80 and utf-8 upper boundary
  55952. // to 0xBF.
  55953. utf8_lower_boundary = 0x80;
  55954. utf8_upper_boundary = 0xBF;
  55955. // 6. Increase utf-8 bytes seen by one and set utf-8 code point
  55956. // to utf-8 code point + (byte − 0x80) << (6 × (utf-8 bytes
  55957. // needed − utf-8 bytes seen)).
  55958. utf8_bytes_seen += 1;
  55959. utf8_code_point += (bite - 0x80) << (6 * (utf8_bytes_needed - utf8_bytes_seen));
  55960. // 7. If utf-8 bytes seen is not equal to utf-8 bytes needed,
  55961. // continue.
  55962. if (utf8_bytes_seen !== utf8_bytes_needed)
  55963. return null;
  55964. // 8. Let code point be utf-8 code point.
  55965. var code_point = utf8_code_point;
  55966. // 9. Set utf-8 code point, utf-8 bytes needed, and utf-8 bytes
  55967. // seen to 0.
  55968. utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0;
  55969. // 10. Return a code point whose value is code point.
  55970. return code_point;
  55971. };
  55972. }
  55973. /**
  55974. * @constructor
  55975. * @implements {Encoder}
  55976. * @param {{fatal: boolean}} options
  55977. */
  55978. function UTF8Encoder(options) {
  55979. var fatal = options.fatal;
  55980. /**
  55981. * @param {Stream} stream Input stream.
  55982. * @param {number} code_point Next code point read from the stream.
  55983. * @return {(number|!Array.<number>)} Byte(s) to emit.
  55984. */
  55985. this.handler = function(stream, code_point) {
  55986. // 1. If code point is end-of-stream, return finished.
  55987. if (code_point === end_of_stream)
  55988. return finished;
  55989. // 2. If code point is in the range U+0000 to U+007F, return a
  55990. // byte whose value is code point.
  55991. if (inRange(code_point, 0x0000, 0x007f))
  55992. return code_point;
  55993. // 3. Set count and offset based on the range code point is in:
  55994. var count, offset;
  55995. // U+0080 to U+07FF: 1 and 0xC0
  55996. if (inRange(code_point, 0x0080, 0x07FF)) {
  55997. count = 1;
  55998. offset = 0xC0;
  55999. }
  56000. // U+0800 to U+FFFF: 2 and 0xE0
  56001. else if (inRange(code_point, 0x0800, 0xFFFF)) {
  56002. count = 2;
  56003. offset = 0xE0;
  56004. }
  56005. // U+10000 to U+10FFFF: 3 and 0xF0
  56006. else if (inRange(code_point, 0x10000, 0x10FFFF)) {
  56007. count = 3;
  56008. offset = 0xF0;
  56009. }
  56010. // 4.Let bytes be a byte sequence whose first byte is (code
  56011. // point >> (6 × count)) + offset.
  56012. var bytes = [(code_point >> (6 * count)) + offset];
  56013. // 5. Run these substeps while count is greater than 0:
  56014. while (count > 0) {
  56015. // 1. Set temp to code point >> (6 × (count − 1)).
  56016. var temp = code_point >> (6 * (count - 1));
  56017. // 2. Append to bytes 0x80 | (temp & 0x3F).
  56018. bytes.push(0x80 | (temp & 0x3F));
  56019. // 3. Decrease count by one.
  56020. count -= 1;
  56021. }
  56022. // 6. Return bytes bytes, in order.
  56023. return bytes;
  56024. };
  56025. }
  56026. /***/ }),
  56027. /* 667 */
  56028. /***/ (function(module, exports, __webpack_require__) {
  56029. "use strict";
  56030. var _interopRequireWildcard = __webpack_require__(105);
  56031. var _interopRequireDefault = __webpack_require__(2);
  56032. exports.__esModule = true;
  56033. exports.default = void 0;
  56034. var _defineProperty2 = _interopRequireDefault(__webpack_require__(17));
  56035. var socketCloseCodes = _interopRequireWildcard(__webpack_require__(73));
  56036. let SocketError = function SocketError(code, message) {
  56037. if (code === void 0) {
  56038. code = socketCloseCodes.codes.CLOSE_FALLBACK_CODE;
  56039. }
  56040. if (message === void 0) {
  56041. message = socketCloseCodes.messages[code] || 'No message available from code.';
  56042. }
  56043. (0, _defineProperty2.default)(this, "code", void 0);
  56044. (0, _defineProperty2.default)(this, "message", void 0);
  56045. this.code = code;
  56046. this.message = message;
  56047. };
  56048. exports.default = SocketError;
  56049. /***/ }),
  56050. /* 668 */
  56051. /***/ (function(module, exports, __webpack_require__) {
  56052. "use strict";
  56053. var _interopRequireDefault = __webpack_require__(2);
  56054. exports.__esModule = true;
  56055. exports.default = void 0;
  56056. var _ws = _interopRequireDefault(__webpack_require__(669));
  56057. var _default = (() => {
  56058. if ((typeof window !== undefined ? window : global).WebSocket) {
  56059. return (typeof window !== undefined ? window : global).WebSocket;
  56060. }
  56061. if (!_ws.default.CONNECTING) {
  56062. // The ws module really should define these statics like browsers do.
  56063. _ws.default.CONNECTING = 0;
  56064. _ws.default.OPEN = 1;
  56065. _ws.default.CLOSING = 2;
  56066. _ws.default.CLOSED = 3;
  56067. }
  56068. return _ws.default;
  56069. })();
  56070. exports.default = _default;
  56071. /***/ }),
  56072. /* 669 */
  56073. /***/ (function(module, exports, __webpack_require__) {
  56074. "use strict";
  56075. module.exports = function() {
  56076. throw new Error(
  56077. 'ws does not work in the browser. Browser clients must use the native ' +
  56078. 'WebSocket object'
  56079. );
  56080. };
  56081. /***/ }),
  56082. /* 670 */
  56083. /***/ (function(module, exports, __webpack_require__) {
  56084. "use strict";
  56085. const deserializeMessage = __webpack_require__(671);
  56086. module.exports = function unboxFromRumorMessage(rumorMessage) {
  56087. const message = deserializeMessage(rumorMessage.data);
  56088. message.transactionId = rumorMessage.transactionId;
  56089. message.fromAddress = rumorMessage.headers['X-TB-FROM-ADDRESS'];
  56090. return message;
  56091. };
  56092. /***/ }),
  56093. /* 671 */
  56094. /***/ (function(module, exports, __webpack_require__) {
  56095. "use strict";
  56096. // Deserialising a Raptor message mainly means doing a JSON.parse on it.
  56097. // We do decorate the final message with a few extra helper properies though.
  56098. //
  56099. // These include:
  56100. // * typeName: A human readable version of the Raptor type. E.g. STREAM instead of 102
  56101. // * actionName: A human readable version of the Raptor action. E.g. CREATE instead of 101
  56102. // * signature: typeName and actionName combined. This is mainly for debugging. E.g. A type
  56103. // of 102 and an action of 101 would result in a signature of "STREAM:CREATE"
  56104. //
  56105. module.exports = function deserializeMessage(msg) {
  56106. if (msg.length === 0) {
  56107. return {};
  56108. }
  56109. const message = JSON.parse(msg);
  56110. const bits = message.uri.substr(1).split('/'); // Remove the Raptor protocol version
  56111. bits.shift();
  56112. if (bits[bits.length - 1] === '') {
  56113. bits.pop();
  56114. }
  56115. message.params = {};
  56116. for (let i = 0, numBits = bits.length; i < numBits - 1; i += 2) {
  56117. message.params[bits[i]] = bits[i + 1];
  56118. } // extract the resource name. We special case 'channel' slightly, as
  56119. // 'subscriber_channel' or 'stream_channel' is more useful for us
  56120. // than 'channel' alone.
  56121. if (bits.length % 2 === 0) {
  56122. if (bits[bits.length - 2] === 'channel' && bits.length > 6) {
  56123. message.resource = bits[bits.length - 4] + "_" + bits[bits.length - 2];
  56124. } else {
  56125. message.resource = bits[bits.length - 2];
  56126. }
  56127. } else if (bits[bits.length - 1] === 'channel' && bits.length > 5) {
  56128. message.resource = bits[bits.length - 3] + "_" + bits[bits.length - 1];
  56129. } else {
  56130. message.resource = bits[bits.length - 1];
  56131. }
  56132. message.signature = message.resource + "#" + message.method;
  56133. return message;
  56134. };
  56135. /***/ }),
  56136. /* 672 */
  56137. /***/ (function(module, exports, __webpack_require__) {
  56138. "use strict";
  56139. const _require = __webpack_require__(3),
  56140. name = _require.name;
  56141. const hasOpenTokSupport = __webpack_require__(56).once;
  56142. module.exports = () => hasOpenTokSupport() && ['Chrome', 'Firefox', 'Safari'].indexOf(name) > -1;
  56143. /***/ }),
  56144. /* 673 */
  56145. /***/ (function(module, exports, __webpack_require__) {
  56146. "use strict";
  56147. const env = __webpack_require__(3);
  56148. const hasOpenTokSupport = __webpack_require__(56).once; // TODO Remove all transport stuff, that belongs to the messaging layer not the Media layer.
  56149. // Indicates if the browser supports bundle
  56150. //
  56151. // Broadly:
  56152. // * Firefox support bundle
  56153. // * Chrome support bundle
  56154. // * We assume NodeJs supports bundle (e.g. 'you're on your own' mode)
  56155. //
  56156. module.exports = () => hasOpenTokSupport() && (env.name === 'Chrome' || env.name === 'Firefox' || env.name === 'Node' || env.name === 'Safari' || env.name === 'Edge');
  56157. /***/ }),
  56158. /* 674 */
  56159. /***/ (function(module, exports, __webpack_require__) {
  56160. "use strict";
  56161. const hasOpenTokSupport = __webpack_require__(56).once; // Indicates if the browser supports RTCP Mux
  56162. //
  56163. // Broadly:
  56164. // * All recent versions of WebRTC (both Chrome and Firefox) support RtcpMux
  56165. module.exports = () => hasOpenTokSupport();
  56166. /***/ }),
  56167. /* 675 */
  56168. /***/ (function(module, exports, __webpack_require__) {
  56169. "use strict";
  56170. // @todo we might not need this anymore, it's really old
  56171. const OTHelpers = __webpack_require__(4); // Returns a String representing the supported WebRTC crypto scheme. The possible
  56172. // values are SDES_SRTP, DTLS_SRTP, and NONE;
  56173. //
  56174. // Broadly:
  56175. // * Firefox only supports DTLS
  56176. // * Older versions of Chrome (<= 24) only support SDES
  56177. // * Newer versions of Chrome (>= 25) support DTLS and SDES
  56178. //
  56179. module.exports = function supportedCryptoScheme() {
  56180. const chromeBefore25 = OTHelpers.env.name === 'Chrome' && OTHelpers.env.version < 25;
  56181. return chromeBefore25 ? 'SDES_SRTP' : 'DTLS_SRTP';
  56182. };
  56183. /***/ }),
  56184. /* 676 */
  56185. /***/ (function(module, exports, __webpack_require__) {
  56186. "use strict";
  56187. module.exports = function capabilitiesFromHash(_ref) {
  56188. let supportsWebRTC = _ref.supportsWebRTC;
  56189. return {
  56190. supportsWebRTC: supportsWebRTC === 'true' || supportsWebRTC === true
  56191. };
  56192. };
  56193. /***/ }),
  56194. /* 677 */
  56195. /***/ (function(module, exports, __webpack_require__) {
  56196. "use strict";
  56197. module.exports = function SignalError(code, message) {
  56198. this.code = code;
  56199. this.message = message; // Undocumented. Left in for backwards compatibility:
  56200. this.reason = message;
  56201. };
  56202. /***/ }),
  56203. /* 678 */
  56204. /***/ (function(module, exports, __webpack_require__) {
  56205. "use strict";
  56206. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  56207. /* eslint-disable prefer-rest-params, no-cond-assign */
  56208. const DelayedEventQueue = function DelayedEventQueue(eventDispatcher) {
  56209. const queue = [];
  56210. this.enqueue = function enqueue()
  56211. /* arg1, arg2, ..., argN */
  56212. {
  56213. queue.push(Array.prototype.slice.call(arguments));
  56214. };
  56215. this.triggerAll = function triggerAll() {
  56216. let event; // Array.prototype.shift is actually pretty inefficient for longer Arrays,
  56217. // this is because after the first element is removed it reshuffles every
  56218. // remaining element up one (1). This involves way too many allocations and
  56219. // deallocations as the queue size increases.
  56220. //
  56221. // A more efficient version could be written by keeping an index to the current
  56222. // 'first' element in the Array and increasing that by one whenever an element
  56223. // is removed. The elements that are infront of the index have been 'deleted'.
  56224. // Periodically the front of the Array could be spliced off to reclaim the space.
  56225. //
  56226. // 1. http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.9
  56227. //
  56228. //
  56229. // TLDR: Array.prototype.shift is O(n), where n is the array length,
  56230. // instead of the expected O(1). You can implement your own shift that runs
  56231. // in amortised constant time.
  56232. //
  56233. // @todo benchmark and see if we should actually care about shift's performance
  56234. // for our common queue sizes.
  56235. //
  56236. while (event = queue.shift()) {
  56237. eventDispatcher.trigger(...event);
  56238. }
  56239. };
  56240. };
  56241. module.exports = DelayedEventQueue;
  56242. /***/ }),
  56243. /* 679 */
  56244. /***/ (function(module, exports, __webpack_require__) {
  56245. "use strict";
  56246. var _interopRequireDefault = __webpack_require__(2);
  56247. var _extends2 = _interopRequireDefault(__webpack_require__(23));
  56248. const defaultAxios = __webpack_require__(186);
  56249. const url = __webpack_require__(220);
  56250. const get = __webpack_require__(51);
  56251. const assign = __webpack_require__(6);
  56252. const SessionInfo = __webpack_require__(246);
  56253. const ExceptionCodes = __webpack_require__(11);
  56254. const mapErrorCodeToName = __webpack_require__(680);
  56255. const mapStatusCodeToErrorCode = __webpack_require__(681);
  56256. const promiseEndeavour = __webpack_require__(280).default;
  56257. const LANGUAGE = {
  56258. EMPTY_RESPONSE: 'Response body was empty, probably due to connectivity loss',
  56259. BADLY_FORMED: 'Unknown error: JSON response was badly formed',
  56260. NO_ERROR: 'No error message',
  56261. UNEXPECTED_SERVER_RESPONSE: details => "Unexpected server response (" + details + "). Try this operation again later."
  56262. };
  56263. const RETRY_DELAYS = [0, 600, 1200];
  56264. /**
  56265. * @typedef {Object} getSessionInfoConfig Configuration
  56266. * @property {String} anvilUrl The base anvil url
  56267. * @property {String} sessionId The id of the session to retrieve info for
  56268. * @property {String} token The token used for authentication
  56269. * @property {String} clientVersion The client version passed to Anvil
  56270. * @property {String} connectionId The connection id passed to Anvil
  56271. *
  56272. * @typedef {Object} getSessionDependencies
  56273. * @property {String=} axios
  56274. */
  56275. /**
  56276. * Factory for injecting dependencies into and returning a getSessionInfo function
  56277. *
  56278. * @param {getSessionDependencies} dependencies
  56279. * @returns {getSessionInfo}
  56280. */
  56281. function getSessionInfoFactory(_temp) {
  56282. let _ref = _temp === void 0 ? {} : _temp,
  56283. _ref$axios = _ref.axios,
  56284. axios = _ref$axios === void 0 ? defaultAxios : _ref$axios,
  56285. _ref$retryDelays = _ref.retryDelays,
  56286. retryDelays = _ref$retryDelays === void 0 ? RETRY_DELAYS : _ref$retryDelays;
  56287. /**
  56288. * getSessionInfo - Fetch session details from Anvil and return a SessionInfo object
  56289. *
  56290. * @function getSessionInfo
  56291. * @param {getSessionInfoConfig} config
  56292. * @returns {Promise<SessionInfo>} The session info
  56293. */
  56294. function getSessionInfo(
  56295. /** @type getSessionInfoConfig */
  56296. _ref2) {
  56297. let anvilUrl = _ref2.anvilUrl,
  56298. sessionId = _ref2.sessionId,
  56299. token = _ref2.token,
  56300. clientVersion = _ref2.clientVersion,
  56301. connectionId = _ref2.connectionId;
  56302. const parts = url.parse(anvilUrl, true);
  56303. const targetUrl = url.format({
  56304. protocol: parts.protocol,
  56305. auth: parts.auth,
  56306. host: parts.host,
  56307. pathname: url.resolve((parts.pathname || '').replace(/\/?$/, '/'), "session/" + sessionId),
  56308. query: (0, _extends2.default)({}, parts.query, {
  56309. extended: true
  56310. })
  56311. });
  56312. return axios.get(targetUrl, {
  56313. validateStatus: status => status >= 200 && status < 300,
  56314. headers: {
  56315. 'X-OPENTOK-AUTH': token,
  56316. 'X-TB-VERSION': 1,
  56317. 'X-TB-CLIENT-VERSION': clientVersion,
  56318. 'X-TB-CONNECTIONID': connectionId,
  56319. Accept: 'application/json'
  56320. }
  56321. }) // general http connectivity and status errors from axios
  56322. .catch(error => {
  56323. if (error.response) {
  56324. const newError = new Error(LANGUAGE.UNEXPECTED_SERVER_RESPONSE("" + error.response.statusCode + (error.response.status ? " " + error.response.status : '')));
  56325. newError.code = ExceptionCodes.ANVIL_INVALID_HTTP_STATUS;
  56326. newError.name = mapErrorCodeToName(newError.code);
  56327. throw newError;
  56328. } else if (error.request) {
  56329. const newError = new Error(LANGUAGE.CONNECT_FAILED);
  56330. newError.code = ExceptionCodes.ANVIL_CONNECT_FAILED;
  56331. newError.name = mapErrorCodeToName(newError.code);
  56332. throw newError;
  56333. } else {
  56334. const code = ExceptionCodes.ANVIL_UNKNOWN_HTTP_ERROR;
  56335. const name = mapErrorCodeToName(error.code);
  56336. assign(error, {
  56337. code,
  56338. name
  56339. });
  56340. throw error;
  56341. }
  56342. }).then((_ref3) => {
  56343. let data = _ref3.data;
  56344. if (typeof data === 'string') {
  56345. // axios could not decode JSON
  56346. if (data.length > 0) {
  56347. try {
  56348. JSON.parse(data);
  56349. } catch (err) {
  56350. err.message = LANGUAGE.UNEXPECTED_SERVER_RESPONSE(err.toString());
  56351. err.code = ExceptionCodes.ANVIL_XDOMAIN_OR_PARSING_ERROR;
  56352. err.name = mapErrorCodeToName(err.code);
  56353. throw err;
  56354. }
  56355. }
  56356. const error = new Error(data.length === 0 ? LANGUAGE.EMPTY_RESPONSE : LANGUAGE.BADLY_FORMED);
  56357. error.code = data.length === 0 ? ExceptionCodes.ANVIL_EMPTY_RESPONSE_BODY : ExceptionCodes.ANVIL_BADLY_FORMED_RESPONSE;
  56358. error.name = mapErrorCodeToName(error.code);
  56359. throw error;
  56360. }
  56361. if (data === null || data.length === 0) {
  56362. // anvil returned empty session info
  56363. const error = new Error(LANGUAGE.EMPTY_RESPONSE);
  56364. error.code = ExceptionCodes.ANVIL_EMPTY_RESPONSE_BODY;
  56365. error.name = mapErrorCodeToName(error.code);
  56366. throw error;
  56367. }
  56368. const _data$filter = data.filter(node => node.error != null),
  56369. errorNode = _data$filter[0];
  56370. if (errorNode) {
  56371. const code = mapStatusCodeToErrorCode(get(errorNode, 'error.code', '500'));
  56372. if (get(errorNode, 'error.errorMessage.message') === 'Invalid token format') {
  56373. errorNode.error.errorMessage.message += " Token: " + token;
  56374. }
  56375. const error = new Error(get(errorNode, 'error.errorMessage.message', code === undefined ? "Unknown error: " + errorNode.error.code : LANGUAGE.NO_ERROR));
  56376. error.code = code || ExceptionCodes.ANVIL_UNEXPECTED_ERROR_CODE;
  56377. error.name = mapErrorCodeToName(error.code);
  56378. throw error;
  56379. }
  56380. return new SessionInfo(data[0]);
  56381. });
  56382. }
  56383. const getSessionInfoRetry = promiseEndeavour(getSessionInfo, (error, attempt) => error.code && error.code >= 3000 && error.code <= 3007 && retryDelays[attempt]);
  56384. return getSessionInfoRetry;
  56385. }
  56386. module.exports = getSessionInfoFactory;
  56387. /***/ }),
  56388. /* 680 */
  56389. /***/ (function(module, exports, __webpack_require__) {
  56390. "use strict";
  56391. const ExceptionCodes = __webpack_require__(11);
  56392. const errors = __webpack_require__(8);
  56393. const errorMap = {
  56394. [ExceptionCodes.ANVIL_BADLY_FORMED_RESPONSE]: errors.BADLY_FORMED_RESPONSE,
  56395. [ExceptionCodes.ANVIL_INVALID_HTTP_STATUS]: errors.INVALID_HTTP_STATUS,
  56396. [ExceptionCodes.ANVIL_XDOMAIN_OR_PARSING_ERROR]: errors.XDOMAIN_OR_PARSING_ERROR,
  56397. [ExceptionCodes.ANVIL_UNKNOWN_HTTP_ERROR]: errors.UNKNOWN_HTTP_ERROR,
  56398. [ExceptionCodes.ANVIL_UNEXPECTED_ERROR_CODE]: errors.UNEXPECTED_ERROR_CODE,
  56399. [ExceptionCodes.ANVIL_EMPTY_RESPONSE_BODY]: errors.EMPTY_RESPONSE_BODY,
  56400. [ExceptionCodes.ANVIL_CONNECT_FAILED]: errors.CONNECT_FAILED,
  56401. [ExceptionCodes.AUTHENTICATION_ERROR]: errors.AUTHENTICATION_ERROR,
  56402. [ExceptionCodes.INVALID_SESSION_ID]: errors.INVALID_SESSION_ID,
  56403. [ExceptionCodes.TERMS_OF_SERVICE_FAILURE]: errors.TERMS_OF_SERVICE_FAILURE,
  56404. [ExceptionCodes.UNEXPECTED_SERVER_RESPONSE]: errors.UNEXPECTED_SERVER_RESPONSE
  56405. };
  56406. /**
  56407. * Maps an error from SessionInfo.get to its corresponding name
  56408. * @param {number} code - Error code
  56409. * @return {string|undefined} Error name
  56410. */
  56411. function mapErrorCodeToName(code) {
  56412. return errorMap[code];
  56413. }
  56414. module.exports = mapErrorCodeToName;
  56415. /***/ }),
  56416. /* 681 */
  56417. /***/ (function(module, exports, __webpack_require__) {
  56418. "use strict";
  56419. const ExceptionCodes = __webpack_require__(11);
  56420. const statusCodeToExceptionCode = {
  56421. 400: ExceptionCodes.INVALID_SESSION_ID,
  56422. 403: ExceptionCodes.AUTHENTICATION_ERROR,
  56423. 404: ExceptionCodes.INVALID_SESSION_ID,
  56424. 409: ExceptionCodes.TERMS_OF_SERVICE_FAILURE,
  56425. 500: ExceptionCodes.UNEXPECTED_SERVER_RESPONSE
  56426. };
  56427. /**
  56428. * Maps an Anvil status code error to an exception code
  56429. * @param {number} code - Anvil status code
  56430. * @return {string|undefined} Exception code
  56431. */
  56432. function mapStatusCodeToErrorCode(code) {
  56433. return statusCodeToExceptionCode[code];
  56434. }
  56435. module.exports = mapStatusCodeToErrorCode;
  56436. /***/ }),
  56437. /* 682 */
  56438. /***/ (function(module, exports, __webpack_require__) {
  56439. "use strict";
  56440. // @todo enable the following disabled rules see OPENTOK-31136 for more info
  56441. /* eslint-disable no-param-reassign, global-require */
  56442. module.exports = function initSessionFactory(deps) {
  56443. if (deps === void 0) {
  56444. deps = {};
  56445. }
  56446. const Session = deps.Session || __webpack_require__(296)();
  56447. const sessionObjects = deps.sessionObjects || __webpack_require__(22);
  56448. /**
  56449. * The first step in using the OpenTok API is to call the <code>OT.initSession()</code>
  56450. * method. Other methods of the OT object check for system requirements and set up error logging.
  56451. *
  56452. * @class OT
  56453. */
  56454. /**
  56455. * <p class="mSummary">
  56456. * Initializes and returns the local session object for a specified session ID.
  56457. * </p>
  56458. * <p>
  56459. * You connect to an OpenTok session using the <code>connect()</code> method
  56460. * of the Session object returned by the <code>OT.initSession()</code> method.
  56461. * Note that calling <code>OT.initSession()</code> does not initiate communications
  56462. * with the cloud. It simply initializes the Session object that you can use to
  56463. * connect (and to perform other operations once connected).
  56464. * </p>
  56465. *
  56466. * <p>
  56467. * Note that you can initialize only one Session object per session ID. Calling
  56468. * <code>OT.initSession()</code> a second time with the same session ID returns the
  56469. * previously created Session object. However, you can initialize multiple Session objects
  56470. * for different sessions (with different session IDs) to connect to multiple sessions.
  56471. * </p>
  56472. *
  56473. * <p>
  56474. * When the client disconnects from the session (and the session dispatches a
  56475. * <code>sessionDisconnected</code> event), you can reuse the Session object to
  56476. * reconnect to the session. However, the Session object will retain any existing
  56477. * event handlers attached to it. You can remove all event handlers by calling the
  56478. * <code>off()</code> method of the Session object (passing in no parameters).
  56479. * </p>
  56480. *
  56481. * <p>
  56482. * For an example, see <a href="Session.html#connect">Session.connect()</a>.
  56483. * </p>
  56484. *
  56485. * @method OT.initSession
  56486. * @memberof OT
  56487. * @param {String} apiKey Your OpenTok API key (see your <a href="https://tokbox.com/account">TokBox
  56488. * account page</a>).
  56489. * @param {String} sessionId The session ID identifying the OpenTok session. For more
  56490. * information, see <a href="https://tokbox.com/opentok/tutorials/create-session/">Session
  56491. * creation</a>.
  56492. * @param {Object} options An object that includes optional options for initializing the session.
  56493. * This object includes the following properties:
  56494. * <ul>
  56495. * <li><code>connectionEventsSuppressed</code> &mdash; (Boolean)
  56496. * Set this property to <code>true</code> to support large interactive video sessions.
  56497. * This prevents the Session object from dispatching <code>connectionCreated</code> and
  56498. * <code>connectionDestroyed</code> events when other clients connect to or disconnect from
  56499. * the session. (Also, the OpenTok server does not send these events to the web client.)
  56500. * For more information, see
  56501. * <a href="https://tokbox.com/developer/guides/broadcast/live-interactive-video/#suppressing-connection-events">
  56502. * Suppressing connection events</a> in the OpenTok developer guides.
  56503. * </li>
  56504. * <li><code>ipWhitelist</code> &mdash; (Boolean) This is available as an add-on feature for
  56505. * <a href="https://tokbox.com/pricing/plans" target="_blank">enterprise accounts</a>.
  56506. * Set this to <code>true</code> if IP white listing is enabled for your project.
  56507. * The default value is <code>false</code>.
  56508. * </li>
  56509. * <li><code>iceConfig</code> &mdash; (Object) This feature is part of the configurable TURN
  56510. * <a href="https://tokbox.com/pricing/plans" target="_blank">add-on feature</a>.
  56511. * </li>
  56512. * <li><code>proxyUrl</code> &mdash; (String) Set this to the URL of
  56513. * the IP proxy server. This is available as an add-on feature. See the OpenTok
  56514. * <a href="https://tokbox.com/pricing" target="_blank">pricing page</a> and the
  56515. * <a href="https://tokbox.com/developer/guides/ip-proxy">IP proxy developer guide</a>.
  56516. * </li>
  56517. * </ul>
  56518. *
  56519. * @returns {Session} The session object through which all further interactions with
  56520. * the session will occur.
  56521. */
  56522. return function initSession(apiKey, sessionId, opt) {
  56523. if (sessionId == null) {
  56524. sessionId = apiKey;
  56525. apiKey = null;
  56526. } // Allow buggy legacy behavior to succeed, where the client can connect if sessionId
  56527. // is an array containing one element (the session ID), but fix it so that sessionId
  56528. // is stored as a string (not an array):
  56529. if (Array.isArray(sessionId) && sessionId.length === 1) {
  56530. sessionId = sessionId[0];
  56531. }
  56532. let session = sessionObjects.sessions.get(sessionId);
  56533. if (!session) {
  56534. session = new Session(apiKey, sessionId, opt);
  56535. sessionObjects.sessions.add(session);
  56536. }
  56537. return session;
  56538. };
  56539. };
  56540. /***/ }),
  56541. /* 683 */
  56542. /***/ (function(module, exports, __webpack_require__) {
  56543. "use strict";
  56544. var _interopRequireDefault = __webpack_require__(2);
  56545. var _regenerator = _interopRequireDefault(__webpack_require__(18));
  56546. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(19));
  56547. const difference = __webpack_require__(684);
  56548. const uniq = __webpack_require__(686);
  56549. const env = __webpack_require__(3);
  56550. const Errors = __webpack_require__(8);
  56551. const ExceptionCodes = __webpack_require__(11);
  56552. const otError = __webpack_require__(12)();
  56553. const SDPHelpers = __webpack_require__(57);
  56554. const shouldUsePlanBSDP = __webpack_require__(100);
  56555. const windowMock = __webpack_require__(138)((typeof window !== undefined ? window : global));
  56556. /**
  56557. * Gets the list of supported codecs for encoding and decoding video streams.
  56558. * <p>
  56559. * The following example gets the list of supported codecs for encoding and
  56560. * decoding video streams:
  56561. * <pre>
  56562. * (async () => {
  56563. * try {
  56564. * const supportedCodecs = await OT.getSupportedCodecs();
  56565. * if (supportedCodecs.videoEncoders.indexOf('H264') < 0 &&
  56566. * supportedCodecs.videoDecoders.indexOf('H264') < 0) {
  56567. * // The client does not support encoding or decoding H264.
  56568. * // Let's recommend using a different browser.
  56569. * }
  56570. * } catch(err) {
  56571. * console.log(err);
  56572. * }
  56573. * })();
  56574. * </pre>
  56575. * <p>
  56576. * You can use the lists of supported video codecs to determine whether the client
  56577. * supports video, depending on the preferred video codec and the type of session being used.
  56578. * You can set the preferred video codec on the Project page of your
  56579. * <a href="https://tokbox.com/account/">TokBox Account</a>. In
  56580. * <a href="https://tokbox.com/developer/guides/create-session/#media-mode">routed sessions</a>
  56581. * (sessions that use the OpenTok Media Router), the preferred video codec is used for all
  56582. * clients in the session. In relayed sessions, clients send streams directly to one another,
  56583. * and each publishing-subscribing pair tries to find a common video codec that they can both use.
  56584. * In this regard, the video codec used by the pair in a relayed session may be different from
  56585. * the preferred video codec setting. For more information see the OpenTok
  56586. * <a href="https://tokbox.com/developer/guides/codecs/">Video codecs</a> developer guide.
  56587. *
  56588. * @return {Promise} A promise that is resolved when the list of supported codecs is ready.
  56589. * The promise is resolved (on success) with an object that has two properties:
  56590. * <code>videoDecoders</code>, an array of supported video codecs for decoding, and
  56591. * <code>videoEncoders</code>, an array of supported video codecs for encoding, such as:
  56592. * <pre>
  56593. * {
  56594. * videoDecoders: ['H264', 'VP8'],
  56595. * videoEncoders: ['H264', 'VP8']
  56596. * }
  56597. * </pre>
  56598. * <p>
  56599. * The promise is rejected if there is an error in getting the list.
  56600. *
  56601. * @method OT.getSupportedCodecs
  56602. * @memberof OT
  56603. */
  56604. const getSupportedCodecs = /*#__PURE__*/function () {
  56605. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  56606. var RTCPeerConnection, canvas, stream, localPc, pcConfig, offer, codecs;
  56607. return _regenerator.default.wrap(function _callee$(_context) {
  56608. while (1) switch (_context.prev = _context.next) {
  56609. case 0:
  56610. if (!(typeof window === 'undefined')) {
  56611. _context.next = 2;
  56612. break;
  56613. }
  56614. return _context.abrupt("return", {
  56615. videoEncoders: [],
  56616. videoDecoders: []
  56617. });
  56618. case 2:
  56619. RTCPeerConnection = windowMock.RTCPeerConnection; // Chrome got support for HTMLCanvasElement#captureStream in version 51
  56620. if (!(env.name === 'Chrome' && !('captureStream' in window.HTMLCanvasElement.prototype))) {
  56621. _context.next = 5;
  56622. break;
  56623. }
  56624. return _context.abrupt("return", {
  56625. videoEncoders: ['VP8'],
  56626. videoDecoders: ['VP8']
  56627. });
  56628. case 5:
  56629. if (!env.isLegacyEdge) {
  56630. _context.next = 7;
  56631. break;
  56632. }
  56633. return _context.abrupt("return", {
  56634. videoEncoders: ['H264', 'VP8'],
  56635. videoDecoders: ['H264', 'VP8']
  56636. });
  56637. case 7:
  56638. canvas = window.document.createElement('canvas'); // Need to make a 2d context for captureStream to work, even though it's not used.
  56639. canvas.getContext('2d');
  56640. stream = canvas.captureStream();
  56641. _context.prev = 10;
  56642. pcConfig = {
  56643. iceServers: []
  56644. };
  56645. if (shouldUsePlanBSDP) {
  56646. pcConfig.sdpSemantics = 'plan-b';
  56647. }
  56648. localPc = new RTCPeerConnection(pcConfig);
  56649. if (localPc.addTrack) {
  56650. localPc.addTrack(stream.getVideoTracks()[0], stream);
  56651. } else if (localPc.addStream) {
  56652. localPc.addStream(stream);
  56653. }
  56654. _context.next = 17;
  56655. return localPc.createOffer();
  56656. case 17:
  56657. offer = _context.sent;
  56658. codecs = SDPHelpers.getCodecs(offer.sdp, 'video') || [];
  56659. codecs = difference(codecs, ['VP9', 'rtx', 'red', 'ulpfec']);
  56660. codecs = uniq(codecs);
  56661. return _context.abrupt("return", {
  56662. videoEncoders: codecs,
  56663. videoDecoders: codecs
  56664. });
  56665. case 24:
  56666. _context.prev = 24;
  56667. _context.t0 = _context["catch"](10);
  56668. throw otError(Errors.UNABLE_TO_ACCESS_MEDIA_ENGINE, new Error('OT.getSupportedCodecs was not able to get the list of supported codecs'), ExceptionCodes.UNABLE_TO_ACCESS_MEDIA_ENGINE);
  56669. case 27:
  56670. _context.prev = 27;
  56671. localPc.close();
  56672. return _context.finish(27);
  56673. case 30:
  56674. case "end":
  56675. return _context.stop();
  56676. }
  56677. }, _callee, null, [[10, 24, 27, 30]]);
  56678. }));
  56679. return function getSupportedCodecs() {
  56680. return _ref.apply(this, arguments);
  56681. };
  56682. }();
  56683. module.exports = getSupportedCodecs;
  56684. /***/ }),
  56685. /* 684 */
  56686. /***/ (function(module, exports, __webpack_require__) {
  56687. var baseDifference = __webpack_require__(685),
  56688. baseFlatten = __webpack_require__(217),
  56689. baseRest = __webpack_require__(94),
  56690. isArrayLikeObject = __webpack_require__(137);
  56691. /**
  56692. * Creates an array of `array` values not included in the other given arrays
  56693. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  56694. * for equality comparisons. The order and references of result values are
  56695. * determined by the first array.
  56696. *
  56697. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  56698. *
  56699. * @static
  56700. * @memberOf _
  56701. * @since 0.1.0
  56702. * @category Array
  56703. * @param {Array} array The array to inspect.
  56704. * @param {...Array} [values] The values to exclude.
  56705. * @returns {Array} Returns the new array of filtered values.
  56706. * @see _.without, _.xor
  56707. * @example
  56708. *
  56709. * _.difference([2, 1], [2, 3]);
  56710. * // => [1]
  56711. */
  56712. var difference = baseRest(function(array, values) {
  56713. return isArrayLikeObject(array)
  56714. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  56715. : [];
  56716. });
  56717. module.exports = difference;
  56718. /***/ }),
  56719. /* 685 */
  56720. /***/ (function(module, exports, __webpack_require__) {
  56721. var SetCache = __webpack_require__(88),
  56722. arrayIncludes = __webpack_require__(86),
  56723. arrayIncludesWith = __webpack_require__(136),
  56724. arrayMap = __webpack_require__(30),
  56725. baseUnary = __webpack_require__(64),
  56726. cacheHas = __webpack_require__(89);
  56727. /** Used as the size to enable large array optimizations. */
  56728. var LARGE_ARRAY_SIZE = 200;
  56729. /**
  56730. * The base implementation of methods like `_.difference` without support
  56731. * for excluding multiple arrays or iteratee shorthands.
  56732. *
  56733. * @private
  56734. * @param {Array} array The array to inspect.
  56735. * @param {Array} values The values to exclude.
  56736. * @param {Function} [iteratee] The iteratee invoked per element.
  56737. * @param {Function} [comparator] The comparator invoked per element.
  56738. * @returns {Array} Returns the new array of filtered values.
  56739. */
  56740. function baseDifference(array, values, iteratee, comparator) {
  56741. var index = -1,
  56742. includes = arrayIncludes,
  56743. isCommon = true,
  56744. length = array.length,
  56745. result = [],
  56746. valuesLength = values.length;
  56747. if (!length) {
  56748. return result;
  56749. }
  56750. if (iteratee) {
  56751. values = arrayMap(values, baseUnary(iteratee));
  56752. }
  56753. if (comparator) {
  56754. includes = arrayIncludesWith;
  56755. isCommon = false;
  56756. }
  56757. else if (values.length >= LARGE_ARRAY_SIZE) {
  56758. includes = cacheHas;
  56759. isCommon = false;
  56760. values = new SetCache(values);
  56761. }
  56762. outer:
  56763. while (++index < length) {
  56764. var value = array[index],
  56765. computed = iteratee == null ? value : iteratee(value);
  56766. value = (comparator || value !== 0) ? value : 0;
  56767. if (isCommon && computed === computed) {
  56768. var valuesIndex = valuesLength;
  56769. while (valuesIndex--) {
  56770. if (values[valuesIndex] === computed) {
  56771. continue outer;
  56772. }
  56773. }
  56774. result.push(value);
  56775. }
  56776. else if (!includes(values, computed, comparator)) {
  56777. result.push(value);
  56778. }
  56779. }
  56780. return result;
  56781. }
  56782. module.exports = baseDifference;
  56783. /***/ }),
  56784. /* 686 */
  56785. /***/ (function(module, exports, __webpack_require__) {
  56786. var baseUniq = __webpack_require__(687);
  56787. /**
  56788. * Creates a duplicate-free version of an array, using
  56789. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  56790. * for equality comparisons, in which only the first occurrence of each element
  56791. * is kept. The order of result values is determined by the order they occur
  56792. * in the array.
  56793. *
  56794. * @static
  56795. * @memberOf _
  56796. * @since 0.1.0
  56797. * @category Array
  56798. * @param {Array} array The array to inspect.
  56799. * @returns {Array} Returns the new duplicate free array.
  56800. * @example
  56801. *
  56802. * _.uniq([2, 1, 2]);
  56803. * // => [2, 1]
  56804. */
  56805. function uniq(array) {
  56806. return (array && array.length) ? baseUniq(array) : [];
  56807. }
  56808. module.exports = uniq;
  56809. /***/ }),
  56810. /* 687 */
  56811. /***/ (function(module, exports, __webpack_require__) {
  56812. var SetCache = __webpack_require__(88),
  56813. arrayIncludes = __webpack_require__(86),
  56814. arrayIncludesWith = __webpack_require__(136),
  56815. cacheHas = __webpack_require__(89),
  56816. createSet = __webpack_require__(688),
  56817. setToArray = __webpack_require__(90);
  56818. /** Used as the size to enable large array optimizations. */
  56819. var LARGE_ARRAY_SIZE = 200;
  56820. /**
  56821. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  56822. *
  56823. * @private
  56824. * @param {Array} array The array to inspect.
  56825. * @param {Function} [iteratee] The iteratee invoked per element.
  56826. * @param {Function} [comparator] The comparator invoked per element.
  56827. * @returns {Array} Returns the new duplicate free array.
  56828. */
  56829. function baseUniq(array, iteratee, comparator) {
  56830. var index = -1,
  56831. includes = arrayIncludes,
  56832. length = array.length,
  56833. isCommon = true,
  56834. result = [],
  56835. seen = result;
  56836. if (comparator) {
  56837. isCommon = false;
  56838. includes = arrayIncludesWith;
  56839. }
  56840. else if (length >= LARGE_ARRAY_SIZE) {
  56841. var set = iteratee ? null : createSet(array);
  56842. if (set) {
  56843. return setToArray(set);
  56844. }
  56845. isCommon = false;
  56846. includes = cacheHas;
  56847. seen = new SetCache;
  56848. }
  56849. else {
  56850. seen = iteratee ? [] : result;
  56851. }
  56852. outer:
  56853. while (++index < length) {
  56854. var value = array[index],
  56855. computed = iteratee ? iteratee(value) : value;
  56856. value = (comparator || value !== 0) ? value : 0;
  56857. if (isCommon && computed === computed) {
  56858. var seenIndex = seen.length;
  56859. while (seenIndex--) {
  56860. if (seen[seenIndex] === computed) {
  56861. continue outer;
  56862. }
  56863. }
  56864. if (iteratee) {
  56865. seen.push(computed);
  56866. }
  56867. result.push(value);
  56868. }
  56869. else if (!includes(seen, computed, comparator)) {
  56870. if (seen !== result) {
  56871. seen.push(computed);
  56872. }
  56873. result.push(value);
  56874. }
  56875. }
  56876. return result;
  56877. }
  56878. module.exports = baseUniq;
  56879. /***/ }),
  56880. /* 688 */
  56881. /***/ (function(module, exports, __webpack_require__) {
  56882. var Set = __webpack_require__(180),
  56883. noop = __webpack_require__(200),
  56884. setToArray = __webpack_require__(90);
  56885. /** Used as references for various `Number` constants. */
  56886. var INFINITY = 1 / 0;
  56887. /**
  56888. * Creates a set object of `values`.
  56889. *
  56890. * @private
  56891. * @param {Array} values The values to add to the set.
  56892. * @returns {Object} Returns the new set.
  56893. */
  56894. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  56895. return new Set(values);
  56896. };
  56897. module.exports = createSet;
  56898. /***/ })
  56899. /******/ ]);
  56900. });
  56901. //# sourceMappingURL=opentok.js.map
  56902. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  56903. /***/ }),
  56904. /***/ "./node_modules/after/index.js":
  56905. /*!*************************************!*\
  56906. !*** ./node_modules/after/index.js ***!
  56907. \*************************************/
  56908. /*! no static exports found */
  56909. /*! all exports used */
  56910. /***/ (function(module, exports) {
  56911. module.exports = after
  56912. function after(count, callback, err_cb) {
  56913. var bail = false
  56914. err_cb = err_cb || noop
  56915. proxy.count = count
  56916. return (count === 0) ? callback() : proxy
  56917. function proxy(err, result) {
  56918. if (proxy.count <= 0) {
  56919. throw new Error('after called too many times')
  56920. }
  56921. --proxy.count
  56922. // after first error, rest are passed to err_cb
  56923. if (err) {
  56924. bail = true
  56925. callback(err)
  56926. // future error callbacks will go to error handler
  56927. callback = err_cb
  56928. } else if (proxy.count === 0 && !bail) {
  56929. callback(null, result)
  56930. }
  56931. }
  56932. }
  56933. function noop() {}
  56934. /***/ }),
  56935. /***/ "./node_modules/arraybuffer.slice/index.js":
  56936. /*!*************************************************!*\
  56937. !*** ./node_modules/arraybuffer.slice/index.js ***!
  56938. \*************************************************/
  56939. /*! no static exports found */
  56940. /*! all exports used */
  56941. /***/ (function(module, exports) {
  56942. /**
  56943. * An abstraction for slicing an arraybuffer even when
  56944. * ArrayBuffer.prototype.slice is not supported
  56945. *
  56946. * @api public
  56947. */
  56948. module.exports = function(arraybuffer, start, end) {
  56949. var bytes = arraybuffer.byteLength;
  56950. start = start || 0;
  56951. end = end || bytes;
  56952. if (arraybuffer.slice) { return arraybuffer.slice(start, end); }
  56953. if (start < 0) { start += bytes; }
  56954. if (end < 0) { end += bytes; }
  56955. if (end > bytes) { end = bytes; }
  56956. if (start >= bytes || start >= end || bytes === 0) {
  56957. return new ArrayBuffer(0);
  56958. }
  56959. var abv = new Uint8Array(arraybuffer);
  56960. var result = new Uint8Array(end - start);
  56961. for (var i = start, ii = 0; i < end; i++, ii++) {
  56962. result[ii] = abv[i];
  56963. }
  56964. return result.buffer;
  56965. };
  56966. /***/ }),
  56967. /***/ "./node_modules/axios/index.js":
  56968. /*!*************************************!*\
  56969. !*** ./node_modules/axios/index.js ***!
  56970. \*************************************/
  56971. /*! no static exports found */
  56972. /*! all exports used */
  56973. /***/ (function(module, exports, __webpack_require__) {
  56974. module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js");
  56975. /***/ }),
  56976. /***/ "./node_modules/axios/lib/adapters/xhr.js":
  56977. /*!************************************************!*\
  56978. !*** ./node_modules/axios/lib/adapters/xhr.js ***!
  56979. \************************************************/
  56980. /*! no static exports found */
  56981. /*! all exports used */
  56982. /***/ (function(module, exports, __webpack_require__) {
  56983. "use strict";
  56984. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  56985. var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
  56986. var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  56987. var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
  56988. var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
  56989. var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
  56990. var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
  56991. module.exports = function xhrAdapter(config) {
  56992. return new Promise(function dispatchXhrRequest(resolve, reject) {
  56993. var requestData = config.data;
  56994. var requestHeaders = config.headers;
  56995. if (utils.isFormData(requestData)) {
  56996. delete requestHeaders['Content-Type']; // Let the browser set it
  56997. }
  56998. var request = new XMLHttpRequest();
  56999. // HTTP basic authentication
  57000. if (config.auth) {
  57001. var username = config.auth.username || '';
  57002. var password = config.auth.password || '';
  57003. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  57004. }
  57005. var fullPath = buildFullPath(config.baseURL, config.url);
  57006. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  57007. // Set the request timeout in MS
  57008. request.timeout = config.timeout;
  57009. // Listen for ready state
  57010. request.onreadystatechange = function handleLoad() {
  57011. if (!request || request.readyState !== 4) {
  57012. return;
  57013. }
  57014. // The request errored out and we didn't get a response, this will be
  57015. // handled by onerror instead
  57016. // With one exception: request that using file: protocol, most browsers
  57017. // will return status as 0 even though it's a successful request
  57018. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  57019. return;
  57020. }
  57021. // Prepare the response
  57022. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  57023. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  57024. var response = {
  57025. data: responseData,
  57026. status: request.status,
  57027. statusText: request.statusText,
  57028. headers: responseHeaders,
  57029. config: config,
  57030. request: request
  57031. };
  57032. settle(resolve, reject, response);
  57033. // Clean up request
  57034. request = null;
  57035. };
  57036. // Handle browser request cancellation (as opposed to a manual cancellation)
  57037. request.onabort = function handleAbort() {
  57038. if (!request) {
  57039. return;
  57040. }
  57041. reject(createError('Request aborted', config, 'ECONNABORTED', request));
  57042. // Clean up request
  57043. request = null;
  57044. };
  57045. // Handle low level network errors
  57046. request.onerror = function handleError() {
  57047. // Real errors are hidden from us by the browser
  57048. // onerror should only fire if it's a network error
  57049. reject(createError('Network Error', config, null, request));
  57050. // Clean up request
  57051. request = null;
  57052. };
  57053. // Handle timeout
  57054. request.ontimeout = function handleTimeout() {
  57055. var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
  57056. if (config.timeoutErrorMessage) {
  57057. timeoutErrorMessage = config.timeoutErrorMessage;
  57058. }
  57059. reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
  57060. request));
  57061. // Clean up request
  57062. request = null;
  57063. };
  57064. // Add xsrf header
  57065. // This is only done if running in a standard browser environment.
  57066. // Specifically not if we're in a web worker, or react-native.
  57067. if (utils.isStandardBrowserEnv()) {
  57068. var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
  57069. // Add xsrf header
  57070. var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
  57071. cookies.read(config.xsrfCookieName) :
  57072. undefined;
  57073. if (xsrfValue) {
  57074. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  57075. }
  57076. }
  57077. // Add headers to the request
  57078. if ('setRequestHeader' in request) {
  57079. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  57080. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  57081. // Remove Content-Type if data is undefined
  57082. delete requestHeaders[key];
  57083. } else {
  57084. // Otherwise add header to the request
  57085. request.setRequestHeader(key, val);
  57086. }
  57087. });
  57088. }
  57089. // Add withCredentials to request if needed
  57090. if (!utils.isUndefined(config.withCredentials)) {
  57091. request.withCredentials = !!config.withCredentials;
  57092. }
  57093. // Add responseType to request if needed
  57094. if (config.responseType) {
  57095. try {
  57096. request.responseType = config.responseType;
  57097. } catch (e) {
  57098. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  57099. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  57100. if (config.responseType !== 'json') {
  57101. throw e;
  57102. }
  57103. }
  57104. }
  57105. // Handle progress if needed
  57106. if (typeof config.onDownloadProgress === 'function') {
  57107. request.addEventListener('progress', config.onDownloadProgress);
  57108. }
  57109. // Not all browsers support upload events
  57110. if (typeof config.onUploadProgress === 'function' && request.upload) {
  57111. request.upload.addEventListener('progress', config.onUploadProgress);
  57112. }
  57113. if (config.cancelToken) {
  57114. // Handle cancellation
  57115. config.cancelToken.promise.then(function onCanceled(cancel) {
  57116. if (!request) {
  57117. return;
  57118. }
  57119. request.abort();
  57120. reject(cancel);
  57121. // Clean up request
  57122. request = null;
  57123. });
  57124. }
  57125. if (requestData === undefined) {
  57126. requestData = null;
  57127. }
  57128. // Send the request
  57129. request.send(requestData);
  57130. });
  57131. };
  57132. /***/ }),
  57133. /***/ "./node_modules/axios/lib/axios.js":
  57134. /*!*****************************************!*\
  57135. !*** ./node_modules/axios/lib/axios.js ***!
  57136. \*****************************************/
  57137. /*! no static exports found */
  57138. /*! all exports used */
  57139. /***/ (function(module, exports, __webpack_require__) {
  57140. "use strict";
  57141. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  57142. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  57143. var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
  57144. var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  57145. var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
  57146. /**
  57147. * Create an instance of Axios
  57148. *
  57149. * @param {Object} defaultConfig The default config for the instance
  57150. * @return {Axios} A new instance of Axios
  57151. */
  57152. function createInstance(defaultConfig) {
  57153. var context = new Axios(defaultConfig);
  57154. var instance = bind(Axios.prototype.request, context);
  57155. // Copy axios.prototype to instance
  57156. utils.extend(instance, Axios.prototype, context);
  57157. // Copy context to instance
  57158. utils.extend(instance, context);
  57159. return instance;
  57160. }
  57161. // Create the default instance to be exported
  57162. var axios = createInstance(defaults);
  57163. // Expose Axios class to allow class inheritance
  57164. axios.Axios = Axios;
  57165. // Factory for creating new instances
  57166. axios.create = function create(instanceConfig) {
  57167. return createInstance(mergeConfig(axios.defaults, instanceConfig));
  57168. };
  57169. // Expose Cancel & CancelToken
  57170. axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  57171. axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
  57172. axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  57173. // Expose all/spread
  57174. axios.all = function all(promises) {
  57175. return Promise.all(promises);
  57176. };
  57177. axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");
  57178. module.exports = axios;
  57179. // Allow use of default import syntax in TypeScript
  57180. module.exports.default = axios;
  57181. /***/ }),
  57182. /***/ "./node_modules/axios/lib/cancel/Cancel.js":
  57183. /*!*************************************************!*\
  57184. !*** ./node_modules/axios/lib/cancel/Cancel.js ***!
  57185. \*************************************************/
  57186. /*! no static exports found */
  57187. /*! all exports used */
  57188. /***/ (function(module, exports, __webpack_require__) {
  57189. "use strict";
  57190. /**
  57191. * A `Cancel` is an object that is thrown when an operation is canceled.
  57192. *
  57193. * @class
  57194. * @param {string=} message The message.
  57195. */
  57196. function Cancel(message) {
  57197. this.message = message;
  57198. }
  57199. Cancel.prototype.toString = function toString() {
  57200. return 'Cancel' + (this.message ? ': ' + this.message : '');
  57201. };
  57202. Cancel.prototype.__CANCEL__ = true;
  57203. module.exports = Cancel;
  57204. /***/ }),
  57205. /***/ "./node_modules/axios/lib/cancel/CancelToken.js":
  57206. /*!******************************************************!*\
  57207. !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
  57208. \******************************************************/
  57209. /*! no static exports found */
  57210. /*! all exports used */
  57211. /***/ (function(module, exports, __webpack_require__) {
  57212. "use strict";
  57213. var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  57214. /**
  57215. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  57216. *
  57217. * @class
  57218. * @param {Function} executor The executor function.
  57219. */
  57220. function CancelToken(executor) {
  57221. if (typeof executor !== 'function') {
  57222. throw new TypeError('executor must be a function.');
  57223. }
  57224. var resolvePromise;
  57225. this.promise = new Promise(function promiseExecutor(resolve) {
  57226. resolvePromise = resolve;
  57227. });
  57228. var token = this;
  57229. executor(function cancel(message) {
  57230. if (token.reason) {
  57231. // Cancellation has already been requested
  57232. return;
  57233. }
  57234. token.reason = new Cancel(message);
  57235. resolvePromise(token.reason);
  57236. });
  57237. }
  57238. /**
  57239. * Throws a `Cancel` if cancellation has been requested.
  57240. */
  57241. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  57242. if (this.reason) {
  57243. throw this.reason;
  57244. }
  57245. };
  57246. /**
  57247. * Returns an object that contains a new `CancelToken` and a function that, when called,
  57248. * cancels the `CancelToken`.
  57249. */
  57250. CancelToken.source = function source() {
  57251. var cancel;
  57252. var token = new CancelToken(function executor(c) {
  57253. cancel = c;
  57254. });
  57255. return {
  57256. token: token,
  57257. cancel: cancel
  57258. };
  57259. };
  57260. module.exports = CancelToken;
  57261. /***/ }),
  57262. /***/ "./node_modules/axios/lib/cancel/isCancel.js":
  57263. /*!***************************************************!*\
  57264. !*** ./node_modules/axios/lib/cancel/isCancel.js ***!
  57265. \***************************************************/
  57266. /*! no static exports found */
  57267. /*! all exports used */
  57268. /***/ (function(module, exports, __webpack_require__) {
  57269. "use strict";
  57270. module.exports = function isCancel(value) {
  57271. return !!(value && value.__CANCEL__);
  57272. };
  57273. /***/ }),
  57274. /***/ "./node_modules/axios/lib/core/Axios.js":
  57275. /*!**********************************************!*\
  57276. !*** ./node_modules/axios/lib/core/Axios.js ***!
  57277. \**********************************************/
  57278. /*! no static exports found */
  57279. /*! all exports used */
  57280. /***/ (function(module, exports, __webpack_require__) {
  57281. "use strict";
  57282. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  57283. var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  57284. var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
  57285. var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
  57286. var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  57287. /**
  57288. * Create a new instance of Axios
  57289. *
  57290. * @param {Object} instanceConfig The default config for the instance
  57291. */
  57292. function Axios(instanceConfig) {
  57293. this.defaults = instanceConfig;
  57294. this.interceptors = {
  57295. request: new InterceptorManager(),
  57296. response: new InterceptorManager()
  57297. };
  57298. }
  57299. /**
  57300. * Dispatch a request
  57301. *
  57302. * @param {Object} config The config specific for this request (merged with this.defaults)
  57303. */
  57304. Axios.prototype.request = function request(config) {
  57305. /*eslint no-param-reassign:0*/
  57306. // Allow for axios('example/url'[, config]) a la fetch API
  57307. if (typeof config === 'string') {
  57308. config = arguments[1] || {};
  57309. config.url = arguments[0];
  57310. } else {
  57311. config = config || {};
  57312. }
  57313. config = mergeConfig(this.defaults, config);
  57314. // Set config.method
  57315. if (config.method) {
  57316. config.method = config.method.toLowerCase();
  57317. } else if (this.defaults.method) {
  57318. config.method = this.defaults.method.toLowerCase();
  57319. } else {
  57320. config.method = 'get';
  57321. }
  57322. // Hook up interceptors middleware
  57323. var chain = [dispatchRequest, undefined];
  57324. var promise = Promise.resolve(config);
  57325. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  57326. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  57327. });
  57328. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  57329. chain.push(interceptor.fulfilled, interceptor.rejected);
  57330. });
  57331. while (chain.length) {
  57332. promise = promise.then(chain.shift(), chain.shift());
  57333. }
  57334. return promise;
  57335. };
  57336. Axios.prototype.getUri = function getUri(config) {
  57337. config = mergeConfig(this.defaults, config);
  57338. return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
  57339. };
  57340. // Provide aliases for supported request methods
  57341. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  57342. /*eslint func-names:0*/
  57343. Axios.prototype[method] = function(url, config) {
  57344. return this.request(utils.merge(config || {}, {
  57345. method: method,
  57346. url: url
  57347. }));
  57348. };
  57349. });
  57350. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  57351. /*eslint func-names:0*/
  57352. Axios.prototype[method] = function(url, data, config) {
  57353. return this.request(utils.merge(config || {}, {
  57354. method: method,
  57355. url: url,
  57356. data: data
  57357. }));
  57358. };
  57359. });
  57360. module.exports = Axios;
  57361. /***/ }),
  57362. /***/ "./node_modules/axios/lib/core/InterceptorManager.js":
  57363. /*!***********************************************************!*\
  57364. !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
  57365. \***********************************************************/
  57366. /*! no static exports found */
  57367. /*! all exports used */
  57368. /***/ (function(module, exports, __webpack_require__) {
  57369. "use strict";
  57370. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  57371. function InterceptorManager() {
  57372. this.handlers = [];
  57373. }
  57374. /**
  57375. * Add a new interceptor to the stack
  57376. *
  57377. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  57378. * @param {Function} rejected The function to handle `reject` for a `Promise`
  57379. *
  57380. * @return {Number} An ID used to remove interceptor later
  57381. */
  57382. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  57383. this.handlers.push({
  57384. fulfilled: fulfilled,
  57385. rejected: rejected
  57386. });
  57387. return this.handlers.length - 1;
  57388. };
  57389. /**
  57390. * Remove an interceptor from the stack
  57391. *
  57392. * @param {Number} id The ID that was returned by `use`
  57393. */
  57394. InterceptorManager.prototype.eject = function eject(id) {
  57395. if (this.handlers[id]) {
  57396. this.handlers[id] = null;
  57397. }
  57398. };
  57399. /**
  57400. * Iterate over all the registered interceptors
  57401. *
  57402. * This method is particularly useful for skipping over any
  57403. * interceptors that may have become `null` calling `eject`.
  57404. *
  57405. * @param {Function} fn The function to call for each interceptor
  57406. */
  57407. InterceptorManager.prototype.forEach = function forEach(fn) {
  57408. utils.forEach(this.handlers, function forEachHandler(h) {
  57409. if (h !== null) {
  57410. fn(h);
  57411. }
  57412. });
  57413. };
  57414. module.exports = InterceptorManager;
  57415. /***/ }),
  57416. /***/ "./node_modules/axios/lib/core/buildFullPath.js":
  57417. /*!******************************************************!*\
  57418. !*** ./node_modules/axios/lib/core/buildFullPath.js ***!
  57419. \******************************************************/
  57420. /*! no static exports found */
  57421. /*! all exports used */
  57422. /***/ (function(module, exports, __webpack_require__) {
  57423. "use strict";
  57424. var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
  57425. var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js");
  57426. /**
  57427. * Creates a new URL by combining the baseURL with the requestedURL,
  57428. * only when the requestedURL is not already an absolute URL.
  57429. * If the requestURL is absolute, this function returns the requestedURL untouched.
  57430. *
  57431. * @param {string} baseURL The base URL
  57432. * @param {string} requestedURL Absolute or relative URL to combine
  57433. * @returns {string} The combined full path
  57434. */
  57435. module.exports = function buildFullPath(baseURL, requestedURL) {
  57436. if (baseURL && !isAbsoluteURL(requestedURL)) {
  57437. return combineURLs(baseURL, requestedURL);
  57438. }
  57439. return requestedURL;
  57440. };
  57441. /***/ }),
  57442. /***/ "./node_modules/axios/lib/core/createError.js":
  57443. /*!****************************************************!*\
  57444. !*** ./node_modules/axios/lib/core/createError.js ***!
  57445. \****************************************************/
  57446. /*! no static exports found */
  57447. /*! all exports used */
  57448. /***/ (function(module, exports, __webpack_require__) {
  57449. "use strict";
  57450. var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
  57451. /**
  57452. * Create an Error with the specified message, config, error code, request and response.
  57453. *
  57454. * @param {string} message The error message.
  57455. * @param {Object} config The config.
  57456. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  57457. * @param {Object} [request] The request.
  57458. * @param {Object} [response] The response.
  57459. * @returns {Error} The created error.
  57460. */
  57461. module.exports = function createError(message, config, code, request, response) {
  57462. var error = new Error(message);
  57463. return enhanceError(error, config, code, request, response);
  57464. };
  57465. /***/ }),
  57466. /***/ "./node_modules/axios/lib/core/dispatchRequest.js":
  57467. /*!********************************************************!*\
  57468. !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
  57469. \********************************************************/
  57470. /*! no static exports found */
  57471. /*! all exports used */
  57472. /***/ (function(module, exports, __webpack_require__) {
  57473. "use strict";
  57474. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  57475. var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
  57476. var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  57477. var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
  57478. /**
  57479. * Throws a `Cancel` if cancellation has been requested.
  57480. */
  57481. function throwIfCancellationRequested(config) {
  57482. if (config.cancelToken) {
  57483. config.cancelToken.throwIfRequested();
  57484. }
  57485. }
  57486. /**
  57487. * Dispatch a request to the server using the configured adapter.
  57488. *
  57489. * @param {object} config The config that is to be used for the request
  57490. * @returns {Promise} The Promise to be fulfilled
  57491. */
  57492. module.exports = function dispatchRequest(config) {
  57493. throwIfCancellationRequested(config);
  57494. // Ensure headers exist
  57495. config.headers = config.headers || {};
  57496. // Transform request data
  57497. config.data = transformData(
  57498. config.data,
  57499. config.headers,
  57500. config.transformRequest
  57501. );
  57502. // Flatten headers
  57503. config.headers = utils.merge(
  57504. config.headers.common || {},
  57505. config.headers[config.method] || {},
  57506. config.headers
  57507. );
  57508. utils.forEach(
  57509. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  57510. function cleanHeaderConfig(method) {
  57511. delete config.headers[method];
  57512. }
  57513. );
  57514. var adapter = config.adapter || defaults.adapter;
  57515. return adapter(config).then(function onAdapterResolution(response) {
  57516. throwIfCancellationRequested(config);
  57517. // Transform response data
  57518. response.data = transformData(
  57519. response.data,
  57520. response.headers,
  57521. config.transformResponse
  57522. );
  57523. return response;
  57524. }, function onAdapterRejection(reason) {
  57525. if (!isCancel(reason)) {
  57526. throwIfCancellationRequested(config);
  57527. // Transform response data
  57528. if (reason && reason.response) {
  57529. reason.response.data = transformData(
  57530. reason.response.data,
  57531. reason.response.headers,
  57532. config.transformResponse
  57533. );
  57534. }
  57535. }
  57536. return Promise.reject(reason);
  57537. });
  57538. };
  57539. /***/ }),
  57540. /***/ "./node_modules/axios/lib/core/enhanceError.js":
  57541. /*!*****************************************************!*\
  57542. !*** ./node_modules/axios/lib/core/enhanceError.js ***!
  57543. \*****************************************************/
  57544. /*! no static exports found */
  57545. /*! all exports used */
  57546. /***/ (function(module, exports, __webpack_require__) {
  57547. "use strict";
  57548. /**
  57549. * Update an Error with the specified config, error code, and response.
  57550. *
  57551. * @param {Error} error The error to update.
  57552. * @param {Object} config The config.
  57553. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  57554. * @param {Object} [request] The request.
  57555. * @param {Object} [response] The response.
  57556. * @returns {Error} The error.
  57557. */
  57558. module.exports = function enhanceError(error, config, code, request, response) {
  57559. error.config = config;
  57560. if (code) {
  57561. error.code = code;
  57562. }
  57563. error.request = request;
  57564. error.response = response;
  57565. error.isAxiosError = true;
  57566. error.toJSON = function() {
  57567. return {
  57568. // Standard
  57569. message: this.message,
  57570. name: this.name,
  57571. // Microsoft
  57572. description: this.description,
  57573. number: this.number,
  57574. // Mozilla
  57575. fileName: this.fileName,
  57576. lineNumber: this.lineNumber,
  57577. columnNumber: this.columnNumber,
  57578. stack: this.stack,
  57579. // Axios
  57580. config: this.config,
  57581. code: this.code
  57582. };
  57583. };
  57584. return error;
  57585. };
  57586. /***/ }),
  57587. /***/ "./node_modules/axios/lib/core/mergeConfig.js":
  57588. /*!****************************************************!*\
  57589. !*** ./node_modules/axios/lib/core/mergeConfig.js ***!
  57590. \****************************************************/
  57591. /*! no static exports found */
  57592. /*! all exports used */
  57593. /***/ (function(module, exports, __webpack_require__) {
  57594. "use strict";
  57595. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  57596. /**
  57597. * Config-specific merge-function which creates a new config-object
  57598. * by merging two configuration objects together.
  57599. *
  57600. * @param {Object} config1
  57601. * @param {Object} config2
  57602. * @returns {Object} New object resulting from merging config2 to config1
  57603. */
  57604. module.exports = function mergeConfig(config1, config2) {
  57605. // eslint-disable-next-line no-param-reassign
  57606. config2 = config2 || {};
  57607. var config = {};
  57608. var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
  57609. var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
  57610. var defaultToConfig2Keys = [
  57611. 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
  57612. 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
  57613. 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
  57614. 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
  57615. 'httpsAgent', 'cancelToken', 'socketPath'
  57616. ];
  57617. utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
  57618. if (typeof config2[prop] !== 'undefined') {
  57619. config[prop] = config2[prop];
  57620. }
  57621. });
  57622. utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
  57623. if (utils.isObject(config2[prop])) {
  57624. config[prop] = utils.deepMerge(config1[prop], config2[prop]);
  57625. } else if (typeof config2[prop] !== 'undefined') {
  57626. config[prop] = config2[prop];
  57627. } else if (utils.isObject(config1[prop])) {
  57628. config[prop] = utils.deepMerge(config1[prop]);
  57629. } else if (typeof config1[prop] !== 'undefined') {
  57630. config[prop] = config1[prop];
  57631. }
  57632. });
  57633. utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
  57634. if (typeof config2[prop] !== 'undefined') {
  57635. config[prop] = config2[prop];
  57636. } else if (typeof config1[prop] !== 'undefined') {
  57637. config[prop] = config1[prop];
  57638. }
  57639. });
  57640. var axiosKeys = valueFromConfig2Keys
  57641. .concat(mergeDeepPropertiesKeys)
  57642. .concat(defaultToConfig2Keys);
  57643. var otherKeys = Object
  57644. .keys(config2)
  57645. .filter(function filterAxiosKeys(key) {
  57646. return axiosKeys.indexOf(key) === -1;
  57647. });
  57648. utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
  57649. if (typeof config2[prop] !== 'undefined') {
  57650. config[prop] = config2[prop];
  57651. } else if (typeof config1[prop] !== 'undefined') {
  57652. config[prop] = config1[prop];
  57653. }
  57654. });
  57655. return config;
  57656. };
  57657. /***/ }),
  57658. /***/ "./node_modules/axios/lib/core/settle.js":
  57659. /*!***********************************************!*\
  57660. !*** ./node_modules/axios/lib/core/settle.js ***!
  57661. \***********************************************/
  57662. /*! no static exports found */
  57663. /*! all exports used */
  57664. /***/ (function(module, exports, __webpack_require__) {
  57665. "use strict";
  57666. var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js");
  57667. /**
  57668. * Resolve or reject a Promise based on response status.
  57669. *
  57670. * @param {Function} resolve A function that resolves the promise.
  57671. * @param {Function} reject A function that rejects the promise.
  57672. * @param {object} response The response.
  57673. */
  57674. module.exports = function settle(resolve, reject, response) {
  57675. var validateStatus = response.config.validateStatus;
  57676. if (!validateStatus || validateStatus(response.status)) {
  57677. resolve(response);
  57678. } else {
  57679. reject(createError(
  57680. 'Request failed with status code ' + response.status,
  57681. response.config,
  57682. null,
  57683. response.request,
  57684. response
  57685. ));
  57686. }
  57687. };
  57688. /***/ }),
  57689. /***/ "./node_modules/axios/lib/core/transformData.js":
  57690. /*!******************************************************!*\
  57691. !*** ./node_modules/axios/lib/core/transformData.js ***!
  57692. \******************************************************/
  57693. /*! no static exports found */
  57694. /*! all exports used */
  57695. /***/ (function(module, exports, __webpack_require__) {
  57696. "use strict";
  57697. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  57698. /**
  57699. * Transform the data for a request or a response
  57700. *
  57701. * @param {Object|String} data The data to be transformed
  57702. * @param {Array} headers The headers for the request or response
  57703. * @param {Array|Function} fns A single function or Array of functions
  57704. * @returns {*} The resulting transformed data
  57705. */
  57706. module.exports = function transformData(data, headers, fns) {
  57707. /*eslint no-param-reassign:0*/
  57708. utils.forEach(fns, function transform(fn) {
  57709. data = fn(data, headers);
  57710. });
  57711. return data;
  57712. };
  57713. /***/ }),
  57714. /***/ "./node_modules/axios/lib/defaults.js":
  57715. /*!********************************************!*\
  57716. !*** ./node_modules/axios/lib/defaults.js ***!
  57717. \********************************************/
  57718. /*! no static exports found */
  57719. /*! all exports used */
  57720. /***/ (function(module, exports, __webpack_require__) {
  57721. "use strict";
  57722. /* WEBPACK VAR INJECTION */(function(process) {
  57723. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  57724. var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
  57725. var DEFAULT_CONTENT_TYPE = {
  57726. 'Content-Type': 'application/x-www-form-urlencoded'
  57727. };
  57728. function setContentTypeIfUnset(headers, value) {
  57729. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  57730. headers['Content-Type'] = value;
  57731. }
  57732. }
  57733. function getDefaultAdapter() {
  57734. var adapter;
  57735. if (typeof XMLHttpRequest !== 'undefined') {
  57736. // For browsers use XHR adapter
  57737. adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
  57738. } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  57739. // For node use HTTP adapter
  57740. adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
  57741. }
  57742. return adapter;
  57743. }
  57744. var defaults = {
  57745. adapter: getDefaultAdapter(),
  57746. transformRequest: [function transformRequest(data, headers) {
  57747. normalizeHeaderName(headers, 'Accept');
  57748. normalizeHeaderName(headers, 'Content-Type');
  57749. if (utils.isFormData(data) ||
  57750. utils.isArrayBuffer(data) ||
  57751. utils.isBuffer(data) ||
  57752. utils.isStream(data) ||
  57753. utils.isFile(data) ||
  57754. utils.isBlob(data)
  57755. ) {
  57756. return data;
  57757. }
  57758. if (utils.isArrayBufferView(data)) {
  57759. return data.buffer;
  57760. }
  57761. if (utils.isURLSearchParams(data)) {
  57762. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  57763. return data.toString();
  57764. }
  57765. if (utils.isObject(data)) {
  57766. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  57767. return JSON.stringify(data);
  57768. }
  57769. return data;
  57770. }],
  57771. transformResponse: [function transformResponse(data) {
  57772. /*eslint no-param-reassign:0*/
  57773. if (typeof data === 'string') {
  57774. try {
  57775. data = JSON.parse(data);
  57776. } catch (e) { /* Ignore */ }
  57777. }
  57778. return data;
  57779. }],
  57780. /**
  57781. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  57782. * timeout is not created.
  57783. */
  57784. timeout: 0,
  57785. xsrfCookieName: 'XSRF-TOKEN',
  57786. xsrfHeaderName: 'X-XSRF-TOKEN',
  57787. maxContentLength: -1,
  57788. validateStatus: function validateStatus(status) {
  57789. return status >= 200 && status < 300;
  57790. }
  57791. };
  57792. defaults.headers = {
  57793. common: {
  57794. 'Accept': 'application/json, text/plain, */*'
  57795. }
  57796. };
  57797. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  57798. defaults.headers[method] = {};
  57799. });
  57800. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  57801. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  57802. });
  57803. module.exports = defaults;
  57804. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
  57805. /***/ }),
  57806. /***/ "./node_modules/axios/lib/helpers/bind.js":
  57807. /*!************************************************!*\
  57808. !*** ./node_modules/axios/lib/helpers/bind.js ***!
  57809. \************************************************/
  57810. /*! no static exports found */
  57811. /*! all exports used */
  57812. /***/ (function(module, exports, __webpack_require__) {
  57813. "use strict";
  57814. module.exports = function bind(fn, thisArg) {
  57815. return function wrap() {
  57816. var args = new Array(arguments.length);
  57817. for (var i = 0; i < args.length; i++) {
  57818. args[i] = arguments[i];
  57819. }
  57820. return fn.apply(thisArg, args);
  57821. };
  57822. };
  57823. /***/ }),
  57824. /***/ "./node_modules/axios/lib/helpers/buildURL.js":
  57825. /*!****************************************************!*\
  57826. !*** ./node_modules/axios/lib/helpers/buildURL.js ***!
  57827. \****************************************************/
  57828. /*! no static exports found */
  57829. /*! all exports used */
  57830. /***/ (function(module, exports, __webpack_require__) {
  57831. "use strict";
  57832. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  57833. function encode(val) {
  57834. return encodeURIComponent(val).
  57835. replace(/%40/gi, '@').
  57836. replace(/%3A/gi, ':').
  57837. replace(/%24/g, '$').
  57838. replace(/%2C/gi, ',').
  57839. replace(/%20/g, '+').
  57840. replace(/%5B/gi, '[').
  57841. replace(/%5D/gi, ']');
  57842. }
  57843. /**
  57844. * Build a URL by appending params to the end
  57845. *
  57846. * @param {string} url The base of the url (e.g., http://www.google.com)
  57847. * @param {object} [params] The params to be appended
  57848. * @returns {string} The formatted url
  57849. */
  57850. module.exports = function buildURL(url, params, paramsSerializer) {
  57851. /*eslint no-param-reassign:0*/
  57852. if (!params) {
  57853. return url;
  57854. }
  57855. var serializedParams;
  57856. if (paramsSerializer) {
  57857. serializedParams = paramsSerializer(params);
  57858. } else if (utils.isURLSearchParams(params)) {
  57859. serializedParams = params.toString();
  57860. } else {
  57861. var parts = [];
  57862. utils.forEach(params, function serialize(val, key) {
  57863. if (val === null || typeof val === 'undefined') {
  57864. return;
  57865. }
  57866. if (utils.isArray(val)) {
  57867. key = key + '[]';
  57868. } else {
  57869. val = [val];
  57870. }
  57871. utils.forEach(val, function parseValue(v) {
  57872. if (utils.isDate(v)) {
  57873. v = v.toISOString();
  57874. } else if (utils.isObject(v)) {
  57875. v = JSON.stringify(v);
  57876. }
  57877. parts.push(encode(key) + '=' + encode(v));
  57878. });
  57879. });
  57880. serializedParams = parts.join('&');
  57881. }
  57882. if (serializedParams) {
  57883. var hashmarkIndex = url.indexOf('#');
  57884. if (hashmarkIndex !== -1) {
  57885. url = url.slice(0, hashmarkIndex);
  57886. }
  57887. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  57888. }
  57889. return url;
  57890. };
  57891. /***/ }),
  57892. /***/ "./node_modules/axios/lib/helpers/combineURLs.js":
  57893. /*!*******************************************************!*\
  57894. !*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
  57895. \*******************************************************/
  57896. /*! no static exports found */
  57897. /*! all exports used */
  57898. /***/ (function(module, exports, __webpack_require__) {
  57899. "use strict";
  57900. /**
  57901. * Creates a new URL by combining the specified URLs
  57902. *
  57903. * @param {string} baseURL The base URL
  57904. * @param {string} relativeURL The relative URL
  57905. * @returns {string} The combined URL
  57906. */
  57907. module.exports = function combineURLs(baseURL, relativeURL) {
  57908. return relativeURL
  57909. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  57910. : baseURL;
  57911. };
  57912. /***/ }),
  57913. /***/ "./node_modules/axios/lib/helpers/cookies.js":
  57914. /*!***************************************************!*\
  57915. !*** ./node_modules/axios/lib/helpers/cookies.js ***!
  57916. \***************************************************/
  57917. /*! no static exports found */
  57918. /*! all exports used */
  57919. /***/ (function(module, exports, __webpack_require__) {
  57920. "use strict";
  57921. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  57922. module.exports = (
  57923. utils.isStandardBrowserEnv() ?
  57924. // Standard browser envs support document.cookie
  57925. (function standardBrowserEnv() {
  57926. return {
  57927. write: function write(name, value, expires, path, domain, secure) {
  57928. var cookie = [];
  57929. cookie.push(name + '=' + encodeURIComponent(value));
  57930. if (utils.isNumber(expires)) {
  57931. cookie.push('expires=' + new Date(expires).toGMTString());
  57932. }
  57933. if (utils.isString(path)) {
  57934. cookie.push('path=' + path);
  57935. }
  57936. if (utils.isString(domain)) {
  57937. cookie.push('domain=' + domain);
  57938. }
  57939. if (secure === true) {
  57940. cookie.push('secure');
  57941. }
  57942. document.cookie = cookie.join('; ');
  57943. },
  57944. read: function read(name) {
  57945. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  57946. return (match ? decodeURIComponent(match[3]) : null);
  57947. },
  57948. remove: function remove(name) {
  57949. this.write(name, '', Date.now() - 86400000);
  57950. }
  57951. };
  57952. })() :
  57953. // Non standard browser env (web workers, react-native) lack needed support.
  57954. (function nonStandardBrowserEnv() {
  57955. return {
  57956. write: function write() {},
  57957. read: function read() { return null; },
  57958. remove: function remove() {}
  57959. };
  57960. })()
  57961. );
  57962. /***/ }),
  57963. /***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
  57964. /*!*********************************************************!*\
  57965. !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
  57966. \*********************************************************/
  57967. /*! no static exports found */
  57968. /*! all exports used */
  57969. /***/ (function(module, exports, __webpack_require__) {
  57970. "use strict";
  57971. /**
  57972. * Determines whether the specified URL is absolute
  57973. *
  57974. * @param {string} url The URL to test
  57975. * @returns {boolean} True if the specified URL is absolute, otherwise false
  57976. */
  57977. module.exports = function isAbsoluteURL(url) {
  57978. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  57979. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  57980. // by any combination of letters, digits, plus, period, or hyphen.
  57981. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  57982. };
  57983. /***/ }),
  57984. /***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
  57985. /*!***********************************************************!*\
  57986. !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
  57987. \***********************************************************/
  57988. /*! no static exports found */
  57989. /*! all exports used */
  57990. /***/ (function(module, exports, __webpack_require__) {
  57991. "use strict";
  57992. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  57993. module.exports = (
  57994. utils.isStandardBrowserEnv() ?
  57995. // Standard browser envs have full support of the APIs needed to test
  57996. // whether the request URL is of the same origin as current location.
  57997. (function standardBrowserEnv() {
  57998. var msie = /(msie|trident)/i.test(navigator.userAgent);
  57999. var urlParsingNode = document.createElement('a');
  58000. var originURL;
  58001. /**
  58002. * Parse a URL to discover it's components
  58003. *
  58004. * @param {String} url The URL to be parsed
  58005. * @returns {Object}
  58006. */
  58007. function resolveURL(url) {
  58008. var href = url;
  58009. if (msie) {
  58010. // IE needs attribute set twice to normalize properties
  58011. urlParsingNode.setAttribute('href', href);
  58012. href = urlParsingNode.href;
  58013. }
  58014. urlParsingNode.setAttribute('href', href);
  58015. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  58016. return {
  58017. href: urlParsingNode.href,
  58018. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  58019. host: urlParsingNode.host,
  58020. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  58021. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  58022. hostname: urlParsingNode.hostname,
  58023. port: urlParsingNode.port,
  58024. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  58025. urlParsingNode.pathname :
  58026. '/' + urlParsingNode.pathname
  58027. };
  58028. }
  58029. originURL = resolveURL(window.location.href);
  58030. /**
  58031. * Determine if a URL shares the same origin as the current location
  58032. *
  58033. * @param {String} requestURL The URL to test
  58034. * @returns {boolean} True if URL shares the same origin, otherwise false
  58035. */
  58036. return function isURLSameOrigin(requestURL) {
  58037. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  58038. return (parsed.protocol === originURL.protocol &&
  58039. parsed.host === originURL.host);
  58040. };
  58041. })() :
  58042. // Non standard browser envs (web workers, react-native) lack needed support.
  58043. (function nonStandardBrowserEnv() {
  58044. return function isURLSameOrigin() {
  58045. return true;
  58046. };
  58047. })()
  58048. );
  58049. /***/ }),
  58050. /***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
  58051. /*!***************************************************************!*\
  58052. !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
  58053. \***************************************************************/
  58054. /*! no static exports found */
  58055. /*! all exports used */
  58056. /***/ (function(module, exports, __webpack_require__) {
  58057. "use strict";
  58058. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  58059. module.exports = function normalizeHeaderName(headers, normalizedName) {
  58060. utils.forEach(headers, function processHeader(value, name) {
  58061. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  58062. headers[normalizedName] = value;
  58063. delete headers[name];
  58064. }
  58065. });
  58066. };
  58067. /***/ }),
  58068. /***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
  58069. /*!********************************************************!*\
  58070. !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
  58071. \********************************************************/
  58072. /*! no static exports found */
  58073. /*! all exports used */
  58074. /***/ (function(module, exports, __webpack_require__) {
  58075. "use strict";
  58076. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  58077. // Headers whose duplicates are ignored by node
  58078. // c.f. https://nodejs.org/api/http.html#http_message_headers
  58079. var ignoreDuplicateOf = [
  58080. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  58081. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  58082. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  58083. 'referer', 'retry-after', 'user-agent'
  58084. ];
  58085. /**
  58086. * Parse headers into an object
  58087. *
  58088. * ```
  58089. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  58090. * Content-Type: application/json
  58091. * Connection: keep-alive
  58092. * Transfer-Encoding: chunked
  58093. * ```
  58094. *
  58095. * @param {String} headers Headers needing to be parsed
  58096. * @returns {Object} Headers parsed into an object
  58097. */
  58098. module.exports = function parseHeaders(headers) {
  58099. var parsed = {};
  58100. var key;
  58101. var val;
  58102. var i;
  58103. if (!headers) { return parsed; }
  58104. utils.forEach(headers.split('\n'), function parser(line) {
  58105. i = line.indexOf(':');
  58106. key = utils.trim(line.substr(0, i)).toLowerCase();
  58107. val = utils.trim(line.substr(i + 1));
  58108. if (key) {
  58109. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  58110. return;
  58111. }
  58112. if (key === 'set-cookie') {
  58113. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  58114. } else {
  58115. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  58116. }
  58117. }
  58118. });
  58119. return parsed;
  58120. };
  58121. /***/ }),
  58122. /***/ "./node_modules/axios/lib/helpers/spread.js":
  58123. /*!**************************************************!*\
  58124. !*** ./node_modules/axios/lib/helpers/spread.js ***!
  58125. \**************************************************/
  58126. /*! no static exports found */
  58127. /*! all exports used */
  58128. /***/ (function(module, exports, __webpack_require__) {
  58129. "use strict";
  58130. /**
  58131. * Syntactic sugar for invoking a function and expanding an array for arguments.
  58132. *
  58133. * Common use case would be to use `Function.prototype.apply`.
  58134. *
  58135. * ```js
  58136. * function f(x, y, z) {}
  58137. * var args = [1, 2, 3];
  58138. * f.apply(null, args);
  58139. * ```
  58140. *
  58141. * With `spread` this example can be re-written.
  58142. *
  58143. * ```js
  58144. * spread(function(x, y, z) {})([1, 2, 3]);
  58145. * ```
  58146. *
  58147. * @param {Function} callback
  58148. * @returns {Function}
  58149. */
  58150. module.exports = function spread(callback) {
  58151. return function wrap(arr) {
  58152. return callback.apply(null, arr);
  58153. };
  58154. };
  58155. /***/ }),
  58156. /***/ "./node_modules/axios/lib/utils.js":
  58157. /*!*****************************************!*\
  58158. !*** ./node_modules/axios/lib/utils.js ***!
  58159. \*****************************************/
  58160. /*! no static exports found */
  58161. /*! all exports used */
  58162. /***/ (function(module, exports, __webpack_require__) {
  58163. "use strict";
  58164. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  58165. /*global toString:true*/
  58166. // utils is a library of generic helper functions non-specific to axios
  58167. var toString = Object.prototype.toString;
  58168. /**
  58169. * Determine if a value is an Array
  58170. *
  58171. * @param {Object} val The value to test
  58172. * @returns {boolean} True if value is an Array, otherwise false
  58173. */
  58174. function isArray(val) {
  58175. return toString.call(val) === '[object Array]';
  58176. }
  58177. /**
  58178. * Determine if a value is undefined
  58179. *
  58180. * @param {Object} val The value to test
  58181. * @returns {boolean} True if the value is undefined, otherwise false
  58182. */
  58183. function isUndefined(val) {
  58184. return typeof val === 'undefined';
  58185. }
  58186. /**
  58187. * Determine if a value is a Buffer
  58188. *
  58189. * @param {Object} val The value to test
  58190. * @returns {boolean} True if value is a Buffer, otherwise false
  58191. */
  58192. function isBuffer(val) {
  58193. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
  58194. && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
  58195. }
  58196. /**
  58197. * Determine if a value is an ArrayBuffer
  58198. *
  58199. * @param {Object} val The value to test
  58200. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  58201. */
  58202. function isArrayBuffer(val) {
  58203. return toString.call(val) === '[object ArrayBuffer]';
  58204. }
  58205. /**
  58206. * Determine if a value is a FormData
  58207. *
  58208. * @param {Object} val The value to test
  58209. * @returns {boolean} True if value is an FormData, otherwise false
  58210. */
  58211. function isFormData(val) {
  58212. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  58213. }
  58214. /**
  58215. * Determine if a value is a view on an ArrayBuffer
  58216. *
  58217. * @param {Object} val The value to test
  58218. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  58219. */
  58220. function isArrayBufferView(val) {
  58221. var result;
  58222. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  58223. result = ArrayBuffer.isView(val);
  58224. } else {
  58225. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  58226. }
  58227. return result;
  58228. }
  58229. /**
  58230. * Determine if a value is a String
  58231. *
  58232. * @param {Object} val The value to test
  58233. * @returns {boolean} True if value is a String, otherwise false
  58234. */
  58235. function isString(val) {
  58236. return typeof val === 'string';
  58237. }
  58238. /**
  58239. * Determine if a value is a Number
  58240. *
  58241. * @param {Object} val The value to test
  58242. * @returns {boolean} True if value is a Number, otherwise false
  58243. */
  58244. function isNumber(val) {
  58245. return typeof val === 'number';
  58246. }
  58247. /**
  58248. * Determine if a value is an Object
  58249. *
  58250. * @param {Object} val The value to test
  58251. * @returns {boolean} True if value is an Object, otherwise false
  58252. */
  58253. function isObject(val) {
  58254. return val !== null && typeof val === 'object';
  58255. }
  58256. /**
  58257. * Determine if a value is a Date
  58258. *
  58259. * @param {Object} val The value to test
  58260. * @returns {boolean} True if value is a Date, otherwise false
  58261. */
  58262. function isDate(val) {
  58263. return toString.call(val) === '[object Date]';
  58264. }
  58265. /**
  58266. * Determine if a value is a File
  58267. *
  58268. * @param {Object} val The value to test
  58269. * @returns {boolean} True if value is a File, otherwise false
  58270. */
  58271. function isFile(val) {
  58272. return toString.call(val) === '[object File]';
  58273. }
  58274. /**
  58275. * Determine if a value is a Blob
  58276. *
  58277. * @param {Object} val The value to test
  58278. * @returns {boolean} True if value is a Blob, otherwise false
  58279. */
  58280. function isBlob(val) {
  58281. return toString.call(val) === '[object Blob]';
  58282. }
  58283. /**
  58284. * Determine if a value is a Function
  58285. *
  58286. * @param {Object} val The value to test
  58287. * @returns {boolean} True if value is a Function, otherwise false
  58288. */
  58289. function isFunction(val) {
  58290. return toString.call(val) === '[object Function]';
  58291. }
  58292. /**
  58293. * Determine if a value is a Stream
  58294. *
  58295. * @param {Object} val The value to test
  58296. * @returns {boolean} True if value is a Stream, otherwise false
  58297. */
  58298. function isStream(val) {
  58299. return isObject(val) && isFunction(val.pipe);
  58300. }
  58301. /**
  58302. * Determine if a value is a URLSearchParams object
  58303. *
  58304. * @param {Object} val The value to test
  58305. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  58306. */
  58307. function isURLSearchParams(val) {
  58308. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  58309. }
  58310. /**
  58311. * Trim excess whitespace off the beginning and end of a string
  58312. *
  58313. * @param {String} str The String to trim
  58314. * @returns {String} The String freed of excess whitespace
  58315. */
  58316. function trim(str) {
  58317. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  58318. }
  58319. /**
  58320. * Determine if we're running in a standard browser environment
  58321. *
  58322. * This allows axios to run in a web worker, and react-native.
  58323. * Both environments support XMLHttpRequest, but not fully standard globals.
  58324. *
  58325. * web workers:
  58326. * typeof window -> undefined
  58327. * typeof document -> undefined
  58328. *
  58329. * react-native:
  58330. * navigator.product -> 'ReactNative'
  58331. * nativescript
  58332. * navigator.product -> 'NativeScript' or 'NS'
  58333. */
  58334. function isStandardBrowserEnv() {
  58335. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  58336. navigator.product === 'NativeScript' ||
  58337. navigator.product === 'NS')) {
  58338. return false;
  58339. }
  58340. return (
  58341. typeof window !== 'undefined' &&
  58342. typeof document !== 'undefined'
  58343. );
  58344. }
  58345. /**
  58346. * Iterate over an Array or an Object invoking a function for each item.
  58347. *
  58348. * If `obj` is an Array callback will be called passing
  58349. * the value, index, and complete array for each item.
  58350. *
  58351. * If 'obj' is an Object callback will be called passing
  58352. * the value, key, and complete object for each property.
  58353. *
  58354. * @param {Object|Array} obj The object to iterate
  58355. * @param {Function} fn The callback to invoke for each item
  58356. */
  58357. function forEach(obj, fn) {
  58358. // Don't bother if no value provided
  58359. if (obj === null || typeof obj === 'undefined') {
  58360. return;
  58361. }
  58362. // Force an array if not already something iterable
  58363. if (typeof obj !== 'object') {
  58364. /*eslint no-param-reassign:0*/
  58365. obj = [obj];
  58366. }
  58367. if (isArray(obj)) {
  58368. // Iterate over array values
  58369. for (var i = 0, l = obj.length; i < l; i++) {
  58370. fn.call(null, obj[i], i, obj);
  58371. }
  58372. } else {
  58373. // Iterate over object keys
  58374. for (var key in obj) {
  58375. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  58376. fn.call(null, obj[key], key, obj);
  58377. }
  58378. }
  58379. }
  58380. }
  58381. /**
  58382. * Accepts varargs expecting each argument to be an object, then
  58383. * immutably merges the properties of each object and returns result.
  58384. *
  58385. * When multiple objects contain the same key the later object in
  58386. * the arguments list will take precedence.
  58387. *
  58388. * Example:
  58389. *
  58390. * ```js
  58391. * var result = merge({foo: 123}, {foo: 456});
  58392. * console.log(result.foo); // outputs 456
  58393. * ```
  58394. *
  58395. * @param {Object} obj1 Object to merge
  58396. * @returns {Object} Result of all merge properties
  58397. */
  58398. function merge(/* obj1, obj2, obj3, ... */) {
  58399. var result = {};
  58400. function assignValue(val, key) {
  58401. if (typeof result[key] === 'object' && typeof val === 'object') {
  58402. result[key] = merge(result[key], val);
  58403. } else {
  58404. result[key] = val;
  58405. }
  58406. }
  58407. for (var i = 0, l = arguments.length; i < l; i++) {
  58408. forEach(arguments[i], assignValue);
  58409. }
  58410. return result;
  58411. }
  58412. /**
  58413. * Function equal to merge with the difference being that no reference
  58414. * to original objects is kept.
  58415. *
  58416. * @see merge
  58417. * @param {Object} obj1 Object to merge
  58418. * @returns {Object} Result of all merge properties
  58419. */
  58420. function deepMerge(/* obj1, obj2, obj3, ... */) {
  58421. var result = {};
  58422. function assignValue(val, key) {
  58423. if (typeof result[key] === 'object' && typeof val === 'object') {
  58424. result[key] = deepMerge(result[key], val);
  58425. } else if (typeof val === 'object') {
  58426. result[key] = deepMerge({}, val);
  58427. } else {
  58428. result[key] = val;
  58429. }
  58430. }
  58431. for (var i = 0, l = arguments.length; i < l; i++) {
  58432. forEach(arguments[i], assignValue);
  58433. }
  58434. return result;
  58435. }
  58436. /**
  58437. * Extends object a by mutably adding to it the properties of object b.
  58438. *
  58439. * @param {Object} a The object to be extended
  58440. * @param {Object} b The object to copy properties from
  58441. * @param {Object} thisArg The object to bind function to
  58442. * @return {Object} The resulting value of object a
  58443. */
  58444. function extend(a, b, thisArg) {
  58445. forEach(b, function assignValue(val, key) {
  58446. if (thisArg && typeof val === 'function') {
  58447. a[key] = bind(val, thisArg);
  58448. } else {
  58449. a[key] = val;
  58450. }
  58451. });
  58452. return a;
  58453. }
  58454. module.exports = {
  58455. isArray: isArray,
  58456. isArrayBuffer: isArrayBuffer,
  58457. isBuffer: isBuffer,
  58458. isFormData: isFormData,
  58459. isArrayBufferView: isArrayBufferView,
  58460. isString: isString,
  58461. isNumber: isNumber,
  58462. isObject: isObject,
  58463. isUndefined: isUndefined,
  58464. isDate: isDate,
  58465. isFile: isFile,
  58466. isBlob: isBlob,
  58467. isFunction: isFunction,
  58468. isStream: isStream,
  58469. isURLSearchParams: isURLSearchParams,
  58470. isStandardBrowserEnv: isStandardBrowserEnv,
  58471. forEach: forEach,
  58472. merge: merge,
  58473. deepMerge: deepMerge,
  58474. extend: extend,
  58475. trim: trim
  58476. };
  58477. /***/ }),
  58478. /***/ "./node_modules/backo2/index.js":
  58479. /*!**************************************!*\
  58480. !*** ./node_modules/backo2/index.js ***!
  58481. \**************************************/
  58482. /*! no static exports found */
  58483. /*! all exports used */
  58484. /***/ (function(module, exports) {
  58485. /**
  58486. * Expose `Backoff`.
  58487. */
  58488. module.exports = Backoff;
  58489. /**
  58490. * Initialize backoff timer with `opts`.
  58491. *
  58492. * - `min` initial timeout in milliseconds [100]
  58493. * - `max` max timeout [10000]
  58494. * - `jitter` [0]
  58495. * - `factor` [2]
  58496. *
  58497. * @param {Object} opts
  58498. * @api public
  58499. */
  58500. function Backoff(opts) {
  58501. opts = opts || {};
  58502. this.ms = opts.min || 100;
  58503. this.max = opts.max || 10000;
  58504. this.factor = opts.factor || 2;
  58505. this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
  58506. this.attempts = 0;
  58507. }
  58508. /**
  58509. * Return the backoff duration.
  58510. *
  58511. * @return {Number}
  58512. * @api public
  58513. */
  58514. Backoff.prototype.duration = function(){
  58515. var ms = this.ms * Math.pow(this.factor, this.attempts++);
  58516. if (this.jitter) {
  58517. var rand = Math.random();
  58518. var deviation = Math.floor(rand * this.jitter * ms);
  58519. ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
  58520. }
  58521. return Math.min(ms, this.max) | 0;
  58522. };
  58523. /**
  58524. * Reset the number of attempts.
  58525. *
  58526. * @api public
  58527. */
  58528. Backoff.prototype.reset = function(){
  58529. this.attempts = 0;
  58530. };
  58531. /**
  58532. * Set the minimum duration
  58533. *
  58534. * @api public
  58535. */
  58536. Backoff.prototype.setMin = function(min){
  58537. this.ms = min;
  58538. };
  58539. /**
  58540. * Set the maximum duration
  58541. *
  58542. * @api public
  58543. */
  58544. Backoff.prototype.setMax = function(max){
  58545. this.max = max;
  58546. };
  58547. /**
  58548. * Set the jitter
  58549. *
  58550. * @api public
  58551. */
  58552. Backoff.prototype.setJitter = function(jitter){
  58553. this.jitter = jitter;
  58554. };
  58555. /***/ }),
  58556. /***/ "./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js":
  58557. /*!*******************************************************************!*\
  58558. !*** ./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js ***!
  58559. \*******************************************************************/
  58560. /*! no static exports found */
  58561. /*! all exports used */
  58562. /***/ (function(module, exports) {
  58563. /*
  58564. * base64-arraybuffer
  58565. * https://github.com/niklasvh/base64-arraybuffer
  58566. *
  58567. * Copyright (c) 2012 Niklas von Hertzen
  58568. * Licensed under the MIT license.
  58569. */
  58570. (function(){
  58571. "use strict";
  58572. var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  58573. // Use a lookup table to find the index.
  58574. var lookup = new Uint8Array(256);
  58575. for (var i = 0; i < chars.length; i++) {
  58576. lookup[chars.charCodeAt(i)] = i;
  58577. }
  58578. exports.encode = function(arraybuffer) {
  58579. var bytes = new Uint8Array(arraybuffer),
  58580. i, len = bytes.length, base64 = "";
  58581. for (i = 0; i < len; i+=3) {
  58582. base64 += chars[bytes[i] >> 2];
  58583. base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
  58584. base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
  58585. base64 += chars[bytes[i + 2] & 63];
  58586. }
  58587. if ((len % 3) === 2) {
  58588. base64 = base64.substring(0, base64.length - 1) + "=";
  58589. } else if (len % 3 === 1) {
  58590. base64 = base64.substring(0, base64.length - 2) + "==";
  58591. }
  58592. return base64;
  58593. };
  58594. exports.decode = function(base64) {
  58595. var bufferLength = base64.length * 0.75,
  58596. len = base64.length, i, p = 0,
  58597. encoded1, encoded2, encoded3, encoded4;
  58598. if (base64[base64.length - 1] === "=") {
  58599. bufferLength--;
  58600. if (base64[base64.length - 2] === "=") {
  58601. bufferLength--;
  58602. }
  58603. }
  58604. var arraybuffer = new ArrayBuffer(bufferLength),
  58605. bytes = new Uint8Array(arraybuffer);
  58606. for (i = 0; i < len; i+=4) {
  58607. encoded1 = lookup[base64.charCodeAt(i)];
  58608. encoded2 = lookup[base64.charCodeAt(i+1)];
  58609. encoded3 = lookup[base64.charCodeAt(i+2)];
  58610. encoded4 = lookup[base64.charCodeAt(i+3)];
  58611. bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
  58612. bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
  58613. bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
  58614. }
  58615. return arraybuffer;
  58616. };
  58617. })();
  58618. /***/ }),
  58619. /***/ "./node_modules/base64-js/index.js":
  58620. /*!*****************************************!*\
  58621. !*** ./node_modules/base64-js/index.js ***!
  58622. \*****************************************/
  58623. /*! no static exports found */
  58624. /*! all exports used */
  58625. /***/ (function(module, exports, __webpack_require__) {
  58626. "use strict";
  58627. exports.byteLength = byteLength
  58628. exports.toByteArray = toByteArray
  58629. exports.fromByteArray = fromByteArray
  58630. var lookup = []
  58631. var revLookup = []
  58632. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  58633. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  58634. for (var i = 0, len = code.length; i < len; ++i) {
  58635. lookup[i] = code[i]
  58636. revLookup[code.charCodeAt(i)] = i
  58637. }
  58638. // Support decoding URL-safe base64 strings, as Node.js does.
  58639. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  58640. revLookup['-'.charCodeAt(0)] = 62
  58641. revLookup['_'.charCodeAt(0)] = 63
  58642. function getLens (b64) {
  58643. var len = b64.length
  58644. if (len % 4 > 0) {
  58645. throw new Error('Invalid string. Length must be a multiple of 4')
  58646. }
  58647. // Trim off extra bytes after placeholder bytes are found
  58648. // See: https://github.com/beatgammit/base64-js/issues/42
  58649. var validLen = b64.indexOf('=')
  58650. if (validLen === -1) validLen = len
  58651. var placeHoldersLen = validLen === len
  58652. ? 0
  58653. : 4 - (validLen % 4)
  58654. return [validLen, placeHoldersLen]
  58655. }
  58656. // base64 is 4/3 + up to two characters of the original data
  58657. function byteLength (b64) {
  58658. var lens = getLens(b64)
  58659. var validLen = lens[0]
  58660. var placeHoldersLen = lens[1]
  58661. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  58662. }
  58663. function _byteLength (b64, validLen, placeHoldersLen) {
  58664. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  58665. }
  58666. function toByteArray (b64) {
  58667. var tmp
  58668. var lens = getLens(b64)
  58669. var validLen = lens[0]
  58670. var placeHoldersLen = lens[1]
  58671. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  58672. var curByte = 0
  58673. // if there are placeholders, only get up to the last complete 4 chars
  58674. var len = placeHoldersLen > 0
  58675. ? validLen - 4
  58676. : validLen
  58677. var i
  58678. for (i = 0; i < len; i += 4) {
  58679. tmp =
  58680. (revLookup[b64.charCodeAt(i)] << 18) |
  58681. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  58682. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  58683. revLookup[b64.charCodeAt(i + 3)]
  58684. arr[curByte++] = (tmp >> 16) & 0xFF
  58685. arr[curByte++] = (tmp >> 8) & 0xFF
  58686. arr[curByte++] = tmp & 0xFF
  58687. }
  58688. if (placeHoldersLen === 2) {
  58689. tmp =
  58690. (revLookup[b64.charCodeAt(i)] << 2) |
  58691. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  58692. arr[curByte++] = tmp & 0xFF
  58693. }
  58694. if (placeHoldersLen === 1) {
  58695. tmp =
  58696. (revLookup[b64.charCodeAt(i)] << 10) |
  58697. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  58698. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  58699. arr[curByte++] = (tmp >> 8) & 0xFF
  58700. arr[curByte++] = tmp & 0xFF
  58701. }
  58702. return arr
  58703. }
  58704. function tripletToBase64 (num) {
  58705. return lookup[num >> 18 & 0x3F] +
  58706. lookup[num >> 12 & 0x3F] +
  58707. lookup[num >> 6 & 0x3F] +
  58708. lookup[num & 0x3F]
  58709. }
  58710. function encodeChunk (uint8, start, end) {
  58711. var tmp
  58712. var output = []
  58713. for (var i = start; i < end; i += 3) {
  58714. tmp =
  58715. ((uint8[i] << 16) & 0xFF0000) +
  58716. ((uint8[i + 1] << 8) & 0xFF00) +
  58717. (uint8[i + 2] & 0xFF)
  58718. output.push(tripletToBase64(tmp))
  58719. }
  58720. return output.join('')
  58721. }
  58722. function fromByteArray (uint8) {
  58723. var tmp
  58724. var len = uint8.length
  58725. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  58726. var parts = []
  58727. var maxChunkLength = 16383 // must be multiple of 3
  58728. // go through the array every three bytes, we'll deal with trailing stuff later
  58729. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  58730. parts.push(encodeChunk(
  58731. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  58732. ))
  58733. }
  58734. // pad the end with zeros, but make sure to not forget the extra bytes
  58735. if (extraBytes === 1) {
  58736. tmp = uint8[len - 1]
  58737. parts.push(
  58738. lookup[tmp >> 2] +
  58739. lookup[(tmp << 4) & 0x3F] +
  58740. '=='
  58741. )
  58742. } else if (extraBytes === 2) {
  58743. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  58744. parts.push(
  58745. lookup[tmp >> 10] +
  58746. lookup[(tmp >> 4) & 0x3F] +
  58747. lookup[(tmp << 2) & 0x3F] +
  58748. '='
  58749. )
  58750. }
  58751. return parts.join('')
  58752. }
  58753. /***/ }),
  58754. /***/ "./node_modules/blob/index.js":
  58755. /*!************************************!*\
  58756. !*** ./node_modules/blob/index.js ***!
  58757. \************************************/
  58758. /*! no static exports found */
  58759. /*! all exports used */
  58760. /***/ (function(module, exports) {
  58761. /**
  58762. * Create a blob builder even when vendor prefixes exist
  58763. */
  58764. var BlobBuilder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :
  58765. typeof WebKitBlobBuilder !== 'undefined' ? WebKitBlobBuilder :
  58766. typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :
  58767. typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :
  58768. false;
  58769. /**
  58770. * Check if Blob constructor is supported
  58771. */
  58772. var blobSupported = (function() {
  58773. try {
  58774. var a = new Blob(['hi']);
  58775. return a.size === 2;
  58776. } catch(e) {
  58777. return false;
  58778. }
  58779. })();
  58780. /**
  58781. * Check if Blob constructor supports ArrayBufferViews
  58782. * Fails in Safari 6, so we need to map to ArrayBuffers there.
  58783. */
  58784. var blobSupportsArrayBufferView = blobSupported && (function() {
  58785. try {
  58786. var b = new Blob([new Uint8Array([1,2])]);
  58787. return b.size === 2;
  58788. } catch(e) {
  58789. return false;
  58790. }
  58791. })();
  58792. /**
  58793. * Check if BlobBuilder is supported
  58794. */
  58795. var blobBuilderSupported = BlobBuilder
  58796. && BlobBuilder.prototype.append
  58797. && BlobBuilder.prototype.getBlob;
  58798. /**
  58799. * Helper function that maps ArrayBufferViews to ArrayBuffers
  58800. * Used by BlobBuilder constructor and old browsers that didn't
  58801. * support it in the Blob constructor.
  58802. */
  58803. function mapArrayBufferViews(ary) {
  58804. return ary.map(function(chunk) {
  58805. if (chunk.buffer instanceof ArrayBuffer) {
  58806. var buf = chunk.buffer;
  58807. // if this is a subarray, make a copy so we only
  58808. // include the subarray region from the underlying buffer
  58809. if (chunk.byteLength !== buf.byteLength) {
  58810. var copy = new Uint8Array(chunk.byteLength);
  58811. copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
  58812. buf = copy.buffer;
  58813. }
  58814. return buf;
  58815. }
  58816. return chunk;
  58817. });
  58818. }
  58819. function BlobBuilderConstructor(ary, options) {
  58820. options = options || {};
  58821. var bb = new BlobBuilder();
  58822. mapArrayBufferViews(ary).forEach(function(part) {
  58823. bb.append(part);
  58824. });
  58825. return (options.type) ? bb.getBlob(options.type) : bb.getBlob();
  58826. };
  58827. function BlobConstructor(ary, options) {
  58828. return new Blob(mapArrayBufferViews(ary), options || {});
  58829. };
  58830. if (typeof Blob !== 'undefined') {
  58831. BlobBuilderConstructor.prototype = Blob.prototype;
  58832. BlobConstructor.prototype = Blob.prototype;
  58833. }
  58834. module.exports = (function() {
  58835. if (blobSupported) {
  58836. return blobSupportsArrayBufferView ? Blob : BlobConstructor;
  58837. } else if (blobBuilderSupported) {
  58838. return BlobBuilderConstructor;
  58839. } else {
  58840. return undefined;
  58841. }
  58842. })();
  58843. /***/ }),
  58844. /***/ "./node_modules/buffer/index.js":
  58845. /*!**************************************!*\
  58846. !*** ./node_modules/buffer/index.js ***!
  58847. \**************************************/
  58848. /*! no static exports found */
  58849. /*! all exports used */
  58850. /***/ (function(module, exports, __webpack_require__) {
  58851. "use strict";
  58852. /* WEBPACK VAR INJECTION */(function(global) {/*!
  58853. * The buffer module from node.js, for the browser.
  58854. *
  58855. * @author Feross Aboukhadijeh <http://feross.org>
  58856. * @license MIT
  58857. */
  58858. /* eslint-disable no-proto */
  58859. var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
  58860. var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
  58861. var isArray = __webpack_require__(/*! isarray */ "./node_modules/buffer/node_modules/isarray/index.js")
  58862. exports.Buffer = Buffer
  58863. exports.SlowBuffer = SlowBuffer
  58864. exports.INSPECT_MAX_BYTES = 50
  58865. /**
  58866. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  58867. * === true Use Uint8Array implementation (fastest)
  58868. * === false Use Object implementation (most compatible, even IE6)
  58869. *
  58870. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  58871. * Opera 11.6+, iOS 4.2+.
  58872. *
  58873. * Due to various browser bugs, sometimes the Object implementation will be used even
  58874. * when the browser supports typed arrays.
  58875. *
  58876. * Note:
  58877. *
  58878. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  58879. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  58880. *
  58881. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  58882. *
  58883. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  58884. * incorrect length in some situations.
  58885. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  58886. * get the Object implementation, which is slower but behaves correctly.
  58887. */
  58888. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  58889. ? global.TYPED_ARRAY_SUPPORT
  58890. : typedArraySupport()
  58891. /*
  58892. * Export kMaxLength after typed array support is determined.
  58893. */
  58894. exports.kMaxLength = kMaxLength()
  58895. function typedArraySupport () {
  58896. try {
  58897. var arr = new Uint8Array(1)
  58898. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  58899. return arr.foo() === 42 && // typed array instances can be augmented
  58900. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  58901. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  58902. } catch (e) {
  58903. return false
  58904. }
  58905. }
  58906. function kMaxLength () {
  58907. return Buffer.TYPED_ARRAY_SUPPORT
  58908. ? 0x7fffffff
  58909. : 0x3fffffff
  58910. }
  58911. function createBuffer (that, length) {
  58912. if (kMaxLength() < length) {
  58913. throw new RangeError('Invalid typed array length')
  58914. }
  58915. if (Buffer.TYPED_ARRAY_SUPPORT) {
  58916. // Return an augmented `Uint8Array` instance, for best performance
  58917. that = new Uint8Array(length)
  58918. that.__proto__ = Buffer.prototype
  58919. } else {
  58920. // Fallback: Return an object instance of the Buffer class
  58921. if (that === null) {
  58922. that = new Buffer(length)
  58923. }
  58924. that.length = length
  58925. }
  58926. return that
  58927. }
  58928. /**
  58929. * The Buffer constructor returns instances of `Uint8Array` that have their
  58930. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  58931. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  58932. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  58933. * returns a single octet.
  58934. *
  58935. * The `Uint8Array` prototype remains unmodified.
  58936. */
  58937. function Buffer (arg, encodingOrOffset, length) {
  58938. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  58939. return new Buffer(arg, encodingOrOffset, length)
  58940. }
  58941. // Common case.
  58942. if (typeof arg === 'number') {
  58943. if (typeof encodingOrOffset === 'string') {
  58944. throw new Error(
  58945. 'If encoding is specified then the first argument must be a string'
  58946. )
  58947. }
  58948. return allocUnsafe(this, arg)
  58949. }
  58950. return from(this, arg, encodingOrOffset, length)
  58951. }
  58952. Buffer.poolSize = 8192 // not used by this implementation
  58953. // TODO: Legacy, not needed anymore. Remove in next major version.
  58954. Buffer._augment = function (arr) {
  58955. arr.__proto__ = Buffer.prototype
  58956. return arr
  58957. }
  58958. function from (that, value, encodingOrOffset, length) {
  58959. if (typeof value === 'number') {
  58960. throw new TypeError('"value" argument must not be a number')
  58961. }
  58962. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  58963. return fromArrayBuffer(that, value, encodingOrOffset, length)
  58964. }
  58965. if (typeof value === 'string') {
  58966. return fromString(that, value, encodingOrOffset)
  58967. }
  58968. return fromObject(that, value)
  58969. }
  58970. /**
  58971. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  58972. * if value is a number.
  58973. * Buffer.from(str[, encoding])
  58974. * Buffer.from(array)
  58975. * Buffer.from(buffer)
  58976. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  58977. **/
  58978. Buffer.from = function (value, encodingOrOffset, length) {
  58979. return from(null, value, encodingOrOffset, length)
  58980. }
  58981. if (Buffer.TYPED_ARRAY_SUPPORT) {
  58982. Buffer.prototype.__proto__ = Uint8Array.prototype
  58983. Buffer.__proto__ = Uint8Array
  58984. if (typeof Symbol !== 'undefined' && Symbol.species &&
  58985. Buffer[Symbol.species] === Buffer) {
  58986. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  58987. Object.defineProperty(Buffer, Symbol.species, {
  58988. value: null,
  58989. configurable: true
  58990. })
  58991. }
  58992. }
  58993. function assertSize (size) {
  58994. if (typeof size !== 'number') {
  58995. throw new TypeError('"size" argument must be a number')
  58996. } else if (size < 0) {
  58997. throw new RangeError('"size" argument must not be negative')
  58998. }
  58999. }
  59000. function alloc (that, size, fill, encoding) {
  59001. assertSize(size)
  59002. if (size <= 0) {
  59003. return createBuffer(that, size)
  59004. }
  59005. if (fill !== undefined) {
  59006. // Only pay attention to encoding if it's a string. This
  59007. // prevents accidentally sending in a number that would
  59008. // be interpretted as a start offset.
  59009. return typeof encoding === 'string'
  59010. ? createBuffer(that, size).fill(fill, encoding)
  59011. : createBuffer(that, size).fill(fill)
  59012. }
  59013. return createBuffer(that, size)
  59014. }
  59015. /**
  59016. * Creates a new filled Buffer instance.
  59017. * alloc(size[, fill[, encoding]])
  59018. **/
  59019. Buffer.alloc = function (size, fill, encoding) {
  59020. return alloc(null, size, fill, encoding)
  59021. }
  59022. function allocUnsafe (that, size) {
  59023. assertSize(size)
  59024. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  59025. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  59026. for (var i = 0; i < size; ++i) {
  59027. that[i] = 0
  59028. }
  59029. }
  59030. return that
  59031. }
  59032. /**
  59033. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  59034. * */
  59035. Buffer.allocUnsafe = function (size) {
  59036. return allocUnsafe(null, size)
  59037. }
  59038. /**
  59039. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  59040. */
  59041. Buffer.allocUnsafeSlow = function (size) {
  59042. return allocUnsafe(null, size)
  59043. }
  59044. function fromString (that, string, encoding) {
  59045. if (typeof encoding !== 'string' || encoding === '') {
  59046. encoding = 'utf8'
  59047. }
  59048. if (!Buffer.isEncoding(encoding)) {
  59049. throw new TypeError('"encoding" must be a valid string encoding')
  59050. }
  59051. var length = byteLength(string, encoding) | 0
  59052. that = createBuffer(that, length)
  59053. var actual = that.write(string, encoding)
  59054. if (actual !== length) {
  59055. // Writing a hex string, for example, that contains invalid characters will
  59056. // cause everything after the first invalid character to be ignored. (e.g.
  59057. // 'abxxcd' will be treated as 'ab')
  59058. that = that.slice(0, actual)
  59059. }
  59060. return that
  59061. }
  59062. function fromArrayLike (that, array) {
  59063. var length = array.length < 0 ? 0 : checked(array.length) | 0
  59064. that = createBuffer(that, length)
  59065. for (var i = 0; i < length; i += 1) {
  59066. that[i] = array[i] & 255
  59067. }
  59068. return that
  59069. }
  59070. function fromArrayBuffer (that, array, byteOffset, length) {
  59071. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  59072. if (byteOffset < 0 || array.byteLength < byteOffset) {
  59073. throw new RangeError('\'offset\' is out of bounds')
  59074. }
  59075. if (array.byteLength < byteOffset + (length || 0)) {
  59076. throw new RangeError('\'length\' is out of bounds')
  59077. }
  59078. if (byteOffset === undefined && length === undefined) {
  59079. array = new Uint8Array(array)
  59080. } else if (length === undefined) {
  59081. array = new Uint8Array(array, byteOffset)
  59082. } else {
  59083. array = new Uint8Array(array, byteOffset, length)
  59084. }
  59085. if (Buffer.TYPED_ARRAY_SUPPORT) {
  59086. // Return an augmented `Uint8Array` instance, for best performance
  59087. that = array
  59088. that.__proto__ = Buffer.prototype
  59089. } else {
  59090. // Fallback: Return an object instance of the Buffer class
  59091. that = fromArrayLike(that, array)
  59092. }
  59093. return that
  59094. }
  59095. function fromObject (that, obj) {
  59096. if (Buffer.isBuffer(obj)) {
  59097. var len = checked(obj.length) | 0
  59098. that = createBuffer(that, len)
  59099. if (that.length === 0) {
  59100. return that
  59101. }
  59102. obj.copy(that, 0, 0, len)
  59103. return that
  59104. }
  59105. if (obj) {
  59106. if ((typeof ArrayBuffer !== 'undefined' &&
  59107. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  59108. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  59109. return createBuffer(that, 0)
  59110. }
  59111. return fromArrayLike(that, obj)
  59112. }
  59113. if (obj.type === 'Buffer' && isArray(obj.data)) {
  59114. return fromArrayLike(that, obj.data)
  59115. }
  59116. }
  59117. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  59118. }
  59119. function checked (length) {
  59120. // Note: cannot use `length < kMaxLength()` here because that fails when
  59121. // length is NaN (which is otherwise coerced to zero.)
  59122. if (length >= kMaxLength()) {
  59123. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  59124. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  59125. }
  59126. return length | 0
  59127. }
  59128. function SlowBuffer (length) {
  59129. if (+length != length) { // eslint-disable-line eqeqeq
  59130. length = 0
  59131. }
  59132. return Buffer.alloc(+length)
  59133. }
  59134. Buffer.isBuffer = function isBuffer (b) {
  59135. return !!(b != null && b._isBuffer)
  59136. }
  59137. Buffer.compare = function compare (a, b) {
  59138. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  59139. throw new TypeError('Arguments must be Buffers')
  59140. }
  59141. if (a === b) return 0
  59142. var x = a.length
  59143. var y = b.length
  59144. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  59145. if (a[i] !== b[i]) {
  59146. x = a[i]
  59147. y = b[i]
  59148. break
  59149. }
  59150. }
  59151. if (x < y) return -1
  59152. if (y < x) return 1
  59153. return 0
  59154. }
  59155. Buffer.isEncoding = function isEncoding (encoding) {
  59156. switch (String(encoding).toLowerCase()) {
  59157. case 'hex':
  59158. case 'utf8':
  59159. case 'utf-8':
  59160. case 'ascii':
  59161. case 'latin1':
  59162. case 'binary':
  59163. case 'base64':
  59164. case 'ucs2':
  59165. case 'ucs-2':
  59166. case 'utf16le':
  59167. case 'utf-16le':
  59168. return true
  59169. default:
  59170. return false
  59171. }
  59172. }
  59173. Buffer.concat = function concat (list, length) {
  59174. if (!isArray(list)) {
  59175. throw new TypeError('"list" argument must be an Array of Buffers')
  59176. }
  59177. if (list.length === 0) {
  59178. return Buffer.alloc(0)
  59179. }
  59180. var i
  59181. if (length === undefined) {
  59182. length = 0
  59183. for (i = 0; i < list.length; ++i) {
  59184. length += list[i].length
  59185. }
  59186. }
  59187. var buffer = Buffer.allocUnsafe(length)
  59188. var pos = 0
  59189. for (i = 0; i < list.length; ++i) {
  59190. var buf = list[i]
  59191. if (!Buffer.isBuffer(buf)) {
  59192. throw new TypeError('"list" argument must be an Array of Buffers')
  59193. }
  59194. buf.copy(buffer, pos)
  59195. pos += buf.length
  59196. }
  59197. return buffer
  59198. }
  59199. function byteLength (string, encoding) {
  59200. if (Buffer.isBuffer(string)) {
  59201. return string.length
  59202. }
  59203. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  59204. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  59205. return string.byteLength
  59206. }
  59207. if (typeof string !== 'string') {
  59208. string = '' + string
  59209. }
  59210. var len = string.length
  59211. if (len === 0) return 0
  59212. // Use a for loop to avoid recursion
  59213. var loweredCase = false
  59214. for (;;) {
  59215. switch (encoding) {
  59216. case 'ascii':
  59217. case 'latin1':
  59218. case 'binary':
  59219. return len
  59220. case 'utf8':
  59221. case 'utf-8':
  59222. case undefined:
  59223. return utf8ToBytes(string).length
  59224. case 'ucs2':
  59225. case 'ucs-2':
  59226. case 'utf16le':
  59227. case 'utf-16le':
  59228. return len * 2
  59229. case 'hex':
  59230. return len >>> 1
  59231. case 'base64':
  59232. return base64ToBytes(string).length
  59233. default:
  59234. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  59235. encoding = ('' + encoding).toLowerCase()
  59236. loweredCase = true
  59237. }
  59238. }
  59239. }
  59240. Buffer.byteLength = byteLength
  59241. function slowToString (encoding, start, end) {
  59242. var loweredCase = false
  59243. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  59244. // property of a typed array.
  59245. // This behaves neither like String nor Uint8Array in that we set start/end
  59246. // to their upper/lower bounds if the value passed is out of range.
  59247. // undefined is handled specially as per ECMA-262 6th Edition,
  59248. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  59249. if (start === undefined || start < 0) {
  59250. start = 0
  59251. }
  59252. // Return early if start > this.length. Done here to prevent potential uint32
  59253. // coercion fail below.
  59254. if (start > this.length) {
  59255. return ''
  59256. }
  59257. if (end === undefined || end > this.length) {
  59258. end = this.length
  59259. }
  59260. if (end <= 0) {
  59261. return ''
  59262. }
  59263. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  59264. end >>>= 0
  59265. start >>>= 0
  59266. if (end <= start) {
  59267. return ''
  59268. }
  59269. if (!encoding) encoding = 'utf8'
  59270. while (true) {
  59271. switch (encoding) {
  59272. case 'hex':
  59273. return hexSlice(this, start, end)
  59274. case 'utf8':
  59275. case 'utf-8':
  59276. return utf8Slice(this, start, end)
  59277. case 'ascii':
  59278. return asciiSlice(this, start, end)
  59279. case 'latin1':
  59280. case 'binary':
  59281. return latin1Slice(this, start, end)
  59282. case 'base64':
  59283. return base64Slice(this, start, end)
  59284. case 'ucs2':
  59285. case 'ucs-2':
  59286. case 'utf16le':
  59287. case 'utf-16le':
  59288. return utf16leSlice(this, start, end)
  59289. default:
  59290. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  59291. encoding = (encoding + '').toLowerCase()
  59292. loweredCase = true
  59293. }
  59294. }
  59295. }
  59296. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  59297. // Buffer instances.
  59298. Buffer.prototype._isBuffer = true
  59299. function swap (b, n, m) {
  59300. var i = b[n]
  59301. b[n] = b[m]
  59302. b[m] = i
  59303. }
  59304. Buffer.prototype.swap16 = function swap16 () {
  59305. var len = this.length
  59306. if (len % 2 !== 0) {
  59307. throw new RangeError('Buffer size must be a multiple of 16-bits')
  59308. }
  59309. for (var i = 0; i < len; i += 2) {
  59310. swap(this, i, i + 1)
  59311. }
  59312. return this
  59313. }
  59314. Buffer.prototype.swap32 = function swap32 () {
  59315. var len = this.length
  59316. if (len % 4 !== 0) {
  59317. throw new RangeError('Buffer size must be a multiple of 32-bits')
  59318. }
  59319. for (var i = 0; i < len; i += 4) {
  59320. swap(this, i, i + 3)
  59321. swap(this, i + 1, i + 2)
  59322. }
  59323. return this
  59324. }
  59325. Buffer.prototype.swap64 = function swap64 () {
  59326. var len = this.length
  59327. if (len % 8 !== 0) {
  59328. throw new RangeError('Buffer size must be a multiple of 64-bits')
  59329. }
  59330. for (var i = 0; i < len; i += 8) {
  59331. swap(this, i, i + 7)
  59332. swap(this, i + 1, i + 6)
  59333. swap(this, i + 2, i + 5)
  59334. swap(this, i + 3, i + 4)
  59335. }
  59336. return this
  59337. }
  59338. Buffer.prototype.toString = function toString () {
  59339. var length = this.length | 0
  59340. if (length === 0) return ''
  59341. if (arguments.length === 0) return utf8Slice(this, 0, length)
  59342. return slowToString.apply(this, arguments)
  59343. }
  59344. Buffer.prototype.equals = function equals (b) {
  59345. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  59346. if (this === b) return true
  59347. return Buffer.compare(this, b) === 0
  59348. }
  59349. Buffer.prototype.inspect = function inspect () {
  59350. var str = ''
  59351. var max = exports.INSPECT_MAX_BYTES
  59352. if (this.length > 0) {
  59353. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  59354. if (this.length > max) str += ' ... '
  59355. }
  59356. return '<Buffer ' + str + '>'
  59357. }
  59358. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  59359. if (!Buffer.isBuffer(target)) {
  59360. throw new TypeError('Argument must be a Buffer')
  59361. }
  59362. if (start === undefined) {
  59363. start = 0
  59364. }
  59365. if (end === undefined) {
  59366. end = target ? target.length : 0
  59367. }
  59368. if (thisStart === undefined) {
  59369. thisStart = 0
  59370. }
  59371. if (thisEnd === undefined) {
  59372. thisEnd = this.length
  59373. }
  59374. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  59375. throw new RangeError('out of range index')
  59376. }
  59377. if (thisStart >= thisEnd && start >= end) {
  59378. return 0
  59379. }
  59380. if (thisStart >= thisEnd) {
  59381. return -1
  59382. }
  59383. if (start >= end) {
  59384. return 1
  59385. }
  59386. start >>>= 0
  59387. end >>>= 0
  59388. thisStart >>>= 0
  59389. thisEnd >>>= 0
  59390. if (this === target) return 0
  59391. var x = thisEnd - thisStart
  59392. var y = end - start
  59393. var len = Math.min(x, y)
  59394. var thisCopy = this.slice(thisStart, thisEnd)
  59395. var targetCopy = target.slice(start, end)
  59396. for (var i = 0; i < len; ++i) {
  59397. if (thisCopy[i] !== targetCopy[i]) {
  59398. x = thisCopy[i]
  59399. y = targetCopy[i]
  59400. break
  59401. }
  59402. }
  59403. if (x < y) return -1
  59404. if (y < x) return 1
  59405. return 0
  59406. }
  59407. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  59408. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  59409. //
  59410. // Arguments:
  59411. // - buffer - a Buffer to search
  59412. // - val - a string, Buffer, or number
  59413. // - byteOffset - an index into `buffer`; will be clamped to an int32
  59414. // - encoding - an optional encoding, relevant is val is a string
  59415. // - dir - true for indexOf, false for lastIndexOf
  59416. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  59417. // Empty buffer means no match
  59418. if (buffer.length === 0) return -1
  59419. // Normalize byteOffset
  59420. if (typeof byteOffset === 'string') {
  59421. encoding = byteOffset
  59422. byteOffset = 0
  59423. } else if (byteOffset > 0x7fffffff) {
  59424. byteOffset = 0x7fffffff
  59425. } else if (byteOffset < -0x80000000) {
  59426. byteOffset = -0x80000000
  59427. }
  59428. byteOffset = +byteOffset // Coerce to Number.
  59429. if (isNaN(byteOffset)) {
  59430. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  59431. byteOffset = dir ? 0 : (buffer.length - 1)
  59432. }
  59433. // Normalize byteOffset: negative offsets start from the end of the buffer
  59434. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  59435. if (byteOffset >= buffer.length) {
  59436. if (dir) return -1
  59437. else byteOffset = buffer.length - 1
  59438. } else if (byteOffset < 0) {
  59439. if (dir) byteOffset = 0
  59440. else return -1
  59441. }
  59442. // Normalize val
  59443. if (typeof val === 'string') {
  59444. val = Buffer.from(val, encoding)
  59445. }
  59446. // Finally, search either indexOf (if dir is true) or lastIndexOf
  59447. if (Buffer.isBuffer(val)) {
  59448. // Special case: looking for empty string/buffer always fails
  59449. if (val.length === 0) {
  59450. return -1
  59451. }
  59452. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  59453. } else if (typeof val === 'number') {
  59454. val = val & 0xFF // Search for a byte value [0-255]
  59455. if (Buffer.TYPED_ARRAY_SUPPORT &&
  59456. typeof Uint8Array.prototype.indexOf === 'function') {
  59457. if (dir) {
  59458. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  59459. } else {
  59460. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  59461. }
  59462. }
  59463. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  59464. }
  59465. throw new TypeError('val must be string, number or Buffer')
  59466. }
  59467. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  59468. var indexSize = 1
  59469. var arrLength = arr.length
  59470. var valLength = val.length
  59471. if (encoding !== undefined) {
  59472. encoding = String(encoding).toLowerCase()
  59473. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  59474. encoding === 'utf16le' || encoding === 'utf-16le') {
  59475. if (arr.length < 2 || val.length < 2) {
  59476. return -1
  59477. }
  59478. indexSize = 2
  59479. arrLength /= 2
  59480. valLength /= 2
  59481. byteOffset /= 2
  59482. }
  59483. }
  59484. function read (buf, i) {
  59485. if (indexSize === 1) {
  59486. return buf[i]
  59487. } else {
  59488. return buf.readUInt16BE(i * indexSize)
  59489. }
  59490. }
  59491. var i
  59492. if (dir) {
  59493. var foundIndex = -1
  59494. for (i = byteOffset; i < arrLength; i++) {
  59495. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  59496. if (foundIndex === -1) foundIndex = i
  59497. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  59498. } else {
  59499. if (foundIndex !== -1) i -= i - foundIndex
  59500. foundIndex = -1
  59501. }
  59502. }
  59503. } else {
  59504. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  59505. for (i = byteOffset; i >= 0; i--) {
  59506. var found = true
  59507. for (var j = 0; j < valLength; j++) {
  59508. if (read(arr, i + j) !== read(val, j)) {
  59509. found = false
  59510. break
  59511. }
  59512. }
  59513. if (found) return i
  59514. }
  59515. }
  59516. return -1
  59517. }
  59518. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  59519. return this.indexOf(val, byteOffset, encoding) !== -1
  59520. }
  59521. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  59522. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  59523. }
  59524. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  59525. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  59526. }
  59527. function hexWrite (buf, string, offset, length) {
  59528. offset = Number(offset) || 0
  59529. var remaining = buf.length - offset
  59530. if (!length) {
  59531. length = remaining
  59532. } else {
  59533. length = Number(length)
  59534. if (length > remaining) {
  59535. length = remaining
  59536. }
  59537. }
  59538. // must be an even number of digits
  59539. var strLen = string.length
  59540. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  59541. if (length > strLen / 2) {
  59542. length = strLen / 2
  59543. }
  59544. for (var i = 0; i < length; ++i) {
  59545. var parsed = parseInt(string.substr(i * 2, 2), 16)
  59546. if (isNaN(parsed)) return i
  59547. buf[offset + i] = parsed
  59548. }
  59549. return i
  59550. }
  59551. function utf8Write (buf, string, offset, length) {
  59552. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  59553. }
  59554. function asciiWrite (buf, string, offset, length) {
  59555. return blitBuffer(asciiToBytes(string), buf, offset, length)
  59556. }
  59557. function latin1Write (buf, string, offset, length) {
  59558. return asciiWrite(buf, string, offset, length)
  59559. }
  59560. function base64Write (buf, string, offset, length) {
  59561. return blitBuffer(base64ToBytes(string), buf, offset, length)
  59562. }
  59563. function ucs2Write (buf, string, offset, length) {
  59564. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  59565. }
  59566. Buffer.prototype.write = function write (string, offset, length, encoding) {
  59567. // Buffer#write(string)
  59568. if (offset === undefined) {
  59569. encoding = 'utf8'
  59570. length = this.length
  59571. offset = 0
  59572. // Buffer#write(string, encoding)
  59573. } else if (length === undefined && typeof offset === 'string') {
  59574. encoding = offset
  59575. length = this.length
  59576. offset = 0
  59577. // Buffer#write(string, offset[, length][, encoding])
  59578. } else if (isFinite(offset)) {
  59579. offset = offset | 0
  59580. if (isFinite(length)) {
  59581. length = length | 0
  59582. if (encoding === undefined) encoding = 'utf8'
  59583. } else {
  59584. encoding = length
  59585. length = undefined
  59586. }
  59587. // legacy write(string, encoding, offset, length) - remove in v0.13
  59588. } else {
  59589. throw new Error(
  59590. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  59591. )
  59592. }
  59593. var remaining = this.length - offset
  59594. if (length === undefined || length > remaining) length = remaining
  59595. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  59596. throw new RangeError('Attempt to write outside buffer bounds')
  59597. }
  59598. if (!encoding) encoding = 'utf8'
  59599. var loweredCase = false
  59600. for (;;) {
  59601. switch (encoding) {
  59602. case 'hex':
  59603. return hexWrite(this, string, offset, length)
  59604. case 'utf8':
  59605. case 'utf-8':
  59606. return utf8Write(this, string, offset, length)
  59607. case 'ascii':
  59608. return asciiWrite(this, string, offset, length)
  59609. case 'latin1':
  59610. case 'binary':
  59611. return latin1Write(this, string, offset, length)
  59612. case 'base64':
  59613. // Warning: maxLength not taken into account in base64Write
  59614. return base64Write(this, string, offset, length)
  59615. case 'ucs2':
  59616. case 'ucs-2':
  59617. case 'utf16le':
  59618. case 'utf-16le':
  59619. return ucs2Write(this, string, offset, length)
  59620. default:
  59621. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  59622. encoding = ('' + encoding).toLowerCase()
  59623. loweredCase = true
  59624. }
  59625. }
  59626. }
  59627. Buffer.prototype.toJSON = function toJSON () {
  59628. return {
  59629. type: 'Buffer',
  59630. data: Array.prototype.slice.call(this._arr || this, 0)
  59631. }
  59632. }
  59633. function base64Slice (buf, start, end) {
  59634. if (start === 0 && end === buf.length) {
  59635. return base64.fromByteArray(buf)
  59636. } else {
  59637. return base64.fromByteArray(buf.slice(start, end))
  59638. }
  59639. }
  59640. function utf8Slice (buf, start, end) {
  59641. end = Math.min(buf.length, end)
  59642. var res = []
  59643. var i = start
  59644. while (i < end) {
  59645. var firstByte = buf[i]
  59646. var codePoint = null
  59647. var bytesPerSequence = (firstByte > 0xEF) ? 4
  59648. : (firstByte > 0xDF) ? 3
  59649. : (firstByte > 0xBF) ? 2
  59650. : 1
  59651. if (i + bytesPerSequence <= end) {
  59652. var secondByte, thirdByte, fourthByte, tempCodePoint
  59653. switch (bytesPerSequence) {
  59654. case 1:
  59655. if (firstByte < 0x80) {
  59656. codePoint = firstByte
  59657. }
  59658. break
  59659. case 2:
  59660. secondByte = buf[i + 1]
  59661. if ((secondByte & 0xC0) === 0x80) {
  59662. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  59663. if (tempCodePoint > 0x7F) {
  59664. codePoint = tempCodePoint
  59665. }
  59666. }
  59667. break
  59668. case 3:
  59669. secondByte = buf[i + 1]
  59670. thirdByte = buf[i + 2]
  59671. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  59672. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  59673. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  59674. codePoint = tempCodePoint
  59675. }
  59676. }
  59677. break
  59678. case 4:
  59679. secondByte = buf[i + 1]
  59680. thirdByte = buf[i + 2]
  59681. fourthByte = buf[i + 3]
  59682. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  59683. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  59684. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  59685. codePoint = tempCodePoint
  59686. }
  59687. }
  59688. }
  59689. }
  59690. if (codePoint === null) {
  59691. // we did not generate a valid codePoint so insert a
  59692. // replacement char (U+FFFD) and advance only 1 byte
  59693. codePoint = 0xFFFD
  59694. bytesPerSequence = 1
  59695. } else if (codePoint > 0xFFFF) {
  59696. // encode to utf16 (surrogate pair dance)
  59697. codePoint -= 0x10000
  59698. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  59699. codePoint = 0xDC00 | codePoint & 0x3FF
  59700. }
  59701. res.push(codePoint)
  59702. i += bytesPerSequence
  59703. }
  59704. return decodeCodePointsArray(res)
  59705. }
  59706. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  59707. // the lowest limit is Chrome, with 0x10000 args.
  59708. // We go 1 magnitude less, for safety
  59709. var MAX_ARGUMENTS_LENGTH = 0x1000
  59710. function decodeCodePointsArray (codePoints) {
  59711. var len = codePoints.length
  59712. if (len <= MAX_ARGUMENTS_LENGTH) {
  59713. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  59714. }
  59715. // Decode in chunks to avoid "call stack size exceeded".
  59716. var res = ''
  59717. var i = 0
  59718. while (i < len) {
  59719. res += String.fromCharCode.apply(
  59720. String,
  59721. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  59722. )
  59723. }
  59724. return res
  59725. }
  59726. function asciiSlice (buf, start, end) {
  59727. var ret = ''
  59728. end = Math.min(buf.length, end)
  59729. for (var i = start; i < end; ++i) {
  59730. ret += String.fromCharCode(buf[i] & 0x7F)
  59731. }
  59732. return ret
  59733. }
  59734. function latin1Slice (buf, start, end) {
  59735. var ret = ''
  59736. end = Math.min(buf.length, end)
  59737. for (var i = start; i < end; ++i) {
  59738. ret += String.fromCharCode(buf[i])
  59739. }
  59740. return ret
  59741. }
  59742. function hexSlice (buf, start, end) {
  59743. var len = buf.length
  59744. if (!start || start < 0) start = 0
  59745. if (!end || end < 0 || end > len) end = len
  59746. var out = ''
  59747. for (var i = start; i < end; ++i) {
  59748. out += toHex(buf[i])
  59749. }
  59750. return out
  59751. }
  59752. function utf16leSlice (buf, start, end) {
  59753. var bytes = buf.slice(start, end)
  59754. var res = ''
  59755. for (var i = 0; i < bytes.length; i += 2) {
  59756. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  59757. }
  59758. return res
  59759. }
  59760. Buffer.prototype.slice = function slice (start, end) {
  59761. var len = this.length
  59762. start = ~~start
  59763. end = end === undefined ? len : ~~end
  59764. if (start < 0) {
  59765. start += len
  59766. if (start < 0) start = 0
  59767. } else if (start > len) {
  59768. start = len
  59769. }
  59770. if (end < 0) {
  59771. end += len
  59772. if (end < 0) end = 0
  59773. } else if (end > len) {
  59774. end = len
  59775. }
  59776. if (end < start) end = start
  59777. var newBuf
  59778. if (Buffer.TYPED_ARRAY_SUPPORT) {
  59779. newBuf = this.subarray(start, end)
  59780. newBuf.__proto__ = Buffer.prototype
  59781. } else {
  59782. var sliceLen = end - start
  59783. newBuf = new Buffer(sliceLen, undefined)
  59784. for (var i = 0; i < sliceLen; ++i) {
  59785. newBuf[i] = this[i + start]
  59786. }
  59787. }
  59788. return newBuf
  59789. }
  59790. /*
  59791. * Need to make sure that buffer isn't trying to write out of bounds.
  59792. */
  59793. function checkOffset (offset, ext, length) {
  59794. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  59795. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  59796. }
  59797. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  59798. offset = offset | 0
  59799. byteLength = byteLength | 0
  59800. if (!noAssert) checkOffset(offset, byteLength, this.length)
  59801. var val = this[offset]
  59802. var mul = 1
  59803. var i = 0
  59804. while (++i < byteLength && (mul *= 0x100)) {
  59805. val += this[offset + i] * mul
  59806. }
  59807. return val
  59808. }
  59809. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  59810. offset = offset | 0
  59811. byteLength = byteLength | 0
  59812. if (!noAssert) {
  59813. checkOffset(offset, byteLength, this.length)
  59814. }
  59815. var val = this[offset + --byteLength]
  59816. var mul = 1
  59817. while (byteLength > 0 && (mul *= 0x100)) {
  59818. val += this[offset + --byteLength] * mul
  59819. }
  59820. return val
  59821. }
  59822. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  59823. if (!noAssert) checkOffset(offset, 1, this.length)
  59824. return this[offset]
  59825. }
  59826. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  59827. if (!noAssert) checkOffset(offset, 2, this.length)
  59828. return this[offset] | (this[offset + 1] << 8)
  59829. }
  59830. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  59831. if (!noAssert) checkOffset(offset, 2, this.length)
  59832. return (this[offset] << 8) | this[offset + 1]
  59833. }
  59834. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  59835. if (!noAssert) checkOffset(offset, 4, this.length)
  59836. return ((this[offset]) |
  59837. (this[offset + 1] << 8) |
  59838. (this[offset + 2] << 16)) +
  59839. (this[offset + 3] * 0x1000000)
  59840. }
  59841. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  59842. if (!noAssert) checkOffset(offset, 4, this.length)
  59843. return (this[offset] * 0x1000000) +
  59844. ((this[offset + 1] << 16) |
  59845. (this[offset + 2] << 8) |
  59846. this[offset + 3])
  59847. }
  59848. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  59849. offset = offset | 0
  59850. byteLength = byteLength | 0
  59851. if (!noAssert) checkOffset(offset, byteLength, this.length)
  59852. var val = this[offset]
  59853. var mul = 1
  59854. var i = 0
  59855. while (++i < byteLength && (mul *= 0x100)) {
  59856. val += this[offset + i] * mul
  59857. }
  59858. mul *= 0x80
  59859. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  59860. return val
  59861. }
  59862. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  59863. offset = offset | 0
  59864. byteLength = byteLength | 0
  59865. if (!noAssert) checkOffset(offset, byteLength, this.length)
  59866. var i = byteLength
  59867. var mul = 1
  59868. var val = this[offset + --i]
  59869. while (i > 0 && (mul *= 0x100)) {
  59870. val += this[offset + --i] * mul
  59871. }
  59872. mul *= 0x80
  59873. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  59874. return val
  59875. }
  59876. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  59877. if (!noAssert) checkOffset(offset, 1, this.length)
  59878. if (!(this[offset] & 0x80)) return (this[offset])
  59879. return ((0xff - this[offset] + 1) * -1)
  59880. }
  59881. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  59882. if (!noAssert) checkOffset(offset, 2, this.length)
  59883. var val = this[offset] | (this[offset + 1] << 8)
  59884. return (val & 0x8000) ? val | 0xFFFF0000 : val
  59885. }
  59886. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  59887. if (!noAssert) checkOffset(offset, 2, this.length)
  59888. var val = this[offset + 1] | (this[offset] << 8)
  59889. return (val & 0x8000) ? val | 0xFFFF0000 : val
  59890. }
  59891. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  59892. if (!noAssert) checkOffset(offset, 4, this.length)
  59893. return (this[offset]) |
  59894. (this[offset + 1] << 8) |
  59895. (this[offset + 2] << 16) |
  59896. (this[offset + 3] << 24)
  59897. }
  59898. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  59899. if (!noAssert) checkOffset(offset, 4, this.length)
  59900. return (this[offset] << 24) |
  59901. (this[offset + 1] << 16) |
  59902. (this[offset + 2] << 8) |
  59903. (this[offset + 3])
  59904. }
  59905. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  59906. if (!noAssert) checkOffset(offset, 4, this.length)
  59907. return ieee754.read(this, offset, true, 23, 4)
  59908. }
  59909. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  59910. if (!noAssert) checkOffset(offset, 4, this.length)
  59911. return ieee754.read(this, offset, false, 23, 4)
  59912. }
  59913. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  59914. if (!noAssert) checkOffset(offset, 8, this.length)
  59915. return ieee754.read(this, offset, true, 52, 8)
  59916. }
  59917. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  59918. if (!noAssert) checkOffset(offset, 8, this.length)
  59919. return ieee754.read(this, offset, false, 52, 8)
  59920. }
  59921. function checkInt (buf, value, offset, ext, max, min) {
  59922. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  59923. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  59924. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  59925. }
  59926. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  59927. value = +value
  59928. offset = offset | 0
  59929. byteLength = byteLength | 0
  59930. if (!noAssert) {
  59931. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  59932. checkInt(this, value, offset, byteLength, maxBytes, 0)
  59933. }
  59934. var mul = 1
  59935. var i = 0
  59936. this[offset] = value & 0xFF
  59937. while (++i < byteLength && (mul *= 0x100)) {
  59938. this[offset + i] = (value / mul) & 0xFF
  59939. }
  59940. return offset + byteLength
  59941. }
  59942. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  59943. value = +value
  59944. offset = offset | 0
  59945. byteLength = byteLength | 0
  59946. if (!noAssert) {
  59947. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  59948. checkInt(this, value, offset, byteLength, maxBytes, 0)
  59949. }
  59950. var i = byteLength - 1
  59951. var mul = 1
  59952. this[offset + i] = value & 0xFF
  59953. while (--i >= 0 && (mul *= 0x100)) {
  59954. this[offset + i] = (value / mul) & 0xFF
  59955. }
  59956. return offset + byteLength
  59957. }
  59958. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  59959. value = +value
  59960. offset = offset | 0
  59961. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  59962. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  59963. this[offset] = (value & 0xff)
  59964. return offset + 1
  59965. }
  59966. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  59967. if (value < 0) value = 0xffff + value + 1
  59968. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  59969. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  59970. (littleEndian ? i : 1 - i) * 8
  59971. }
  59972. }
  59973. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  59974. value = +value
  59975. offset = offset | 0
  59976. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  59977. if (Buffer.TYPED_ARRAY_SUPPORT) {
  59978. this[offset] = (value & 0xff)
  59979. this[offset + 1] = (value >>> 8)
  59980. } else {
  59981. objectWriteUInt16(this, value, offset, true)
  59982. }
  59983. return offset + 2
  59984. }
  59985. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  59986. value = +value
  59987. offset = offset | 0
  59988. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  59989. if (Buffer.TYPED_ARRAY_SUPPORT) {
  59990. this[offset] = (value >>> 8)
  59991. this[offset + 1] = (value & 0xff)
  59992. } else {
  59993. objectWriteUInt16(this, value, offset, false)
  59994. }
  59995. return offset + 2
  59996. }
  59997. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  59998. if (value < 0) value = 0xffffffff + value + 1
  59999. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  60000. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  60001. }
  60002. }
  60003. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  60004. value = +value
  60005. offset = offset | 0
  60006. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  60007. if (Buffer.TYPED_ARRAY_SUPPORT) {
  60008. this[offset + 3] = (value >>> 24)
  60009. this[offset + 2] = (value >>> 16)
  60010. this[offset + 1] = (value >>> 8)
  60011. this[offset] = (value & 0xff)
  60012. } else {
  60013. objectWriteUInt32(this, value, offset, true)
  60014. }
  60015. return offset + 4
  60016. }
  60017. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  60018. value = +value
  60019. offset = offset | 0
  60020. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  60021. if (Buffer.TYPED_ARRAY_SUPPORT) {
  60022. this[offset] = (value >>> 24)
  60023. this[offset + 1] = (value >>> 16)
  60024. this[offset + 2] = (value >>> 8)
  60025. this[offset + 3] = (value & 0xff)
  60026. } else {
  60027. objectWriteUInt32(this, value, offset, false)
  60028. }
  60029. return offset + 4
  60030. }
  60031. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  60032. value = +value
  60033. offset = offset | 0
  60034. if (!noAssert) {
  60035. var limit = Math.pow(2, 8 * byteLength - 1)
  60036. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  60037. }
  60038. var i = 0
  60039. var mul = 1
  60040. var sub = 0
  60041. this[offset] = value & 0xFF
  60042. while (++i < byteLength && (mul *= 0x100)) {
  60043. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  60044. sub = 1
  60045. }
  60046. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  60047. }
  60048. return offset + byteLength
  60049. }
  60050. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  60051. value = +value
  60052. offset = offset | 0
  60053. if (!noAssert) {
  60054. var limit = Math.pow(2, 8 * byteLength - 1)
  60055. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  60056. }
  60057. var i = byteLength - 1
  60058. var mul = 1
  60059. var sub = 0
  60060. this[offset + i] = value & 0xFF
  60061. while (--i >= 0 && (mul *= 0x100)) {
  60062. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  60063. sub = 1
  60064. }
  60065. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  60066. }
  60067. return offset + byteLength
  60068. }
  60069. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  60070. value = +value
  60071. offset = offset | 0
  60072. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  60073. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  60074. if (value < 0) value = 0xff + value + 1
  60075. this[offset] = (value & 0xff)
  60076. return offset + 1
  60077. }
  60078. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  60079. value = +value
  60080. offset = offset | 0
  60081. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  60082. if (Buffer.TYPED_ARRAY_SUPPORT) {
  60083. this[offset] = (value & 0xff)
  60084. this[offset + 1] = (value >>> 8)
  60085. } else {
  60086. objectWriteUInt16(this, value, offset, true)
  60087. }
  60088. return offset + 2
  60089. }
  60090. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  60091. value = +value
  60092. offset = offset | 0
  60093. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  60094. if (Buffer.TYPED_ARRAY_SUPPORT) {
  60095. this[offset] = (value >>> 8)
  60096. this[offset + 1] = (value & 0xff)
  60097. } else {
  60098. objectWriteUInt16(this, value, offset, false)
  60099. }
  60100. return offset + 2
  60101. }
  60102. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  60103. value = +value
  60104. offset = offset | 0
  60105. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  60106. if (Buffer.TYPED_ARRAY_SUPPORT) {
  60107. this[offset] = (value & 0xff)
  60108. this[offset + 1] = (value >>> 8)
  60109. this[offset + 2] = (value >>> 16)
  60110. this[offset + 3] = (value >>> 24)
  60111. } else {
  60112. objectWriteUInt32(this, value, offset, true)
  60113. }
  60114. return offset + 4
  60115. }
  60116. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  60117. value = +value
  60118. offset = offset | 0
  60119. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  60120. if (value < 0) value = 0xffffffff + value + 1
  60121. if (Buffer.TYPED_ARRAY_SUPPORT) {
  60122. this[offset] = (value >>> 24)
  60123. this[offset + 1] = (value >>> 16)
  60124. this[offset + 2] = (value >>> 8)
  60125. this[offset + 3] = (value & 0xff)
  60126. } else {
  60127. objectWriteUInt32(this, value, offset, false)
  60128. }
  60129. return offset + 4
  60130. }
  60131. function checkIEEE754 (buf, value, offset, ext, max, min) {
  60132. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  60133. if (offset < 0) throw new RangeError('Index out of range')
  60134. }
  60135. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  60136. if (!noAssert) {
  60137. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  60138. }
  60139. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  60140. return offset + 4
  60141. }
  60142. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  60143. return writeFloat(this, value, offset, true, noAssert)
  60144. }
  60145. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  60146. return writeFloat(this, value, offset, false, noAssert)
  60147. }
  60148. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  60149. if (!noAssert) {
  60150. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  60151. }
  60152. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  60153. return offset + 8
  60154. }
  60155. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  60156. return writeDouble(this, value, offset, true, noAssert)
  60157. }
  60158. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  60159. return writeDouble(this, value, offset, false, noAssert)
  60160. }
  60161. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  60162. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  60163. if (!start) start = 0
  60164. if (!end && end !== 0) end = this.length
  60165. if (targetStart >= target.length) targetStart = target.length
  60166. if (!targetStart) targetStart = 0
  60167. if (end > 0 && end < start) end = start
  60168. // Copy 0 bytes; we're done
  60169. if (end === start) return 0
  60170. if (target.length === 0 || this.length === 0) return 0
  60171. // Fatal error conditions
  60172. if (targetStart < 0) {
  60173. throw new RangeError('targetStart out of bounds')
  60174. }
  60175. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  60176. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  60177. // Are we oob?
  60178. if (end > this.length) end = this.length
  60179. if (target.length - targetStart < end - start) {
  60180. end = target.length - targetStart + start
  60181. }
  60182. var len = end - start
  60183. var i
  60184. if (this === target && start < targetStart && targetStart < end) {
  60185. // descending copy from end
  60186. for (i = len - 1; i >= 0; --i) {
  60187. target[i + targetStart] = this[i + start]
  60188. }
  60189. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  60190. // ascending copy from start
  60191. for (i = 0; i < len; ++i) {
  60192. target[i + targetStart] = this[i + start]
  60193. }
  60194. } else {
  60195. Uint8Array.prototype.set.call(
  60196. target,
  60197. this.subarray(start, start + len),
  60198. targetStart
  60199. )
  60200. }
  60201. return len
  60202. }
  60203. // Usage:
  60204. // buffer.fill(number[, offset[, end]])
  60205. // buffer.fill(buffer[, offset[, end]])
  60206. // buffer.fill(string[, offset[, end]][, encoding])
  60207. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  60208. // Handle string cases:
  60209. if (typeof val === 'string') {
  60210. if (typeof start === 'string') {
  60211. encoding = start
  60212. start = 0
  60213. end = this.length
  60214. } else if (typeof end === 'string') {
  60215. encoding = end
  60216. end = this.length
  60217. }
  60218. if (val.length === 1) {
  60219. var code = val.charCodeAt(0)
  60220. if (code < 256) {
  60221. val = code
  60222. }
  60223. }
  60224. if (encoding !== undefined && typeof encoding !== 'string') {
  60225. throw new TypeError('encoding must be a string')
  60226. }
  60227. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  60228. throw new TypeError('Unknown encoding: ' + encoding)
  60229. }
  60230. } else if (typeof val === 'number') {
  60231. val = val & 255
  60232. }
  60233. // Invalid ranges are not set to a default, so can range check early.
  60234. if (start < 0 || this.length < start || this.length < end) {
  60235. throw new RangeError('Out of range index')
  60236. }
  60237. if (end <= start) {
  60238. return this
  60239. }
  60240. start = start >>> 0
  60241. end = end === undefined ? this.length : end >>> 0
  60242. if (!val) val = 0
  60243. var i
  60244. if (typeof val === 'number') {
  60245. for (i = start; i < end; ++i) {
  60246. this[i] = val
  60247. }
  60248. } else {
  60249. var bytes = Buffer.isBuffer(val)
  60250. ? val
  60251. : utf8ToBytes(new Buffer(val, encoding).toString())
  60252. var len = bytes.length
  60253. for (i = 0; i < end - start; ++i) {
  60254. this[i + start] = bytes[i % len]
  60255. }
  60256. }
  60257. return this
  60258. }
  60259. // HELPER FUNCTIONS
  60260. // ================
  60261. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  60262. function base64clean (str) {
  60263. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  60264. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  60265. // Node converts strings with length < 2 to ''
  60266. if (str.length < 2) return ''
  60267. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  60268. while (str.length % 4 !== 0) {
  60269. str = str + '='
  60270. }
  60271. return str
  60272. }
  60273. function stringtrim (str) {
  60274. if (str.trim) return str.trim()
  60275. return str.replace(/^\s+|\s+$/g, '')
  60276. }
  60277. function toHex (n) {
  60278. if (n < 16) return '0' + n.toString(16)
  60279. return n.toString(16)
  60280. }
  60281. function utf8ToBytes (string, units) {
  60282. units = units || Infinity
  60283. var codePoint
  60284. var length = string.length
  60285. var leadSurrogate = null
  60286. var bytes = []
  60287. for (var i = 0; i < length; ++i) {
  60288. codePoint = string.charCodeAt(i)
  60289. // is surrogate component
  60290. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  60291. // last char was a lead
  60292. if (!leadSurrogate) {
  60293. // no lead yet
  60294. if (codePoint > 0xDBFF) {
  60295. // unexpected trail
  60296. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  60297. continue
  60298. } else if (i + 1 === length) {
  60299. // unpaired lead
  60300. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  60301. continue
  60302. }
  60303. // valid lead
  60304. leadSurrogate = codePoint
  60305. continue
  60306. }
  60307. // 2 leads in a row
  60308. if (codePoint < 0xDC00) {
  60309. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  60310. leadSurrogate = codePoint
  60311. continue
  60312. }
  60313. // valid surrogate pair
  60314. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  60315. } else if (leadSurrogate) {
  60316. // valid bmp char, but last char was a lead
  60317. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  60318. }
  60319. leadSurrogate = null
  60320. // encode utf8
  60321. if (codePoint < 0x80) {
  60322. if ((units -= 1) < 0) break
  60323. bytes.push(codePoint)
  60324. } else if (codePoint < 0x800) {
  60325. if ((units -= 2) < 0) break
  60326. bytes.push(
  60327. codePoint >> 0x6 | 0xC0,
  60328. codePoint & 0x3F | 0x80
  60329. )
  60330. } else if (codePoint < 0x10000) {
  60331. if ((units -= 3) < 0) break
  60332. bytes.push(
  60333. codePoint >> 0xC | 0xE0,
  60334. codePoint >> 0x6 & 0x3F | 0x80,
  60335. codePoint & 0x3F | 0x80
  60336. )
  60337. } else if (codePoint < 0x110000) {
  60338. if ((units -= 4) < 0) break
  60339. bytes.push(
  60340. codePoint >> 0x12 | 0xF0,
  60341. codePoint >> 0xC & 0x3F | 0x80,
  60342. codePoint >> 0x6 & 0x3F | 0x80,
  60343. codePoint & 0x3F | 0x80
  60344. )
  60345. } else {
  60346. throw new Error('Invalid code point')
  60347. }
  60348. }
  60349. return bytes
  60350. }
  60351. function asciiToBytes (str) {
  60352. var byteArray = []
  60353. for (var i = 0; i < str.length; ++i) {
  60354. // Node's code seems to be doing this and not & 0x7F..
  60355. byteArray.push(str.charCodeAt(i) & 0xFF)
  60356. }
  60357. return byteArray
  60358. }
  60359. function utf16leToBytes (str, units) {
  60360. var c, hi, lo
  60361. var byteArray = []
  60362. for (var i = 0; i < str.length; ++i) {
  60363. if ((units -= 2) < 0) break
  60364. c = str.charCodeAt(i)
  60365. hi = c >> 8
  60366. lo = c % 256
  60367. byteArray.push(lo)
  60368. byteArray.push(hi)
  60369. }
  60370. return byteArray
  60371. }
  60372. function base64ToBytes (str) {
  60373. return base64.toByteArray(base64clean(str))
  60374. }
  60375. function blitBuffer (src, dst, offset, length) {
  60376. for (var i = 0; i < length; ++i) {
  60377. if ((i + offset >= dst.length) || (i >= src.length)) break
  60378. dst[i + offset] = src[i]
  60379. }
  60380. return i
  60381. }
  60382. function isnan (val) {
  60383. return val !== val // eslint-disable-line no-self-compare
  60384. }
  60385. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  60386. /***/ }),
  60387. /***/ "./node_modules/buffer/node_modules/isarray/index.js":
  60388. /*!***********************************************************!*\
  60389. !*** ./node_modules/buffer/node_modules/isarray/index.js ***!
  60390. \***********************************************************/
  60391. /*! no static exports found */
  60392. /*! all exports used */
  60393. /***/ (function(module, exports) {
  60394. var toString = {}.toString;
  60395. module.exports = Array.isArray || function (arr) {
  60396. return toString.call(arr) == '[object Array]';
  60397. };
  60398. /***/ }),
  60399. /***/ "./node_modules/component-bind/index.js":
  60400. /*!**********************************************!*\
  60401. !*** ./node_modules/component-bind/index.js ***!
  60402. \**********************************************/
  60403. /*! no static exports found */
  60404. /*! all exports used */
  60405. /***/ (function(module, exports) {
  60406. /**
  60407. * Slice reference.
  60408. */
  60409. var slice = [].slice;
  60410. /**
  60411. * Bind `obj` to `fn`.
  60412. *
  60413. * @param {Object} obj
  60414. * @param {Function|String} fn or string
  60415. * @return {Function}
  60416. * @api public
  60417. */
  60418. module.exports = function(obj, fn){
  60419. if ('string' == typeof fn) fn = obj[fn];
  60420. if ('function' != typeof fn) throw new Error('bind() requires a function');
  60421. var args = slice.call(arguments, 2);
  60422. return function(){
  60423. return fn.apply(obj, args.concat(slice.call(arguments)));
  60424. }
  60425. };
  60426. /***/ }),
  60427. /***/ "./node_modules/component-emitter/index.js":
  60428. /*!*************************************************!*\
  60429. !*** ./node_modules/component-emitter/index.js ***!
  60430. \*************************************************/
  60431. /*! no static exports found */
  60432. /*! all exports used */
  60433. /***/ (function(module, exports, __webpack_require__) {
  60434. /**
  60435. * Expose `Emitter`.
  60436. */
  60437. if (true) {
  60438. module.exports = Emitter;
  60439. }
  60440. /**
  60441. * Initialize a new `Emitter`.
  60442. *
  60443. * @api public
  60444. */
  60445. function Emitter(obj) {
  60446. if (obj) return mixin(obj);
  60447. };
  60448. /**
  60449. * Mixin the emitter properties.
  60450. *
  60451. * @param {Object} obj
  60452. * @return {Object}
  60453. * @api private
  60454. */
  60455. function mixin(obj) {
  60456. for (var key in Emitter.prototype) {
  60457. obj[key] = Emitter.prototype[key];
  60458. }
  60459. return obj;
  60460. }
  60461. /**
  60462. * Listen on the given `event` with `fn`.
  60463. *
  60464. * @param {String} event
  60465. * @param {Function} fn
  60466. * @return {Emitter}
  60467. * @api public
  60468. */
  60469. Emitter.prototype.on =
  60470. Emitter.prototype.addEventListener = function(event, fn){
  60471. this._callbacks = this._callbacks || {};
  60472. (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
  60473. .push(fn);
  60474. return this;
  60475. };
  60476. /**
  60477. * Adds an `event` listener that will be invoked a single
  60478. * time then automatically removed.
  60479. *
  60480. * @param {String} event
  60481. * @param {Function} fn
  60482. * @return {Emitter}
  60483. * @api public
  60484. */
  60485. Emitter.prototype.once = function(event, fn){
  60486. function on() {
  60487. this.off(event, on);
  60488. fn.apply(this, arguments);
  60489. }
  60490. on.fn = fn;
  60491. this.on(event, on);
  60492. return this;
  60493. };
  60494. /**
  60495. * Remove the given callback for `event` or all
  60496. * registered callbacks.
  60497. *
  60498. * @param {String} event
  60499. * @param {Function} fn
  60500. * @return {Emitter}
  60501. * @api public
  60502. */
  60503. Emitter.prototype.off =
  60504. Emitter.prototype.removeListener =
  60505. Emitter.prototype.removeAllListeners =
  60506. Emitter.prototype.removeEventListener = function(event, fn){
  60507. this._callbacks = this._callbacks || {};
  60508. // all
  60509. if (0 == arguments.length) {
  60510. this._callbacks = {};
  60511. return this;
  60512. }
  60513. // specific event
  60514. var callbacks = this._callbacks['$' + event];
  60515. if (!callbacks) return this;
  60516. // remove all handlers
  60517. if (1 == arguments.length) {
  60518. delete this._callbacks['$' + event];
  60519. return this;
  60520. }
  60521. // remove specific handler
  60522. var cb;
  60523. for (var i = 0; i < callbacks.length; i++) {
  60524. cb = callbacks[i];
  60525. if (cb === fn || cb.fn === fn) {
  60526. callbacks.splice(i, 1);
  60527. break;
  60528. }
  60529. }
  60530. return this;
  60531. };
  60532. /**
  60533. * Emit `event` with the given args.
  60534. *
  60535. * @param {String} event
  60536. * @param {Mixed} ...
  60537. * @return {Emitter}
  60538. */
  60539. Emitter.prototype.emit = function(event){
  60540. this._callbacks = this._callbacks || {};
  60541. var args = [].slice.call(arguments, 1)
  60542. , callbacks = this._callbacks['$' + event];
  60543. if (callbacks) {
  60544. callbacks = callbacks.slice(0);
  60545. for (var i = 0, len = callbacks.length; i < len; ++i) {
  60546. callbacks[i].apply(this, args);
  60547. }
  60548. }
  60549. return this;
  60550. };
  60551. /**
  60552. * Return array of callbacks for `event`.
  60553. *
  60554. * @param {String} event
  60555. * @return {Array}
  60556. * @api public
  60557. */
  60558. Emitter.prototype.listeners = function(event){
  60559. this._callbacks = this._callbacks || {};
  60560. return this._callbacks['$' + event] || [];
  60561. };
  60562. /**
  60563. * Check if this emitter has `event` handlers.
  60564. *
  60565. * @param {String} event
  60566. * @return {Boolean}
  60567. * @api public
  60568. */
  60569. Emitter.prototype.hasListeners = function(event){
  60570. return !! this.listeners(event).length;
  60571. };
  60572. /***/ }),
  60573. /***/ "./node_modules/component-inherit/index.js":
  60574. /*!*************************************************!*\
  60575. !*** ./node_modules/component-inherit/index.js ***!
  60576. \*************************************************/
  60577. /*! no static exports found */
  60578. /*! all exports used */
  60579. /***/ (function(module, exports) {
  60580. module.exports = function(a, b){
  60581. var fn = function(){};
  60582. fn.prototype = b.prototype;
  60583. a.prototype = new fn;
  60584. a.prototype.constructor = a;
  60585. };
  60586. /***/ }),
  60587. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./resources/js/fix.scss":
  60588. /*!******************************************************************************************************************************************************************!*\
  60589. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./resources/js/fix.scss ***!
  60590. \******************************************************************************************************************************************************************/
  60591. /*! no static exports found */
  60592. /*! all exports used */
  60593. /***/ (function(module, exports, __webpack_require__) {
  60594. // Imports
  60595. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  60596. exports = ___CSS_LOADER_API_IMPORT___(false);
  60597. // Module
  60598. exports.push([module.i, "", ""]);
  60599. // Exports
  60600. module.exports = exports;
  60601. /***/ }),
  60602. /***/ "./node_modules/css-loader/dist/runtime/api.js":
  60603. /*!*****************************************************!*\
  60604. !*** ./node_modules/css-loader/dist/runtime/api.js ***!
  60605. \*****************************************************/
  60606. /*! no static exports found */
  60607. /*! all exports used */
  60608. /***/ (function(module, exports, __webpack_require__) {
  60609. "use strict";
  60610. /*
  60611. MIT License http://www.opensource.org/licenses/mit-license.php
  60612. Author Tobias Koppers @sokra
  60613. */
  60614. // css base code, injected by the css-loader
  60615. // eslint-disable-next-line func-names
  60616. module.exports = function (useSourceMap) {
  60617. var list = []; // return the list of modules as css string
  60618. list.toString = function toString() {
  60619. return this.map(function (item) {
  60620. var content = cssWithMappingToString(item, useSourceMap);
  60621. if (item[2]) {
  60622. return "@media ".concat(item[2], " {").concat(content, "}");
  60623. }
  60624. return content;
  60625. }).join('');
  60626. }; // import a list of modules into the list
  60627. // eslint-disable-next-line func-names
  60628. list.i = function (modules, mediaQuery, dedupe) {
  60629. if (typeof modules === 'string') {
  60630. // eslint-disable-next-line no-param-reassign
  60631. modules = [[null, modules, '']];
  60632. }
  60633. var alreadyImportedModules = {};
  60634. if (dedupe) {
  60635. for (var i = 0; i < this.length; i++) {
  60636. // eslint-disable-next-line prefer-destructuring
  60637. var id = this[i][0];
  60638. if (id != null) {
  60639. alreadyImportedModules[id] = true;
  60640. }
  60641. }
  60642. }
  60643. for (var _i = 0; _i < modules.length; _i++) {
  60644. var item = [].concat(modules[_i]);
  60645. if (dedupe && alreadyImportedModules[item[0]]) {
  60646. // eslint-disable-next-line no-continue
  60647. continue;
  60648. }
  60649. if (mediaQuery) {
  60650. if (!item[2]) {
  60651. item[2] = mediaQuery;
  60652. } else {
  60653. item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
  60654. }
  60655. }
  60656. list.push(item);
  60657. }
  60658. };
  60659. return list;
  60660. };
  60661. function cssWithMappingToString(item, useSourceMap) {
  60662. var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
  60663. var cssMapping = item[3];
  60664. if (!cssMapping) {
  60665. return content;
  60666. }
  60667. if (useSourceMap && typeof btoa === 'function') {
  60668. var sourceMapping = toComment(cssMapping);
  60669. var sourceURLs = cssMapping.sources.map(function (source) {
  60670. return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
  60671. });
  60672. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  60673. }
  60674. return [content].join('\n');
  60675. } // Adapted from convert-source-map (MIT)
  60676. function toComment(sourceMap) {
  60677. // eslint-disable-next-line no-undef
  60678. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  60679. var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
  60680. return "/*# ".concat(data, " */");
  60681. }
  60682. /***/ }),
  60683. /***/ "./node_modules/debug/src/browser.js":
  60684. /*!*******************************************!*\
  60685. !*** ./node_modules/debug/src/browser.js ***!
  60686. \*******************************************/
  60687. /*! no static exports found */
  60688. /*! all exports used */
  60689. /***/ (function(module, exports, __webpack_require__) {
  60690. /* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */
  60691. /**
  60692. * This is the web browser implementation of `debug()`.
  60693. */
  60694. exports.log = log;
  60695. exports.formatArgs = formatArgs;
  60696. exports.save = save;
  60697. exports.load = load;
  60698. exports.useColors = useColors;
  60699. exports.storage = localstorage();
  60700. /**
  60701. * Colors.
  60702. */
  60703. exports.colors = [
  60704. '#0000CC',
  60705. '#0000FF',
  60706. '#0033CC',
  60707. '#0033FF',
  60708. '#0066CC',
  60709. '#0066FF',
  60710. '#0099CC',
  60711. '#0099FF',
  60712. '#00CC00',
  60713. '#00CC33',
  60714. '#00CC66',
  60715. '#00CC99',
  60716. '#00CCCC',
  60717. '#00CCFF',
  60718. '#3300CC',
  60719. '#3300FF',
  60720. '#3333CC',
  60721. '#3333FF',
  60722. '#3366CC',
  60723. '#3366FF',
  60724. '#3399CC',
  60725. '#3399FF',
  60726. '#33CC00',
  60727. '#33CC33',
  60728. '#33CC66',
  60729. '#33CC99',
  60730. '#33CCCC',
  60731. '#33CCFF',
  60732. '#6600CC',
  60733. '#6600FF',
  60734. '#6633CC',
  60735. '#6633FF',
  60736. '#66CC00',
  60737. '#66CC33',
  60738. '#9900CC',
  60739. '#9900FF',
  60740. '#9933CC',
  60741. '#9933FF',
  60742. '#99CC00',
  60743. '#99CC33',
  60744. '#CC0000',
  60745. '#CC0033',
  60746. '#CC0066',
  60747. '#CC0099',
  60748. '#CC00CC',
  60749. '#CC00FF',
  60750. '#CC3300',
  60751. '#CC3333',
  60752. '#CC3366',
  60753. '#CC3399',
  60754. '#CC33CC',
  60755. '#CC33FF',
  60756. '#CC6600',
  60757. '#CC6633',
  60758. '#CC9900',
  60759. '#CC9933',
  60760. '#CCCC00',
  60761. '#CCCC33',
  60762. '#FF0000',
  60763. '#FF0033',
  60764. '#FF0066',
  60765. '#FF0099',
  60766. '#FF00CC',
  60767. '#FF00FF',
  60768. '#FF3300',
  60769. '#FF3333',
  60770. '#FF3366',
  60771. '#FF3399',
  60772. '#FF33CC',
  60773. '#FF33FF',
  60774. '#FF6600',
  60775. '#FF6633',
  60776. '#FF9900',
  60777. '#FF9933',
  60778. '#FFCC00',
  60779. '#FFCC33'
  60780. ];
  60781. /**
  60782. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  60783. * and the Firebug extension (any Firefox version) are known
  60784. * to support "%c" CSS customizations.
  60785. *
  60786. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  60787. */
  60788. // eslint-disable-next-line complexity
  60789. function useColors() {
  60790. // NB: In an Electron preload script, document will be defined but not fully
  60791. // initialized. Since we know we're in Chrome, we'll just detect this case
  60792. // explicitly
  60793. if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
  60794. return true;
  60795. }
  60796. // Internet Explorer and Edge do not support colors.
  60797. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  60798. return false;
  60799. }
  60800. // Is webkit? http://stackoverflow.com/a/16459606/376773
  60801. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  60802. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  60803. // Is firebug? http://stackoverflow.com/a/398120/376773
  60804. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  60805. // Is firefox >= v31?
  60806. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  60807. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  60808. // Double check webkit in userAgent just in case we are in a worker
  60809. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  60810. }
  60811. /**
  60812. * Colorize log arguments if enabled.
  60813. *
  60814. * @api public
  60815. */
  60816. function formatArgs(args) {
  60817. args[0] = (this.useColors ? '%c' : '') +
  60818. this.namespace +
  60819. (this.useColors ? ' %c' : ' ') +
  60820. args[0] +
  60821. (this.useColors ? '%c ' : ' ') +
  60822. '+' + module.exports.humanize(this.diff);
  60823. if (!this.useColors) {
  60824. return;
  60825. }
  60826. const c = 'color: ' + this.color;
  60827. args.splice(1, 0, c, 'color: inherit');
  60828. // The final "%c" is somewhat tricky, because there could be other
  60829. // arguments passed either before or after the %c, so we need to
  60830. // figure out the correct index to insert the CSS into
  60831. let index = 0;
  60832. let lastC = 0;
  60833. args[0].replace(/%[a-zA-Z%]/g, match => {
  60834. if (match === '%%') {
  60835. return;
  60836. }
  60837. index++;
  60838. if (match === '%c') {
  60839. // We only are interested in the *last* %c
  60840. // (the user may have provided their own)
  60841. lastC = index;
  60842. }
  60843. });
  60844. args.splice(lastC, 0, c);
  60845. }
  60846. /**
  60847. * Invokes `console.log()` when available.
  60848. * No-op when `console.log` is not a "function".
  60849. *
  60850. * @api public
  60851. */
  60852. function log(...args) {
  60853. // This hackery is required for IE8/9, where
  60854. // the `console.log` function doesn't have 'apply'
  60855. return typeof console === 'object' &&
  60856. console.log &&
  60857. console.log(...args);
  60858. }
  60859. /**
  60860. * Save `namespaces`.
  60861. *
  60862. * @param {String} namespaces
  60863. * @api private
  60864. */
  60865. function save(namespaces) {
  60866. try {
  60867. if (namespaces) {
  60868. exports.storage.setItem('debug', namespaces);
  60869. } else {
  60870. exports.storage.removeItem('debug');
  60871. }
  60872. } catch (error) {
  60873. // Swallow
  60874. // XXX (@Qix-) should we be logging these?
  60875. }
  60876. }
  60877. /**
  60878. * Load `namespaces`.
  60879. *
  60880. * @return {String} returns the previously persisted debug modes
  60881. * @api private
  60882. */
  60883. function load() {
  60884. let r;
  60885. try {
  60886. r = exports.storage.getItem('debug');
  60887. } catch (error) {
  60888. // Swallow
  60889. // XXX (@Qix-) should we be logging these?
  60890. }
  60891. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  60892. if (!r && typeof process !== 'undefined' && 'env' in process) {
  60893. r = process.env.DEBUG;
  60894. }
  60895. return r;
  60896. }
  60897. /**
  60898. * Localstorage attempts to return the localstorage.
  60899. *
  60900. * This is necessary because safari throws
  60901. * when a user disables cookies/localstorage
  60902. * and you attempt to access it.
  60903. *
  60904. * @return {LocalStorage}
  60905. * @api private
  60906. */
  60907. function localstorage() {
  60908. try {
  60909. // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
  60910. // The Browser also has localStorage in the global context.
  60911. return localStorage;
  60912. } catch (error) {
  60913. // Swallow
  60914. // XXX (@Qix-) should we be logging these?
  60915. }
  60916. }
  60917. module.exports = __webpack_require__(/*! ./common */ "./node_modules/debug/src/common.js")(exports);
  60918. const {formatters} = module.exports;
  60919. /**
  60920. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  60921. */
  60922. formatters.j = function (v) {
  60923. try {
  60924. return JSON.stringify(v);
  60925. } catch (error) {
  60926. return '[UnexpectedJSONParseError]: ' + error.message;
  60927. }
  60928. };
  60929. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
  60930. /***/ }),
  60931. /***/ "./node_modules/debug/src/common.js":
  60932. /*!******************************************!*\
  60933. !*** ./node_modules/debug/src/common.js ***!
  60934. \******************************************/
  60935. /*! no static exports found */
  60936. /*! all exports used */
  60937. /***/ (function(module, exports, __webpack_require__) {
  60938. /**
  60939. * This is the common logic for both the Node.js and web browser
  60940. * implementations of `debug()`.
  60941. */
  60942. function setup(env) {
  60943. createDebug.debug = createDebug;
  60944. createDebug.default = createDebug;
  60945. createDebug.coerce = coerce;
  60946. createDebug.disable = disable;
  60947. createDebug.enable = enable;
  60948. createDebug.enabled = enabled;
  60949. createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js");
  60950. Object.keys(env).forEach(key => {
  60951. createDebug[key] = env[key];
  60952. });
  60953. /**
  60954. * Active `debug` instances.
  60955. */
  60956. createDebug.instances = [];
  60957. /**
  60958. * The currently active debug mode names, and names to skip.
  60959. */
  60960. createDebug.names = [];
  60961. createDebug.skips = [];
  60962. /**
  60963. * Map of special "%n" handling functions, for the debug "format" argument.
  60964. *
  60965. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  60966. */
  60967. createDebug.formatters = {};
  60968. /**
  60969. * Selects a color for a debug namespace
  60970. * @param {String} namespace The namespace string for the for the debug instance to be colored
  60971. * @return {Number|String} An ANSI color code for the given namespace
  60972. * @api private
  60973. */
  60974. function selectColor(namespace) {
  60975. let hash = 0;
  60976. for (let i = 0; i < namespace.length; i++) {
  60977. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  60978. hash |= 0; // Convert to 32bit integer
  60979. }
  60980. return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  60981. }
  60982. createDebug.selectColor = selectColor;
  60983. /**
  60984. * Create a debugger with the given `namespace`.
  60985. *
  60986. * @param {String} namespace
  60987. * @return {Function}
  60988. * @api public
  60989. */
  60990. function createDebug(namespace) {
  60991. let prevTime;
  60992. function debug(...args) {
  60993. // Disabled?
  60994. if (!debug.enabled) {
  60995. return;
  60996. }
  60997. const self = debug;
  60998. // Set `diff` timestamp
  60999. const curr = Number(new Date());
  61000. const ms = curr - (prevTime || curr);
  61001. self.diff = ms;
  61002. self.prev = prevTime;
  61003. self.curr = curr;
  61004. prevTime = curr;
  61005. args[0] = createDebug.coerce(args[0]);
  61006. if (typeof args[0] !== 'string') {
  61007. // Anything else let's inspect with %O
  61008. args.unshift('%O');
  61009. }
  61010. // Apply any `formatters` transformations
  61011. let index = 0;
  61012. args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
  61013. // If we encounter an escaped % then don't increase the array index
  61014. if (match === '%%') {
  61015. return match;
  61016. }
  61017. index++;
  61018. const formatter = createDebug.formatters[format];
  61019. if (typeof formatter === 'function') {
  61020. const val = args[index];
  61021. match = formatter.call(self, val);
  61022. // Now we need to remove `args[index]` since it's inlined in the `format`
  61023. args.splice(index, 1);
  61024. index--;
  61025. }
  61026. return match;
  61027. });
  61028. // Apply env-specific formatting (colors, etc.)
  61029. createDebug.formatArgs.call(self, args);
  61030. const logFn = self.log || createDebug.log;
  61031. logFn.apply(self, args);
  61032. }
  61033. debug.namespace = namespace;
  61034. debug.enabled = createDebug.enabled(namespace);
  61035. debug.useColors = createDebug.useColors();
  61036. debug.color = selectColor(namespace);
  61037. debug.destroy = destroy;
  61038. debug.extend = extend;
  61039. // Debug.formatArgs = formatArgs;
  61040. // debug.rawLog = rawLog;
  61041. // env-specific initialization logic for debug instances
  61042. if (typeof createDebug.init === 'function') {
  61043. createDebug.init(debug);
  61044. }
  61045. createDebug.instances.push(debug);
  61046. return debug;
  61047. }
  61048. function destroy() {
  61049. const index = createDebug.instances.indexOf(this);
  61050. if (index !== -1) {
  61051. createDebug.instances.splice(index, 1);
  61052. return true;
  61053. }
  61054. return false;
  61055. }
  61056. function extend(namespace, delimiter) {
  61057. const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
  61058. newDebug.log = this.log;
  61059. return newDebug;
  61060. }
  61061. /**
  61062. * Enables a debug mode by namespaces. This can include modes
  61063. * separated by a colon and wildcards.
  61064. *
  61065. * @param {String} namespaces
  61066. * @api public
  61067. */
  61068. function enable(namespaces) {
  61069. createDebug.save(namespaces);
  61070. createDebug.names = [];
  61071. createDebug.skips = [];
  61072. let i;
  61073. const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  61074. const len = split.length;
  61075. for (i = 0; i < len; i++) {
  61076. if (!split[i]) {
  61077. // ignore empty strings
  61078. continue;
  61079. }
  61080. namespaces = split[i].replace(/\*/g, '.*?');
  61081. if (namespaces[0] === '-') {
  61082. createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  61083. } else {
  61084. createDebug.names.push(new RegExp('^' + namespaces + '$'));
  61085. }
  61086. }
  61087. for (i = 0; i < createDebug.instances.length; i++) {
  61088. const instance = createDebug.instances[i];
  61089. instance.enabled = createDebug.enabled(instance.namespace);
  61090. }
  61091. }
  61092. /**
  61093. * Disable debug output.
  61094. *
  61095. * @return {String} namespaces
  61096. * @api public
  61097. */
  61098. function disable() {
  61099. const namespaces = [
  61100. ...createDebug.names.map(toNamespace),
  61101. ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
  61102. ].join(',');
  61103. createDebug.enable('');
  61104. return namespaces;
  61105. }
  61106. /**
  61107. * Returns true if the given mode name is enabled, false otherwise.
  61108. *
  61109. * @param {String} name
  61110. * @return {Boolean}
  61111. * @api public
  61112. */
  61113. function enabled(name) {
  61114. if (name[name.length - 1] === '*') {
  61115. return true;
  61116. }
  61117. let i;
  61118. let len;
  61119. for (i = 0, len = createDebug.skips.length; i < len; i++) {
  61120. if (createDebug.skips[i].test(name)) {
  61121. return false;
  61122. }
  61123. }
  61124. for (i = 0, len = createDebug.names.length; i < len; i++) {
  61125. if (createDebug.names[i].test(name)) {
  61126. return true;
  61127. }
  61128. }
  61129. return false;
  61130. }
  61131. /**
  61132. * Convert regexp to namespace
  61133. *
  61134. * @param {RegExp} regxep
  61135. * @return {String} namespace
  61136. * @api private
  61137. */
  61138. function toNamespace(regexp) {
  61139. return regexp.toString()
  61140. .substring(2, regexp.toString().length - 2)
  61141. .replace(/\.\*\?$/, '*');
  61142. }
  61143. /**
  61144. * Coerce `val`.
  61145. *
  61146. * @param {Mixed} val
  61147. * @return {Mixed}
  61148. * @api private
  61149. */
  61150. function coerce(val) {
  61151. if (val instanceof Error) {
  61152. return val.stack || val.message;
  61153. }
  61154. return val;
  61155. }
  61156. createDebug.enable(createDebug.load());
  61157. return createDebug;
  61158. }
  61159. module.exports = setup;
  61160. /***/ }),
  61161. /***/ "./node_modules/engine.io-parser/lib/browser.js":
  61162. /*!******************************************************!*\
  61163. !*** ./node_modules/engine.io-parser/lib/browser.js ***!
  61164. \******************************************************/
  61165. /*! no static exports found */
  61166. /*! all exports used */
  61167. /***/ (function(module, exports, __webpack_require__) {
  61168. /**
  61169. * Module dependencies.
  61170. */
  61171. var keys = __webpack_require__(/*! ./keys */ "./node_modules/engine.io-parser/lib/keys.js");
  61172. var hasBinary = __webpack_require__(/*! has-binary2 */ "./node_modules/has-binary2/index.js");
  61173. var sliceBuffer = __webpack_require__(/*! arraybuffer.slice */ "./node_modules/arraybuffer.slice/index.js");
  61174. var after = __webpack_require__(/*! after */ "./node_modules/after/index.js");
  61175. var utf8 = __webpack_require__(/*! ./utf8 */ "./node_modules/engine.io-parser/lib/utf8.js");
  61176. var base64encoder;
  61177. if (typeof ArrayBuffer !== 'undefined') {
  61178. base64encoder = __webpack_require__(/*! base64-arraybuffer */ "./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js");
  61179. }
  61180. /**
  61181. * Check if we are running an android browser. That requires us to use
  61182. * ArrayBuffer with polling transports...
  61183. *
  61184. * http://ghinda.net/jpeg-blob-ajax-android/
  61185. */
  61186. var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);
  61187. /**
  61188. * Check if we are running in PhantomJS.
  61189. * Uploading a Blob with PhantomJS does not work correctly, as reported here:
  61190. * https://github.com/ariya/phantomjs/issues/11395
  61191. * @type boolean
  61192. */
  61193. var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);
  61194. /**
  61195. * When true, avoids using Blobs to encode payloads.
  61196. * @type boolean
  61197. */
  61198. var dontSendBlobs = isAndroid || isPhantomJS;
  61199. /**
  61200. * Current protocol version.
  61201. */
  61202. exports.protocol = 3;
  61203. /**
  61204. * Packet types.
  61205. */
  61206. var packets = exports.packets = {
  61207. open: 0 // non-ws
  61208. , close: 1 // non-ws
  61209. , ping: 2
  61210. , pong: 3
  61211. , message: 4
  61212. , upgrade: 5
  61213. , noop: 6
  61214. };
  61215. var packetslist = keys(packets);
  61216. /**
  61217. * Premade error packet.
  61218. */
  61219. var err = { type: 'error', data: 'parser error' };
  61220. /**
  61221. * Create a blob api even for blob builder when vendor prefixes exist
  61222. */
  61223. var Blob = __webpack_require__(/*! blob */ "./node_modules/blob/index.js");
  61224. /**
  61225. * Encodes a packet.
  61226. *
  61227. * <packet type id> [ <data> ]
  61228. *
  61229. * Example:
  61230. *
  61231. * 5hello world
  61232. * 3
  61233. * 4
  61234. *
  61235. * Binary is encoded in an identical principle
  61236. *
  61237. * @api private
  61238. */
  61239. exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {
  61240. if (typeof supportsBinary === 'function') {
  61241. callback = supportsBinary;
  61242. supportsBinary = false;
  61243. }
  61244. if (typeof utf8encode === 'function') {
  61245. callback = utf8encode;
  61246. utf8encode = null;
  61247. }
  61248. var data = (packet.data === undefined)
  61249. ? undefined
  61250. : packet.data.buffer || packet.data;
  61251. if (typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) {
  61252. return encodeArrayBuffer(packet, supportsBinary, callback);
  61253. } else if (typeof Blob !== 'undefined' && data instanceof Blob) {
  61254. return encodeBlob(packet, supportsBinary, callback);
  61255. }
  61256. // might be an object with { base64: true, data: dataAsBase64String }
  61257. if (data && data.base64) {
  61258. return encodeBase64Object(packet, callback);
  61259. }
  61260. // Sending data as a utf-8 string
  61261. var encoded = packets[packet.type];
  61262. // data fragment is optional
  61263. if (undefined !== packet.data) {
  61264. encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);
  61265. }
  61266. return callback('' + encoded);
  61267. };
  61268. function encodeBase64Object(packet, callback) {
  61269. // packet data is an object { base64: true, data: dataAsBase64String }
  61270. var message = 'b' + exports.packets[packet.type] + packet.data.data;
  61271. return callback(message);
  61272. }
  61273. /**
  61274. * Encode packet helpers for binary types
  61275. */
  61276. function encodeArrayBuffer(packet, supportsBinary, callback) {
  61277. if (!supportsBinary) {
  61278. return exports.encodeBase64Packet(packet, callback);
  61279. }
  61280. var data = packet.data;
  61281. var contentArray = new Uint8Array(data);
  61282. var resultBuffer = new Uint8Array(1 + data.byteLength);
  61283. resultBuffer[0] = packets[packet.type];
  61284. for (var i = 0; i < contentArray.length; i++) {
  61285. resultBuffer[i+1] = contentArray[i];
  61286. }
  61287. return callback(resultBuffer.buffer);
  61288. }
  61289. function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {
  61290. if (!supportsBinary) {
  61291. return exports.encodeBase64Packet(packet, callback);
  61292. }
  61293. var fr = new FileReader();
  61294. fr.onload = function() {
  61295. exports.encodePacket({ type: packet.type, data: fr.result }, supportsBinary, true, callback);
  61296. };
  61297. return fr.readAsArrayBuffer(packet.data);
  61298. }
  61299. function encodeBlob(packet, supportsBinary, callback) {
  61300. if (!supportsBinary) {
  61301. return exports.encodeBase64Packet(packet, callback);
  61302. }
  61303. if (dontSendBlobs) {
  61304. return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);
  61305. }
  61306. var length = new Uint8Array(1);
  61307. length[0] = packets[packet.type];
  61308. var blob = new Blob([length.buffer, packet.data]);
  61309. return callback(blob);
  61310. }
  61311. /**
  61312. * Encodes a packet with binary data in a base64 string
  61313. *
  61314. * @param {Object} packet, has `type` and `data`
  61315. * @return {String} base64 encoded message
  61316. */
  61317. exports.encodeBase64Packet = function(packet, callback) {
  61318. var message = 'b' + exports.packets[packet.type];
  61319. if (typeof Blob !== 'undefined' && packet.data instanceof Blob) {
  61320. var fr = new FileReader();
  61321. fr.onload = function() {
  61322. var b64 = fr.result.split(',')[1];
  61323. callback(message + b64);
  61324. };
  61325. return fr.readAsDataURL(packet.data);
  61326. }
  61327. var b64data;
  61328. try {
  61329. b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));
  61330. } catch (e) {
  61331. // iPhone Safari doesn't let you apply with typed arrays
  61332. var typed = new Uint8Array(packet.data);
  61333. var basic = new Array(typed.length);
  61334. for (var i = 0; i < typed.length; i++) {
  61335. basic[i] = typed[i];
  61336. }
  61337. b64data = String.fromCharCode.apply(null, basic);
  61338. }
  61339. message += btoa(b64data);
  61340. return callback(message);
  61341. };
  61342. /**
  61343. * Decodes a packet. Changes format to Blob if requested.
  61344. *
  61345. * @return {Object} with `type` and `data` (if any)
  61346. * @api private
  61347. */
  61348. exports.decodePacket = function (data, binaryType, utf8decode) {
  61349. if (data === undefined) {
  61350. return err;
  61351. }
  61352. // String data
  61353. if (typeof data === 'string') {
  61354. if (data.charAt(0) === 'b') {
  61355. return exports.decodeBase64Packet(data.substr(1), binaryType);
  61356. }
  61357. if (utf8decode) {
  61358. data = tryDecode(data);
  61359. if (data === false) {
  61360. return err;
  61361. }
  61362. }
  61363. var type = data.charAt(0);
  61364. if (Number(type) != type || !packetslist[type]) {
  61365. return err;
  61366. }
  61367. if (data.length > 1) {
  61368. return { type: packetslist[type], data: data.substring(1) };
  61369. } else {
  61370. return { type: packetslist[type] };
  61371. }
  61372. }
  61373. var asArray = new Uint8Array(data);
  61374. var type = asArray[0];
  61375. var rest = sliceBuffer(data, 1);
  61376. if (Blob && binaryType === 'blob') {
  61377. rest = new Blob([rest]);
  61378. }
  61379. return { type: packetslist[type], data: rest };
  61380. };
  61381. function tryDecode(data) {
  61382. try {
  61383. data = utf8.decode(data, { strict: false });
  61384. } catch (e) {
  61385. return false;
  61386. }
  61387. return data;
  61388. }
  61389. /**
  61390. * Decodes a packet encoded in a base64 string
  61391. *
  61392. * @param {String} base64 encoded message
  61393. * @return {Object} with `type` and `data` (if any)
  61394. */
  61395. exports.decodeBase64Packet = function(msg, binaryType) {
  61396. var type = packetslist[msg.charAt(0)];
  61397. if (!base64encoder) {
  61398. return { type: type, data: { base64: true, data: msg.substr(1) } };
  61399. }
  61400. var data = base64encoder.decode(msg.substr(1));
  61401. if (binaryType === 'blob' && Blob) {
  61402. data = new Blob([data]);
  61403. }
  61404. return { type: type, data: data };
  61405. };
  61406. /**
  61407. * Encodes multiple messages (payload).
  61408. *
  61409. * <length>:data
  61410. *
  61411. * Example:
  61412. *
  61413. * 11:hello world2:hi
  61414. *
  61415. * If any contents are binary, they will be encoded as base64 strings. Base64
  61416. * encoded strings are marked with a b before the length specifier
  61417. *
  61418. * @param {Array} packets
  61419. * @api private
  61420. */
  61421. exports.encodePayload = function (packets, supportsBinary, callback) {
  61422. if (typeof supportsBinary === 'function') {
  61423. callback = supportsBinary;
  61424. supportsBinary = null;
  61425. }
  61426. var isBinary = hasBinary(packets);
  61427. if (supportsBinary && isBinary) {
  61428. if (Blob && !dontSendBlobs) {
  61429. return exports.encodePayloadAsBlob(packets, callback);
  61430. }
  61431. return exports.encodePayloadAsArrayBuffer(packets, callback);
  61432. }
  61433. if (!packets.length) {
  61434. return callback('0:');
  61435. }
  61436. function setLengthHeader(message) {
  61437. return message.length + ':' + message;
  61438. }
  61439. function encodeOne(packet, doneCallback) {
  61440. exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {
  61441. doneCallback(null, setLengthHeader(message));
  61442. });
  61443. }
  61444. map(packets, encodeOne, function(err, results) {
  61445. return callback(results.join(''));
  61446. });
  61447. };
  61448. /**
  61449. * Async array map using after
  61450. */
  61451. function map(ary, each, done) {
  61452. var result = new Array(ary.length);
  61453. var next = after(ary.length, done);
  61454. var eachWithIndex = function(i, el, cb) {
  61455. each(el, function(error, msg) {
  61456. result[i] = msg;
  61457. cb(error, result);
  61458. });
  61459. };
  61460. for (var i = 0; i < ary.length; i++) {
  61461. eachWithIndex(i, ary[i], next);
  61462. }
  61463. }
  61464. /*
  61465. * Decodes data when a payload is maybe expected. Possible binary contents are
  61466. * decoded from their base64 representation
  61467. *
  61468. * @param {String} data, callback method
  61469. * @api public
  61470. */
  61471. exports.decodePayload = function (data, binaryType, callback) {
  61472. if (typeof data !== 'string') {
  61473. return exports.decodePayloadAsBinary(data, binaryType, callback);
  61474. }
  61475. if (typeof binaryType === 'function') {
  61476. callback = binaryType;
  61477. binaryType = null;
  61478. }
  61479. var packet;
  61480. if (data === '') {
  61481. // parser error - ignoring payload
  61482. return callback(err, 0, 1);
  61483. }
  61484. var length = '', n, msg;
  61485. for (var i = 0, l = data.length; i < l; i++) {
  61486. var chr = data.charAt(i);
  61487. if (chr !== ':') {
  61488. length += chr;
  61489. continue;
  61490. }
  61491. if (length === '' || (length != (n = Number(length)))) {
  61492. // parser error - ignoring payload
  61493. return callback(err, 0, 1);
  61494. }
  61495. msg = data.substr(i + 1, n);
  61496. if (length != msg.length) {
  61497. // parser error - ignoring payload
  61498. return callback(err, 0, 1);
  61499. }
  61500. if (msg.length) {
  61501. packet = exports.decodePacket(msg, binaryType, false);
  61502. if (err.type === packet.type && err.data === packet.data) {
  61503. // parser error in individual packet - ignoring payload
  61504. return callback(err, 0, 1);
  61505. }
  61506. var ret = callback(packet, i + n, l);
  61507. if (false === ret) return;
  61508. }
  61509. // advance cursor
  61510. i += n;
  61511. length = '';
  61512. }
  61513. if (length !== '') {
  61514. // parser error - ignoring payload
  61515. return callback(err, 0, 1);
  61516. }
  61517. };
  61518. /**
  61519. * Encodes multiple messages (payload) as binary.
  61520. *
  61521. * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number
  61522. * 255><data>
  61523. *
  61524. * Example:
  61525. * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers
  61526. *
  61527. * @param {Array} packets
  61528. * @return {ArrayBuffer} encoded payload
  61529. * @api private
  61530. */
  61531. exports.encodePayloadAsArrayBuffer = function(packets, callback) {
  61532. if (!packets.length) {
  61533. return callback(new ArrayBuffer(0));
  61534. }
  61535. function encodeOne(packet, doneCallback) {
  61536. exports.encodePacket(packet, true, true, function(data) {
  61537. return doneCallback(null, data);
  61538. });
  61539. }
  61540. map(packets, encodeOne, function(err, encodedPackets) {
  61541. var totalLength = encodedPackets.reduce(function(acc, p) {
  61542. var len;
  61543. if (typeof p === 'string'){
  61544. len = p.length;
  61545. } else {
  61546. len = p.byteLength;
  61547. }
  61548. return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2
  61549. }, 0);
  61550. var resultArray = new Uint8Array(totalLength);
  61551. var bufferIndex = 0;
  61552. encodedPackets.forEach(function(p) {
  61553. var isString = typeof p === 'string';
  61554. var ab = p;
  61555. if (isString) {
  61556. var view = new Uint8Array(p.length);
  61557. for (var i = 0; i < p.length; i++) {
  61558. view[i] = p.charCodeAt(i);
  61559. }
  61560. ab = view.buffer;
  61561. }
  61562. if (isString) { // not true binary
  61563. resultArray[bufferIndex++] = 0;
  61564. } else { // true binary
  61565. resultArray[bufferIndex++] = 1;
  61566. }
  61567. var lenStr = ab.byteLength.toString();
  61568. for (var i = 0; i < lenStr.length; i++) {
  61569. resultArray[bufferIndex++] = parseInt(lenStr[i]);
  61570. }
  61571. resultArray[bufferIndex++] = 255;
  61572. var view = new Uint8Array(ab);
  61573. for (var i = 0; i < view.length; i++) {
  61574. resultArray[bufferIndex++] = view[i];
  61575. }
  61576. });
  61577. return callback(resultArray.buffer);
  61578. });
  61579. };
  61580. /**
  61581. * Encode as Blob
  61582. */
  61583. exports.encodePayloadAsBlob = function(packets, callback) {
  61584. function encodeOne(packet, doneCallback) {
  61585. exports.encodePacket(packet, true, true, function(encoded) {
  61586. var binaryIdentifier = new Uint8Array(1);
  61587. binaryIdentifier[0] = 1;
  61588. if (typeof encoded === 'string') {
  61589. var view = new Uint8Array(encoded.length);
  61590. for (var i = 0; i < encoded.length; i++) {
  61591. view[i] = encoded.charCodeAt(i);
  61592. }
  61593. encoded = view.buffer;
  61594. binaryIdentifier[0] = 0;
  61595. }
  61596. var len = (encoded instanceof ArrayBuffer)
  61597. ? encoded.byteLength
  61598. : encoded.size;
  61599. var lenStr = len.toString();
  61600. var lengthAry = new Uint8Array(lenStr.length + 1);
  61601. for (var i = 0; i < lenStr.length; i++) {
  61602. lengthAry[i] = parseInt(lenStr[i]);
  61603. }
  61604. lengthAry[lenStr.length] = 255;
  61605. if (Blob) {
  61606. var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);
  61607. doneCallback(null, blob);
  61608. }
  61609. });
  61610. }
  61611. map(packets, encodeOne, function(err, results) {
  61612. return callback(new Blob(results));
  61613. });
  61614. };
  61615. /*
  61616. * Decodes data when a payload is maybe expected. Strings are decoded by
  61617. * interpreting each byte as a key code for entries marked to start with 0. See
  61618. * description of encodePayloadAsBinary
  61619. *
  61620. * @param {ArrayBuffer} data, callback method
  61621. * @api public
  61622. */
  61623. exports.decodePayloadAsBinary = function (data, binaryType, callback) {
  61624. if (typeof binaryType === 'function') {
  61625. callback = binaryType;
  61626. binaryType = null;
  61627. }
  61628. var bufferTail = data;
  61629. var buffers = [];
  61630. while (bufferTail.byteLength > 0) {
  61631. var tailArray = new Uint8Array(bufferTail);
  61632. var isString = tailArray[0] === 0;
  61633. var msgLength = '';
  61634. for (var i = 1; ; i++) {
  61635. if (tailArray[i] === 255) break;
  61636. // 310 = char length of Number.MAX_VALUE
  61637. if (msgLength.length > 310) {
  61638. return callback(err, 0, 1);
  61639. }
  61640. msgLength += tailArray[i];
  61641. }
  61642. bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);
  61643. msgLength = parseInt(msgLength);
  61644. var msg = sliceBuffer(bufferTail, 0, msgLength);
  61645. if (isString) {
  61646. try {
  61647. msg = String.fromCharCode.apply(null, new Uint8Array(msg));
  61648. } catch (e) {
  61649. // iPhone Safari doesn't let you apply to typed arrays
  61650. var typed = new Uint8Array(msg);
  61651. msg = '';
  61652. for (var i = 0; i < typed.length; i++) {
  61653. msg += String.fromCharCode(typed[i]);
  61654. }
  61655. }
  61656. }
  61657. buffers.push(msg);
  61658. bufferTail = sliceBuffer(bufferTail, msgLength);
  61659. }
  61660. var total = buffers.length;
  61661. buffers.forEach(function(buffer, i) {
  61662. callback(exports.decodePacket(buffer, binaryType, true), i, total);
  61663. });
  61664. };
  61665. /***/ }),
  61666. /***/ "./node_modules/engine.io-parser/lib/keys.js":
  61667. /*!***************************************************!*\
  61668. !*** ./node_modules/engine.io-parser/lib/keys.js ***!
  61669. \***************************************************/
  61670. /*! no static exports found */
  61671. /*! all exports used */
  61672. /***/ (function(module, exports) {
  61673. /**
  61674. * Gets the keys for an object.
  61675. *
  61676. * @return {Array} keys
  61677. * @api private
  61678. */
  61679. module.exports = Object.keys || function keys (obj){
  61680. var arr = [];
  61681. var has = Object.prototype.hasOwnProperty;
  61682. for (var i in obj) {
  61683. if (has.call(obj, i)) {
  61684. arr.push(i);
  61685. }
  61686. }
  61687. return arr;
  61688. };
  61689. /***/ }),
  61690. /***/ "./node_modules/engine.io-parser/lib/utf8.js":
  61691. /*!***************************************************!*\
  61692. !*** ./node_modules/engine.io-parser/lib/utf8.js ***!
  61693. \***************************************************/
  61694. /*! no static exports found */
  61695. /*! all exports used */
  61696. /***/ (function(module, exports) {
  61697. /*! https://mths.be/utf8js v2.1.2 by @mathias */
  61698. var stringFromCharCode = String.fromCharCode;
  61699. // Taken from https://mths.be/punycode
  61700. function ucs2decode(string) {
  61701. var output = [];
  61702. var counter = 0;
  61703. var length = string.length;
  61704. var value;
  61705. var extra;
  61706. while (counter < length) {
  61707. value = string.charCodeAt(counter++);
  61708. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  61709. // high surrogate, and there is a next character
  61710. extra = string.charCodeAt(counter++);
  61711. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  61712. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  61713. } else {
  61714. // unmatched surrogate; only append this code unit, in case the next
  61715. // code unit is the high surrogate of a surrogate pair
  61716. output.push(value);
  61717. counter--;
  61718. }
  61719. } else {
  61720. output.push(value);
  61721. }
  61722. }
  61723. return output;
  61724. }
  61725. // Taken from https://mths.be/punycode
  61726. function ucs2encode(array) {
  61727. var length = array.length;
  61728. var index = -1;
  61729. var value;
  61730. var output = '';
  61731. while (++index < length) {
  61732. value = array[index];
  61733. if (value > 0xFFFF) {
  61734. value -= 0x10000;
  61735. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  61736. value = 0xDC00 | value & 0x3FF;
  61737. }
  61738. output += stringFromCharCode(value);
  61739. }
  61740. return output;
  61741. }
  61742. function checkScalarValue(codePoint, strict) {
  61743. if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
  61744. if (strict) {
  61745. throw Error(
  61746. 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
  61747. ' is not a scalar value'
  61748. );
  61749. }
  61750. return false;
  61751. }
  61752. return true;
  61753. }
  61754. /*--------------------------------------------------------------------------*/
  61755. function createByte(codePoint, shift) {
  61756. return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
  61757. }
  61758. function encodeCodePoint(codePoint, strict) {
  61759. if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence
  61760. return stringFromCharCode(codePoint);
  61761. }
  61762. var symbol = '';
  61763. if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence
  61764. symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
  61765. }
  61766. else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence
  61767. if (!checkScalarValue(codePoint, strict)) {
  61768. codePoint = 0xFFFD;
  61769. }
  61770. symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
  61771. symbol += createByte(codePoint, 6);
  61772. }
  61773. else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence
  61774. symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
  61775. symbol += createByte(codePoint, 12);
  61776. symbol += createByte(codePoint, 6);
  61777. }
  61778. symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
  61779. return symbol;
  61780. }
  61781. function utf8encode(string, opts) {
  61782. opts = opts || {};
  61783. var strict = false !== opts.strict;
  61784. var codePoints = ucs2decode(string);
  61785. var length = codePoints.length;
  61786. var index = -1;
  61787. var codePoint;
  61788. var byteString = '';
  61789. while (++index < length) {
  61790. codePoint = codePoints[index];
  61791. byteString += encodeCodePoint(codePoint, strict);
  61792. }
  61793. return byteString;
  61794. }
  61795. /*--------------------------------------------------------------------------*/
  61796. function readContinuationByte() {
  61797. if (byteIndex >= byteCount) {
  61798. throw Error('Invalid byte index');
  61799. }
  61800. var continuationByte = byteArray[byteIndex] & 0xFF;
  61801. byteIndex++;
  61802. if ((continuationByte & 0xC0) == 0x80) {
  61803. return continuationByte & 0x3F;
  61804. }
  61805. // If we end up here, it’s not a continuation byte
  61806. throw Error('Invalid continuation byte');
  61807. }
  61808. function decodeSymbol(strict) {
  61809. var byte1;
  61810. var byte2;
  61811. var byte3;
  61812. var byte4;
  61813. var codePoint;
  61814. if (byteIndex > byteCount) {
  61815. throw Error('Invalid byte index');
  61816. }
  61817. if (byteIndex == byteCount) {
  61818. return false;
  61819. }
  61820. // Read first byte
  61821. byte1 = byteArray[byteIndex] & 0xFF;
  61822. byteIndex++;
  61823. // 1-byte sequence (no continuation bytes)
  61824. if ((byte1 & 0x80) == 0) {
  61825. return byte1;
  61826. }
  61827. // 2-byte sequence
  61828. if ((byte1 & 0xE0) == 0xC0) {
  61829. byte2 = readContinuationByte();
  61830. codePoint = ((byte1 & 0x1F) << 6) | byte2;
  61831. if (codePoint >= 0x80) {
  61832. return codePoint;
  61833. } else {
  61834. throw Error('Invalid continuation byte');
  61835. }
  61836. }
  61837. // 3-byte sequence (may include unpaired surrogates)
  61838. if ((byte1 & 0xF0) == 0xE0) {
  61839. byte2 = readContinuationByte();
  61840. byte3 = readContinuationByte();
  61841. codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;
  61842. if (codePoint >= 0x0800) {
  61843. return checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;
  61844. } else {
  61845. throw Error('Invalid continuation byte');
  61846. }
  61847. }
  61848. // 4-byte sequence
  61849. if ((byte1 & 0xF8) == 0xF0) {
  61850. byte2 = readContinuationByte();
  61851. byte3 = readContinuationByte();
  61852. byte4 = readContinuationByte();
  61853. codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |
  61854. (byte3 << 0x06) | byte4;
  61855. if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {
  61856. return codePoint;
  61857. }
  61858. }
  61859. throw Error('Invalid UTF-8 detected');
  61860. }
  61861. var byteArray;
  61862. var byteCount;
  61863. var byteIndex;
  61864. function utf8decode(byteString, opts) {
  61865. opts = opts || {};
  61866. var strict = false !== opts.strict;
  61867. byteArray = ucs2decode(byteString);
  61868. byteCount = byteArray.length;
  61869. byteIndex = 0;
  61870. var codePoints = [];
  61871. var tmp;
  61872. while ((tmp = decodeSymbol(strict)) !== false) {
  61873. codePoints.push(tmp);
  61874. }
  61875. return ucs2encode(codePoints);
  61876. }
  61877. module.exports = {
  61878. version: '2.1.2',
  61879. encode: utf8encode,
  61880. decode: utf8decode
  61881. };
  61882. /***/ }),
  61883. /***/ "./node_modules/has-binary2/index.js":
  61884. /*!*******************************************!*\
  61885. !*** ./node_modules/has-binary2/index.js ***!
  61886. \*******************************************/
  61887. /*! no static exports found */
  61888. /*! all exports used */
  61889. /***/ (function(module, exports, __webpack_require__) {
  61890. /* WEBPACK VAR INJECTION */(function(Buffer) {/* global Blob File */
  61891. /*
  61892. * Module requirements.
  61893. */
  61894. var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js");
  61895. var toString = Object.prototype.toString;
  61896. var withNativeBlob = typeof Blob === 'function' ||
  61897. typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]';
  61898. var withNativeFile = typeof File === 'function' ||
  61899. typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]';
  61900. /**
  61901. * Module exports.
  61902. */
  61903. module.exports = hasBinary;
  61904. /**
  61905. * Checks for binary data.
  61906. *
  61907. * Supports Buffer, ArrayBuffer, Blob and File.
  61908. *
  61909. * @param {Object} anything
  61910. * @api public
  61911. */
  61912. function hasBinary (obj) {
  61913. if (!obj || typeof obj !== 'object') {
  61914. return false;
  61915. }
  61916. if (isArray(obj)) {
  61917. for (var i = 0, l = obj.length; i < l; i++) {
  61918. if (hasBinary(obj[i])) {
  61919. return true;
  61920. }
  61921. }
  61922. return false;
  61923. }
  61924. if ((typeof Buffer === 'function' && Buffer.isBuffer && Buffer.isBuffer(obj)) ||
  61925. (typeof ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||
  61926. (withNativeBlob && obj instanceof Blob) ||
  61927. (withNativeFile && obj instanceof File)
  61928. ) {
  61929. return true;
  61930. }
  61931. // see: https://github.com/Automattic/has-binary/pull/4
  61932. if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {
  61933. return hasBinary(obj.toJSON(), true);
  61934. }
  61935. for (var key in obj) {
  61936. if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
  61937. return true;
  61938. }
  61939. }
  61940. return false;
  61941. }
  61942. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  61943. /***/ }),
  61944. /***/ "./node_modules/has-cors/index.js":
  61945. /*!****************************************!*\
  61946. !*** ./node_modules/has-cors/index.js ***!
  61947. \****************************************/
  61948. /*! no static exports found */
  61949. /*! all exports used */
  61950. /***/ (function(module, exports) {
  61951. /**
  61952. * Module exports.
  61953. *
  61954. * Logic borrowed from Modernizr:
  61955. *
  61956. * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
  61957. */
  61958. try {
  61959. module.exports = typeof XMLHttpRequest !== 'undefined' &&
  61960. 'withCredentials' in new XMLHttpRequest();
  61961. } catch (err) {
  61962. // if XMLHttp support is disabled in IE then it will throw
  61963. // when trying to create
  61964. module.exports = false;
  61965. }
  61966. /***/ }),
  61967. /***/ "./node_modules/ieee754/index.js":
  61968. /*!***************************************!*\
  61969. !*** ./node_modules/ieee754/index.js ***!
  61970. \***************************************/
  61971. /*! no static exports found */
  61972. /*! all exports used */
  61973. /***/ (function(module, exports) {
  61974. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  61975. var e, m
  61976. var eLen = (nBytes * 8) - mLen - 1
  61977. var eMax = (1 << eLen) - 1
  61978. var eBias = eMax >> 1
  61979. var nBits = -7
  61980. var i = isLE ? (nBytes - 1) : 0
  61981. var d = isLE ? -1 : 1
  61982. var s = buffer[offset + i]
  61983. i += d
  61984. e = s & ((1 << (-nBits)) - 1)
  61985. s >>= (-nBits)
  61986. nBits += eLen
  61987. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  61988. m = e & ((1 << (-nBits)) - 1)
  61989. e >>= (-nBits)
  61990. nBits += mLen
  61991. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  61992. if (e === 0) {
  61993. e = 1 - eBias
  61994. } else if (e === eMax) {
  61995. return m ? NaN : ((s ? -1 : 1) * Infinity)
  61996. } else {
  61997. m = m + Math.pow(2, mLen)
  61998. e = e - eBias
  61999. }
  62000. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  62001. }
  62002. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  62003. var e, m, c
  62004. var eLen = (nBytes * 8) - mLen - 1
  62005. var eMax = (1 << eLen) - 1
  62006. var eBias = eMax >> 1
  62007. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  62008. var i = isLE ? 0 : (nBytes - 1)
  62009. var d = isLE ? 1 : -1
  62010. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  62011. value = Math.abs(value)
  62012. if (isNaN(value) || value === Infinity) {
  62013. m = isNaN(value) ? 1 : 0
  62014. e = eMax
  62015. } else {
  62016. e = Math.floor(Math.log(value) / Math.LN2)
  62017. if (value * (c = Math.pow(2, -e)) < 1) {
  62018. e--
  62019. c *= 2
  62020. }
  62021. if (e + eBias >= 1) {
  62022. value += rt / c
  62023. } else {
  62024. value += rt * Math.pow(2, 1 - eBias)
  62025. }
  62026. if (value * c >= 2) {
  62027. e++
  62028. c /= 2
  62029. }
  62030. if (e + eBias >= eMax) {
  62031. m = 0
  62032. e = eMax
  62033. } else if (e + eBias >= 1) {
  62034. m = ((value * c) - 1) * Math.pow(2, mLen)
  62035. e = e + eBias
  62036. } else {
  62037. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  62038. e = 0
  62039. }
  62040. }
  62041. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  62042. e = (e << mLen) | m
  62043. eLen += mLen
  62044. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  62045. buffer[offset + i - d] |= s * 128
  62046. }
  62047. /***/ }),
  62048. /***/ "./node_modules/indexof/index.js":
  62049. /*!***************************************!*\
  62050. !*** ./node_modules/indexof/index.js ***!
  62051. \***************************************/
  62052. /*! no static exports found */
  62053. /*! all exports used */
  62054. /***/ (function(module, exports) {
  62055. var indexOf = [].indexOf;
  62056. module.exports = function(arr, obj){
  62057. if (indexOf) return arr.indexOf(obj);
  62058. for (var i = 0; i < arr.length; ++i) {
  62059. if (arr[i] === obj) return i;
  62060. }
  62061. return -1;
  62062. };
  62063. /***/ }),
  62064. /***/ "./node_modules/isarray/index.js":
  62065. /*!***************************************!*\
  62066. !*** ./node_modules/isarray/index.js ***!
  62067. \***************************************/
  62068. /*! no static exports found */
  62069. /*! all exports used */
  62070. /***/ (function(module, exports) {
  62071. var toString = {}.toString;
  62072. module.exports = Array.isArray || function (arr) {
  62073. return toString.call(arr) == '[object Array]';
  62074. };
  62075. /***/ }),
  62076. /***/ "./node_modules/jquery/dist/jquery.js":
  62077. /*!********************************************!*\
  62078. !*** ./node_modules/jquery/dist/jquery.js ***!
  62079. \********************************************/
  62080. /*! no static exports found */
  62081. /*! exports used: default */
  62082. /***/ (function(module, exports, __webpack_require__) {
  62083. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  62084. * jQuery JavaScript Library v3.5.1
  62085. * https://jquery.com/
  62086. *
  62087. * Includes Sizzle.js
  62088. * https://sizzlejs.com/
  62089. *
  62090. * Copyright JS Foundation and other contributors
  62091. * Released under the MIT license
  62092. * https://jquery.org/license
  62093. *
  62094. * Date: 2020-05-04T22:49Z
  62095. */
  62096. ( function( global, factory ) {
  62097. "use strict";
  62098. if ( true && typeof module.exports === "object" ) {
  62099. // For CommonJS and CommonJS-like environments where a proper `window`
  62100. // is present, execute the factory and get jQuery.
  62101. // For environments that do not have a `window` with a `document`
  62102. // (such as Node.js), expose a factory as module.exports.
  62103. // This accentuates the need for the creation of a real `window`.
  62104. // e.g. var jQuery = require("jquery")(window);
  62105. // See ticket #14549 for more info.
  62106. module.exports = global.document ?
  62107. factory( global, true ) :
  62108. function( w ) {
  62109. if ( !w.document ) {
  62110. throw new Error( "jQuery requires a window with a document" );
  62111. }
  62112. return factory( w );
  62113. };
  62114. } else {
  62115. factory( global );
  62116. }
  62117. // Pass this if window is not defined yet
  62118. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  62119. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  62120. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  62121. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  62122. // enough that all such attempts are guarded in a try block.
  62123. "use strict";
  62124. var arr = [];
  62125. var getProto = Object.getPrototypeOf;
  62126. var slice = arr.slice;
  62127. var flat = arr.flat ? function( array ) {
  62128. return arr.flat.call( array );
  62129. } : function( array ) {
  62130. return arr.concat.apply( [], array );
  62131. };
  62132. var push = arr.push;
  62133. var indexOf = arr.indexOf;
  62134. var class2type = {};
  62135. var toString = class2type.toString;
  62136. var hasOwn = class2type.hasOwnProperty;
  62137. var fnToString = hasOwn.toString;
  62138. var ObjectFunctionString = fnToString.call( Object );
  62139. var support = {};
  62140. var isFunction = function isFunction( obj ) {
  62141. // Support: Chrome <=57, Firefox <=52
  62142. // In some browsers, typeof returns "function" for HTML <object> elements
  62143. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  62144. // We don't want to classify *any* DOM node as a function.
  62145. return typeof obj === "function" && typeof obj.nodeType !== "number";
  62146. };
  62147. var isWindow = function isWindow( obj ) {
  62148. return obj != null && obj === obj.window;
  62149. };
  62150. var document = window.document;
  62151. var preservedScriptAttributes = {
  62152. type: true,
  62153. src: true,
  62154. nonce: true,
  62155. noModule: true
  62156. };
  62157. function DOMEval( code, node, doc ) {
  62158. doc = doc || document;
  62159. var i, val,
  62160. script = doc.createElement( "script" );
  62161. script.text = code;
  62162. if ( node ) {
  62163. for ( i in preservedScriptAttributes ) {
  62164. // Support: Firefox 64+, Edge 18+
  62165. // Some browsers don't support the "nonce" property on scripts.
  62166. // On the other hand, just using `getAttribute` is not enough as
  62167. // the `nonce` attribute is reset to an empty string whenever it
  62168. // becomes browsing-context connected.
  62169. // See https://github.com/whatwg/html/issues/2369
  62170. // See https://html.spec.whatwg.org/#nonce-attributes
  62171. // The `node.getAttribute` check was added for the sake of
  62172. // `jQuery.globalEval` so that it can fake a nonce-containing node
  62173. // via an object.
  62174. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  62175. if ( val ) {
  62176. script.setAttribute( i, val );
  62177. }
  62178. }
  62179. }
  62180. doc.head.appendChild( script ).parentNode.removeChild( script );
  62181. }
  62182. function toType( obj ) {
  62183. if ( obj == null ) {
  62184. return obj + "";
  62185. }
  62186. // Support: Android <=2.3 only (functionish RegExp)
  62187. return typeof obj === "object" || typeof obj === "function" ?
  62188. class2type[ toString.call( obj ) ] || "object" :
  62189. typeof obj;
  62190. }
  62191. /* global Symbol */
  62192. // Defining this global in .eslintrc.json would create a danger of using the global
  62193. // unguarded in another place, it seems safer to define global only for this module
  62194. var
  62195. version = "3.5.1",
  62196. // Define a local copy of jQuery
  62197. jQuery = function( selector, context ) {
  62198. // The jQuery object is actually just the init constructor 'enhanced'
  62199. // Need init if jQuery is called (just allow error to be thrown if not included)
  62200. return new jQuery.fn.init( selector, context );
  62201. };
  62202. jQuery.fn = jQuery.prototype = {
  62203. // The current version of jQuery being used
  62204. jquery: version,
  62205. constructor: jQuery,
  62206. // The default length of a jQuery object is 0
  62207. length: 0,
  62208. toArray: function() {
  62209. return slice.call( this );
  62210. },
  62211. // Get the Nth element in the matched element set OR
  62212. // Get the whole matched element set as a clean array
  62213. get: function( num ) {
  62214. // Return all the elements in a clean array
  62215. if ( num == null ) {
  62216. return slice.call( this );
  62217. }
  62218. // Return just the one element from the set
  62219. return num < 0 ? this[ num + this.length ] : this[ num ];
  62220. },
  62221. // Take an array of elements and push it onto the stack
  62222. // (returning the new matched element set)
  62223. pushStack: function( elems ) {
  62224. // Build a new jQuery matched element set
  62225. var ret = jQuery.merge( this.constructor(), elems );
  62226. // Add the old object onto the stack (as a reference)
  62227. ret.prevObject = this;
  62228. // Return the newly-formed element set
  62229. return ret;
  62230. },
  62231. // Execute a callback for every element in the matched set.
  62232. each: function( callback ) {
  62233. return jQuery.each( this, callback );
  62234. },
  62235. map: function( callback ) {
  62236. return this.pushStack( jQuery.map( this, function( elem, i ) {
  62237. return callback.call( elem, i, elem );
  62238. } ) );
  62239. },
  62240. slice: function() {
  62241. return this.pushStack( slice.apply( this, arguments ) );
  62242. },
  62243. first: function() {
  62244. return this.eq( 0 );
  62245. },
  62246. last: function() {
  62247. return this.eq( -1 );
  62248. },
  62249. even: function() {
  62250. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  62251. return ( i + 1 ) % 2;
  62252. } ) );
  62253. },
  62254. odd: function() {
  62255. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  62256. return i % 2;
  62257. } ) );
  62258. },
  62259. eq: function( i ) {
  62260. var len = this.length,
  62261. j = +i + ( i < 0 ? len : 0 );
  62262. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  62263. },
  62264. end: function() {
  62265. return this.prevObject || this.constructor();
  62266. },
  62267. // For internal use only.
  62268. // Behaves like an Array's method, not like a jQuery method.
  62269. push: push,
  62270. sort: arr.sort,
  62271. splice: arr.splice
  62272. };
  62273. jQuery.extend = jQuery.fn.extend = function() {
  62274. var options, name, src, copy, copyIsArray, clone,
  62275. target = arguments[ 0 ] || {},
  62276. i = 1,
  62277. length = arguments.length,
  62278. deep = false;
  62279. // Handle a deep copy situation
  62280. if ( typeof target === "boolean" ) {
  62281. deep = target;
  62282. // Skip the boolean and the target
  62283. target = arguments[ i ] || {};
  62284. i++;
  62285. }
  62286. // Handle case when target is a string or something (possible in deep copy)
  62287. if ( typeof target !== "object" && !isFunction( target ) ) {
  62288. target = {};
  62289. }
  62290. // Extend jQuery itself if only one argument is passed
  62291. if ( i === length ) {
  62292. target = this;
  62293. i--;
  62294. }
  62295. for ( ; i < length; i++ ) {
  62296. // Only deal with non-null/undefined values
  62297. if ( ( options = arguments[ i ] ) != null ) {
  62298. // Extend the base object
  62299. for ( name in options ) {
  62300. copy = options[ name ];
  62301. // Prevent Object.prototype pollution
  62302. // Prevent never-ending loop
  62303. if ( name === "__proto__" || target === copy ) {
  62304. continue;
  62305. }
  62306. // Recurse if we're merging plain objects or arrays
  62307. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  62308. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  62309. src = target[ name ];
  62310. // Ensure proper type for the source value
  62311. if ( copyIsArray && !Array.isArray( src ) ) {
  62312. clone = [];
  62313. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  62314. clone = {};
  62315. } else {
  62316. clone = src;
  62317. }
  62318. copyIsArray = false;
  62319. // Never move original objects, clone them
  62320. target[ name ] = jQuery.extend( deep, clone, copy );
  62321. // Don't bring in undefined values
  62322. } else if ( copy !== undefined ) {
  62323. target[ name ] = copy;
  62324. }
  62325. }
  62326. }
  62327. }
  62328. // Return the modified object
  62329. return target;
  62330. };
  62331. jQuery.extend( {
  62332. // Unique for each copy of jQuery on the page
  62333. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  62334. // Assume jQuery is ready without the ready module
  62335. isReady: true,
  62336. error: function( msg ) {
  62337. throw new Error( msg );
  62338. },
  62339. noop: function() {},
  62340. isPlainObject: function( obj ) {
  62341. var proto, Ctor;
  62342. // Detect obvious negatives
  62343. // Use toString instead of jQuery.type to catch host objects
  62344. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  62345. return false;
  62346. }
  62347. proto = getProto( obj );
  62348. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  62349. if ( !proto ) {
  62350. return true;
  62351. }
  62352. // Objects with prototype are plain iff they were constructed by a global Object function
  62353. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  62354. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  62355. },
  62356. isEmptyObject: function( obj ) {
  62357. var name;
  62358. for ( name in obj ) {
  62359. return false;
  62360. }
  62361. return true;
  62362. },
  62363. // Evaluates a script in a provided context; falls back to the global one
  62364. // if not specified.
  62365. globalEval: function( code, options, doc ) {
  62366. DOMEval( code, { nonce: options && options.nonce }, doc );
  62367. },
  62368. each: function( obj, callback ) {
  62369. var length, i = 0;
  62370. if ( isArrayLike( obj ) ) {
  62371. length = obj.length;
  62372. for ( ; i < length; i++ ) {
  62373. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  62374. break;
  62375. }
  62376. }
  62377. } else {
  62378. for ( i in obj ) {
  62379. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  62380. break;
  62381. }
  62382. }
  62383. }
  62384. return obj;
  62385. },
  62386. // results is for internal usage only
  62387. makeArray: function( arr, results ) {
  62388. var ret = results || [];
  62389. if ( arr != null ) {
  62390. if ( isArrayLike( Object( arr ) ) ) {
  62391. jQuery.merge( ret,
  62392. typeof arr === "string" ?
  62393. [ arr ] : arr
  62394. );
  62395. } else {
  62396. push.call( ret, arr );
  62397. }
  62398. }
  62399. return ret;
  62400. },
  62401. inArray: function( elem, arr, i ) {
  62402. return arr == null ? -1 : indexOf.call( arr, elem, i );
  62403. },
  62404. // Support: Android <=4.0 only, PhantomJS 1 only
  62405. // push.apply(_, arraylike) throws on ancient WebKit
  62406. merge: function( first, second ) {
  62407. var len = +second.length,
  62408. j = 0,
  62409. i = first.length;
  62410. for ( ; j < len; j++ ) {
  62411. first[ i++ ] = second[ j ];
  62412. }
  62413. first.length = i;
  62414. return first;
  62415. },
  62416. grep: function( elems, callback, invert ) {
  62417. var callbackInverse,
  62418. matches = [],
  62419. i = 0,
  62420. length = elems.length,
  62421. callbackExpect = !invert;
  62422. // Go through the array, only saving the items
  62423. // that pass the validator function
  62424. for ( ; i < length; i++ ) {
  62425. callbackInverse = !callback( elems[ i ], i );
  62426. if ( callbackInverse !== callbackExpect ) {
  62427. matches.push( elems[ i ] );
  62428. }
  62429. }
  62430. return matches;
  62431. },
  62432. // arg is for internal usage only
  62433. map: function( elems, callback, arg ) {
  62434. var length, value,
  62435. i = 0,
  62436. ret = [];
  62437. // Go through the array, translating each of the items to their new values
  62438. if ( isArrayLike( elems ) ) {
  62439. length = elems.length;
  62440. for ( ; i < length; i++ ) {
  62441. value = callback( elems[ i ], i, arg );
  62442. if ( value != null ) {
  62443. ret.push( value );
  62444. }
  62445. }
  62446. // Go through every key on the object,
  62447. } else {
  62448. for ( i in elems ) {
  62449. value = callback( elems[ i ], i, arg );
  62450. if ( value != null ) {
  62451. ret.push( value );
  62452. }
  62453. }
  62454. }
  62455. // Flatten any nested arrays
  62456. return flat( ret );
  62457. },
  62458. // A global GUID counter for objects
  62459. guid: 1,
  62460. // jQuery.support is not used in Core but other projects attach their
  62461. // properties to it so it needs to exist.
  62462. support: support
  62463. } );
  62464. if ( typeof Symbol === "function" ) {
  62465. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  62466. }
  62467. // Populate the class2type map
  62468. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  62469. function( _i, name ) {
  62470. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  62471. } );
  62472. function isArrayLike( obj ) {
  62473. // Support: real iOS 8.2 only (not reproducible in simulator)
  62474. // `in` check used to prevent JIT error (gh-2145)
  62475. // hasOwn isn't used here due to false negatives
  62476. // regarding Nodelist length in IE
  62477. var length = !!obj && "length" in obj && obj.length,
  62478. type = toType( obj );
  62479. if ( isFunction( obj ) || isWindow( obj ) ) {
  62480. return false;
  62481. }
  62482. return type === "array" || length === 0 ||
  62483. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  62484. }
  62485. var Sizzle =
  62486. /*!
  62487. * Sizzle CSS Selector Engine v2.3.5
  62488. * https://sizzlejs.com/
  62489. *
  62490. * Copyright JS Foundation and other contributors
  62491. * Released under the MIT license
  62492. * https://js.foundation/
  62493. *
  62494. * Date: 2020-03-14
  62495. */
  62496. ( function( window ) {
  62497. var i,
  62498. support,
  62499. Expr,
  62500. getText,
  62501. isXML,
  62502. tokenize,
  62503. compile,
  62504. select,
  62505. outermostContext,
  62506. sortInput,
  62507. hasDuplicate,
  62508. // Local document vars
  62509. setDocument,
  62510. document,
  62511. docElem,
  62512. documentIsHTML,
  62513. rbuggyQSA,
  62514. rbuggyMatches,
  62515. matches,
  62516. contains,
  62517. // Instance-specific data
  62518. expando = "sizzle" + 1 * new Date(),
  62519. preferredDoc = window.document,
  62520. dirruns = 0,
  62521. done = 0,
  62522. classCache = createCache(),
  62523. tokenCache = createCache(),
  62524. compilerCache = createCache(),
  62525. nonnativeSelectorCache = createCache(),
  62526. sortOrder = function( a, b ) {
  62527. if ( a === b ) {
  62528. hasDuplicate = true;
  62529. }
  62530. return 0;
  62531. },
  62532. // Instance methods
  62533. hasOwn = ( {} ).hasOwnProperty,
  62534. arr = [],
  62535. pop = arr.pop,
  62536. pushNative = arr.push,
  62537. push = arr.push,
  62538. slice = arr.slice,
  62539. // Use a stripped-down indexOf as it's faster than native
  62540. // https://jsperf.com/thor-indexof-vs-for/5
  62541. indexOf = function( list, elem ) {
  62542. var i = 0,
  62543. len = list.length;
  62544. for ( ; i < len; i++ ) {
  62545. if ( list[ i ] === elem ) {
  62546. return i;
  62547. }
  62548. }
  62549. return -1;
  62550. },
  62551. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
  62552. "ismap|loop|multiple|open|readonly|required|scoped",
  62553. // Regular expressions
  62554. // http://www.w3.org/TR/css3-selectors/#whitespace
  62555. whitespace = "[\\x20\\t\\r\\n\\f]",
  62556. // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  62557. identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  62558. "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  62559. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  62560. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  62561. // Operator (capture 2)
  62562. "*([*^$|!~]?=)" + whitespace +
  62563. // "Attribute values must be CSS identifiers [capture 5]
  62564. // or strings [capture 3 or capture 4]"
  62565. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  62566. whitespace + "*\\]",
  62567. pseudos = ":(" + identifier + ")(?:\\((" +
  62568. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  62569. // 1. quoted (capture 3; capture 4 or capture 5)
  62570. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  62571. // 2. simple (capture 6)
  62572. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  62573. // 3. anything else (capture 2)
  62574. ".*" +
  62575. ")\\)|)",
  62576. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  62577. rwhitespace = new RegExp( whitespace + "+", "g" ),
  62578. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
  62579. whitespace + "+$", "g" ),
  62580. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  62581. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
  62582. "*" ),
  62583. rdescend = new RegExp( whitespace + "|>" ),
  62584. rpseudo = new RegExp( pseudos ),
  62585. ridentifier = new RegExp( "^" + identifier + "$" ),
  62586. matchExpr = {
  62587. "ID": new RegExp( "^#(" + identifier + ")" ),
  62588. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  62589. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  62590. "ATTR": new RegExp( "^" + attributes ),
  62591. "PSEUDO": new RegExp( "^" + pseudos ),
  62592. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  62593. whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  62594. whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  62595. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  62596. // For use in libraries implementing .is()
  62597. // We use this for POS matching in `select`
  62598. "needsContext": new RegExp( "^" + whitespace +
  62599. "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  62600. "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  62601. },
  62602. rhtml = /HTML$/i,
  62603. rinputs = /^(?:input|select|textarea|button)$/i,
  62604. rheader = /^h\d$/i,
  62605. rnative = /^[^{]+\{\s*\[native \w/,
  62606. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  62607. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  62608. rsibling = /[+~]/,
  62609. // CSS escapes
  62610. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  62611. runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
  62612. funescape = function( escape, nonHex ) {
  62613. var high = "0x" + escape.slice( 1 ) - 0x10000;
  62614. return nonHex ?
  62615. // Strip the backslash prefix from a non-hex escape sequence
  62616. nonHex :
  62617. // Replace a hexadecimal escape sequence with the encoded Unicode code point
  62618. // Support: IE <=11+
  62619. // For values outside the Basic Multilingual Plane (BMP), manually construct a
  62620. // surrogate pair
  62621. high < 0 ?
  62622. String.fromCharCode( high + 0x10000 ) :
  62623. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  62624. },
  62625. // CSS string/identifier serialization
  62626. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  62627. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  62628. fcssescape = function( ch, asCodePoint ) {
  62629. if ( asCodePoint ) {
  62630. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  62631. if ( ch === "\0" ) {
  62632. return "\uFFFD";
  62633. }
  62634. // Control characters and (dependent upon position) numbers get escaped as code points
  62635. return ch.slice( 0, -1 ) + "\\" +
  62636. ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  62637. }
  62638. // Other potentially-special ASCII characters get backslash-escaped
  62639. return "\\" + ch;
  62640. },
  62641. // Used for iframes
  62642. // See setDocument()
  62643. // Removing the function wrapper causes a "Permission Denied"
  62644. // error in IE
  62645. unloadHandler = function() {
  62646. setDocument();
  62647. },
  62648. inDisabledFieldset = addCombinator(
  62649. function( elem ) {
  62650. return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  62651. },
  62652. { dir: "parentNode", next: "legend" }
  62653. );
  62654. // Optimize for push.apply( _, NodeList )
  62655. try {
  62656. push.apply(
  62657. ( arr = slice.call( preferredDoc.childNodes ) ),
  62658. preferredDoc.childNodes
  62659. );
  62660. // Support: Android<4.0
  62661. // Detect silently failing push.apply
  62662. // eslint-disable-next-line no-unused-expressions
  62663. arr[ preferredDoc.childNodes.length ].nodeType;
  62664. } catch ( e ) {
  62665. push = { apply: arr.length ?
  62666. // Leverage slice if possible
  62667. function( target, els ) {
  62668. pushNative.apply( target, slice.call( els ) );
  62669. } :
  62670. // Support: IE<9
  62671. // Otherwise append directly
  62672. function( target, els ) {
  62673. var j = target.length,
  62674. i = 0;
  62675. // Can't trust NodeList.length
  62676. while ( ( target[ j++ ] = els[ i++ ] ) ) {}
  62677. target.length = j - 1;
  62678. }
  62679. };
  62680. }
  62681. function Sizzle( selector, context, results, seed ) {
  62682. var m, i, elem, nid, match, groups, newSelector,
  62683. newContext = context && context.ownerDocument,
  62684. // nodeType defaults to 9, since context defaults to document
  62685. nodeType = context ? context.nodeType : 9;
  62686. results = results || [];
  62687. // Return early from calls with invalid selector or context
  62688. if ( typeof selector !== "string" || !selector ||
  62689. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  62690. return results;
  62691. }
  62692. // Try to shortcut find operations (as opposed to filters) in HTML documents
  62693. if ( !seed ) {
  62694. setDocument( context );
  62695. context = context || document;
  62696. if ( documentIsHTML ) {
  62697. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  62698. // (excepting DocumentFragment context, where the methods don't exist)
  62699. if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  62700. // ID selector
  62701. if ( ( m = match[ 1 ] ) ) {
  62702. // Document context
  62703. if ( nodeType === 9 ) {
  62704. if ( ( elem = context.getElementById( m ) ) ) {
  62705. // Support: IE, Opera, Webkit
  62706. // TODO: identify versions
  62707. // getElementById can match elements by name instead of ID
  62708. if ( elem.id === m ) {
  62709. results.push( elem );
  62710. return results;
  62711. }
  62712. } else {
  62713. return results;
  62714. }
  62715. // Element context
  62716. } else {
  62717. // Support: IE, Opera, Webkit
  62718. // TODO: identify versions
  62719. // getElementById can match elements by name instead of ID
  62720. if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  62721. contains( context, elem ) &&
  62722. elem.id === m ) {
  62723. results.push( elem );
  62724. return results;
  62725. }
  62726. }
  62727. // Type selector
  62728. } else if ( match[ 2 ] ) {
  62729. push.apply( results, context.getElementsByTagName( selector ) );
  62730. return results;
  62731. // Class selector
  62732. } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
  62733. context.getElementsByClassName ) {
  62734. push.apply( results, context.getElementsByClassName( m ) );
  62735. return results;
  62736. }
  62737. }
  62738. // Take advantage of querySelectorAll
  62739. if ( support.qsa &&
  62740. !nonnativeSelectorCache[ selector + " " ] &&
  62741. ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
  62742. // Support: IE 8 only
  62743. // Exclude object elements
  62744. ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
  62745. newSelector = selector;
  62746. newContext = context;
  62747. // qSA considers elements outside a scoping root when evaluating child or
  62748. // descendant combinators, which is not what we want.
  62749. // In such cases, we work around the behavior by prefixing every selector in the
  62750. // list with an ID selector referencing the scope context.
  62751. // The technique has to be used as well when a leading combinator is used
  62752. // as such selectors are not recognized by querySelectorAll.
  62753. // Thanks to Andrew Dupont for this technique.
  62754. if ( nodeType === 1 &&
  62755. ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
  62756. // Expand context for sibling selectors
  62757. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  62758. context;
  62759. // We can use :scope instead of the ID hack if the browser
  62760. // supports it & if we're not changing the context.
  62761. if ( newContext !== context || !support.scope ) {
  62762. // Capture the context ID, setting it first if necessary
  62763. if ( ( nid = context.getAttribute( "id" ) ) ) {
  62764. nid = nid.replace( rcssescape, fcssescape );
  62765. } else {
  62766. context.setAttribute( "id", ( nid = expando ) );
  62767. }
  62768. }
  62769. // Prefix every selector in the list
  62770. groups = tokenize( selector );
  62771. i = groups.length;
  62772. while ( i-- ) {
  62773. groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  62774. toSelector( groups[ i ] );
  62775. }
  62776. newSelector = groups.join( "," );
  62777. }
  62778. try {
  62779. push.apply( results,
  62780. newContext.querySelectorAll( newSelector )
  62781. );
  62782. return results;
  62783. } catch ( qsaError ) {
  62784. nonnativeSelectorCache( selector, true );
  62785. } finally {
  62786. if ( nid === expando ) {
  62787. context.removeAttribute( "id" );
  62788. }
  62789. }
  62790. }
  62791. }
  62792. }
  62793. // All others
  62794. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  62795. }
  62796. /**
  62797. * Create key-value caches of limited size
  62798. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  62799. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  62800. * deleting the oldest entry
  62801. */
  62802. function createCache() {
  62803. var keys = [];
  62804. function cache( key, value ) {
  62805. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  62806. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  62807. // Only keep the most recent entries
  62808. delete cache[ keys.shift() ];
  62809. }
  62810. return ( cache[ key + " " ] = value );
  62811. }
  62812. return cache;
  62813. }
  62814. /**
  62815. * Mark a function for special use by Sizzle
  62816. * @param {Function} fn The function to mark
  62817. */
  62818. function markFunction( fn ) {
  62819. fn[ expando ] = true;
  62820. return fn;
  62821. }
  62822. /**
  62823. * Support testing using an element
  62824. * @param {Function} fn Passed the created element and returns a boolean result
  62825. */
  62826. function assert( fn ) {
  62827. var el = document.createElement( "fieldset" );
  62828. try {
  62829. return !!fn( el );
  62830. } catch ( e ) {
  62831. return false;
  62832. } finally {
  62833. // Remove from its parent by default
  62834. if ( el.parentNode ) {
  62835. el.parentNode.removeChild( el );
  62836. }
  62837. // release memory in IE
  62838. el = null;
  62839. }
  62840. }
  62841. /**
  62842. * Adds the same handler for all of the specified attrs
  62843. * @param {String} attrs Pipe-separated list of attributes
  62844. * @param {Function} handler The method that will be applied
  62845. */
  62846. function addHandle( attrs, handler ) {
  62847. var arr = attrs.split( "|" ),
  62848. i = arr.length;
  62849. while ( i-- ) {
  62850. Expr.attrHandle[ arr[ i ] ] = handler;
  62851. }
  62852. }
  62853. /**
  62854. * Checks document order of two siblings
  62855. * @param {Element} a
  62856. * @param {Element} b
  62857. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  62858. */
  62859. function siblingCheck( a, b ) {
  62860. var cur = b && a,
  62861. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  62862. a.sourceIndex - b.sourceIndex;
  62863. // Use IE sourceIndex if available on both nodes
  62864. if ( diff ) {
  62865. return diff;
  62866. }
  62867. // Check if b follows a
  62868. if ( cur ) {
  62869. while ( ( cur = cur.nextSibling ) ) {
  62870. if ( cur === b ) {
  62871. return -1;
  62872. }
  62873. }
  62874. }
  62875. return a ? 1 : -1;
  62876. }
  62877. /**
  62878. * Returns a function to use in pseudos for input types
  62879. * @param {String} type
  62880. */
  62881. function createInputPseudo( type ) {
  62882. return function( elem ) {
  62883. var name = elem.nodeName.toLowerCase();
  62884. return name === "input" && elem.type === type;
  62885. };
  62886. }
  62887. /**
  62888. * Returns a function to use in pseudos for buttons
  62889. * @param {String} type
  62890. */
  62891. function createButtonPseudo( type ) {
  62892. return function( elem ) {
  62893. var name = elem.nodeName.toLowerCase();
  62894. return ( name === "input" || name === "button" ) && elem.type === type;
  62895. };
  62896. }
  62897. /**
  62898. * Returns a function to use in pseudos for :enabled/:disabled
  62899. * @param {Boolean} disabled true for :disabled; false for :enabled
  62900. */
  62901. function createDisabledPseudo( disabled ) {
  62902. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  62903. return function( elem ) {
  62904. // Only certain elements can match :enabled or :disabled
  62905. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  62906. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  62907. if ( "form" in elem ) {
  62908. // Check for inherited disabledness on relevant non-disabled elements:
  62909. // * listed form-associated elements in a disabled fieldset
  62910. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  62911. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  62912. // * option elements in a disabled optgroup
  62913. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  62914. // All such elements have a "form" property.
  62915. if ( elem.parentNode && elem.disabled === false ) {
  62916. // Option elements defer to a parent optgroup if present
  62917. if ( "label" in elem ) {
  62918. if ( "label" in elem.parentNode ) {
  62919. return elem.parentNode.disabled === disabled;
  62920. } else {
  62921. return elem.disabled === disabled;
  62922. }
  62923. }
  62924. // Support: IE 6 - 11
  62925. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  62926. return elem.isDisabled === disabled ||
  62927. // Where there is no isDisabled, check manually
  62928. /* jshint -W018 */
  62929. elem.isDisabled !== !disabled &&
  62930. inDisabledFieldset( elem ) === disabled;
  62931. }
  62932. return elem.disabled === disabled;
  62933. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  62934. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  62935. // even exist on them, let alone have a boolean value.
  62936. } else if ( "label" in elem ) {
  62937. return elem.disabled === disabled;
  62938. }
  62939. // Remaining elements are neither :enabled nor :disabled
  62940. return false;
  62941. };
  62942. }
  62943. /**
  62944. * Returns a function to use in pseudos for positionals
  62945. * @param {Function} fn
  62946. */
  62947. function createPositionalPseudo( fn ) {
  62948. return markFunction( function( argument ) {
  62949. argument = +argument;
  62950. return markFunction( function( seed, matches ) {
  62951. var j,
  62952. matchIndexes = fn( [], seed.length, argument ),
  62953. i = matchIndexes.length;
  62954. // Match elements found at the specified indexes
  62955. while ( i-- ) {
  62956. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  62957. seed[ j ] = !( matches[ j ] = seed[ j ] );
  62958. }
  62959. }
  62960. } );
  62961. } );
  62962. }
  62963. /**
  62964. * Checks a node for validity as a Sizzle context
  62965. * @param {Element|Object=} context
  62966. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  62967. */
  62968. function testContext( context ) {
  62969. return context && typeof context.getElementsByTagName !== "undefined" && context;
  62970. }
  62971. // Expose support vars for convenience
  62972. support = Sizzle.support = {};
  62973. /**
  62974. * Detects XML nodes
  62975. * @param {Element|Object} elem An element or a document
  62976. * @returns {Boolean} True iff elem is a non-HTML XML node
  62977. */
  62978. isXML = Sizzle.isXML = function( elem ) {
  62979. var namespace = elem.namespaceURI,
  62980. docElem = ( elem.ownerDocument || elem ).documentElement;
  62981. // Support: IE <=8
  62982. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  62983. // https://bugs.jquery.com/ticket/4833
  62984. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  62985. };
  62986. /**
  62987. * Sets document-related variables once based on the current document
  62988. * @param {Element|Object} [doc] An element or document object to use to set the document
  62989. * @returns {Object} Returns the current document
  62990. */
  62991. setDocument = Sizzle.setDocument = function( node ) {
  62992. var hasCompare, subWindow,
  62993. doc = node ? node.ownerDocument || node : preferredDoc;
  62994. // Return early if doc is invalid or already selected
  62995. // Support: IE 11+, Edge 17 - 18+
  62996. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  62997. // two documents; shallow comparisons work.
  62998. // eslint-disable-next-line eqeqeq
  62999. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  63000. return document;
  63001. }
  63002. // Update global variables
  63003. document = doc;
  63004. docElem = document.documentElement;
  63005. documentIsHTML = !isXML( document );
  63006. // Support: IE 9 - 11+, Edge 12 - 18+
  63007. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  63008. // Support: IE 11+, Edge 17 - 18+
  63009. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  63010. // two documents; shallow comparisons work.
  63011. // eslint-disable-next-line eqeqeq
  63012. if ( preferredDoc != document &&
  63013. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  63014. // Support: IE 11, Edge
  63015. if ( subWindow.addEventListener ) {
  63016. subWindow.addEventListener( "unload", unloadHandler, false );
  63017. // Support: IE 9 - 10 only
  63018. } else if ( subWindow.attachEvent ) {
  63019. subWindow.attachEvent( "onunload", unloadHandler );
  63020. }
  63021. }
  63022. // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
  63023. // Safari 4 - 5 only, Opera <=11.6 - 12.x only
  63024. // IE/Edge & older browsers don't support the :scope pseudo-class.
  63025. // Support: Safari 6.0 only
  63026. // Safari 6.0 supports :scope but it's an alias of :root there.
  63027. support.scope = assert( function( el ) {
  63028. docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
  63029. return typeof el.querySelectorAll !== "undefined" &&
  63030. !el.querySelectorAll( ":scope fieldset div" ).length;
  63031. } );
  63032. /* Attributes
  63033. ---------------------------------------------------------------------- */
  63034. // Support: IE<8
  63035. // Verify that getAttribute really returns attributes and not properties
  63036. // (excepting IE8 booleans)
  63037. support.attributes = assert( function( el ) {
  63038. el.className = "i";
  63039. return !el.getAttribute( "className" );
  63040. } );
  63041. /* getElement(s)By*
  63042. ---------------------------------------------------------------------- */
  63043. // Check if getElementsByTagName("*") returns only elements
  63044. support.getElementsByTagName = assert( function( el ) {
  63045. el.appendChild( document.createComment( "" ) );
  63046. return !el.getElementsByTagName( "*" ).length;
  63047. } );
  63048. // Support: IE<9
  63049. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  63050. // Support: IE<10
  63051. // Check if getElementById returns elements by name
  63052. // The broken getElementById methods don't pick up programmatically-set names,
  63053. // so use a roundabout getElementsByName test
  63054. support.getById = assert( function( el ) {
  63055. docElem.appendChild( el ).id = expando;
  63056. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  63057. } );
  63058. // ID filter and find
  63059. if ( support.getById ) {
  63060. Expr.filter[ "ID" ] = function( id ) {
  63061. var attrId = id.replace( runescape, funescape );
  63062. return function( elem ) {
  63063. return elem.getAttribute( "id" ) === attrId;
  63064. };
  63065. };
  63066. Expr.find[ "ID" ] = function( id, context ) {
  63067. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  63068. var elem = context.getElementById( id );
  63069. return elem ? [ elem ] : [];
  63070. }
  63071. };
  63072. } else {
  63073. Expr.filter[ "ID" ] = function( id ) {
  63074. var attrId = id.replace( runescape, funescape );
  63075. return function( elem ) {
  63076. var node = typeof elem.getAttributeNode !== "undefined" &&
  63077. elem.getAttributeNode( "id" );
  63078. return node && node.value === attrId;
  63079. };
  63080. };
  63081. // Support: IE 6 - 7 only
  63082. // getElementById is not reliable as a find shortcut
  63083. Expr.find[ "ID" ] = function( id, context ) {
  63084. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  63085. var node, i, elems,
  63086. elem = context.getElementById( id );
  63087. if ( elem ) {
  63088. // Verify the id attribute
  63089. node = elem.getAttributeNode( "id" );
  63090. if ( node && node.value === id ) {
  63091. return [ elem ];
  63092. }
  63093. // Fall back on getElementsByName
  63094. elems = context.getElementsByName( id );
  63095. i = 0;
  63096. while ( ( elem = elems[ i++ ] ) ) {
  63097. node = elem.getAttributeNode( "id" );
  63098. if ( node && node.value === id ) {
  63099. return [ elem ];
  63100. }
  63101. }
  63102. }
  63103. return [];
  63104. }
  63105. };
  63106. }
  63107. // Tag
  63108. Expr.find[ "TAG" ] = support.getElementsByTagName ?
  63109. function( tag, context ) {
  63110. if ( typeof context.getElementsByTagName !== "undefined" ) {
  63111. return context.getElementsByTagName( tag );
  63112. // DocumentFragment nodes don't have gEBTN
  63113. } else if ( support.qsa ) {
  63114. return context.querySelectorAll( tag );
  63115. }
  63116. } :
  63117. function( tag, context ) {
  63118. var elem,
  63119. tmp = [],
  63120. i = 0,
  63121. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  63122. results = context.getElementsByTagName( tag );
  63123. // Filter out possible comments
  63124. if ( tag === "*" ) {
  63125. while ( ( elem = results[ i++ ] ) ) {
  63126. if ( elem.nodeType === 1 ) {
  63127. tmp.push( elem );
  63128. }
  63129. }
  63130. return tmp;
  63131. }
  63132. return results;
  63133. };
  63134. // Class
  63135. Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
  63136. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  63137. return context.getElementsByClassName( className );
  63138. }
  63139. };
  63140. /* QSA/matchesSelector
  63141. ---------------------------------------------------------------------- */
  63142. // QSA and matchesSelector support
  63143. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  63144. rbuggyMatches = [];
  63145. // qSa(:focus) reports false when true (Chrome 21)
  63146. // We allow this because of a bug in IE8/9 that throws an error
  63147. // whenever `document.activeElement` is accessed on an iframe
  63148. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  63149. // See https://bugs.jquery.com/ticket/13378
  63150. rbuggyQSA = [];
  63151. if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
  63152. // Build QSA regex
  63153. // Regex strategy adopted from Diego Perini
  63154. assert( function( el ) {
  63155. var input;
  63156. // Select is set to empty string on purpose
  63157. // This is to test IE's treatment of not explicitly
  63158. // setting a boolean content attribute,
  63159. // since its presence should be enough
  63160. // https://bugs.jquery.com/ticket/12359
  63161. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  63162. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  63163. "<option selected=''></option></select>";
  63164. // Support: IE8, Opera 11-12.16
  63165. // Nothing should be selected when empty strings follow ^= or $= or *=
  63166. // The test attribute must be unknown in Opera but "safe" for WinRT
  63167. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  63168. if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
  63169. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  63170. }
  63171. // Support: IE8
  63172. // Boolean attributes and "value" are not treated correctly
  63173. if ( !el.querySelectorAll( "[selected]" ).length ) {
  63174. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  63175. }
  63176. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  63177. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  63178. rbuggyQSA.push( "~=" );
  63179. }
  63180. // Support: IE 11+, Edge 15 - 18+
  63181. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  63182. // Adding a temporary attribute to the document before the selection works
  63183. // around the issue.
  63184. // Interestingly, IE 10 & older don't seem to have the issue.
  63185. input = document.createElement( "input" );
  63186. input.setAttribute( "name", "" );
  63187. el.appendChild( input );
  63188. if ( !el.querySelectorAll( "[name='']" ).length ) {
  63189. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  63190. whitespace + "*(?:''|\"\")" );
  63191. }
  63192. // Webkit/Opera - :checked should return selected option elements
  63193. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  63194. // IE8 throws error here and will not see later tests
  63195. if ( !el.querySelectorAll( ":checked" ).length ) {
  63196. rbuggyQSA.push( ":checked" );
  63197. }
  63198. // Support: Safari 8+, iOS 8+
  63199. // https://bugs.webkit.org/show_bug.cgi?id=136851
  63200. // In-page `selector#id sibling-combinator selector` fails
  63201. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  63202. rbuggyQSA.push( ".#.+[+~]" );
  63203. }
  63204. // Support: Firefox <=3.6 - 5 only
  63205. // Old Firefox doesn't throw on a badly-escaped identifier.
  63206. el.querySelectorAll( "\\\f" );
  63207. rbuggyQSA.push( "[\\r\\n\\f]" );
  63208. } );
  63209. assert( function( el ) {
  63210. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  63211. "<select disabled='disabled'><option/></select>";
  63212. // Support: Windows 8 Native Apps
  63213. // The type and name attributes are restricted during .innerHTML assignment
  63214. var input = document.createElement( "input" );
  63215. input.setAttribute( "type", "hidden" );
  63216. el.appendChild( input ).setAttribute( "name", "D" );
  63217. // Support: IE8
  63218. // Enforce case-sensitivity of name attribute
  63219. if ( el.querySelectorAll( "[name=d]" ).length ) {
  63220. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  63221. }
  63222. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  63223. // IE8 throws error here and will not see later tests
  63224. if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
  63225. rbuggyQSA.push( ":enabled", ":disabled" );
  63226. }
  63227. // Support: IE9-11+
  63228. // IE's :disabled selector does not pick up the children of disabled fieldsets
  63229. docElem.appendChild( el ).disabled = true;
  63230. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  63231. rbuggyQSA.push( ":enabled", ":disabled" );
  63232. }
  63233. // Support: Opera 10 - 11 only
  63234. // Opera 10-11 does not throw on post-comma invalid pseudos
  63235. el.querySelectorAll( "*,:x" );
  63236. rbuggyQSA.push( ",.*:" );
  63237. } );
  63238. }
  63239. if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
  63240. docElem.webkitMatchesSelector ||
  63241. docElem.mozMatchesSelector ||
  63242. docElem.oMatchesSelector ||
  63243. docElem.msMatchesSelector ) ) ) ) {
  63244. assert( function( el ) {
  63245. // Check to see if it's possible to do matchesSelector
  63246. // on a disconnected node (IE 9)
  63247. support.disconnectedMatch = matches.call( el, "*" );
  63248. // This should fail with an exception
  63249. // Gecko does not error, returns false instead
  63250. matches.call( el, "[s!='']:x" );
  63251. rbuggyMatches.push( "!=", pseudos );
  63252. } );
  63253. }
  63254. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  63255. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
  63256. /* Contains
  63257. ---------------------------------------------------------------------- */
  63258. hasCompare = rnative.test( docElem.compareDocumentPosition );
  63259. // Element contains another
  63260. // Purposefully self-exclusive
  63261. // As in, an element does not contain itself
  63262. contains = hasCompare || rnative.test( docElem.contains ) ?
  63263. function( a, b ) {
  63264. var adown = a.nodeType === 9 ? a.documentElement : a,
  63265. bup = b && b.parentNode;
  63266. return a === bup || !!( bup && bup.nodeType === 1 && (
  63267. adown.contains ?
  63268. adown.contains( bup ) :
  63269. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  63270. ) );
  63271. } :
  63272. function( a, b ) {
  63273. if ( b ) {
  63274. while ( ( b = b.parentNode ) ) {
  63275. if ( b === a ) {
  63276. return true;
  63277. }
  63278. }
  63279. }
  63280. return false;
  63281. };
  63282. /* Sorting
  63283. ---------------------------------------------------------------------- */
  63284. // Document order sorting
  63285. sortOrder = hasCompare ?
  63286. function( a, b ) {
  63287. // Flag for duplicate removal
  63288. if ( a === b ) {
  63289. hasDuplicate = true;
  63290. return 0;
  63291. }
  63292. // Sort on method existence if only one input has compareDocumentPosition
  63293. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  63294. if ( compare ) {
  63295. return compare;
  63296. }
  63297. // Calculate position if both inputs belong to the same document
  63298. // Support: IE 11+, Edge 17 - 18+
  63299. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  63300. // two documents; shallow comparisons work.
  63301. // eslint-disable-next-line eqeqeq
  63302. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  63303. a.compareDocumentPosition( b ) :
  63304. // Otherwise we know they are disconnected
  63305. 1;
  63306. // Disconnected nodes
  63307. if ( compare & 1 ||
  63308. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  63309. // Choose the first element that is related to our preferred document
  63310. // Support: IE 11+, Edge 17 - 18+
  63311. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  63312. // two documents; shallow comparisons work.
  63313. // eslint-disable-next-line eqeqeq
  63314. if ( a == document || a.ownerDocument == preferredDoc &&
  63315. contains( preferredDoc, a ) ) {
  63316. return -1;
  63317. }
  63318. // Support: IE 11+, Edge 17 - 18+
  63319. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  63320. // two documents; shallow comparisons work.
  63321. // eslint-disable-next-line eqeqeq
  63322. if ( b == document || b.ownerDocument == preferredDoc &&
  63323. contains( preferredDoc, b ) ) {
  63324. return 1;
  63325. }
  63326. // Maintain original order
  63327. return sortInput ?
  63328. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  63329. 0;
  63330. }
  63331. return compare & 4 ? -1 : 1;
  63332. } :
  63333. function( a, b ) {
  63334. // Exit early if the nodes are identical
  63335. if ( a === b ) {
  63336. hasDuplicate = true;
  63337. return 0;
  63338. }
  63339. var cur,
  63340. i = 0,
  63341. aup = a.parentNode,
  63342. bup = b.parentNode,
  63343. ap = [ a ],
  63344. bp = [ b ];
  63345. // Parentless nodes are either documents or disconnected
  63346. if ( !aup || !bup ) {
  63347. // Support: IE 11+, Edge 17 - 18+
  63348. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  63349. // two documents; shallow comparisons work.
  63350. /* eslint-disable eqeqeq */
  63351. return a == document ? -1 :
  63352. b == document ? 1 :
  63353. /* eslint-enable eqeqeq */
  63354. aup ? -1 :
  63355. bup ? 1 :
  63356. sortInput ?
  63357. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  63358. 0;
  63359. // If the nodes are siblings, we can do a quick check
  63360. } else if ( aup === bup ) {
  63361. return siblingCheck( a, b );
  63362. }
  63363. // Otherwise we need full lists of their ancestors for comparison
  63364. cur = a;
  63365. while ( ( cur = cur.parentNode ) ) {
  63366. ap.unshift( cur );
  63367. }
  63368. cur = b;
  63369. while ( ( cur = cur.parentNode ) ) {
  63370. bp.unshift( cur );
  63371. }
  63372. // Walk down the tree looking for a discrepancy
  63373. while ( ap[ i ] === bp[ i ] ) {
  63374. i++;
  63375. }
  63376. return i ?
  63377. // Do a sibling check if the nodes have a common ancestor
  63378. siblingCheck( ap[ i ], bp[ i ] ) :
  63379. // Otherwise nodes in our document sort first
  63380. // Support: IE 11+, Edge 17 - 18+
  63381. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  63382. // two documents; shallow comparisons work.
  63383. /* eslint-disable eqeqeq */
  63384. ap[ i ] == preferredDoc ? -1 :
  63385. bp[ i ] == preferredDoc ? 1 :
  63386. /* eslint-enable eqeqeq */
  63387. 0;
  63388. };
  63389. return document;
  63390. };
  63391. Sizzle.matches = function( expr, elements ) {
  63392. return Sizzle( expr, null, null, elements );
  63393. };
  63394. Sizzle.matchesSelector = function( elem, expr ) {
  63395. setDocument( elem );
  63396. if ( support.matchesSelector && documentIsHTML &&
  63397. !nonnativeSelectorCache[ expr + " " ] &&
  63398. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  63399. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  63400. try {
  63401. var ret = matches.call( elem, expr );
  63402. // IE 9's matchesSelector returns false on disconnected nodes
  63403. if ( ret || support.disconnectedMatch ||
  63404. // As well, disconnected nodes are said to be in a document
  63405. // fragment in IE 9
  63406. elem.document && elem.document.nodeType !== 11 ) {
  63407. return ret;
  63408. }
  63409. } catch ( e ) {
  63410. nonnativeSelectorCache( expr, true );
  63411. }
  63412. }
  63413. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  63414. };
  63415. Sizzle.contains = function( context, elem ) {
  63416. // Set document vars if needed
  63417. // Support: IE 11+, Edge 17 - 18+
  63418. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  63419. // two documents; shallow comparisons work.
  63420. // eslint-disable-next-line eqeqeq
  63421. if ( ( context.ownerDocument || context ) != document ) {
  63422. setDocument( context );
  63423. }
  63424. return contains( context, elem );
  63425. };
  63426. Sizzle.attr = function( elem, name ) {
  63427. // Set document vars if needed
  63428. // Support: IE 11+, Edge 17 - 18+
  63429. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  63430. // two documents; shallow comparisons work.
  63431. // eslint-disable-next-line eqeqeq
  63432. if ( ( elem.ownerDocument || elem ) != document ) {
  63433. setDocument( elem );
  63434. }
  63435. var fn = Expr.attrHandle[ name.toLowerCase() ],
  63436. // Don't get fooled by Object.prototype properties (jQuery #13807)
  63437. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  63438. fn( elem, name, !documentIsHTML ) :
  63439. undefined;
  63440. return val !== undefined ?
  63441. val :
  63442. support.attributes || !documentIsHTML ?
  63443. elem.getAttribute( name ) :
  63444. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  63445. val.value :
  63446. null;
  63447. };
  63448. Sizzle.escape = function( sel ) {
  63449. return ( sel + "" ).replace( rcssescape, fcssescape );
  63450. };
  63451. Sizzle.error = function( msg ) {
  63452. throw new Error( "Syntax error, unrecognized expression: " + msg );
  63453. };
  63454. /**
  63455. * Document sorting and removing duplicates
  63456. * @param {ArrayLike} results
  63457. */
  63458. Sizzle.uniqueSort = function( results ) {
  63459. var elem,
  63460. duplicates = [],
  63461. j = 0,
  63462. i = 0;
  63463. // Unless we *know* we can detect duplicates, assume their presence
  63464. hasDuplicate = !support.detectDuplicates;
  63465. sortInput = !support.sortStable && results.slice( 0 );
  63466. results.sort( sortOrder );
  63467. if ( hasDuplicate ) {
  63468. while ( ( elem = results[ i++ ] ) ) {
  63469. if ( elem === results[ i ] ) {
  63470. j = duplicates.push( i );
  63471. }
  63472. }
  63473. while ( j-- ) {
  63474. results.splice( duplicates[ j ], 1 );
  63475. }
  63476. }
  63477. // Clear input after sorting to release objects
  63478. // See https://github.com/jquery/sizzle/pull/225
  63479. sortInput = null;
  63480. return results;
  63481. };
  63482. /**
  63483. * Utility function for retrieving the text value of an array of DOM nodes
  63484. * @param {Array|Element} elem
  63485. */
  63486. getText = Sizzle.getText = function( elem ) {
  63487. var node,
  63488. ret = "",
  63489. i = 0,
  63490. nodeType = elem.nodeType;
  63491. if ( !nodeType ) {
  63492. // If no nodeType, this is expected to be an array
  63493. while ( ( node = elem[ i++ ] ) ) {
  63494. // Do not traverse comment nodes
  63495. ret += getText( node );
  63496. }
  63497. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  63498. // Use textContent for elements
  63499. // innerText usage removed for consistency of new lines (jQuery #11153)
  63500. if ( typeof elem.textContent === "string" ) {
  63501. return elem.textContent;
  63502. } else {
  63503. // Traverse its children
  63504. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  63505. ret += getText( elem );
  63506. }
  63507. }
  63508. } else if ( nodeType === 3 || nodeType === 4 ) {
  63509. return elem.nodeValue;
  63510. }
  63511. // Do not include comment or processing instruction nodes
  63512. return ret;
  63513. };
  63514. Expr = Sizzle.selectors = {
  63515. // Can be adjusted by the user
  63516. cacheLength: 50,
  63517. createPseudo: markFunction,
  63518. match: matchExpr,
  63519. attrHandle: {},
  63520. find: {},
  63521. relative: {
  63522. ">": { dir: "parentNode", first: true },
  63523. " ": { dir: "parentNode" },
  63524. "+": { dir: "previousSibling", first: true },
  63525. "~": { dir: "previousSibling" }
  63526. },
  63527. preFilter: {
  63528. "ATTR": function( match ) {
  63529. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  63530. // Move the given value to match[3] whether quoted or unquoted
  63531. match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
  63532. match[ 5 ] || "" ).replace( runescape, funescape );
  63533. if ( match[ 2 ] === "~=" ) {
  63534. match[ 3 ] = " " + match[ 3 ] + " ";
  63535. }
  63536. return match.slice( 0, 4 );
  63537. },
  63538. "CHILD": function( match ) {
  63539. /* matches from matchExpr["CHILD"]
  63540. 1 type (only|nth|...)
  63541. 2 what (child|of-type)
  63542. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  63543. 4 xn-component of xn+y argument ([+-]?\d*n|)
  63544. 5 sign of xn-component
  63545. 6 x of xn-component
  63546. 7 sign of y-component
  63547. 8 y of y-component
  63548. */
  63549. match[ 1 ] = match[ 1 ].toLowerCase();
  63550. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  63551. // nth-* requires argument
  63552. if ( !match[ 3 ] ) {
  63553. Sizzle.error( match[ 0 ] );
  63554. }
  63555. // numeric x and y parameters for Expr.filter.CHILD
  63556. // remember that false/true cast respectively to 0/1
  63557. match[ 4 ] = +( match[ 4 ] ?
  63558. match[ 5 ] + ( match[ 6 ] || 1 ) :
  63559. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
  63560. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  63561. // other types prohibit arguments
  63562. } else if ( match[ 3 ] ) {
  63563. Sizzle.error( match[ 0 ] );
  63564. }
  63565. return match;
  63566. },
  63567. "PSEUDO": function( match ) {
  63568. var excess,
  63569. unquoted = !match[ 6 ] && match[ 2 ];
  63570. if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
  63571. return null;
  63572. }
  63573. // Accept quoted arguments as-is
  63574. if ( match[ 3 ] ) {
  63575. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  63576. // Strip excess characters from unquoted arguments
  63577. } else if ( unquoted && rpseudo.test( unquoted ) &&
  63578. // Get excess from tokenize (recursively)
  63579. ( excess = tokenize( unquoted, true ) ) &&
  63580. // advance to the next closing parenthesis
  63581. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  63582. // excess is a negative index
  63583. match[ 0 ] = match[ 0 ].slice( 0, excess );
  63584. match[ 2 ] = unquoted.slice( 0, excess );
  63585. }
  63586. // Return only captures needed by the pseudo filter method (type and argument)
  63587. return match.slice( 0, 3 );
  63588. }
  63589. },
  63590. filter: {
  63591. "TAG": function( nodeNameSelector ) {
  63592. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  63593. return nodeNameSelector === "*" ?
  63594. function() {
  63595. return true;
  63596. } :
  63597. function( elem ) {
  63598. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  63599. };
  63600. },
  63601. "CLASS": function( className ) {
  63602. var pattern = classCache[ className + " " ];
  63603. return pattern ||
  63604. ( pattern = new RegExp( "(^|" + whitespace +
  63605. ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
  63606. className, function( elem ) {
  63607. return pattern.test(
  63608. typeof elem.className === "string" && elem.className ||
  63609. typeof elem.getAttribute !== "undefined" &&
  63610. elem.getAttribute( "class" ) ||
  63611. ""
  63612. );
  63613. } );
  63614. },
  63615. "ATTR": function( name, operator, check ) {
  63616. return function( elem ) {
  63617. var result = Sizzle.attr( elem, name );
  63618. if ( result == null ) {
  63619. return operator === "!=";
  63620. }
  63621. if ( !operator ) {
  63622. return true;
  63623. }
  63624. result += "";
  63625. /* eslint-disable max-len */
  63626. return operator === "=" ? result === check :
  63627. operator === "!=" ? result !== check :
  63628. operator === "^=" ? check && result.indexOf( check ) === 0 :
  63629. operator === "*=" ? check && result.indexOf( check ) > -1 :
  63630. operator === "$=" ? check && result.slice( -check.length ) === check :
  63631. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  63632. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  63633. false;
  63634. /* eslint-enable max-len */
  63635. };
  63636. },
  63637. "CHILD": function( type, what, _argument, first, last ) {
  63638. var simple = type.slice( 0, 3 ) !== "nth",
  63639. forward = type.slice( -4 ) !== "last",
  63640. ofType = what === "of-type";
  63641. return first === 1 && last === 0 ?
  63642. // Shortcut for :nth-*(n)
  63643. function( elem ) {
  63644. return !!elem.parentNode;
  63645. } :
  63646. function( elem, _context, xml ) {
  63647. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  63648. dir = simple !== forward ? "nextSibling" : "previousSibling",
  63649. parent = elem.parentNode,
  63650. name = ofType && elem.nodeName.toLowerCase(),
  63651. useCache = !xml && !ofType,
  63652. diff = false;
  63653. if ( parent ) {
  63654. // :(first|last|only)-(child|of-type)
  63655. if ( simple ) {
  63656. while ( dir ) {
  63657. node = elem;
  63658. while ( ( node = node[ dir ] ) ) {
  63659. if ( ofType ?
  63660. node.nodeName.toLowerCase() === name :
  63661. node.nodeType === 1 ) {
  63662. return false;
  63663. }
  63664. }
  63665. // Reverse direction for :only-* (if we haven't yet done so)
  63666. start = dir = type === "only" && !start && "nextSibling";
  63667. }
  63668. return true;
  63669. }
  63670. start = [ forward ? parent.firstChild : parent.lastChild ];
  63671. // non-xml :nth-child(...) stores cache data on `parent`
  63672. if ( forward && useCache ) {
  63673. // Seek `elem` from a previously-cached index
  63674. // ...in a gzip-friendly way
  63675. node = parent;
  63676. outerCache = node[ expando ] || ( node[ expando ] = {} );
  63677. // Support: IE <9 only
  63678. // Defend against cloned attroperties (jQuery gh-1709)
  63679. uniqueCache = outerCache[ node.uniqueID ] ||
  63680. ( outerCache[ node.uniqueID ] = {} );
  63681. cache = uniqueCache[ type ] || [];
  63682. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  63683. diff = nodeIndex && cache[ 2 ];
  63684. node = nodeIndex && parent.childNodes[ nodeIndex ];
  63685. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  63686. // Fallback to seeking `elem` from the start
  63687. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  63688. // When found, cache indexes on `parent` and break
  63689. if ( node.nodeType === 1 && ++diff && node === elem ) {
  63690. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  63691. break;
  63692. }
  63693. }
  63694. } else {
  63695. // Use previously-cached element index if available
  63696. if ( useCache ) {
  63697. // ...in a gzip-friendly way
  63698. node = elem;
  63699. outerCache = node[ expando ] || ( node[ expando ] = {} );
  63700. // Support: IE <9 only
  63701. // Defend against cloned attroperties (jQuery gh-1709)
  63702. uniqueCache = outerCache[ node.uniqueID ] ||
  63703. ( outerCache[ node.uniqueID ] = {} );
  63704. cache = uniqueCache[ type ] || [];
  63705. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  63706. diff = nodeIndex;
  63707. }
  63708. // xml :nth-child(...)
  63709. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  63710. if ( diff === false ) {
  63711. // Use the same loop as above to seek `elem` from the start
  63712. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  63713. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  63714. if ( ( ofType ?
  63715. node.nodeName.toLowerCase() === name :
  63716. node.nodeType === 1 ) &&
  63717. ++diff ) {
  63718. // Cache the index of each encountered element
  63719. if ( useCache ) {
  63720. outerCache = node[ expando ] ||
  63721. ( node[ expando ] = {} );
  63722. // Support: IE <9 only
  63723. // Defend against cloned attroperties (jQuery gh-1709)
  63724. uniqueCache = outerCache[ node.uniqueID ] ||
  63725. ( outerCache[ node.uniqueID ] = {} );
  63726. uniqueCache[ type ] = [ dirruns, diff ];
  63727. }
  63728. if ( node === elem ) {
  63729. break;
  63730. }
  63731. }
  63732. }
  63733. }
  63734. }
  63735. // Incorporate the offset, then check against cycle size
  63736. diff -= last;
  63737. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  63738. }
  63739. };
  63740. },
  63741. "PSEUDO": function( pseudo, argument ) {
  63742. // pseudo-class names are case-insensitive
  63743. // http://www.w3.org/TR/selectors/#pseudo-classes
  63744. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  63745. // Remember that setFilters inherits from pseudos
  63746. var args,
  63747. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  63748. Sizzle.error( "unsupported pseudo: " + pseudo );
  63749. // The user may use createPseudo to indicate that
  63750. // arguments are needed to create the filter function
  63751. // just as Sizzle does
  63752. if ( fn[ expando ] ) {
  63753. return fn( argument );
  63754. }
  63755. // But maintain support for old signatures
  63756. if ( fn.length > 1 ) {
  63757. args = [ pseudo, pseudo, "", argument ];
  63758. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  63759. markFunction( function( seed, matches ) {
  63760. var idx,
  63761. matched = fn( seed, argument ),
  63762. i = matched.length;
  63763. while ( i-- ) {
  63764. idx = indexOf( seed, matched[ i ] );
  63765. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  63766. }
  63767. } ) :
  63768. function( elem ) {
  63769. return fn( elem, 0, args );
  63770. };
  63771. }
  63772. return fn;
  63773. }
  63774. },
  63775. pseudos: {
  63776. // Potentially complex pseudos
  63777. "not": markFunction( function( selector ) {
  63778. // Trim the selector passed to compile
  63779. // to avoid treating leading and trailing
  63780. // spaces as combinators
  63781. var input = [],
  63782. results = [],
  63783. matcher = compile( selector.replace( rtrim, "$1" ) );
  63784. return matcher[ expando ] ?
  63785. markFunction( function( seed, matches, _context, xml ) {
  63786. var elem,
  63787. unmatched = matcher( seed, null, xml, [] ),
  63788. i = seed.length;
  63789. // Match elements unmatched by `matcher`
  63790. while ( i-- ) {
  63791. if ( ( elem = unmatched[ i ] ) ) {
  63792. seed[ i ] = !( matches[ i ] = elem );
  63793. }
  63794. }
  63795. } ) :
  63796. function( elem, _context, xml ) {
  63797. input[ 0 ] = elem;
  63798. matcher( input, null, xml, results );
  63799. // Don't keep the element (issue #299)
  63800. input[ 0 ] = null;
  63801. return !results.pop();
  63802. };
  63803. } ),
  63804. "has": markFunction( function( selector ) {
  63805. return function( elem ) {
  63806. return Sizzle( selector, elem ).length > 0;
  63807. };
  63808. } ),
  63809. "contains": markFunction( function( text ) {
  63810. text = text.replace( runescape, funescape );
  63811. return function( elem ) {
  63812. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  63813. };
  63814. } ),
  63815. // "Whether an element is represented by a :lang() selector
  63816. // is based solely on the element's language value
  63817. // being equal to the identifier C,
  63818. // or beginning with the identifier C immediately followed by "-".
  63819. // The matching of C against the element's language value is performed case-insensitively.
  63820. // The identifier C does not have to be a valid language name."
  63821. // http://www.w3.org/TR/selectors/#lang-pseudo
  63822. "lang": markFunction( function( lang ) {
  63823. // lang value must be a valid identifier
  63824. if ( !ridentifier.test( lang || "" ) ) {
  63825. Sizzle.error( "unsupported lang: " + lang );
  63826. }
  63827. lang = lang.replace( runescape, funescape ).toLowerCase();
  63828. return function( elem ) {
  63829. var elemLang;
  63830. do {
  63831. if ( ( elemLang = documentIsHTML ?
  63832. elem.lang :
  63833. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  63834. elemLang = elemLang.toLowerCase();
  63835. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  63836. }
  63837. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  63838. return false;
  63839. };
  63840. } ),
  63841. // Miscellaneous
  63842. "target": function( elem ) {
  63843. var hash = window.location && window.location.hash;
  63844. return hash && hash.slice( 1 ) === elem.id;
  63845. },
  63846. "root": function( elem ) {
  63847. return elem === docElem;
  63848. },
  63849. "focus": function( elem ) {
  63850. return elem === document.activeElement &&
  63851. ( !document.hasFocus || document.hasFocus() ) &&
  63852. !!( elem.type || elem.href || ~elem.tabIndex );
  63853. },
  63854. // Boolean properties
  63855. "enabled": createDisabledPseudo( false ),
  63856. "disabled": createDisabledPseudo( true ),
  63857. "checked": function( elem ) {
  63858. // In CSS3, :checked should return both checked and selected elements
  63859. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  63860. var nodeName = elem.nodeName.toLowerCase();
  63861. return ( nodeName === "input" && !!elem.checked ) ||
  63862. ( nodeName === "option" && !!elem.selected );
  63863. },
  63864. "selected": function( elem ) {
  63865. // Accessing this property makes selected-by-default
  63866. // options in Safari work properly
  63867. if ( elem.parentNode ) {
  63868. // eslint-disable-next-line no-unused-expressions
  63869. elem.parentNode.selectedIndex;
  63870. }
  63871. return elem.selected === true;
  63872. },
  63873. // Contents
  63874. "empty": function( elem ) {
  63875. // http://www.w3.org/TR/selectors/#empty-pseudo
  63876. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  63877. // but not by others (comment: 8; processing instruction: 7; etc.)
  63878. // nodeType < 6 works because attributes (2) do not appear as children
  63879. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  63880. if ( elem.nodeType < 6 ) {
  63881. return false;
  63882. }
  63883. }
  63884. return true;
  63885. },
  63886. "parent": function( elem ) {
  63887. return !Expr.pseudos[ "empty" ]( elem );
  63888. },
  63889. // Element/input types
  63890. "header": function( elem ) {
  63891. return rheader.test( elem.nodeName );
  63892. },
  63893. "input": function( elem ) {
  63894. return rinputs.test( elem.nodeName );
  63895. },
  63896. "button": function( elem ) {
  63897. var name = elem.nodeName.toLowerCase();
  63898. return name === "input" && elem.type === "button" || name === "button";
  63899. },
  63900. "text": function( elem ) {
  63901. var attr;
  63902. return elem.nodeName.toLowerCase() === "input" &&
  63903. elem.type === "text" &&
  63904. // Support: IE<8
  63905. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  63906. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  63907. attr.toLowerCase() === "text" );
  63908. },
  63909. // Position-in-collection
  63910. "first": createPositionalPseudo( function() {
  63911. return [ 0 ];
  63912. } ),
  63913. "last": createPositionalPseudo( function( _matchIndexes, length ) {
  63914. return [ length - 1 ];
  63915. } ),
  63916. "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
  63917. return [ argument < 0 ? argument + length : argument ];
  63918. } ),
  63919. "even": createPositionalPseudo( function( matchIndexes, length ) {
  63920. var i = 0;
  63921. for ( ; i < length; i += 2 ) {
  63922. matchIndexes.push( i );
  63923. }
  63924. return matchIndexes;
  63925. } ),
  63926. "odd": createPositionalPseudo( function( matchIndexes, length ) {
  63927. var i = 1;
  63928. for ( ; i < length; i += 2 ) {
  63929. matchIndexes.push( i );
  63930. }
  63931. return matchIndexes;
  63932. } ),
  63933. "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  63934. var i = argument < 0 ?
  63935. argument + length :
  63936. argument > length ?
  63937. length :
  63938. argument;
  63939. for ( ; --i >= 0; ) {
  63940. matchIndexes.push( i );
  63941. }
  63942. return matchIndexes;
  63943. } ),
  63944. "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  63945. var i = argument < 0 ? argument + length : argument;
  63946. for ( ; ++i < length; ) {
  63947. matchIndexes.push( i );
  63948. }
  63949. return matchIndexes;
  63950. } )
  63951. }
  63952. };
  63953. Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
  63954. // Add button/input type pseudos
  63955. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  63956. Expr.pseudos[ i ] = createInputPseudo( i );
  63957. }
  63958. for ( i in { submit: true, reset: true } ) {
  63959. Expr.pseudos[ i ] = createButtonPseudo( i );
  63960. }
  63961. // Easy API for creating new setFilters
  63962. function setFilters() {}
  63963. setFilters.prototype = Expr.filters = Expr.pseudos;
  63964. Expr.setFilters = new setFilters();
  63965. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  63966. var matched, match, tokens, type,
  63967. soFar, groups, preFilters,
  63968. cached = tokenCache[ selector + " " ];
  63969. if ( cached ) {
  63970. return parseOnly ? 0 : cached.slice( 0 );
  63971. }
  63972. soFar = selector;
  63973. groups = [];
  63974. preFilters = Expr.preFilter;
  63975. while ( soFar ) {
  63976. // Comma and first run
  63977. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  63978. if ( match ) {
  63979. // Don't consume trailing commas as valid
  63980. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  63981. }
  63982. groups.push( ( tokens = [] ) );
  63983. }
  63984. matched = false;
  63985. // Combinators
  63986. if ( ( match = rcombinators.exec( soFar ) ) ) {
  63987. matched = match.shift();
  63988. tokens.push( {
  63989. value: matched,
  63990. // Cast descendant combinators to space
  63991. type: match[ 0 ].replace( rtrim, " " )
  63992. } );
  63993. soFar = soFar.slice( matched.length );
  63994. }
  63995. // Filters
  63996. for ( type in Expr.filter ) {
  63997. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  63998. ( match = preFilters[ type ]( match ) ) ) ) {
  63999. matched = match.shift();
  64000. tokens.push( {
  64001. value: matched,
  64002. type: type,
  64003. matches: match
  64004. } );
  64005. soFar = soFar.slice( matched.length );
  64006. }
  64007. }
  64008. if ( !matched ) {
  64009. break;
  64010. }
  64011. }
  64012. // Return the length of the invalid excess
  64013. // if we're just parsing
  64014. // Otherwise, throw an error or return tokens
  64015. return parseOnly ?
  64016. soFar.length :
  64017. soFar ?
  64018. Sizzle.error( selector ) :
  64019. // Cache the tokens
  64020. tokenCache( selector, groups ).slice( 0 );
  64021. };
  64022. function toSelector( tokens ) {
  64023. var i = 0,
  64024. len = tokens.length,
  64025. selector = "";
  64026. for ( ; i < len; i++ ) {
  64027. selector += tokens[ i ].value;
  64028. }
  64029. return selector;
  64030. }
  64031. function addCombinator( matcher, combinator, base ) {
  64032. var dir = combinator.dir,
  64033. skip = combinator.next,
  64034. key = skip || dir,
  64035. checkNonElements = base && key === "parentNode",
  64036. doneName = done++;
  64037. return combinator.first ?
  64038. // Check against closest ancestor/preceding element
  64039. function( elem, context, xml ) {
  64040. while ( ( elem = elem[ dir ] ) ) {
  64041. if ( elem.nodeType === 1 || checkNonElements ) {
  64042. return matcher( elem, context, xml );
  64043. }
  64044. }
  64045. return false;
  64046. } :
  64047. // Check against all ancestor/preceding elements
  64048. function( elem, context, xml ) {
  64049. var oldCache, uniqueCache, outerCache,
  64050. newCache = [ dirruns, doneName ];
  64051. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  64052. if ( xml ) {
  64053. while ( ( elem = elem[ dir ] ) ) {
  64054. if ( elem.nodeType === 1 || checkNonElements ) {
  64055. if ( matcher( elem, context, xml ) ) {
  64056. return true;
  64057. }
  64058. }
  64059. }
  64060. } else {
  64061. while ( ( elem = elem[ dir ] ) ) {
  64062. if ( elem.nodeType === 1 || checkNonElements ) {
  64063. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  64064. // Support: IE <9 only
  64065. // Defend against cloned attroperties (jQuery gh-1709)
  64066. uniqueCache = outerCache[ elem.uniqueID ] ||
  64067. ( outerCache[ elem.uniqueID ] = {} );
  64068. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  64069. elem = elem[ dir ] || elem;
  64070. } else if ( ( oldCache = uniqueCache[ key ] ) &&
  64071. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  64072. // Assign to newCache so results back-propagate to previous elements
  64073. return ( newCache[ 2 ] = oldCache[ 2 ] );
  64074. } else {
  64075. // Reuse newcache so results back-propagate to previous elements
  64076. uniqueCache[ key ] = newCache;
  64077. // A match means we're done; a fail means we have to keep checking
  64078. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  64079. return true;
  64080. }
  64081. }
  64082. }
  64083. }
  64084. }
  64085. return false;
  64086. };
  64087. }
  64088. function elementMatcher( matchers ) {
  64089. return matchers.length > 1 ?
  64090. function( elem, context, xml ) {
  64091. var i = matchers.length;
  64092. while ( i-- ) {
  64093. if ( !matchers[ i ]( elem, context, xml ) ) {
  64094. return false;
  64095. }
  64096. }
  64097. return true;
  64098. } :
  64099. matchers[ 0 ];
  64100. }
  64101. function multipleContexts( selector, contexts, results ) {
  64102. var i = 0,
  64103. len = contexts.length;
  64104. for ( ; i < len; i++ ) {
  64105. Sizzle( selector, contexts[ i ], results );
  64106. }
  64107. return results;
  64108. }
  64109. function condense( unmatched, map, filter, context, xml ) {
  64110. var elem,
  64111. newUnmatched = [],
  64112. i = 0,
  64113. len = unmatched.length,
  64114. mapped = map != null;
  64115. for ( ; i < len; i++ ) {
  64116. if ( ( elem = unmatched[ i ] ) ) {
  64117. if ( !filter || filter( elem, context, xml ) ) {
  64118. newUnmatched.push( elem );
  64119. if ( mapped ) {
  64120. map.push( i );
  64121. }
  64122. }
  64123. }
  64124. }
  64125. return newUnmatched;
  64126. }
  64127. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  64128. if ( postFilter && !postFilter[ expando ] ) {
  64129. postFilter = setMatcher( postFilter );
  64130. }
  64131. if ( postFinder && !postFinder[ expando ] ) {
  64132. postFinder = setMatcher( postFinder, postSelector );
  64133. }
  64134. return markFunction( function( seed, results, context, xml ) {
  64135. var temp, i, elem,
  64136. preMap = [],
  64137. postMap = [],
  64138. preexisting = results.length,
  64139. // Get initial elements from seed or context
  64140. elems = seed || multipleContexts(
  64141. selector || "*",
  64142. context.nodeType ? [ context ] : context,
  64143. []
  64144. ),
  64145. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  64146. matcherIn = preFilter && ( seed || !selector ) ?
  64147. condense( elems, preMap, preFilter, context, xml ) :
  64148. elems,
  64149. matcherOut = matcher ?
  64150. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  64151. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  64152. // ...intermediate processing is necessary
  64153. [] :
  64154. // ...otherwise use results directly
  64155. results :
  64156. matcherIn;
  64157. // Find primary matches
  64158. if ( matcher ) {
  64159. matcher( matcherIn, matcherOut, context, xml );
  64160. }
  64161. // Apply postFilter
  64162. if ( postFilter ) {
  64163. temp = condense( matcherOut, postMap );
  64164. postFilter( temp, [], context, xml );
  64165. // Un-match failing elements by moving them back to matcherIn
  64166. i = temp.length;
  64167. while ( i-- ) {
  64168. if ( ( elem = temp[ i ] ) ) {
  64169. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  64170. }
  64171. }
  64172. }
  64173. if ( seed ) {
  64174. if ( postFinder || preFilter ) {
  64175. if ( postFinder ) {
  64176. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  64177. temp = [];
  64178. i = matcherOut.length;
  64179. while ( i-- ) {
  64180. if ( ( elem = matcherOut[ i ] ) ) {
  64181. // Restore matcherIn since elem is not yet a final match
  64182. temp.push( ( matcherIn[ i ] = elem ) );
  64183. }
  64184. }
  64185. postFinder( null, ( matcherOut = [] ), temp, xml );
  64186. }
  64187. // Move matched elements from seed to results to keep them synchronized
  64188. i = matcherOut.length;
  64189. while ( i-- ) {
  64190. if ( ( elem = matcherOut[ i ] ) &&
  64191. ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
  64192. seed[ temp ] = !( results[ temp ] = elem );
  64193. }
  64194. }
  64195. }
  64196. // Add elements to results, through postFinder if defined
  64197. } else {
  64198. matcherOut = condense(
  64199. matcherOut === results ?
  64200. matcherOut.splice( preexisting, matcherOut.length ) :
  64201. matcherOut
  64202. );
  64203. if ( postFinder ) {
  64204. postFinder( null, results, matcherOut, xml );
  64205. } else {
  64206. push.apply( results, matcherOut );
  64207. }
  64208. }
  64209. } );
  64210. }
  64211. function matcherFromTokens( tokens ) {
  64212. var checkContext, matcher, j,
  64213. len = tokens.length,
  64214. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  64215. implicitRelative = leadingRelative || Expr.relative[ " " ],
  64216. i = leadingRelative ? 1 : 0,
  64217. // The foundational matcher ensures that elements are reachable from top-level context(s)
  64218. matchContext = addCombinator( function( elem ) {
  64219. return elem === checkContext;
  64220. }, implicitRelative, true ),
  64221. matchAnyContext = addCombinator( function( elem ) {
  64222. return indexOf( checkContext, elem ) > -1;
  64223. }, implicitRelative, true ),
  64224. matchers = [ function( elem, context, xml ) {
  64225. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  64226. ( checkContext = context ).nodeType ?
  64227. matchContext( elem, context, xml ) :
  64228. matchAnyContext( elem, context, xml ) );
  64229. // Avoid hanging onto element (issue #299)
  64230. checkContext = null;
  64231. return ret;
  64232. } ];
  64233. for ( ; i < len; i++ ) {
  64234. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  64235. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  64236. } else {
  64237. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  64238. // Return special upon seeing a positional matcher
  64239. if ( matcher[ expando ] ) {
  64240. // Find the next relative operator (if any) for proper handling
  64241. j = ++i;
  64242. for ( ; j < len; j++ ) {
  64243. if ( Expr.relative[ tokens[ j ].type ] ) {
  64244. break;
  64245. }
  64246. }
  64247. return setMatcher(
  64248. i > 1 && elementMatcher( matchers ),
  64249. i > 1 && toSelector(
  64250. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  64251. tokens
  64252. .slice( 0, i - 1 )
  64253. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  64254. ).replace( rtrim, "$1" ),
  64255. matcher,
  64256. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  64257. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  64258. j < len && toSelector( tokens )
  64259. );
  64260. }
  64261. matchers.push( matcher );
  64262. }
  64263. }
  64264. return elementMatcher( matchers );
  64265. }
  64266. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  64267. var bySet = setMatchers.length > 0,
  64268. byElement = elementMatchers.length > 0,
  64269. superMatcher = function( seed, context, xml, results, outermost ) {
  64270. var elem, j, matcher,
  64271. matchedCount = 0,
  64272. i = "0",
  64273. unmatched = seed && [],
  64274. setMatched = [],
  64275. contextBackup = outermostContext,
  64276. // We must always have either seed elements or outermost context
  64277. elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
  64278. // Use integer dirruns iff this is the outermost matcher
  64279. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  64280. len = elems.length;
  64281. if ( outermost ) {
  64282. // Support: IE 11+, Edge 17 - 18+
  64283. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  64284. // two documents; shallow comparisons work.
  64285. // eslint-disable-next-line eqeqeq
  64286. outermostContext = context == document || context || outermost;
  64287. }
  64288. // Add elements passing elementMatchers directly to results
  64289. // Support: IE<9, Safari
  64290. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  64291. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  64292. if ( byElement && elem ) {
  64293. j = 0;
  64294. // Support: IE 11+, Edge 17 - 18+
  64295. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  64296. // two documents; shallow comparisons work.
  64297. // eslint-disable-next-line eqeqeq
  64298. if ( !context && elem.ownerDocument != document ) {
  64299. setDocument( elem );
  64300. xml = !documentIsHTML;
  64301. }
  64302. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  64303. if ( matcher( elem, context || document, xml ) ) {
  64304. results.push( elem );
  64305. break;
  64306. }
  64307. }
  64308. if ( outermost ) {
  64309. dirruns = dirrunsUnique;
  64310. }
  64311. }
  64312. // Track unmatched elements for set filters
  64313. if ( bySet ) {
  64314. // They will have gone through all possible matchers
  64315. if ( ( elem = !matcher && elem ) ) {
  64316. matchedCount--;
  64317. }
  64318. // Lengthen the array for every element, matched or not
  64319. if ( seed ) {
  64320. unmatched.push( elem );
  64321. }
  64322. }
  64323. }
  64324. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  64325. // makes the latter nonnegative.
  64326. matchedCount += i;
  64327. // Apply set filters to unmatched elements
  64328. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  64329. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  64330. // no element matchers and no seed.
  64331. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  64332. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  64333. // numerically zero.
  64334. if ( bySet && i !== matchedCount ) {
  64335. j = 0;
  64336. while ( ( matcher = setMatchers[ j++ ] ) ) {
  64337. matcher( unmatched, setMatched, context, xml );
  64338. }
  64339. if ( seed ) {
  64340. // Reintegrate element matches to eliminate the need for sorting
  64341. if ( matchedCount > 0 ) {
  64342. while ( i-- ) {
  64343. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  64344. setMatched[ i ] = pop.call( results );
  64345. }
  64346. }
  64347. }
  64348. // Discard index placeholder values to get only actual matches
  64349. setMatched = condense( setMatched );
  64350. }
  64351. // Add matches to results
  64352. push.apply( results, setMatched );
  64353. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  64354. if ( outermost && !seed && setMatched.length > 0 &&
  64355. ( matchedCount + setMatchers.length ) > 1 ) {
  64356. Sizzle.uniqueSort( results );
  64357. }
  64358. }
  64359. // Override manipulation of globals by nested matchers
  64360. if ( outermost ) {
  64361. dirruns = dirrunsUnique;
  64362. outermostContext = contextBackup;
  64363. }
  64364. return unmatched;
  64365. };
  64366. return bySet ?
  64367. markFunction( superMatcher ) :
  64368. superMatcher;
  64369. }
  64370. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  64371. var i,
  64372. setMatchers = [],
  64373. elementMatchers = [],
  64374. cached = compilerCache[ selector + " " ];
  64375. if ( !cached ) {
  64376. // Generate a function of recursive functions that can be used to check each element
  64377. if ( !match ) {
  64378. match = tokenize( selector );
  64379. }
  64380. i = match.length;
  64381. while ( i-- ) {
  64382. cached = matcherFromTokens( match[ i ] );
  64383. if ( cached[ expando ] ) {
  64384. setMatchers.push( cached );
  64385. } else {
  64386. elementMatchers.push( cached );
  64387. }
  64388. }
  64389. // Cache the compiled function
  64390. cached = compilerCache(
  64391. selector,
  64392. matcherFromGroupMatchers( elementMatchers, setMatchers )
  64393. );
  64394. // Save selector and tokenization
  64395. cached.selector = selector;
  64396. }
  64397. return cached;
  64398. };
  64399. /**
  64400. * A low-level selection function that works with Sizzle's compiled
  64401. * selector functions
  64402. * @param {String|Function} selector A selector or a pre-compiled
  64403. * selector function built with Sizzle.compile
  64404. * @param {Element} context
  64405. * @param {Array} [results]
  64406. * @param {Array} [seed] A set of elements to match against
  64407. */
  64408. select = Sizzle.select = function( selector, context, results, seed ) {
  64409. var i, tokens, token, type, find,
  64410. compiled = typeof selector === "function" && selector,
  64411. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  64412. results = results || [];
  64413. // Try to minimize operations if there is only one selector in the list and no seed
  64414. // (the latter of which guarantees us context)
  64415. if ( match.length === 1 ) {
  64416. // Reduce context if the leading compound selector is an ID
  64417. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  64418. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  64419. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  64420. context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
  64421. .replace( runescape, funescape ), context ) || [] )[ 0 ];
  64422. if ( !context ) {
  64423. return results;
  64424. // Precompiled matchers will still verify ancestry, so step up a level
  64425. } else if ( compiled ) {
  64426. context = context.parentNode;
  64427. }
  64428. selector = selector.slice( tokens.shift().value.length );
  64429. }
  64430. // Fetch a seed set for right-to-left matching
  64431. i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
  64432. while ( i-- ) {
  64433. token = tokens[ i ];
  64434. // Abort if we hit a combinator
  64435. if ( Expr.relative[ ( type = token.type ) ] ) {
  64436. break;
  64437. }
  64438. if ( ( find = Expr.find[ type ] ) ) {
  64439. // Search, expanding context for leading sibling combinators
  64440. if ( ( seed = find(
  64441. token.matches[ 0 ].replace( runescape, funescape ),
  64442. rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
  64443. context
  64444. ) ) ) {
  64445. // If seed is empty or no tokens remain, we can return early
  64446. tokens.splice( i, 1 );
  64447. selector = seed.length && toSelector( tokens );
  64448. if ( !selector ) {
  64449. push.apply( results, seed );
  64450. return results;
  64451. }
  64452. break;
  64453. }
  64454. }
  64455. }
  64456. }
  64457. // Compile and execute a filtering function if one is not provided
  64458. // Provide `match` to avoid retokenization if we modified the selector above
  64459. ( compiled || compile( selector, match ) )(
  64460. seed,
  64461. context,
  64462. !documentIsHTML,
  64463. results,
  64464. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  64465. );
  64466. return results;
  64467. };
  64468. // One-time assignments
  64469. // Sort stability
  64470. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  64471. // Support: Chrome 14-35+
  64472. // Always assume duplicates if they aren't passed to the comparison function
  64473. support.detectDuplicates = !!hasDuplicate;
  64474. // Initialize against the default document
  64475. setDocument();
  64476. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  64477. // Detached nodes confoundingly follow *each other*
  64478. support.sortDetached = assert( function( el ) {
  64479. // Should return 1, but returns 4 (following)
  64480. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  64481. } );
  64482. // Support: IE<8
  64483. // Prevent attribute/property "interpolation"
  64484. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  64485. if ( !assert( function( el ) {
  64486. el.innerHTML = "<a href='#'></a>";
  64487. return el.firstChild.getAttribute( "href" ) === "#";
  64488. } ) ) {
  64489. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  64490. if ( !isXML ) {
  64491. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  64492. }
  64493. } );
  64494. }
  64495. // Support: IE<9
  64496. // Use defaultValue in place of getAttribute("value")
  64497. if ( !support.attributes || !assert( function( el ) {
  64498. el.innerHTML = "<input/>";
  64499. el.firstChild.setAttribute( "value", "" );
  64500. return el.firstChild.getAttribute( "value" ) === "";
  64501. } ) ) {
  64502. addHandle( "value", function( elem, _name, isXML ) {
  64503. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  64504. return elem.defaultValue;
  64505. }
  64506. } );
  64507. }
  64508. // Support: IE<9
  64509. // Use getAttributeNode to fetch booleans when getAttribute lies
  64510. if ( !assert( function( el ) {
  64511. return el.getAttribute( "disabled" ) == null;
  64512. } ) ) {
  64513. addHandle( booleans, function( elem, name, isXML ) {
  64514. var val;
  64515. if ( !isXML ) {
  64516. return elem[ name ] === true ? name.toLowerCase() :
  64517. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  64518. val.value :
  64519. null;
  64520. }
  64521. } );
  64522. }
  64523. return Sizzle;
  64524. } )( window );
  64525. jQuery.find = Sizzle;
  64526. jQuery.expr = Sizzle.selectors;
  64527. // Deprecated
  64528. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  64529. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  64530. jQuery.text = Sizzle.getText;
  64531. jQuery.isXMLDoc = Sizzle.isXML;
  64532. jQuery.contains = Sizzle.contains;
  64533. jQuery.escapeSelector = Sizzle.escape;
  64534. var dir = function( elem, dir, until ) {
  64535. var matched = [],
  64536. truncate = until !== undefined;
  64537. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  64538. if ( elem.nodeType === 1 ) {
  64539. if ( truncate && jQuery( elem ).is( until ) ) {
  64540. break;
  64541. }
  64542. matched.push( elem );
  64543. }
  64544. }
  64545. return matched;
  64546. };
  64547. var siblings = function( n, elem ) {
  64548. var matched = [];
  64549. for ( ; n; n = n.nextSibling ) {
  64550. if ( n.nodeType === 1 && n !== elem ) {
  64551. matched.push( n );
  64552. }
  64553. }
  64554. return matched;
  64555. };
  64556. var rneedsContext = jQuery.expr.match.needsContext;
  64557. function nodeName( elem, name ) {
  64558. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  64559. };
  64560. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  64561. // Implement the identical functionality for filter and not
  64562. function winnow( elements, qualifier, not ) {
  64563. if ( isFunction( qualifier ) ) {
  64564. return jQuery.grep( elements, function( elem, i ) {
  64565. return !!qualifier.call( elem, i, elem ) !== not;
  64566. } );
  64567. }
  64568. // Single element
  64569. if ( qualifier.nodeType ) {
  64570. return jQuery.grep( elements, function( elem ) {
  64571. return ( elem === qualifier ) !== not;
  64572. } );
  64573. }
  64574. // Arraylike of elements (jQuery, arguments, Array)
  64575. if ( typeof qualifier !== "string" ) {
  64576. return jQuery.grep( elements, function( elem ) {
  64577. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  64578. } );
  64579. }
  64580. // Filtered directly for both simple and complex selectors
  64581. return jQuery.filter( qualifier, elements, not );
  64582. }
  64583. jQuery.filter = function( expr, elems, not ) {
  64584. var elem = elems[ 0 ];
  64585. if ( not ) {
  64586. expr = ":not(" + expr + ")";
  64587. }
  64588. if ( elems.length === 1 && elem.nodeType === 1 ) {
  64589. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  64590. }
  64591. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  64592. return elem.nodeType === 1;
  64593. } ) );
  64594. };
  64595. jQuery.fn.extend( {
  64596. find: function( selector ) {
  64597. var i, ret,
  64598. len = this.length,
  64599. self = this;
  64600. if ( typeof selector !== "string" ) {
  64601. return this.pushStack( jQuery( selector ).filter( function() {
  64602. for ( i = 0; i < len; i++ ) {
  64603. if ( jQuery.contains( self[ i ], this ) ) {
  64604. return true;
  64605. }
  64606. }
  64607. } ) );
  64608. }
  64609. ret = this.pushStack( [] );
  64610. for ( i = 0; i < len; i++ ) {
  64611. jQuery.find( selector, self[ i ], ret );
  64612. }
  64613. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  64614. },
  64615. filter: function( selector ) {
  64616. return this.pushStack( winnow( this, selector || [], false ) );
  64617. },
  64618. not: function( selector ) {
  64619. return this.pushStack( winnow( this, selector || [], true ) );
  64620. },
  64621. is: function( selector ) {
  64622. return !!winnow(
  64623. this,
  64624. // If this is a positional/relative selector, check membership in the returned set
  64625. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  64626. typeof selector === "string" && rneedsContext.test( selector ) ?
  64627. jQuery( selector ) :
  64628. selector || [],
  64629. false
  64630. ).length;
  64631. }
  64632. } );
  64633. // Initialize a jQuery object
  64634. // A central reference to the root jQuery(document)
  64635. var rootjQuery,
  64636. // A simple way to check for HTML strings
  64637. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  64638. // Strict HTML recognition (#11290: must start with <)
  64639. // Shortcut simple #id case for speed
  64640. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  64641. init = jQuery.fn.init = function( selector, context, root ) {
  64642. var match, elem;
  64643. // HANDLE: $(""), $(null), $(undefined), $(false)
  64644. if ( !selector ) {
  64645. return this;
  64646. }
  64647. // Method init() accepts an alternate rootjQuery
  64648. // so migrate can support jQuery.sub (gh-2101)
  64649. root = root || rootjQuery;
  64650. // Handle HTML strings
  64651. if ( typeof selector === "string" ) {
  64652. if ( selector[ 0 ] === "<" &&
  64653. selector[ selector.length - 1 ] === ">" &&
  64654. selector.length >= 3 ) {
  64655. // Assume that strings that start and end with <> are HTML and skip the regex check
  64656. match = [ null, selector, null ];
  64657. } else {
  64658. match = rquickExpr.exec( selector );
  64659. }
  64660. // Match html or make sure no context is specified for #id
  64661. if ( match && ( match[ 1 ] || !context ) ) {
  64662. // HANDLE: $(html) -> $(array)
  64663. if ( match[ 1 ] ) {
  64664. context = context instanceof jQuery ? context[ 0 ] : context;
  64665. // Option to run scripts is true for back-compat
  64666. // Intentionally let the error be thrown if parseHTML is not present
  64667. jQuery.merge( this, jQuery.parseHTML(
  64668. match[ 1 ],
  64669. context && context.nodeType ? context.ownerDocument || context : document,
  64670. true
  64671. ) );
  64672. // HANDLE: $(html, props)
  64673. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  64674. for ( match in context ) {
  64675. // Properties of context are called as methods if possible
  64676. if ( isFunction( this[ match ] ) ) {
  64677. this[ match ]( context[ match ] );
  64678. // ...and otherwise set as attributes
  64679. } else {
  64680. this.attr( match, context[ match ] );
  64681. }
  64682. }
  64683. }
  64684. return this;
  64685. // HANDLE: $(#id)
  64686. } else {
  64687. elem = document.getElementById( match[ 2 ] );
  64688. if ( elem ) {
  64689. // Inject the element directly into the jQuery object
  64690. this[ 0 ] = elem;
  64691. this.length = 1;
  64692. }
  64693. return this;
  64694. }
  64695. // HANDLE: $(expr, $(...))
  64696. } else if ( !context || context.jquery ) {
  64697. return ( context || root ).find( selector );
  64698. // HANDLE: $(expr, context)
  64699. // (which is just equivalent to: $(context).find(expr)
  64700. } else {
  64701. return this.constructor( context ).find( selector );
  64702. }
  64703. // HANDLE: $(DOMElement)
  64704. } else if ( selector.nodeType ) {
  64705. this[ 0 ] = selector;
  64706. this.length = 1;
  64707. return this;
  64708. // HANDLE: $(function)
  64709. // Shortcut for document ready
  64710. } else if ( isFunction( selector ) ) {
  64711. return root.ready !== undefined ?
  64712. root.ready( selector ) :
  64713. // Execute immediately if ready is not present
  64714. selector( jQuery );
  64715. }
  64716. return jQuery.makeArray( selector, this );
  64717. };
  64718. // Give the init function the jQuery prototype for later instantiation
  64719. init.prototype = jQuery.fn;
  64720. // Initialize central reference
  64721. rootjQuery = jQuery( document );
  64722. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  64723. // Methods guaranteed to produce a unique set when starting from a unique set
  64724. guaranteedUnique = {
  64725. children: true,
  64726. contents: true,
  64727. next: true,
  64728. prev: true
  64729. };
  64730. jQuery.fn.extend( {
  64731. has: function( target ) {
  64732. var targets = jQuery( target, this ),
  64733. l = targets.length;
  64734. return this.filter( function() {
  64735. var i = 0;
  64736. for ( ; i < l; i++ ) {
  64737. if ( jQuery.contains( this, targets[ i ] ) ) {
  64738. return true;
  64739. }
  64740. }
  64741. } );
  64742. },
  64743. closest: function( selectors, context ) {
  64744. var cur,
  64745. i = 0,
  64746. l = this.length,
  64747. matched = [],
  64748. targets = typeof selectors !== "string" && jQuery( selectors );
  64749. // Positional selectors never match, since there's no _selection_ context
  64750. if ( !rneedsContext.test( selectors ) ) {
  64751. for ( ; i < l; i++ ) {
  64752. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  64753. // Always skip document fragments
  64754. if ( cur.nodeType < 11 && ( targets ?
  64755. targets.index( cur ) > -1 :
  64756. // Don't pass non-elements to Sizzle
  64757. cur.nodeType === 1 &&
  64758. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  64759. matched.push( cur );
  64760. break;
  64761. }
  64762. }
  64763. }
  64764. }
  64765. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  64766. },
  64767. // Determine the position of an element within the set
  64768. index: function( elem ) {
  64769. // No argument, return index in parent
  64770. if ( !elem ) {
  64771. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  64772. }
  64773. // Index in selector
  64774. if ( typeof elem === "string" ) {
  64775. return indexOf.call( jQuery( elem ), this[ 0 ] );
  64776. }
  64777. // Locate the position of the desired element
  64778. return indexOf.call( this,
  64779. // If it receives a jQuery object, the first element is used
  64780. elem.jquery ? elem[ 0 ] : elem
  64781. );
  64782. },
  64783. add: function( selector, context ) {
  64784. return this.pushStack(
  64785. jQuery.uniqueSort(
  64786. jQuery.merge( this.get(), jQuery( selector, context ) )
  64787. )
  64788. );
  64789. },
  64790. addBack: function( selector ) {
  64791. return this.add( selector == null ?
  64792. this.prevObject : this.prevObject.filter( selector )
  64793. );
  64794. }
  64795. } );
  64796. function sibling( cur, dir ) {
  64797. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  64798. return cur;
  64799. }
  64800. jQuery.each( {
  64801. parent: function( elem ) {
  64802. var parent = elem.parentNode;
  64803. return parent && parent.nodeType !== 11 ? parent : null;
  64804. },
  64805. parents: function( elem ) {
  64806. return dir( elem, "parentNode" );
  64807. },
  64808. parentsUntil: function( elem, _i, until ) {
  64809. return dir( elem, "parentNode", until );
  64810. },
  64811. next: function( elem ) {
  64812. return sibling( elem, "nextSibling" );
  64813. },
  64814. prev: function( elem ) {
  64815. return sibling( elem, "previousSibling" );
  64816. },
  64817. nextAll: function( elem ) {
  64818. return dir( elem, "nextSibling" );
  64819. },
  64820. prevAll: function( elem ) {
  64821. return dir( elem, "previousSibling" );
  64822. },
  64823. nextUntil: function( elem, _i, until ) {
  64824. return dir( elem, "nextSibling", until );
  64825. },
  64826. prevUntil: function( elem, _i, until ) {
  64827. return dir( elem, "previousSibling", until );
  64828. },
  64829. siblings: function( elem ) {
  64830. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  64831. },
  64832. children: function( elem ) {
  64833. return siblings( elem.firstChild );
  64834. },
  64835. contents: function( elem ) {
  64836. if ( elem.contentDocument != null &&
  64837. // Support: IE 11+
  64838. // <object> elements with no `data` attribute has an object
  64839. // `contentDocument` with a `null` prototype.
  64840. getProto( elem.contentDocument ) ) {
  64841. return elem.contentDocument;
  64842. }
  64843. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  64844. // Treat the template element as a regular one in browsers that
  64845. // don't support it.
  64846. if ( nodeName( elem, "template" ) ) {
  64847. elem = elem.content || elem;
  64848. }
  64849. return jQuery.merge( [], elem.childNodes );
  64850. }
  64851. }, function( name, fn ) {
  64852. jQuery.fn[ name ] = function( until, selector ) {
  64853. var matched = jQuery.map( this, fn, until );
  64854. if ( name.slice( -5 ) !== "Until" ) {
  64855. selector = until;
  64856. }
  64857. if ( selector && typeof selector === "string" ) {
  64858. matched = jQuery.filter( selector, matched );
  64859. }
  64860. if ( this.length > 1 ) {
  64861. // Remove duplicates
  64862. if ( !guaranteedUnique[ name ] ) {
  64863. jQuery.uniqueSort( matched );
  64864. }
  64865. // Reverse order for parents* and prev-derivatives
  64866. if ( rparentsprev.test( name ) ) {
  64867. matched.reverse();
  64868. }
  64869. }
  64870. return this.pushStack( matched );
  64871. };
  64872. } );
  64873. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  64874. // Convert String-formatted options into Object-formatted ones
  64875. function createOptions( options ) {
  64876. var object = {};
  64877. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  64878. object[ flag ] = true;
  64879. } );
  64880. return object;
  64881. }
  64882. /*
  64883. * Create a callback list using the following parameters:
  64884. *
  64885. * options: an optional list of space-separated options that will change how
  64886. * the callback list behaves or a more traditional option object
  64887. *
  64888. * By default a callback list will act like an event callback list and can be
  64889. * "fired" multiple times.
  64890. *
  64891. * Possible options:
  64892. *
  64893. * once: will ensure the callback list can only be fired once (like a Deferred)
  64894. *
  64895. * memory: will keep track of previous values and will call any callback added
  64896. * after the list has been fired right away with the latest "memorized"
  64897. * values (like a Deferred)
  64898. *
  64899. * unique: will ensure a callback can only be added once (no duplicate in the list)
  64900. *
  64901. * stopOnFalse: interrupt callings when a callback returns false
  64902. *
  64903. */
  64904. jQuery.Callbacks = function( options ) {
  64905. // Convert options from String-formatted to Object-formatted if needed
  64906. // (we check in cache first)
  64907. options = typeof options === "string" ?
  64908. createOptions( options ) :
  64909. jQuery.extend( {}, options );
  64910. var // Flag to know if list is currently firing
  64911. firing,
  64912. // Last fire value for non-forgettable lists
  64913. memory,
  64914. // Flag to know if list was already fired
  64915. fired,
  64916. // Flag to prevent firing
  64917. locked,
  64918. // Actual callback list
  64919. list = [],
  64920. // Queue of execution data for repeatable lists
  64921. queue = [],
  64922. // Index of currently firing callback (modified by add/remove as needed)
  64923. firingIndex = -1,
  64924. // Fire callbacks
  64925. fire = function() {
  64926. // Enforce single-firing
  64927. locked = locked || options.once;
  64928. // Execute callbacks for all pending executions,
  64929. // respecting firingIndex overrides and runtime changes
  64930. fired = firing = true;
  64931. for ( ; queue.length; firingIndex = -1 ) {
  64932. memory = queue.shift();
  64933. while ( ++firingIndex < list.length ) {
  64934. // Run callback and check for early termination
  64935. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  64936. options.stopOnFalse ) {
  64937. // Jump to end and forget the data so .add doesn't re-fire
  64938. firingIndex = list.length;
  64939. memory = false;
  64940. }
  64941. }
  64942. }
  64943. // Forget the data if we're done with it
  64944. if ( !options.memory ) {
  64945. memory = false;
  64946. }
  64947. firing = false;
  64948. // Clean up if we're done firing for good
  64949. if ( locked ) {
  64950. // Keep an empty list if we have data for future add calls
  64951. if ( memory ) {
  64952. list = [];
  64953. // Otherwise, this object is spent
  64954. } else {
  64955. list = "";
  64956. }
  64957. }
  64958. },
  64959. // Actual Callbacks object
  64960. self = {
  64961. // Add a callback or a collection of callbacks to the list
  64962. add: function() {
  64963. if ( list ) {
  64964. // If we have memory from a past run, we should fire after adding
  64965. if ( memory && !firing ) {
  64966. firingIndex = list.length - 1;
  64967. queue.push( memory );
  64968. }
  64969. ( function add( args ) {
  64970. jQuery.each( args, function( _, arg ) {
  64971. if ( isFunction( arg ) ) {
  64972. if ( !options.unique || !self.has( arg ) ) {
  64973. list.push( arg );
  64974. }
  64975. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  64976. // Inspect recursively
  64977. add( arg );
  64978. }
  64979. } );
  64980. } )( arguments );
  64981. if ( memory && !firing ) {
  64982. fire();
  64983. }
  64984. }
  64985. return this;
  64986. },
  64987. // Remove a callback from the list
  64988. remove: function() {
  64989. jQuery.each( arguments, function( _, arg ) {
  64990. var index;
  64991. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  64992. list.splice( index, 1 );
  64993. // Handle firing indexes
  64994. if ( index <= firingIndex ) {
  64995. firingIndex--;
  64996. }
  64997. }
  64998. } );
  64999. return this;
  65000. },
  65001. // Check if a given callback is in the list.
  65002. // If no argument is given, return whether or not list has callbacks attached.
  65003. has: function( fn ) {
  65004. return fn ?
  65005. jQuery.inArray( fn, list ) > -1 :
  65006. list.length > 0;
  65007. },
  65008. // Remove all callbacks from the list
  65009. empty: function() {
  65010. if ( list ) {
  65011. list = [];
  65012. }
  65013. return this;
  65014. },
  65015. // Disable .fire and .add
  65016. // Abort any current/pending executions
  65017. // Clear all callbacks and values
  65018. disable: function() {
  65019. locked = queue = [];
  65020. list = memory = "";
  65021. return this;
  65022. },
  65023. disabled: function() {
  65024. return !list;
  65025. },
  65026. // Disable .fire
  65027. // Also disable .add unless we have memory (since it would have no effect)
  65028. // Abort any pending executions
  65029. lock: function() {
  65030. locked = queue = [];
  65031. if ( !memory && !firing ) {
  65032. list = memory = "";
  65033. }
  65034. return this;
  65035. },
  65036. locked: function() {
  65037. return !!locked;
  65038. },
  65039. // Call all callbacks with the given context and arguments
  65040. fireWith: function( context, args ) {
  65041. if ( !locked ) {
  65042. args = args || [];
  65043. args = [ context, args.slice ? args.slice() : args ];
  65044. queue.push( args );
  65045. if ( !firing ) {
  65046. fire();
  65047. }
  65048. }
  65049. return this;
  65050. },
  65051. // Call all the callbacks with the given arguments
  65052. fire: function() {
  65053. self.fireWith( this, arguments );
  65054. return this;
  65055. },
  65056. // To know if the callbacks have already been called at least once
  65057. fired: function() {
  65058. return !!fired;
  65059. }
  65060. };
  65061. return self;
  65062. };
  65063. function Identity( v ) {
  65064. return v;
  65065. }
  65066. function Thrower( ex ) {
  65067. throw ex;
  65068. }
  65069. function adoptValue( value, resolve, reject, noValue ) {
  65070. var method;
  65071. try {
  65072. // Check for promise aspect first to privilege synchronous behavior
  65073. if ( value && isFunction( ( method = value.promise ) ) ) {
  65074. method.call( value ).done( resolve ).fail( reject );
  65075. // Other thenables
  65076. } else if ( value && isFunction( ( method = value.then ) ) ) {
  65077. method.call( value, resolve, reject );
  65078. // Other non-thenables
  65079. } else {
  65080. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  65081. // * false: [ value ].slice( 0 ) => resolve( value )
  65082. // * true: [ value ].slice( 1 ) => resolve()
  65083. resolve.apply( undefined, [ value ].slice( noValue ) );
  65084. }
  65085. // For Promises/A+, convert exceptions into rejections
  65086. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  65087. // Deferred#then to conditionally suppress rejection.
  65088. } catch ( value ) {
  65089. // Support: Android 4.0 only
  65090. // Strict mode functions invoked without .call/.apply get global-object context
  65091. reject.apply( undefined, [ value ] );
  65092. }
  65093. }
  65094. jQuery.extend( {
  65095. Deferred: function( func ) {
  65096. var tuples = [
  65097. // action, add listener, callbacks,
  65098. // ... .then handlers, argument index, [final state]
  65099. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  65100. jQuery.Callbacks( "memory" ), 2 ],
  65101. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  65102. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  65103. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  65104. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  65105. ],
  65106. state = "pending",
  65107. promise = {
  65108. state: function() {
  65109. return state;
  65110. },
  65111. always: function() {
  65112. deferred.done( arguments ).fail( arguments );
  65113. return this;
  65114. },
  65115. "catch": function( fn ) {
  65116. return promise.then( null, fn );
  65117. },
  65118. // Keep pipe for back-compat
  65119. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  65120. var fns = arguments;
  65121. return jQuery.Deferred( function( newDefer ) {
  65122. jQuery.each( tuples, function( _i, tuple ) {
  65123. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  65124. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  65125. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  65126. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  65127. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  65128. deferred[ tuple[ 1 ] ]( function() {
  65129. var returned = fn && fn.apply( this, arguments );
  65130. if ( returned && isFunction( returned.promise ) ) {
  65131. returned.promise()
  65132. .progress( newDefer.notify )
  65133. .done( newDefer.resolve )
  65134. .fail( newDefer.reject );
  65135. } else {
  65136. newDefer[ tuple[ 0 ] + "With" ](
  65137. this,
  65138. fn ? [ returned ] : arguments
  65139. );
  65140. }
  65141. } );
  65142. } );
  65143. fns = null;
  65144. } ).promise();
  65145. },
  65146. then: function( onFulfilled, onRejected, onProgress ) {
  65147. var maxDepth = 0;
  65148. function resolve( depth, deferred, handler, special ) {
  65149. return function() {
  65150. var that = this,
  65151. args = arguments,
  65152. mightThrow = function() {
  65153. var returned, then;
  65154. // Support: Promises/A+ section 2.3.3.3.3
  65155. // https://promisesaplus.com/#point-59
  65156. // Ignore double-resolution attempts
  65157. if ( depth < maxDepth ) {
  65158. return;
  65159. }
  65160. returned = handler.apply( that, args );
  65161. // Support: Promises/A+ section 2.3.1
  65162. // https://promisesaplus.com/#point-48
  65163. if ( returned === deferred.promise() ) {
  65164. throw new TypeError( "Thenable self-resolution" );
  65165. }
  65166. // Support: Promises/A+ sections 2.3.3.1, 3.5
  65167. // https://promisesaplus.com/#point-54
  65168. // https://promisesaplus.com/#point-75
  65169. // Retrieve `then` only once
  65170. then = returned &&
  65171. // Support: Promises/A+ section 2.3.4
  65172. // https://promisesaplus.com/#point-64
  65173. // Only check objects and functions for thenability
  65174. ( typeof returned === "object" ||
  65175. typeof returned === "function" ) &&
  65176. returned.then;
  65177. // Handle a returned thenable
  65178. if ( isFunction( then ) ) {
  65179. // Special processors (notify) just wait for resolution
  65180. if ( special ) {
  65181. then.call(
  65182. returned,
  65183. resolve( maxDepth, deferred, Identity, special ),
  65184. resolve( maxDepth, deferred, Thrower, special )
  65185. );
  65186. // Normal processors (resolve) also hook into progress
  65187. } else {
  65188. // ...and disregard older resolution values
  65189. maxDepth++;
  65190. then.call(
  65191. returned,
  65192. resolve( maxDepth, deferred, Identity, special ),
  65193. resolve( maxDepth, deferred, Thrower, special ),
  65194. resolve( maxDepth, deferred, Identity,
  65195. deferred.notifyWith )
  65196. );
  65197. }
  65198. // Handle all other returned values
  65199. } else {
  65200. // Only substitute handlers pass on context
  65201. // and multiple values (non-spec behavior)
  65202. if ( handler !== Identity ) {
  65203. that = undefined;
  65204. args = [ returned ];
  65205. }
  65206. // Process the value(s)
  65207. // Default process is resolve
  65208. ( special || deferred.resolveWith )( that, args );
  65209. }
  65210. },
  65211. // Only normal processors (resolve) catch and reject exceptions
  65212. process = special ?
  65213. mightThrow :
  65214. function() {
  65215. try {
  65216. mightThrow();
  65217. } catch ( e ) {
  65218. if ( jQuery.Deferred.exceptionHook ) {
  65219. jQuery.Deferred.exceptionHook( e,
  65220. process.stackTrace );
  65221. }
  65222. // Support: Promises/A+ section 2.3.3.3.4.1
  65223. // https://promisesaplus.com/#point-61
  65224. // Ignore post-resolution exceptions
  65225. if ( depth + 1 >= maxDepth ) {
  65226. // Only substitute handlers pass on context
  65227. // and multiple values (non-spec behavior)
  65228. if ( handler !== Thrower ) {
  65229. that = undefined;
  65230. args = [ e ];
  65231. }
  65232. deferred.rejectWith( that, args );
  65233. }
  65234. }
  65235. };
  65236. // Support: Promises/A+ section 2.3.3.3.1
  65237. // https://promisesaplus.com/#point-57
  65238. // Re-resolve promises immediately to dodge false rejection from
  65239. // subsequent errors
  65240. if ( depth ) {
  65241. process();
  65242. } else {
  65243. // Call an optional hook to record the stack, in case of exception
  65244. // since it's otherwise lost when execution goes async
  65245. if ( jQuery.Deferred.getStackHook ) {
  65246. process.stackTrace = jQuery.Deferred.getStackHook();
  65247. }
  65248. window.setTimeout( process );
  65249. }
  65250. };
  65251. }
  65252. return jQuery.Deferred( function( newDefer ) {
  65253. // progress_handlers.add( ... )
  65254. tuples[ 0 ][ 3 ].add(
  65255. resolve(
  65256. 0,
  65257. newDefer,
  65258. isFunction( onProgress ) ?
  65259. onProgress :
  65260. Identity,
  65261. newDefer.notifyWith
  65262. )
  65263. );
  65264. // fulfilled_handlers.add( ... )
  65265. tuples[ 1 ][ 3 ].add(
  65266. resolve(
  65267. 0,
  65268. newDefer,
  65269. isFunction( onFulfilled ) ?
  65270. onFulfilled :
  65271. Identity
  65272. )
  65273. );
  65274. // rejected_handlers.add( ... )
  65275. tuples[ 2 ][ 3 ].add(
  65276. resolve(
  65277. 0,
  65278. newDefer,
  65279. isFunction( onRejected ) ?
  65280. onRejected :
  65281. Thrower
  65282. )
  65283. );
  65284. } ).promise();
  65285. },
  65286. // Get a promise for this deferred
  65287. // If obj is provided, the promise aspect is added to the object
  65288. promise: function( obj ) {
  65289. return obj != null ? jQuery.extend( obj, promise ) : promise;
  65290. }
  65291. },
  65292. deferred = {};
  65293. // Add list-specific methods
  65294. jQuery.each( tuples, function( i, tuple ) {
  65295. var list = tuple[ 2 ],
  65296. stateString = tuple[ 5 ];
  65297. // promise.progress = list.add
  65298. // promise.done = list.add
  65299. // promise.fail = list.add
  65300. promise[ tuple[ 1 ] ] = list.add;
  65301. // Handle state
  65302. if ( stateString ) {
  65303. list.add(
  65304. function() {
  65305. // state = "resolved" (i.e., fulfilled)
  65306. // state = "rejected"
  65307. state = stateString;
  65308. },
  65309. // rejected_callbacks.disable
  65310. // fulfilled_callbacks.disable
  65311. tuples[ 3 - i ][ 2 ].disable,
  65312. // rejected_handlers.disable
  65313. // fulfilled_handlers.disable
  65314. tuples[ 3 - i ][ 3 ].disable,
  65315. // progress_callbacks.lock
  65316. tuples[ 0 ][ 2 ].lock,
  65317. // progress_handlers.lock
  65318. tuples[ 0 ][ 3 ].lock
  65319. );
  65320. }
  65321. // progress_handlers.fire
  65322. // fulfilled_handlers.fire
  65323. // rejected_handlers.fire
  65324. list.add( tuple[ 3 ].fire );
  65325. // deferred.notify = function() { deferred.notifyWith(...) }
  65326. // deferred.resolve = function() { deferred.resolveWith(...) }
  65327. // deferred.reject = function() { deferred.rejectWith(...) }
  65328. deferred[ tuple[ 0 ] ] = function() {
  65329. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  65330. return this;
  65331. };
  65332. // deferred.notifyWith = list.fireWith
  65333. // deferred.resolveWith = list.fireWith
  65334. // deferred.rejectWith = list.fireWith
  65335. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  65336. } );
  65337. // Make the deferred a promise
  65338. promise.promise( deferred );
  65339. // Call given func if any
  65340. if ( func ) {
  65341. func.call( deferred, deferred );
  65342. }
  65343. // All done!
  65344. return deferred;
  65345. },
  65346. // Deferred helper
  65347. when: function( singleValue ) {
  65348. var
  65349. // count of uncompleted subordinates
  65350. remaining = arguments.length,
  65351. // count of unprocessed arguments
  65352. i = remaining,
  65353. // subordinate fulfillment data
  65354. resolveContexts = Array( i ),
  65355. resolveValues = slice.call( arguments ),
  65356. // the master Deferred
  65357. master = jQuery.Deferred(),
  65358. // subordinate callback factory
  65359. updateFunc = function( i ) {
  65360. return function( value ) {
  65361. resolveContexts[ i ] = this;
  65362. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  65363. if ( !( --remaining ) ) {
  65364. master.resolveWith( resolveContexts, resolveValues );
  65365. }
  65366. };
  65367. };
  65368. // Single- and empty arguments are adopted like Promise.resolve
  65369. if ( remaining <= 1 ) {
  65370. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
  65371. !remaining );
  65372. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  65373. if ( master.state() === "pending" ||
  65374. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  65375. return master.then();
  65376. }
  65377. }
  65378. // Multiple arguments are aggregated like Promise.all array elements
  65379. while ( i-- ) {
  65380. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  65381. }
  65382. return master.promise();
  65383. }
  65384. } );
  65385. // These usually indicate a programmer mistake during development,
  65386. // warn about them ASAP rather than swallowing them by default.
  65387. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  65388. jQuery.Deferred.exceptionHook = function( error, stack ) {
  65389. // Support: IE 8 - 9 only
  65390. // Console exists when dev tools are open, which can happen at any time
  65391. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  65392. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  65393. }
  65394. };
  65395. jQuery.readyException = function( error ) {
  65396. window.setTimeout( function() {
  65397. throw error;
  65398. } );
  65399. };
  65400. // The deferred used on DOM ready
  65401. var readyList = jQuery.Deferred();
  65402. jQuery.fn.ready = function( fn ) {
  65403. readyList
  65404. .then( fn )
  65405. // Wrap jQuery.readyException in a function so that the lookup
  65406. // happens at the time of error handling instead of callback
  65407. // registration.
  65408. .catch( function( error ) {
  65409. jQuery.readyException( error );
  65410. } );
  65411. return this;
  65412. };
  65413. jQuery.extend( {
  65414. // Is the DOM ready to be used? Set to true once it occurs.
  65415. isReady: false,
  65416. // A counter to track how many items to wait for before
  65417. // the ready event fires. See #6781
  65418. readyWait: 1,
  65419. // Handle when the DOM is ready
  65420. ready: function( wait ) {
  65421. // Abort if there are pending holds or we're already ready
  65422. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  65423. return;
  65424. }
  65425. // Remember that the DOM is ready
  65426. jQuery.isReady = true;
  65427. // If a normal DOM Ready event fired, decrement, and wait if need be
  65428. if ( wait !== true && --jQuery.readyWait > 0 ) {
  65429. return;
  65430. }
  65431. // If there are functions bound, to execute
  65432. readyList.resolveWith( document, [ jQuery ] );
  65433. }
  65434. } );
  65435. jQuery.ready.then = readyList.then;
  65436. // The ready event handler and self cleanup method
  65437. function completed() {
  65438. document.removeEventListener( "DOMContentLoaded", completed );
  65439. window.removeEventListener( "load", completed );
  65440. jQuery.ready();
  65441. }
  65442. // Catch cases where $(document).ready() is called
  65443. // after the browser event has already occurred.
  65444. // Support: IE <=9 - 10 only
  65445. // Older IE sometimes signals "interactive" too soon
  65446. if ( document.readyState === "complete" ||
  65447. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  65448. // Handle it asynchronously to allow scripts the opportunity to delay ready
  65449. window.setTimeout( jQuery.ready );
  65450. } else {
  65451. // Use the handy event callback
  65452. document.addEventListener( "DOMContentLoaded", completed );
  65453. // A fallback to window.onload, that will always work
  65454. window.addEventListener( "load", completed );
  65455. }
  65456. // Multifunctional method to get and set values of a collection
  65457. // The value/s can optionally be executed if it's a function
  65458. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  65459. var i = 0,
  65460. len = elems.length,
  65461. bulk = key == null;
  65462. // Sets many values
  65463. if ( toType( key ) === "object" ) {
  65464. chainable = true;
  65465. for ( i in key ) {
  65466. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  65467. }
  65468. // Sets one value
  65469. } else if ( value !== undefined ) {
  65470. chainable = true;
  65471. if ( !isFunction( value ) ) {
  65472. raw = true;
  65473. }
  65474. if ( bulk ) {
  65475. // Bulk operations run against the entire set
  65476. if ( raw ) {
  65477. fn.call( elems, value );
  65478. fn = null;
  65479. // ...except when executing function values
  65480. } else {
  65481. bulk = fn;
  65482. fn = function( elem, _key, value ) {
  65483. return bulk.call( jQuery( elem ), value );
  65484. };
  65485. }
  65486. }
  65487. if ( fn ) {
  65488. for ( ; i < len; i++ ) {
  65489. fn(
  65490. elems[ i ], key, raw ?
  65491. value :
  65492. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  65493. );
  65494. }
  65495. }
  65496. }
  65497. if ( chainable ) {
  65498. return elems;
  65499. }
  65500. // Gets
  65501. if ( bulk ) {
  65502. return fn.call( elems );
  65503. }
  65504. return len ? fn( elems[ 0 ], key ) : emptyGet;
  65505. };
  65506. // Matches dashed string for camelizing
  65507. var rmsPrefix = /^-ms-/,
  65508. rdashAlpha = /-([a-z])/g;
  65509. // Used by camelCase as callback to replace()
  65510. function fcamelCase( _all, letter ) {
  65511. return letter.toUpperCase();
  65512. }
  65513. // Convert dashed to camelCase; used by the css and data modules
  65514. // Support: IE <=9 - 11, Edge 12 - 15
  65515. // Microsoft forgot to hump their vendor prefix (#9572)
  65516. function camelCase( string ) {
  65517. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  65518. }
  65519. var acceptData = function( owner ) {
  65520. // Accepts only:
  65521. // - Node
  65522. // - Node.ELEMENT_NODE
  65523. // - Node.DOCUMENT_NODE
  65524. // - Object
  65525. // - Any
  65526. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  65527. };
  65528. function Data() {
  65529. this.expando = jQuery.expando + Data.uid++;
  65530. }
  65531. Data.uid = 1;
  65532. Data.prototype = {
  65533. cache: function( owner ) {
  65534. // Check if the owner object already has a cache
  65535. var value = owner[ this.expando ];
  65536. // If not, create one
  65537. if ( !value ) {
  65538. value = {};
  65539. // We can accept data for non-element nodes in modern browsers,
  65540. // but we should not, see #8335.
  65541. // Always return an empty object.
  65542. if ( acceptData( owner ) ) {
  65543. // If it is a node unlikely to be stringify-ed or looped over
  65544. // use plain assignment
  65545. if ( owner.nodeType ) {
  65546. owner[ this.expando ] = value;
  65547. // Otherwise secure it in a non-enumerable property
  65548. // configurable must be true to allow the property to be
  65549. // deleted when data is removed
  65550. } else {
  65551. Object.defineProperty( owner, this.expando, {
  65552. value: value,
  65553. configurable: true
  65554. } );
  65555. }
  65556. }
  65557. }
  65558. return value;
  65559. },
  65560. set: function( owner, data, value ) {
  65561. var prop,
  65562. cache = this.cache( owner );
  65563. // Handle: [ owner, key, value ] args
  65564. // Always use camelCase key (gh-2257)
  65565. if ( typeof data === "string" ) {
  65566. cache[ camelCase( data ) ] = value;
  65567. // Handle: [ owner, { properties } ] args
  65568. } else {
  65569. // Copy the properties one-by-one to the cache object
  65570. for ( prop in data ) {
  65571. cache[ camelCase( prop ) ] = data[ prop ];
  65572. }
  65573. }
  65574. return cache;
  65575. },
  65576. get: function( owner, key ) {
  65577. return key === undefined ?
  65578. this.cache( owner ) :
  65579. // Always use camelCase key (gh-2257)
  65580. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  65581. },
  65582. access: function( owner, key, value ) {
  65583. // In cases where either:
  65584. //
  65585. // 1. No key was specified
  65586. // 2. A string key was specified, but no value provided
  65587. //
  65588. // Take the "read" path and allow the get method to determine
  65589. // which value to return, respectively either:
  65590. //
  65591. // 1. The entire cache object
  65592. // 2. The data stored at the key
  65593. //
  65594. if ( key === undefined ||
  65595. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  65596. return this.get( owner, key );
  65597. }
  65598. // When the key is not a string, or both a key and value
  65599. // are specified, set or extend (existing objects) with either:
  65600. //
  65601. // 1. An object of properties
  65602. // 2. A key and value
  65603. //
  65604. this.set( owner, key, value );
  65605. // Since the "set" path can have two possible entry points
  65606. // return the expected data based on which path was taken[*]
  65607. return value !== undefined ? value : key;
  65608. },
  65609. remove: function( owner, key ) {
  65610. var i,
  65611. cache = owner[ this.expando ];
  65612. if ( cache === undefined ) {
  65613. return;
  65614. }
  65615. if ( key !== undefined ) {
  65616. // Support array or space separated string of keys
  65617. if ( Array.isArray( key ) ) {
  65618. // If key is an array of keys...
  65619. // We always set camelCase keys, so remove that.
  65620. key = key.map( camelCase );
  65621. } else {
  65622. key = camelCase( key );
  65623. // If a key with the spaces exists, use it.
  65624. // Otherwise, create an array by matching non-whitespace
  65625. key = key in cache ?
  65626. [ key ] :
  65627. ( key.match( rnothtmlwhite ) || [] );
  65628. }
  65629. i = key.length;
  65630. while ( i-- ) {
  65631. delete cache[ key[ i ] ];
  65632. }
  65633. }
  65634. // Remove the expando if there's no more data
  65635. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  65636. // Support: Chrome <=35 - 45
  65637. // Webkit & Blink performance suffers when deleting properties
  65638. // from DOM nodes, so set to undefined instead
  65639. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  65640. if ( owner.nodeType ) {
  65641. owner[ this.expando ] = undefined;
  65642. } else {
  65643. delete owner[ this.expando ];
  65644. }
  65645. }
  65646. },
  65647. hasData: function( owner ) {
  65648. var cache = owner[ this.expando ];
  65649. return cache !== undefined && !jQuery.isEmptyObject( cache );
  65650. }
  65651. };
  65652. var dataPriv = new Data();
  65653. var dataUser = new Data();
  65654. // Implementation Summary
  65655. //
  65656. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  65657. // 2. Improve the module's maintainability by reducing the storage
  65658. // paths to a single mechanism.
  65659. // 3. Use the same single mechanism to support "private" and "user" data.
  65660. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  65661. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  65662. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  65663. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  65664. rmultiDash = /[A-Z]/g;
  65665. function getData( data ) {
  65666. if ( data === "true" ) {
  65667. return true;
  65668. }
  65669. if ( data === "false" ) {
  65670. return false;
  65671. }
  65672. if ( data === "null" ) {
  65673. return null;
  65674. }
  65675. // Only convert to a number if it doesn't change the string
  65676. if ( data === +data + "" ) {
  65677. return +data;
  65678. }
  65679. if ( rbrace.test( data ) ) {
  65680. return JSON.parse( data );
  65681. }
  65682. return data;
  65683. }
  65684. function dataAttr( elem, key, data ) {
  65685. var name;
  65686. // If nothing was found internally, try to fetch any
  65687. // data from the HTML5 data-* attribute
  65688. if ( data === undefined && elem.nodeType === 1 ) {
  65689. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  65690. data = elem.getAttribute( name );
  65691. if ( typeof data === "string" ) {
  65692. try {
  65693. data = getData( data );
  65694. } catch ( e ) {}
  65695. // Make sure we set the data so it isn't changed later
  65696. dataUser.set( elem, key, data );
  65697. } else {
  65698. data = undefined;
  65699. }
  65700. }
  65701. return data;
  65702. }
  65703. jQuery.extend( {
  65704. hasData: function( elem ) {
  65705. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  65706. },
  65707. data: function( elem, name, data ) {
  65708. return dataUser.access( elem, name, data );
  65709. },
  65710. removeData: function( elem, name ) {
  65711. dataUser.remove( elem, name );
  65712. },
  65713. // TODO: Now that all calls to _data and _removeData have been replaced
  65714. // with direct calls to dataPriv methods, these can be deprecated.
  65715. _data: function( elem, name, data ) {
  65716. return dataPriv.access( elem, name, data );
  65717. },
  65718. _removeData: function( elem, name ) {
  65719. dataPriv.remove( elem, name );
  65720. }
  65721. } );
  65722. jQuery.fn.extend( {
  65723. data: function( key, value ) {
  65724. var i, name, data,
  65725. elem = this[ 0 ],
  65726. attrs = elem && elem.attributes;
  65727. // Gets all values
  65728. if ( key === undefined ) {
  65729. if ( this.length ) {
  65730. data = dataUser.get( elem );
  65731. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  65732. i = attrs.length;
  65733. while ( i-- ) {
  65734. // Support: IE 11 only
  65735. // The attrs elements can be null (#14894)
  65736. if ( attrs[ i ] ) {
  65737. name = attrs[ i ].name;
  65738. if ( name.indexOf( "data-" ) === 0 ) {
  65739. name = camelCase( name.slice( 5 ) );
  65740. dataAttr( elem, name, data[ name ] );
  65741. }
  65742. }
  65743. }
  65744. dataPriv.set( elem, "hasDataAttrs", true );
  65745. }
  65746. }
  65747. return data;
  65748. }
  65749. // Sets multiple values
  65750. if ( typeof key === "object" ) {
  65751. return this.each( function() {
  65752. dataUser.set( this, key );
  65753. } );
  65754. }
  65755. return access( this, function( value ) {
  65756. var data;
  65757. // The calling jQuery object (element matches) is not empty
  65758. // (and therefore has an element appears at this[ 0 ]) and the
  65759. // `value` parameter was not undefined. An empty jQuery object
  65760. // will result in `undefined` for elem = this[ 0 ] which will
  65761. // throw an exception if an attempt to read a data cache is made.
  65762. if ( elem && value === undefined ) {
  65763. // Attempt to get data from the cache
  65764. // The key will always be camelCased in Data
  65765. data = dataUser.get( elem, key );
  65766. if ( data !== undefined ) {
  65767. return data;
  65768. }
  65769. // Attempt to "discover" the data in
  65770. // HTML5 custom data-* attrs
  65771. data = dataAttr( elem, key );
  65772. if ( data !== undefined ) {
  65773. return data;
  65774. }
  65775. // We tried really hard, but the data doesn't exist.
  65776. return;
  65777. }
  65778. // Set the data...
  65779. this.each( function() {
  65780. // We always store the camelCased key
  65781. dataUser.set( this, key, value );
  65782. } );
  65783. }, null, value, arguments.length > 1, null, true );
  65784. },
  65785. removeData: function( key ) {
  65786. return this.each( function() {
  65787. dataUser.remove( this, key );
  65788. } );
  65789. }
  65790. } );
  65791. jQuery.extend( {
  65792. queue: function( elem, type, data ) {
  65793. var queue;
  65794. if ( elem ) {
  65795. type = ( type || "fx" ) + "queue";
  65796. queue = dataPriv.get( elem, type );
  65797. // Speed up dequeue by getting out quickly if this is just a lookup
  65798. if ( data ) {
  65799. if ( !queue || Array.isArray( data ) ) {
  65800. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  65801. } else {
  65802. queue.push( data );
  65803. }
  65804. }
  65805. return queue || [];
  65806. }
  65807. },
  65808. dequeue: function( elem, type ) {
  65809. type = type || "fx";
  65810. var queue = jQuery.queue( elem, type ),
  65811. startLength = queue.length,
  65812. fn = queue.shift(),
  65813. hooks = jQuery._queueHooks( elem, type ),
  65814. next = function() {
  65815. jQuery.dequeue( elem, type );
  65816. };
  65817. // If the fx queue is dequeued, always remove the progress sentinel
  65818. if ( fn === "inprogress" ) {
  65819. fn = queue.shift();
  65820. startLength--;
  65821. }
  65822. if ( fn ) {
  65823. // Add a progress sentinel to prevent the fx queue from being
  65824. // automatically dequeued
  65825. if ( type === "fx" ) {
  65826. queue.unshift( "inprogress" );
  65827. }
  65828. // Clear up the last queue stop function
  65829. delete hooks.stop;
  65830. fn.call( elem, next, hooks );
  65831. }
  65832. if ( !startLength && hooks ) {
  65833. hooks.empty.fire();
  65834. }
  65835. },
  65836. // Not public - generate a queueHooks object, or return the current one
  65837. _queueHooks: function( elem, type ) {
  65838. var key = type + "queueHooks";
  65839. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  65840. empty: jQuery.Callbacks( "once memory" ).add( function() {
  65841. dataPriv.remove( elem, [ type + "queue", key ] );
  65842. } )
  65843. } );
  65844. }
  65845. } );
  65846. jQuery.fn.extend( {
  65847. queue: function( type, data ) {
  65848. var setter = 2;
  65849. if ( typeof type !== "string" ) {
  65850. data = type;
  65851. type = "fx";
  65852. setter--;
  65853. }
  65854. if ( arguments.length < setter ) {
  65855. return jQuery.queue( this[ 0 ], type );
  65856. }
  65857. return data === undefined ?
  65858. this :
  65859. this.each( function() {
  65860. var queue = jQuery.queue( this, type, data );
  65861. // Ensure a hooks for this queue
  65862. jQuery._queueHooks( this, type );
  65863. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  65864. jQuery.dequeue( this, type );
  65865. }
  65866. } );
  65867. },
  65868. dequeue: function( type ) {
  65869. return this.each( function() {
  65870. jQuery.dequeue( this, type );
  65871. } );
  65872. },
  65873. clearQueue: function( type ) {
  65874. return this.queue( type || "fx", [] );
  65875. },
  65876. // Get a promise resolved when queues of a certain type
  65877. // are emptied (fx is the type by default)
  65878. promise: function( type, obj ) {
  65879. var tmp,
  65880. count = 1,
  65881. defer = jQuery.Deferred(),
  65882. elements = this,
  65883. i = this.length,
  65884. resolve = function() {
  65885. if ( !( --count ) ) {
  65886. defer.resolveWith( elements, [ elements ] );
  65887. }
  65888. };
  65889. if ( typeof type !== "string" ) {
  65890. obj = type;
  65891. type = undefined;
  65892. }
  65893. type = type || "fx";
  65894. while ( i-- ) {
  65895. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  65896. if ( tmp && tmp.empty ) {
  65897. count++;
  65898. tmp.empty.add( resolve );
  65899. }
  65900. }
  65901. resolve();
  65902. return defer.promise( obj );
  65903. }
  65904. } );
  65905. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  65906. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  65907. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  65908. var documentElement = document.documentElement;
  65909. var isAttached = function( elem ) {
  65910. return jQuery.contains( elem.ownerDocument, elem );
  65911. },
  65912. composed = { composed: true };
  65913. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  65914. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  65915. // Support: iOS 10.0-10.2 only
  65916. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  65917. // leading to errors. We need to check for `getRootNode`.
  65918. if ( documentElement.getRootNode ) {
  65919. isAttached = function( elem ) {
  65920. return jQuery.contains( elem.ownerDocument, elem ) ||
  65921. elem.getRootNode( composed ) === elem.ownerDocument;
  65922. };
  65923. }
  65924. var isHiddenWithinTree = function( elem, el ) {
  65925. // isHiddenWithinTree might be called from jQuery#filter function;
  65926. // in that case, element will be second argument
  65927. elem = el || elem;
  65928. // Inline style trumps all
  65929. return elem.style.display === "none" ||
  65930. elem.style.display === "" &&
  65931. // Otherwise, check computed style
  65932. // Support: Firefox <=43 - 45
  65933. // Disconnected elements can have computed display: none, so first confirm that elem is
  65934. // in the document.
  65935. isAttached( elem ) &&
  65936. jQuery.css( elem, "display" ) === "none";
  65937. };
  65938. function adjustCSS( elem, prop, valueParts, tween ) {
  65939. var adjusted, scale,
  65940. maxIterations = 20,
  65941. currentValue = tween ?
  65942. function() {
  65943. return tween.cur();
  65944. } :
  65945. function() {
  65946. return jQuery.css( elem, prop, "" );
  65947. },
  65948. initial = currentValue(),
  65949. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  65950. // Starting value computation is required for potential unit mismatches
  65951. initialInUnit = elem.nodeType &&
  65952. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  65953. rcssNum.exec( jQuery.css( elem, prop ) );
  65954. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  65955. // Support: Firefox <=54
  65956. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  65957. initial = initial / 2;
  65958. // Trust units reported by jQuery.css
  65959. unit = unit || initialInUnit[ 3 ];
  65960. // Iteratively approximate from a nonzero starting point
  65961. initialInUnit = +initial || 1;
  65962. while ( maxIterations-- ) {
  65963. // Evaluate and update our best guess (doubling guesses that zero out).
  65964. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  65965. jQuery.style( elem, prop, initialInUnit + unit );
  65966. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  65967. maxIterations = 0;
  65968. }
  65969. initialInUnit = initialInUnit / scale;
  65970. }
  65971. initialInUnit = initialInUnit * 2;
  65972. jQuery.style( elem, prop, initialInUnit + unit );
  65973. // Make sure we update the tween properties later on
  65974. valueParts = valueParts || [];
  65975. }
  65976. if ( valueParts ) {
  65977. initialInUnit = +initialInUnit || +initial || 0;
  65978. // Apply relative offset (+=/-=) if specified
  65979. adjusted = valueParts[ 1 ] ?
  65980. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  65981. +valueParts[ 2 ];
  65982. if ( tween ) {
  65983. tween.unit = unit;
  65984. tween.start = initialInUnit;
  65985. tween.end = adjusted;
  65986. }
  65987. }
  65988. return adjusted;
  65989. }
  65990. var defaultDisplayMap = {};
  65991. function getDefaultDisplay( elem ) {
  65992. var temp,
  65993. doc = elem.ownerDocument,
  65994. nodeName = elem.nodeName,
  65995. display = defaultDisplayMap[ nodeName ];
  65996. if ( display ) {
  65997. return display;
  65998. }
  65999. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  66000. display = jQuery.css( temp, "display" );
  66001. temp.parentNode.removeChild( temp );
  66002. if ( display === "none" ) {
  66003. display = "block";
  66004. }
  66005. defaultDisplayMap[ nodeName ] = display;
  66006. return display;
  66007. }
  66008. function showHide( elements, show ) {
  66009. var display, elem,
  66010. values = [],
  66011. index = 0,
  66012. length = elements.length;
  66013. // Determine new display value for elements that need to change
  66014. for ( ; index < length; index++ ) {
  66015. elem = elements[ index ];
  66016. if ( !elem.style ) {
  66017. continue;
  66018. }
  66019. display = elem.style.display;
  66020. if ( show ) {
  66021. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  66022. // check is required in this first loop unless we have a nonempty display value (either
  66023. // inline or about-to-be-restored)
  66024. if ( display === "none" ) {
  66025. values[ index ] = dataPriv.get( elem, "display" ) || null;
  66026. if ( !values[ index ] ) {
  66027. elem.style.display = "";
  66028. }
  66029. }
  66030. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  66031. values[ index ] = getDefaultDisplay( elem );
  66032. }
  66033. } else {
  66034. if ( display !== "none" ) {
  66035. values[ index ] = "none";
  66036. // Remember what we're overwriting
  66037. dataPriv.set( elem, "display", display );
  66038. }
  66039. }
  66040. }
  66041. // Set the display of the elements in a second loop to avoid constant reflow
  66042. for ( index = 0; index < length; index++ ) {
  66043. if ( values[ index ] != null ) {
  66044. elements[ index ].style.display = values[ index ];
  66045. }
  66046. }
  66047. return elements;
  66048. }
  66049. jQuery.fn.extend( {
  66050. show: function() {
  66051. return showHide( this, true );
  66052. },
  66053. hide: function() {
  66054. return showHide( this );
  66055. },
  66056. toggle: function( state ) {
  66057. if ( typeof state === "boolean" ) {
  66058. return state ? this.show() : this.hide();
  66059. }
  66060. return this.each( function() {
  66061. if ( isHiddenWithinTree( this ) ) {
  66062. jQuery( this ).show();
  66063. } else {
  66064. jQuery( this ).hide();
  66065. }
  66066. } );
  66067. }
  66068. } );
  66069. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  66070. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  66071. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  66072. ( function() {
  66073. var fragment = document.createDocumentFragment(),
  66074. div = fragment.appendChild( document.createElement( "div" ) ),
  66075. input = document.createElement( "input" );
  66076. // Support: Android 4.0 - 4.3 only
  66077. // Check state lost if the name is set (#11217)
  66078. // Support: Windows Web Apps (WWA)
  66079. // `name` and `type` must use .setAttribute for WWA (#14901)
  66080. input.setAttribute( "type", "radio" );
  66081. input.setAttribute( "checked", "checked" );
  66082. input.setAttribute( "name", "t" );
  66083. div.appendChild( input );
  66084. // Support: Android <=4.1 only
  66085. // Older WebKit doesn't clone checked state correctly in fragments
  66086. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  66087. // Support: IE <=11 only
  66088. // Make sure textarea (and checkbox) defaultValue is properly cloned
  66089. div.innerHTML = "<textarea>x</textarea>";
  66090. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  66091. // Support: IE <=9 only
  66092. // IE <=9 replaces <option> tags with their contents when inserted outside of
  66093. // the select element.
  66094. div.innerHTML = "<option></option>";
  66095. support.option = !!div.lastChild;
  66096. } )();
  66097. // We have to close these tags to support XHTML (#13200)
  66098. var wrapMap = {
  66099. // XHTML parsers do not magically insert elements in the
  66100. // same way that tag soup parsers do. So we cannot shorten
  66101. // this by omitting <tbody> or other required elements.
  66102. thead: [ 1, "<table>", "</table>" ],
  66103. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  66104. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  66105. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  66106. _default: [ 0, "", "" ]
  66107. };
  66108. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  66109. wrapMap.th = wrapMap.td;
  66110. // Support: IE <=9 only
  66111. if ( !support.option ) {
  66112. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  66113. }
  66114. function getAll( context, tag ) {
  66115. // Support: IE <=9 - 11 only
  66116. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  66117. var ret;
  66118. if ( typeof context.getElementsByTagName !== "undefined" ) {
  66119. ret = context.getElementsByTagName( tag || "*" );
  66120. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  66121. ret = context.querySelectorAll( tag || "*" );
  66122. } else {
  66123. ret = [];
  66124. }
  66125. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  66126. return jQuery.merge( [ context ], ret );
  66127. }
  66128. return ret;
  66129. }
  66130. // Mark scripts as having already been evaluated
  66131. function setGlobalEval( elems, refElements ) {
  66132. var i = 0,
  66133. l = elems.length;
  66134. for ( ; i < l; i++ ) {
  66135. dataPriv.set(
  66136. elems[ i ],
  66137. "globalEval",
  66138. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  66139. );
  66140. }
  66141. }
  66142. var rhtml = /<|&#?\w+;/;
  66143. function buildFragment( elems, context, scripts, selection, ignored ) {
  66144. var elem, tmp, tag, wrap, attached, j,
  66145. fragment = context.createDocumentFragment(),
  66146. nodes = [],
  66147. i = 0,
  66148. l = elems.length;
  66149. for ( ; i < l; i++ ) {
  66150. elem = elems[ i ];
  66151. if ( elem || elem === 0 ) {
  66152. // Add nodes directly
  66153. if ( toType( elem ) === "object" ) {
  66154. // Support: Android <=4.0 only, PhantomJS 1 only
  66155. // push.apply(_, arraylike) throws on ancient WebKit
  66156. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  66157. // Convert non-html into a text node
  66158. } else if ( !rhtml.test( elem ) ) {
  66159. nodes.push( context.createTextNode( elem ) );
  66160. // Convert html into DOM nodes
  66161. } else {
  66162. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  66163. // Deserialize a standard representation
  66164. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  66165. wrap = wrapMap[ tag ] || wrapMap._default;
  66166. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  66167. // Descend through wrappers to the right content
  66168. j = wrap[ 0 ];
  66169. while ( j-- ) {
  66170. tmp = tmp.lastChild;
  66171. }
  66172. // Support: Android <=4.0 only, PhantomJS 1 only
  66173. // push.apply(_, arraylike) throws on ancient WebKit
  66174. jQuery.merge( nodes, tmp.childNodes );
  66175. // Remember the top-level container
  66176. tmp = fragment.firstChild;
  66177. // Ensure the created nodes are orphaned (#12392)
  66178. tmp.textContent = "";
  66179. }
  66180. }
  66181. }
  66182. // Remove wrapper from fragment
  66183. fragment.textContent = "";
  66184. i = 0;
  66185. while ( ( elem = nodes[ i++ ] ) ) {
  66186. // Skip elements already in the context collection (trac-4087)
  66187. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  66188. if ( ignored ) {
  66189. ignored.push( elem );
  66190. }
  66191. continue;
  66192. }
  66193. attached = isAttached( elem );
  66194. // Append to fragment
  66195. tmp = getAll( fragment.appendChild( elem ), "script" );
  66196. // Preserve script evaluation history
  66197. if ( attached ) {
  66198. setGlobalEval( tmp );
  66199. }
  66200. // Capture executables
  66201. if ( scripts ) {
  66202. j = 0;
  66203. while ( ( elem = tmp[ j++ ] ) ) {
  66204. if ( rscriptType.test( elem.type || "" ) ) {
  66205. scripts.push( elem );
  66206. }
  66207. }
  66208. }
  66209. }
  66210. return fragment;
  66211. }
  66212. var
  66213. rkeyEvent = /^key/,
  66214. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  66215. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  66216. function returnTrue() {
  66217. return true;
  66218. }
  66219. function returnFalse() {
  66220. return false;
  66221. }
  66222. // Support: IE <=9 - 11+
  66223. // focus() and blur() are asynchronous, except when they are no-op.
  66224. // So expect focus to be synchronous when the element is already active,
  66225. // and blur to be synchronous when the element is not already active.
  66226. // (focus and blur are always synchronous in other supported browsers,
  66227. // this just defines when we can count on it).
  66228. function expectSync( elem, type ) {
  66229. return ( elem === safeActiveElement() ) === ( type === "focus" );
  66230. }
  66231. // Support: IE <=9 only
  66232. // Accessing document.activeElement can throw unexpectedly
  66233. // https://bugs.jquery.com/ticket/13393
  66234. function safeActiveElement() {
  66235. try {
  66236. return document.activeElement;
  66237. } catch ( err ) { }
  66238. }
  66239. function on( elem, types, selector, data, fn, one ) {
  66240. var origFn, type;
  66241. // Types can be a map of types/handlers
  66242. if ( typeof types === "object" ) {
  66243. // ( types-Object, selector, data )
  66244. if ( typeof selector !== "string" ) {
  66245. // ( types-Object, data )
  66246. data = data || selector;
  66247. selector = undefined;
  66248. }
  66249. for ( type in types ) {
  66250. on( elem, type, selector, data, types[ type ], one );
  66251. }
  66252. return elem;
  66253. }
  66254. if ( data == null && fn == null ) {
  66255. // ( types, fn )
  66256. fn = selector;
  66257. data = selector = undefined;
  66258. } else if ( fn == null ) {
  66259. if ( typeof selector === "string" ) {
  66260. // ( types, selector, fn )
  66261. fn = data;
  66262. data = undefined;
  66263. } else {
  66264. // ( types, data, fn )
  66265. fn = data;
  66266. data = selector;
  66267. selector = undefined;
  66268. }
  66269. }
  66270. if ( fn === false ) {
  66271. fn = returnFalse;
  66272. } else if ( !fn ) {
  66273. return elem;
  66274. }
  66275. if ( one === 1 ) {
  66276. origFn = fn;
  66277. fn = function( event ) {
  66278. // Can use an empty set, since event contains the info
  66279. jQuery().off( event );
  66280. return origFn.apply( this, arguments );
  66281. };
  66282. // Use same guid so caller can remove using origFn
  66283. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  66284. }
  66285. return elem.each( function() {
  66286. jQuery.event.add( this, types, fn, data, selector );
  66287. } );
  66288. }
  66289. /*
  66290. * Helper functions for managing events -- not part of the public interface.
  66291. * Props to Dean Edwards' addEvent library for many of the ideas.
  66292. */
  66293. jQuery.event = {
  66294. global: {},
  66295. add: function( elem, types, handler, data, selector ) {
  66296. var handleObjIn, eventHandle, tmp,
  66297. events, t, handleObj,
  66298. special, handlers, type, namespaces, origType,
  66299. elemData = dataPriv.get( elem );
  66300. // Only attach events to objects that accept data
  66301. if ( !acceptData( elem ) ) {
  66302. return;
  66303. }
  66304. // Caller can pass in an object of custom data in lieu of the handler
  66305. if ( handler.handler ) {
  66306. handleObjIn = handler;
  66307. handler = handleObjIn.handler;
  66308. selector = handleObjIn.selector;
  66309. }
  66310. // Ensure that invalid selectors throw exceptions at attach time
  66311. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  66312. if ( selector ) {
  66313. jQuery.find.matchesSelector( documentElement, selector );
  66314. }
  66315. // Make sure that the handler has a unique ID, used to find/remove it later
  66316. if ( !handler.guid ) {
  66317. handler.guid = jQuery.guid++;
  66318. }
  66319. // Init the element's event structure and main handler, if this is the first
  66320. if ( !( events = elemData.events ) ) {
  66321. events = elemData.events = Object.create( null );
  66322. }
  66323. if ( !( eventHandle = elemData.handle ) ) {
  66324. eventHandle = elemData.handle = function( e ) {
  66325. // Discard the second event of a jQuery.event.trigger() and
  66326. // when an event is called after a page has unloaded
  66327. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  66328. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  66329. };
  66330. }
  66331. // Handle multiple events separated by a space
  66332. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  66333. t = types.length;
  66334. while ( t-- ) {
  66335. tmp = rtypenamespace.exec( types[ t ] ) || [];
  66336. type = origType = tmp[ 1 ];
  66337. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  66338. // There *must* be a type, no attaching namespace-only handlers
  66339. if ( !type ) {
  66340. continue;
  66341. }
  66342. // If event changes its type, use the special event handlers for the changed type
  66343. special = jQuery.event.special[ type ] || {};
  66344. // If selector defined, determine special event api type, otherwise given type
  66345. type = ( selector ? special.delegateType : special.bindType ) || type;
  66346. // Update special based on newly reset type
  66347. special = jQuery.event.special[ type ] || {};
  66348. // handleObj is passed to all event handlers
  66349. handleObj = jQuery.extend( {
  66350. type: type,
  66351. origType: origType,
  66352. data: data,
  66353. handler: handler,
  66354. guid: handler.guid,
  66355. selector: selector,
  66356. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  66357. namespace: namespaces.join( "." )
  66358. }, handleObjIn );
  66359. // Init the event handler queue if we're the first
  66360. if ( !( handlers = events[ type ] ) ) {
  66361. handlers = events[ type ] = [];
  66362. handlers.delegateCount = 0;
  66363. // Only use addEventListener if the special events handler returns false
  66364. if ( !special.setup ||
  66365. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  66366. if ( elem.addEventListener ) {
  66367. elem.addEventListener( type, eventHandle );
  66368. }
  66369. }
  66370. }
  66371. if ( special.add ) {
  66372. special.add.call( elem, handleObj );
  66373. if ( !handleObj.handler.guid ) {
  66374. handleObj.handler.guid = handler.guid;
  66375. }
  66376. }
  66377. // Add to the element's handler list, delegates in front
  66378. if ( selector ) {
  66379. handlers.splice( handlers.delegateCount++, 0, handleObj );
  66380. } else {
  66381. handlers.push( handleObj );
  66382. }
  66383. // Keep track of which events have ever been used, for event optimization
  66384. jQuery.event.global[ type ] = true;
  66385. }
  66386. },
  66387. // Detach an event or set of events from an element
  66388. remove: function( elem, types, handler, selector, mappedTypes ) {
  66389. var j, origCount, tmp,
  66390. events, t, handleObj,
  66391. special, handlers, type, namespaces, origType,
  66392. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  66393. if ( !elemData || !( events = elemData.events ) ) {
  66394. return;
  66395. }
  66396. // Once for each type.namespace in types; type may be omitted
  66397. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  66398. t = types.length;
  66399. while ( t-- ) {
  66400. tmp = rtypenamespace.exec( types[ t ] ) || [];
  66401. type = origType = tmp[ 1 ];
  66402. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  66403. // Unbind all events (on this namespace, if provided) for the element
  66404. if ( !type ) {
  66405. for ( type in events ) {
  66406. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  66407. }
  66408. continue;
  66409. }
  66410. special = jQuery.event.special[ type ] || {};
  66411. type = ( selector ? special.delegateType : special.bindType ) || type;
  66412. handlers = events[ type ] || [];
  66413. tmp = tmp[ 2 ] &&
  66414. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  66415. // Remove matching events
  66416. origCount = j = handlers.length;
  66417. while ( j-- ) {
  66418. handleObj = handlers[ j ];
  66419. if ( ( mappedTypes || origType === handleObj.origType ) &&
  66420. ( !handler || handler.guid === handleObj.guid ) &&
  66421. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  66422. ( !selector || selector === handleObj.selector ||
  66423. selector === "**" && handleObj.selector ) ) {
  66424. handlers.splice( j, 1 );
  66425. if ( handleObj.selector ) {
  66426. handlers.delegateCount--;
  66427. }
  66428. if ( special.remove ) {
  66429. special.remove.call( elem, handleObj );
  66430. }
  66431. }
  66432. }
  66433. // Remove generic event handler if we removed something and no more handlers exist
  66434. // (avoids potential for endless recursion during removal of special event handlers)
  66435. if ( origCount && !handlers.length ) {
  66436. if ( !special.teardown ||
  66437. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  66438. jQuery.removeEvent( elem, type, elemData.handle );
  66439. }
  66440. delete events[ type ];
  66441. }
  66442. }
  66443. // Remove data and the expando if it's no longer used
  66444. if ( jQuery.isEmptyObject( events ) ) {
  66445. dataPriv.remove( elem, "handle events" );
  66446. }
  66447. },
  66448. dispatch: function( nativeEvent ) {
  66449. var i, j, ret, matched, handleObj, handlerQueue,
  66450. args = new Array( arguments.length ),
  66451. // Make a writable jQuery.Event from the native event object
  66452. event = jQuery.event.fix( nativeEvent ),
  66453. handlers = (
  66454. dataPriv.get( this, "events" ) || Object.create( null )
  66455. )[ event.type ] || [],
  66456. special = jQuery.event.special[ event.type ] || {};
  66457. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  66458. args[ 0 ] = event;
  66459. for ( i = 1; i < arguments.length; i++ ) {
  66460. args[ i ] = arguments[ i ];
  66461. }
  66462. event.delegateTarget = this;
  66463. // Call the preDispatch hook for the mapped type, and let it bail if desired
  66464. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  66465. return;
  66466. }
  66467. // Determine handlers
  66468. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  66469. // Run delegates first; they may want to stop propagation beneath us
  66470. i = 0;
  66471. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  66472. event.currentTarget = matched.elem;
  66473. j = 0;
  66474. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  66475. !event.isImmediatePropagationStopped() ) {
  66476. // If the event is namespaced, then each handler is only invoked if it is
  66477. // specially universal or its namespaces are a superset of the event's.
  66478. if ( !event.rnamespace || handleObj.namespace === false ||
  66479. event.rnamespace.test( handleObj.namespace ) ) {
  66480. event.handleObj = handleObj;
  66481. event.data = handleObj.data;
  66482. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  66483. handleObj.handler ).apply( matched.elem, args );
  66484. if ( ret !== undefined ) {
  66485. if ( ( event.result = ret ) === false ) {
  66486. event.preventDefault();
  66487. event.stopPropagation();
  66488. }
  66489. }
  66490. }
  66491. }
  66492. }
  66493. // Call the postDispatch hook for the mapped type
  66494. if ( special.postDispatch ) {
  66495. special.postDispatch.call( this, event );
  66496. }
  66497. return event.result;
  66498. },
  66499. handlers: function( event, handlers ) {
  66500. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  66501. handlerQueue = [],
  66502. delegateCount = handlers.delegateCount,
  66503. cur = event.target;
  66504. // Find delegate handlers
  66505. if ( delegateCount &&
  66506. // Support: IE <=9
  66507. // Black-hole SVG <use> instance trees (trac-13180)
  66508. cur.nodeType &&
  66509. // Support: Firefox <=42
  66510. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  66511. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  66512. // Support: IE 11 only
  66513. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  66514. !( event.type === "click" && event.button >= 1 ) ) {
  66515. for ( ; cur !== this; cur = cur.parentNode || this ) {
  66516. // Don't check non-elements (#13208)
  66517. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  66518. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  66519. matchedHandlers = [];
  66520. matchedSelectors = {};
  66521. for ( i = 0; i < delegateCount; i++ ) {
  66522. handleObj = handlers[ i ];
  66523. // Don't conflict with Object.prototype properties (#13203)
  66524. sel = handleObj.selector + " ";
  66525. if ( matchedSelectors[ sel ] === undefined ) {
  66526. matchedSelectors[ sel ] = handleObj.needsContext ?
  66527. jQuery( sel, this ).index( cur ) > -1 :
  66528. jQuery.find( sel, this, null, [ cur ] ).length;
  66529. }
  66530. if ( matchedSelectors[ sel ] ) {
  66531. matchedHandlers.push( handleObj );
  66532. }
  66533. }
  66534. if ( matchedHandlers.length ) {
  66535. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  66536. }
  66537. }
  66538. }
  66539. }
  66540. // Add the remaining (directly-bound) handlers
  66541. cur = this;
  66542. if ( delegateCount < handlers.length ) {
  66543. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  66544. }
  66545. return handlerQueue;
  66546. },
  66547. addProp: function( name, hook ) {
  66548. Object.defineProperty( jQuery.Event.prototype, name, {
  66549. enumerable: true,
  66550. configurable: true,
  66551. get: isFunction( hook ) ?
  66552. function() {
  66553. if ( this.originalEvent ) {
  66554. return hook( this.originalEvent );
  66555. }
  66556. } :
  66557. function() {
  66558. if ( this.originalEvent ) {
  66559. return this.originalEvent[ name ];
  66560. }
  66561. },
  66562. set: function( value ) {
  66563. Object.defineProperty( this, name, {
  66564. enumerable: true,
  66565. configurable: true,
  66566. writable: true,
  66567. value: value
  66568. } );
  66569. }
  66570. } );
  66571. },
  66572. fix: function( originalEvent ) {
  66573. return originalEvent[ jQuery.expando ] ?
  66574. originalEvent :
  66575. new jQuery.Event( originalEvent );
  66576. },
  66577. special: {
  66578. load: {
  66579. // Prevent triggered image.load events from bubbling to window.load
  66580. noBubble: true
  66581. },
  66582. click: {
  66583. // Utilize native event to ensure correct state for checkable inputs
  66584. setup: function( data ) {
  66585. // For mutual compressibility with _default, replace `this` access with a local var.
  66586. // `|| data` is dead code meant only to preserve the variable through minification.
  66587. var el = this || data;
  66588. // Claim the first handler
  66589. if ( rcheckableType.test( el.type ) &&
  66590. el.click && nodeName( el, "input" ) ) {
  66591. // dataPriv.set( el, "click", ... )
  66592. leverageNative( el, "click", returnTrue );
  66593. }
  66594. // Return false to allow normal processing in the caller
  66595. return false;
  66596. },
  66597. trigger: function( data ) {
  66598. // For mutual compressibility with _default, replace `this` access with a local var.
  66599. // `|| data` is dead code meant only to preserve the variable through minification.
  66600. var el = this || data;
  66601. // Force setup before triggering a click
  66602. if ( rcheckableType.test( el.type ) &&
  66603. el.click && nodeName( el, "input" ) ) {
  66604. leverageNative( el, "click" );
  66605. }
  66606. // Return non-false to allow normal event-path propagation
  66607. return true;
  66608. },
  66609. // For cross-browser consistency, suppress native .click() on links
  66610. // Also prevent it if we're currently inside a leveraged native-event stack
  66611. _default: function( event ) {
  66612. var target = event.target;
  66613. return rcheckableType.test( target.type ) &&
  66614. target.click && nodeName( target, "input" ) &&
  66615. dataPriv.get( target, "click" ) ||
  66616. nodeName( target, "a" );
  66617. }
  66618. },
  66619. beforeunload: {
  66620. postDispatch: function( event ) {
  66621. // Support: Firefox 20+
  66622. // Firefox doesn't alert if the returnValue field is not set.
  66623. if ( event.result !== undefined && event.originalEvent ) {
  66624. event.originalEvent.returnValue = event.result;
  66625. }
  66626. }
  66627. }
  66628. }
  66629. };
  66630. // Ensure the presence of an event listener that handles manually-triggered
  66631. // synthetic events by interrupting progress until reinvoked in response to
  66632. // *native* events that it fires directly, ensuring that state changes have
  66633. // already occurred before other listeners are invoked.
  66634. function leverageNative( el, type, expectSync ) {
  66635. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  66636. if ( !expectSync ) {
  66637. if ( dataPriv.get( el, type ) === undefined ) {
  66638. jQuery.event.add( el, type, returnTrue );
  66639. }
  66640. return;
  66641. }
  66642. // Register the controller as a special universal handler for all event namespaces
  66643. dataPriv.set( el, type, false );
  66644. jQuery.event.add( el, type, {
  66645. namespace: false,
  66646. handler: function( event ) {
  66647. var notAsync, result,
  66648. saved = dataPriv.get( this, type );
  66649. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  66650. // Interrupt processing of the outer synthetic .trigger()ed event
  66651. // Saved data should be false in such cases, but might be a leftover capture object
  66652. // from an async native handler (gh-4350)
  66653. if ( !saved.length ) {
  66654. // Store arguments for use when handling the inner native event
  66655. // There will always be at least one argument (an event object), so this array
  66656. // will not be confused with a leftover capture object.
  66657. saved = slice.call( arguments );
  66658. dataPriv.set( this, type, saved );
  66659. // Trigger the native event and capture its result
  66660. // Support: IE <=9 - 11+
  66661. // focus() and blur() are asynchronous
  66662. notAsync = expectSync( this, type );
  66663. this[ type ]();
  66664. result = dataPriv.get( this, type );
  66665. if ( saved !== result || notAsync ) {
  66666. dataPriv.set( this, type, false );
  66667. } else {
  66668. result = {};
  66669. }
  66670. if ( saved !== result ) {
  66671. // Cancel the outer synthetic event
  66672. event.stopImmediatePropagation();
  66673. event.preventDefault();
  66674. return result.value;
  66675. }
  66676. // If this is an inner synthetic event for an event with a bubbling surrogate
  66677. // (focus or blur), assume that the surrogate already propagated from triggering the
  66678. // native event and prevent that from happening again here.
  66679. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  66680. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  66681. // less bad than duplication.
  66682. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  66683. event.stopPropagation();
  66684. }
  66685. // If this is a native event triggered above, everything is now in order
  66686. // Fire an inner synthetic event with the original arguments
  66687. } else if ( saved.length ) {
  66688. // ...and capture the result
  66689. dataPriv.set( this, type, {
  66690. value: jQuery.event.trigger(
  66691. // Support: IE <=9 - 11+
  66692. // Extend with the prototype to reset the above stopImmediatePropagation()
  66693. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  66694. saved.slice( 1 ),
  66695. this
  66696. )
  66697. } );
  66698. // Abort handling of the native event
  66699. event.stopImmediatePropagation();
  66700. }
  66701. }
  66702. } );
  66703. }
  66704. jQuery.removeEvent = function( elem, type, handle ) {
  66705. // This "if" is needed for plain objects
  66706. if ( elem.removeEventListener ) {
  66707. elem.removeEventListener( type, handle );
  66708. }
  66709. };
  66710. jQuery.Event = function( src, props ) {
  66711. // Allow instantiation without the 'new' keyword
  66712. if ( !( this instanceof jQuery.Event ) ) {
  66713. return new jQuery.Event( src, props );
  66714. }
  66715. // Event object
  66716. if ( src && src.type ) {
  66717. this.originalEvent = src;
  66718. this.type = src.type;
  66719. // Events bubbling up the document may have been marked as prevented
  66720. // by a handler lower down the tree; reflect the correct value.
  66721. this.isDefaultPrevented = src.defaultPrevented ||
  66722. src.defaultPrevented === undefined &&
  66723. // Support: Android <=2.3 only
  66724. src.returnValue === false ?
  66725. returnTrue :
  66726. returnFalse;
  66727. // Create target properties
  66728. // Support: Safari <=6 - 7 only
  66729. // Target should not be a text node (#504, #13143)
  66730. this.target = ( src.target && src.target.nodeType === 3 ) ?
  66731. src.target.parentNode :
  66732. src.target;
  66733. this.currentTarget = src.currentTarget;
  66734. this.relatedTarget = src.relatedTarget;
  66735. // Event type
  66736. } else {
  66737. this.type = src;
  66738. }
  66739. // Put explicitly provided properties onto the event object
  66740. if ( props ) {
  66741. jQuery.extend( this, props );
  66742. }
  66743. // Create a timestamp if incoming event doesn't have one
  66744. this.timeStamp = src && src.timeStamp || Date.now();
  66745. // Mark it as fixed
  66746. this[ jQuery.expando ] = true;
  66747. };
  66748. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  66749. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  66750. jQuery.Event.prototype = {
  66751. constructor: jQuery.Event,
  66752. isDefaultPrevented: returnFalse,
  66753. isPropagationStopped: returnFalse,
  66754. isImmediatePropagationStopped: returnFalse,
  66755. isSimulated: false,
  66756. preventDefault: function() {
  66757. var e = this.originalEvent;
  66758. this.isDefaultPrevented = returnTrue;
  66759. if ( e && !this.isSimulated ) {
  66760. e.preventDefault();
  66761. }
  66762. },
  66763. stopPropagation: function() {
  66764. var e = this.originalEvent;
  66765. this.isPropagationStopped = returnTrue;
  66766. if ( e && !this.isSimulated ) {
  66767. e.stopPropagation();
  66768. }
  66769. },
  66770. stopImmediatePropagation: function() {
  66771. var e = this.originalEvent;
  66772. this.isImmediatePropagationStopped = returnTrue;
  66773. if ( e && !this.isSimulated ) {
  66774. e.stopImmediatePropagation();
  66775. }
  66776. this.stopPropagation();
  66777. }
  66778. };
  66779. // Includes all common event props including KeyEvent and MouseEvent specific props
  66780. jQuery.each( {
  66781. altKey: true,
  66782. bubbles: true,
  66783. cancelable: true,
  66784. changedTouches: true,
  66785. ctrlKey: true,
  66786. detail: true,
  66787. eventPhase: true,
  66788. metaKey: true,
  66789. pageX: true,
  66790. pageY: true,
  66791. shiftKey: true,
  66792. view: true,
  66793. "char": true,
  66794. code: true,
  66795. charCode: true,
  66796. key: true,
  66797. keyCode: true,
  66798. button: true,
  66799. buttons: true,
  66800. clientX: true,
  66801. clientY: true,
  66802. offsetX: true,
  66803. offsetY: true,
  66804. pointerId: true,
  66805. pointerType: true,
  66806. screenX: true,
  66807. screenY: true,
  66808. targetTouches: true,
  66809. toElement: true,
  66810. touches: true,
  66811. which: function( event ) {
  66812. var button = event.button;
  66813. // Add which for key events
  66814. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  66815. return event.charCode != null ? event.charCode : event.keyCode;
  66816. }
  66817. // Add which for click: 1 === left; 2 === middle; 3 === right
  66818. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  66819. if ( button & 1 ) {
  66820. return 1;
  66821. }
  66822. if ( button & 2 ) {
  66823. return 3;
  66824. }
  66825. if ( button & 4 ) {
  66826. return 2;
  66827. }
  66828. return 0;
  66829. }
  66830. return event.which;
  66831. }
  66832. }, jQuery.event.addProp );
  66833. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  66834. jQuery.event.special[ type ] = {
  66835. // Utilize native event if possible so blur/focus sequence is correct
  66836. setup: function() {
  66837. // Claim the first handler
  66838. // dataPriv.set( this, "focus", ... )
  66839. // dataPriv.set( this, "blur", ... )
  66840. leverageNative( this, type, expectSync );
  66841. // Return false to allow normal processing in the caller
  66842. return false;
  66843. },
  66844. trigger: function() {
  66845. // Force setup before trigger
  66846. leverageNative( this, type );
  66847. // Return non-false to allow normal event-path propagation
  66848. return true;
  66849. },
  66850. delegateType: delegateType
  66851. };
  66852. } );
  66853. // Create mouseenter/leave events using mouseover/out and event-time checks
  66854. // so that event delegation works in jQuery.
  66855. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  66856. //
  66857. // Support: Safari 7 only
  66858. // Safari sends mouseenter too often; see:
  66859. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  66860. // for the description of the bug (it existed in older Chrome versions as well).
  66861. jQuery.each( {
  66862. mouseenter: "mouseover",
  66863. mouseleave: "mouseout",
  66864. pointerenter: "pointerover",
  66865. pointerleave: "pointerout"
  66866. }, function( orig, fix ) {
  66867. jQuery.event.special[ orig ] = {
  66868. delegateType: fix,
  66869. bindType: fix,
  66870. handle: function( event ) {
  66871. var ret,
  66872. target = this,
  66873. related = event.relatedTarget,
  66874. handleObj = event.handleObj;
  66875. // For mouseenter/leave call the handler if related is outside the target.
  66876. // NB: No relatedTarget if the mouse left/entered the browser window
  66877. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  66878. event.type = handleObj.origType;
  66879. ret = handleObj.handler.apply( this, arguments );
  66880. event.type = fix;
  66881. }
  66882. return ret;
  66883. }
  66884. };
  66885. } );
  66886. jQuery.fn.extend( {
  66887. on: function( types, selector, data, fn ) {
  66888. return on( this, types, selector, data, fn );
  66889. },
  66890. one: function( types, selector, data, fn ) {
  66891. return on( this, types, selector, data, fn, 1 );
  66892. },
  66893. off: function( types, selector, fn ) {
  66894. var handleObj, type;
  66895. if ( types && types.preventDefault && types.handleObj ) {
  66896. // ( event ) dispatched jQuery.Event
  66897. handleObj = types.handleObj;
  66898. jQuery( types.delegateTarget ).off(
  66899. handleObj.namespace ?
  66900. handleObj.origType + "." + handleObj.namespace :
  66901. handleObj.origType,
  66902. handleObj.selector,
  66903. handleObj.handler
  66904. );
  66905. return this;
  66906. }
  66907. if ( typeof types === "object" ) {
  66908. // ( types-object [, selector] )
  66909. for ( type in types ) {
  66910. this.off( type, selector, types[ type ] );
  66911. }
  66912. return this;
  66913. }
  66914. if ( selector === false || typeof selector === "function" ) {
  66915. // ( types [, fn] )
  66916. fn = selector;
  66917. selector = undefined;
  66918. }
  66919. if ( fn === false ) {
  66920. fn = returnFalse;
  66921. }
  66922. return this.each( function() {
  66923. jQuery.event.remove( this, types, fn, selector );
  66924. } );
  66925. }
  66926. } );
  66927. var
  66928. // Support: IE <=10 - 11, Edge 12 - 13 only
  66929. // In IE/Edge using regex groups here causes severe slowdowns.
  66930. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  66931. rnoInnerhtml = /<script|<style|<link/i,
  66932. // checked="checked" or checked
  66933. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  66934. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  66935. // Prefer a tbody over its parent table for containing new rows
  66936. function manipulationTarget( elem, content ) {
  66937. if ( nodeName( elem, "table" ) &&
  66938. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  66939. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  66940. }
  66941. return elem;
  66942. }
  66943. // Replace/restore the type attribute of script elements for safe DOM manipulation
  66944. function disableScript( elem ) {
  66945. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  66946. return elem;
  66947. }
  66948. function restoreScript( elem ) {
  66949. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  66950. elem.type = elem.type.slice( 5 );
  66951. } else {
  66952. elem.removeAttribute( "type" );
  66953. }
  66954. return elem;
  66955. }
  66956. function cloneCopyEvent( src, dest ) {
  66957. var i, l, type, pdataOld, udataOld, udataCur, events;
  66958. if ( dest.nodeType !== 1 ) {
  66959. return;
  66960. }
  66961. // 1. Copy private data: events, handlers, etc.
  66962. if ( dataPriv.hasData( src ) ) {
  66963. pdataOld = dataPriv.get( src );
  66964. events = pdataOld.events;
  66965. if ( events ) {
  66966. dataPriv.remove( dest, "handle events" );
  66967. for ( type in events ) {
  66968. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  66969. jQuery.event.add( dest, type, events[ type ][ i ] );
  66970. }
  66971. }
  66972. }
  66973. }
  66974. // 2. Copy user data
  66975. if ( dataUser.hasData( src ) ) {
  66976. udataOld = dataUser.access( src );
  66977. udataCur = jQuery.extend( {}, udataOld );
  66978. dataUser.set( dest, udataCur );
  66979. }
  66980. }
  66981. // Fix IE bugs, see support tests
  66982. function fixInput( src, dest ) {
  66983. var nodeName = dest.nodeName.toLowerCase();
  66984. // Fails to persist the checked state of a cloned checkbox or radio button.
  66985. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  66986. dest.checked = src.checked;
  66987. // Fails to return the selected option to the default selected state when cloning options
  66988. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  66989. dest.defaultValue = src.defaultValue;
  66990. }
  66991. }
  66992. function domManip( collection, args, callback, ignored ) {
  66993. // Flatten any nested arrays
  66994. args = flat( args );
  66995. var fragment, first, scripts, hasScripts, node, doc,
  66996. i = 0,
  66997. l = collection.length,
  66998. iNoClone = l - 1,
  66999. value = args[ 0 ],
  67000. valueIsFunction = isFunction( value );
  67001. // We can't cloneNode fragments that contain checked, in WebKit
  67002. if ( valueIsFunction ||
  67003. ( l > 1 && typeof value === "string" &&
  67004. !support.checkClone && rchecked.test( value ) ) ) {
  67005. return collection.each( function( index ) {
  67006. var self = collection.eq( index );
  67007. if ( valueIsFunction ) {
  67008. args[ 0 ] = value.call( this, index, self.html() );
  67009. }
  67010. domManip( self, args, callback, ignored );
  67011. } );
  67012. }
  67013. if ( l ) {
  67014. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  67015. first = fragment.firstChild;
  67016. if ( fragment.childNodes.length === 1 ) {
  67017. fragment = first;
  67018. }
  67019. // Require either new content or an interest in ignored elements to invoke the callback
  67020. if ( first || ignored ) {
  67021. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  67022. hasScripts = scripts.length;
  67023. // Use the original fragment for the last item
  67024. // instead of the first because it can end up
  67025. // being emptied incorrectly in certain situations (#8070).
  67026. for ( ; i < l; i++ ) {
  67027. node = fragment;
  67028. if ( i !== iNoClone ) {
  67029. node = jQuery.clone( node, true, true );
  67030. // Keep references to cloned scripts for later restoration
  67031. if ( hasScripts ) {
  67032. // Support: Android <=4.0 only, PhantomJS 1 only
  67033. // push.apply(_, arraylike) throws on ancient WebKit
  67034. jQuery.merge( scripts, getAll( node, "script" ) );
  67035. }
  67036. }
  67037. callback.call( collection[ i ], node, i );
  67038. }
  67039. if ( hasScripts ) {
  67040. doc = scripts[ scripts.length - 1 ].ownerDocument;
  67041. // Reenable scripts
  67042. jQuery.map( scripts, restoreScript );
  67043. // Evaluate executable scripts on first document insertion
  67044. for ( i = 0; i < hasScripts; i++ ) {
  67045. node = scripts[ i ];
  67046. if ( rscriptType.test( node.type || "" ) &&
  67047. !dataPriv.access( node, "globalEval" ) &&
  67048. jQuery.contains( doc, node ) ) {
  67049. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  67050. // Optional AJAX dependency, but won't run scripts if not present
  67051. if ( jQuery._evalUrl && !node.noModule ) {
  67052. jQuery._evalUrl( node.src, {
  67053. nonce: node.nonce || node.getAttribute( "nonce" )
  67054. }, doc );
  67055. }
  67056. } else {
  67057. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  67058. }
  67059. }
  67060. }
  67061. }
  67062. }
  67063. }
  67064. return collection;
  67065. }
  67066. function remove( elem, selector, keepData ) {
  67067. var node,
  67068. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  67069. i = 0;
  67070. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  67071. if ( !keepData && node.nodeType === 1 ) {
  67072. jQuery.cleanData( getAll( node ) );
  67073. }
  67074. if ( node.parentNode ) {
  67075. if ( keepData && isAttached( node ) ) {
  67076. setGlobalEval( getAll( node, "script" ) );
  67077. }
  67078. node.parentNode.removeChild( node );
  67079. }
  67080. }
  67081. return elem;
  67082. }
  67083. jQuery.extend( {
  67084. htmlPrefilter: function( html ) {
  67085. return html;
  67086. },
  67087. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  67088. var i, l, srcElements, destElements,
  67089. clone = elem.cloneNode( true ),
  67090. inPage = isAttached( elem );
  67091. // Fix IE cloning issues
  67092. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  67093. !jQuery.isXMLDoc( elem ) ) {
  67094. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  67095. destElements = getAll( clone );
  67096. srcElements = getAll( elem );
  67097. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  67098. fixInput( srcElements[ i ], destElements[ i ] );
  67099. }
  67100. }
  67101. // Copy the events from the original to the clone
  67102. if ( dataAndEvents ) {
  67103. if ( deepDataAndEvents ) {
  67104. srcElements = srcElements || getAll( elem );
  67105. destElements = destElements || getAll( clone );
  67106. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  67107. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  67108. }
  67109. } else {
  67110. cloneCopyEvent( elem, clone );
  67111. }
  67112. }
  67113. // Preserve script evaluation history
  67114. destElements = getAll( clone, "script" );
  67115. if ( destElements.length > 0 ) {
  67116. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  67117. }
  67118. // Return the cloned set
  67119. return clone;
  67120. },
  67121. cleanData: function( elems ) {
  67122. var data, elem, type,
  67123. special = jQuery.event.special,
  67124. i = 0;
  67125. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  67126. if ( acceptData( elem ) ) {
  67127. if ( ( data = elem[ dataPriv.expando ] ) ) {
  67128. if ( data.events ) {
  67129. for ( type in data.events ) {
  67130. if ( special[ type ] ) {
  67131. jQuery.event.remove( elem, type );
  67132. // This is a shortcut to avoid jQuery.event.remove's overhead
  67133. } else {
  67134. jQuery.removeEvent( elem, type, data.handle );
  67135. }
  67136. }
  67137. }
  67138. // Support: Chrome <=35 - 45+
  67139. // Assign undefined instead of using delete, see Data#remove
  67140. elem[ dataPriv.expando ] = undefined;
  67141. }
  67142. if ( elem[ dataUser.expando ] ) {
  67143. // Support: Chrome <=35 - 45+
  67144. // Assign undefined instead of using delete, see Data#remove
  67145. elem[ dataUser.expando ] = undefined;
  67146. }
  67147. }
  67148. }
  67149. }
  67150. } );
  67151. jQuery.fn.extend( {
  67152. detach: function( selector ) {
  67153. return remove( this, selector, true );
  67154. },
  67155. remove: function( selector ) {
  67156. return remove( this, selector );
  67157. },
  67158. text: function( value ) {
  67159. return access( this, function( value ) {
  67160. return value === undefined ?
  67161. jQuery.text( this ) :
  67162. this.empty().each( function() {
  67163. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  67164. this.textContent = value;
  67165. }
  67166. } );
  67167. }, null, value, arguments.length );
  67168. },
  67169. append: function() {
  67170. return domManip( this, arguments, function( elem ) {
  67171. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  67172. var target = manipulationTarget( this, elem );
  67173. target.appendChild( elem );
  67174. }
  67175. } );
  67176. },
  67177. prepend: function() {
  67178. return domManip( this, arguments, function( elem ) {
  67179. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  67180. var target = manipulationTarget( this, elem );
  67181. target.insertBefore( elem, target.firstChild );
  67182. }
  67183. } );
  67184. },
  67185. before: function() {
  67186. return domManip( this, arguments, function( elem ) {
  67187. if ( this.parentNode ) {
  67188. this.parentNode.insertBefore( elem, this );
  67189. }
  67190. } );
  67191. },
  67192. after: function() {
  67193. return domManip( this, arguments, function( elem ) {
  67194. if ( this.parentNode ) {
  67195. this.parentNode.insertBefore( elem, this.nextSibling );
  67196. }
  67197. } );
  67198. },
  67199. empty: function() {
  67200. var elem,
  67201. i = 0;
  67202. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  67203. if ( elem.nodeType === 1 ) {
  67204. // Prevent memory leaks
  67205. jQuery.cleanData( getAll( elem, false ) );
  67206. // Remove any remaining nodes
  67207. elem.textContent = "";
  67208. }
  67209. }
  67210. return this;
  67211. },
  67212. clone: function( dataAndEvents, deepDataAndEvents ) {
  67213. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  67214. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  67215. return this.map( function() {
  67216. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  67217. } );
  67218. },
  67219. html: function( value ) {
  67220. return access( this, function( value ) {
  67221. var elem = this[ 0 ] || {},
  67222. i = 0,
  67223. l = this.length;
  67224. if ( value === undefined && elem.nodeType === 1 ) {
  67225. return elem.innerHTML;
  67226. }
  67227. // See if we can take a shortcut and just use innerHTML
  67228. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  67229. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  67230. value = jQuery.htmlPrefilter( value );
  67231. try {
  67232. for ( ; i < l; i++ ) {
  67233. elem = this[ i ] || {};
  67234. // Remove element nodes and prevent memory leaks
  67235. if ( elem.nodeType === 1 ) {
  67236. jQuery.cleanData( getAll( elem, false ) );
  67237. elem.innerHTML = value;
  67238. }
  67239. }
  67240. elem = 0;
  67241. // If using innerHTML throws an exception, use the fallback method
  67242. } catch ( e ) {}
  67243. }
  67244. if ( elem ) {
  67245. this.empty().append( value );
  67246. }
  67247. }, null, value, arguments.length );
  67248. },
  67249. replaceWith: function() {
  67250. var ignored = [];
  67251. // Make the changes, replacing each non-ignored context element with the new content
  67252. return domManip( this, arguments, function( elem ) {
  67253. var parent = this.parentNode;
  67254. if ( jQuery.inArray( this, ignored ) < 0 ) {
  67255. jQuery.cleanData( getAll( this ) );
  67256. if ( parent ) {
  67257. parent.replaceChild( elem, this );
  67258. }
  67259. }
  67260. // Force callback invocation
  67261. }, ignored );
  67262. }
  67263. } );
  67264. jQuery.each( {
  67265. appendTo: "append",
  67266. prependTo: "prepend",
  67267. insertBefore: "before",
  67268. insertAfter: "after",
  67269. replaceAll: "replaceWith"
  67270. }, function( name, original ) {
  67271. jQuery.fn[ name ] = function( selector ) {
  67272. var elems,
  67273. ret = [],
  67274. insert = jQuery( selector ),
  67275. last = insert.length - 1,
  67276. i = 0;
  67277. for ( ; i <= last; i++ ) {
  67278. elems = i === last ? this : this.clone( true );
  67279. jQuery( insert[ i ] )[ original ]( elems );
  67280. // Support: Android <=4.0 only, PhantomJS 1 only
  67281. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  67282. push.apply( ret, elems.get() );
  67283. }
  67284. return this.pushStack( ret );
  67285. };
  67286. } );
  67287. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  67288. var getStyles = function( elem ) {
  67289. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  67290. // IE throws on elements created in popups
  67291. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  67292. var view = elem.ownerDocument.defaultView;
  67293. if ( !view || !view.opener ) {
  67294. view = window;
  67295. }
  67296. return view.getComputedStyle( elem );
  67297. };
  67298. var swap = function( elem, options, callback ) {
  67299. var ret, name,
  67300. old = {};
  67301. // Remember the old values, and insert the new ones
  67302. for ( name in options ) {
  67303. old[ name ] = elem.style[ name ];
  67304. elem.style[ name ] = options[ name ];
  67305. }
  67306. ret = callback.call( elem );
  67307. // Revert the old values
  67308. for ( name in options ) {
  67309. elem.style[ name ] = old[ name ];
  67310. }
  67311. return ret;
  67312. };
  67313. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  67314. ( function() {
  67315. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  67316. // so they're executed at the same time to save the second computation.
  67317. function computeStyleTests() {
  67318. // This is a singleton, we need to execute it only once
  67319. if ( !div ) {
  67320. return;
  67321. }
  67322. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  67323. "margin-top:1px;padding:0;border:0";
  67324. div.style.cssText =
  67325. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  67326. "margin:auto;border:1px;padding:1px;" +
  67327. "width:60%;top:1%";
  67328. documentElement.appendChild( container ).appendChild( div );
  67329. var divStyle = window.getComputedStyle( div );
  67330. pixelPositionVal = divStyle.top !== "1%";
  67331. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  67332. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  67333. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  67334. // Some styles come back with percentage values, even though they shouldn't
  67335. div.style.right = "60%";
  67336. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  67337. // Support: IE 9 - 11 only
  67338. // Detect misreporting of content dimensions for box-sizing:border-box elements
  67339. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  67340. // Support: IE 9 only
  67341. // Detect overflow:scroll screwiness (gh-3699)
  67342. // Support: Chrome <=64
  67343. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  67344. div.style.position = "absolute";
  67345. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  67346. documentElement.removeChild( container );
  67347. // Nullify the div so it wouldn't be stored in the memory and
  67348. // it will also be a sign that checks already performed
  67349. div = null;
  67350. }
  67351. function roundPixelMeasures( measure ) {
  67352. return Math.round( parseFloat( measure ) );
  67353. }
  67354. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  67355. reliableTrDimensionsVal, reliableMarginLeftVal,
  67356. container = document.createElement( "div" ),
  67357. div = document.createElement( "div" );
  67358. // Finish early in limited (non-browser) environments
  67359. if ( !div.style ) {
  67360. return;
  67361. }
  67362. // Support: IE <=9 - 11 only
  67363. // Style of cloned element affects source element cloned (#8908)
  67364. div.style.backgroundClip = "content-box";
  67365. div.cloneNode( true ).style.backgroundClip = "";
  67366. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  67367. jQuery.extend( support, {
  67368. boxSizingReliable: function() {
  67369. computeStyleTests();
  67370. return boxSizingReliableVal;
  67371. },
  67372. pixelBoxStyles: function() {
  67373. computeStyleTests();
  67374. return pixelBoxStylesVal;
  67375. },
  67376. pixelPosition: function() {
  67377. computeStyleTests();
  67378. return pixelPositionVal;
  67379. },
  67380. reliableMarginLeft: function() {
  67381. computeStyleTests();
  67382. return reliableMarginLeftVal;
  67383. },
  67384. scrollboxSize: function() {
  67385. computeStyleTests();
  67386. return scrollboxSizeVal;
  67387. },
  67388. // Support: IE 9 - 11+, Edge 15 - 18+
  67389. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  67390. // set in CSS while `offset*` properties report correct values.
  67391. // Behavior in IE 9 is more subtle than in newer versions & it passes
  67392. // some versions of this test; make sure not to make it pass there!
  67393. reliableTrDimensions: function() {
  67394. var table, tr, trChild, trStyle;
  67395. if ( reliableTrDimensionsVal == null ) {
  67396. table = document.createElement( "table" );
  67397. tr = document.createElement( "tr" );
  67398. trChild = document.createElement( "div" );
  67399. table.style.cssText = "position:absolute;left:-11111px";
  67400. tr.style.height = "1px";
  67401. trChild.style.height = "9px";
  67402. documentElement
  67403. .appendChild( table )
  67404. .appendChild( tr )
  67405. .appendChild( trChild );
  67406. trStyle = window.getComputedStyle( tr );
  67407. reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
  67408. documentElement.removeChild( table );
  67409. }
  67410. return reliableTrDimensionsVal;
  67411. }
  67412. } );
  67413. } )();
  67414. function curCSS( elem, name, computed ) {
  67415. var width, minWidth, maxWidth, ret,
  67416. // Support: Firefox 51+
  67417. // Retrieving style before computed somehow
  67418. // fixes an issue with getting wrong values
  67419. // on detached elements
  67420. style = elem.style;
  67421. computed = computed || getStyles( elem );
  67422. // getPropertyValue is needed for:
  67423. // .css('filter') (IE 9 only, #12537)
  67424. // .css('--customProperty) (#3144)
  67425. if ( computed ) {
  67426. ret = computed.getPropertyValue( name ) || computed[ name ];
  67427. if ( ret === "" && !isAttached( elem ) ) {
  67428. ret = jQuery.style( elem, name );
  67429. }
  67430. // A tribute to the "awesome hack by Dean Edwards"
  67431. // Android Browser returns percentage for some values,
  67432. // but width seems to be reliably pixels.
  67433. // This is against the CSSOM draft spec:
  67434. // https://drafts.csswg.org/cssom/#resolved-values
  67435. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  67436. // Remember the original values
  67437. width = style.width;
  67438. minWidth = style.minWidth;
  67439. maxWidth = style.maxWidth;
  67440. // Put in the new values to get a computed value out
  67441. style.minWidth = style.maxWidth = style.width = ret;
  67442. ret = computed.width;
  67443. // Revert the changed values
  67444. style.width = width;
  67445. style.minWidth = minWidth;
  67446. style.maxWidth = maxWidth;
  67447. }
  67448. }
  67449. return ret !== undefined ?
  67450. // Support: IE <=9 - 11 only
  67451. // IE returns zIndex value as an integer.
  67452. ret + "" :
  67453. ret;
  67454. }
  67455. function addGetHookIf( conditionFn, hookFn ) {
  67456. // Define the hook, we'll check on the first run if it's really needed.
  67457. return {
  67458. get: function() {
  67459. if ( conditionFn() ) {
  67460. // Hook not needed (or it's not possible to use it due
  67461. // to missing dependency), remove it.
  67462. delete this.get;
  67463. return;
  67464. }
  67465. // Hook needed; redefine it so that the support test is not executed again.
  67466. return ( this.get = hookFn ).apply( this, arguments );
  67467. }
  67468. };
  67469. }
  67470. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  67471. emptyStyle = document.createElement( "div" ).style,
  67472. vendorProps = {};
  67473. // Return a vendor-prefixed property or undefined
  67474. function vendorPropName( name ) {
  67475. // Check for vendor prefixed names
  67476. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  67477. i = cssPrefixes.length;
  67478. while ( i-- ) {
  67479. name = cssPrefixes[ i ] + capName;
  67480. if ( name in emptyStyle ) {
  67481. return name;
  67482. }
  67483. }
  67484. }
  67485. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  67486. function finalPropName( name ) {
  67487. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  67488. if ( final ) {
  67489. return final;
  67490. }
  67491. if ( name in emptyStyle ) {
  67492. return name;
  67493. }
  67494. return vendorProps[ name ] = vendorPropName( name ) || name;
  67495. }
  67496. var
  67497. // Swappable if display is none or starts with table
  67498. // except "table", "table-cell", or "table-caption"
  67499. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  67500. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  67501. rcustomProp = /^--/,
  67502. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  67503. cssNormalTransform = {
  67504. letterSpacing: "0",
  67505. fontWeight: "400"
  67506. };
  67507. function setPositiveNumber( _elem, value, subtract ) {
  67508. // Any relative (+/-) values have already been
  67509. // normalized at this point
  67510. var matches = rcssNum.exec( value );
  67511. return matches ?
  67512. // Guard against undefined "subtract", e.g., when used as in cssHooks
  67513. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  67514. value;
  67515. }
  67516. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  67517. var i = dimension === "width" ? 1 : 0,
  67518. extra = 0,
  67519. delta = 0;
  67520. // Adjustment may not be necessary
  67521. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  67522. return 0;
  67523. }
  67524. for ( ; i < 4; i += 2 ) {
  67525. // Both box models exclude margin
  67526. if ( box === "margin" ) {
  67527. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  67528. }
  67529. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  67530. if ( !isBorderBox ) {
  67531. // Add padding
  67532. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  67533. // For "border" or "margin", add border
  67534. if ( box !== "padding" ) {
  67535. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  67536. // But still keep track of it otherwise
  67537. } else {
  67538. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  67539. }
  67540. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  67541. // "padding" or "margin"
  67542. } else {
  67543. // For "content", subtract padding
  67544. if ( box === "content" ) {
  67545. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  67546. }
  67547. // For "content" or "padding", subtract border
  67548. if ( box !== "margin" ) {
  67549. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  67550. }
  67551. }
  67552. }
  67553. // Account for positive content-box scroll gutter when requested by providing computedVal
  67554. if ( !isBorderBox && computedVal >= 0 ) {
  67555. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  67556. // Assuming integer scroll gutter, subtract the rest and round down
  67557. delta += Math.max( 0, Math.ceil(
  67558. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  67559. computedVal -
  67560. delta -
  67561. extra -
  67562. 0.5
  67563. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  67564. // Use an explicit zero to avoid NaN (gh-3964)
  67565. ) ) || 0;
  67566. }
  67567. return delta;
  67568. }
  67569. function getWidthOrHeight( elem, dimension, extra ) {
  67570. // Start with computed style
  67571. var styles = getStyles( elem ),
  67572. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  67573. // Fake content-box until we know it's needed to know the true value.
  67574. boxSizingNeeded = !support.boxSizingReliable() || extra,
  67575. isBorderBox = boxSizingNeeded &&
  67576. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  67577. valueIsBorderBox = isBorderBox,
  67578. val = curCSS( elem, dimension, styles ),
  67579. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  67580. // Support: Firefox <=54
  67581. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  67582. if ( rnumnonpx.test( val ) ) {
  67583. if ( !extra ) {
  67584. return val;
  67585. }
  67586. val = "auto";
  67587. }
  67588. // Support: IE 9 - 11 only
  67589. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  67590. // In those cases, the computed value can be trusted to be border-box.
  67591. if ( ( !support.boxSizingReliable() && isBorderBox ||
  67592. // Support: IE 10 - 11+, Edge 15 - 18+
  67593. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  67594. // set in CSS while `offset*` properties report correct values.
  67595. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  67596. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  67597. // Fall back to offsetWidth/offsetHeight when value is "auto"
  67598. // This happens for inline elements with no explicit setting (gh-3571)
  67599. val === "auto" ||
  67600. // Support: Android <=4.1 - 4.3 only
  67601. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  67602. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  67603. // Make sure the element is visible & connected
  67604. elem.getClientRects().length ) {
  67605. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  67606. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  67607. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  67608. // retrieved value as a content box dimension.
  67609. valueIsBorderBox = offsetProp in elem;
  67610. if ( valueIsBorderBox ) {
  67611. val = elem[ offsetProp ];
  67612. }
  67613. }
  67614. // Normalize "" and auto
  67615. val = parseFloat( val ) || 0;
  67616. // Adjust for the element's box model
  67617. return ( val +
  67618. boxModelAdjustment(
  67619. elem,
  67620. dimension,
  67621. extra || ( isBorderBox ? "border" : "content" ),
  67622. valueIsBorderBox,
  67623. styles,
  67624. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  67625. val
  67626. )
  67627. ) + "px";
  67628. }
  67629. jQuery.extend( {
  67630. // Add in style property hooks for overriding the default
  67631. // behavior of getting and setting a style property
  67632. cssHooks: {
  67633. opacity: {
  67634. get: function( elem, computed ) {
  67635. if ( computed ) {
  67636. // We should always get a number back from opacity
  67637. var ret = curCSS( elem, "opacity" );
  67638. return ret === "" ? "1" : ret;
  67639. }
  67640. }
  67641. }
  67642. },
  67643. // Don't automatically add "px" to these possibly-unitless properties
  67644. cssNumber: {
  67645. "animationIterationCount": true,
  67646. "columnCount": true,
  67647. "fillOpacity": true,
  67648. "flexGrow": true,
  67649. "flexShrink": true,
  67650. "fontWeight": true,
  67651. "gridArea": true,
  67652. "gridColumn": true,
  67653. "gridColumnEnd": true,
  67654. "gridColumnStart": true,
  67655. "gridRow": true,
  67656. "gridRowEnd": true,
  67657. "gridRowStart": true,
  67658. "lineHeight": true,
  67659. "opacity": true,
  67660. "order": true,
  67661. "orphans": true,
  67662. "widows": true,
  67663. "zIndex": true,
  67664. "zoom": true
  67665. },
  67666. // Add in properties whose names you wish to fix before
  67667. // setting or getting the value
  67668. cssProps: {},
  67669. // Get and set the style property on a DOM Node
  67670. style: function( elem, name, value, extra ) {
  67671. // Don't set styles on text and comment nodes
  67672. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  67673. return;
  67674. }
  67675. // Make sure that we're working with the right name
  67676. var ret, type, hooks,
  67677. origName = camelCase( name ),
  67678. isCustomProp = rcustomProp.test( name ),
  67679. style = elem.style;
  67680. // Make sure that we're working with the right name. We don't
  67681. // want to query the value if it is a CSS custom property
  67682. // since they are user-defined.
  67683. if ( !isCustomProp ) {
  67684. name = finalPropName( origName );
  67685. }
  67686. // Gets hook for the prefixed version, then unprefixed version
  67687. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  67688. // Check if we're setting a value
  67689. if ( value !== undefined ) {
  67690. type = typeof value;
  67691. // Convert "+=" or "-=" to relative numbers (#7345)
  67692. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  67693. value = adjustCSS( elem, name, ret );
  67694. // Fixes bug #9237
  67695. type = "number";
  67696. }
  67697. // Make sure that null and NaN values aren't set (#7116)
  67698. if ( value == null || value !== value ) {
  67699. return;
  67700. }
  67701. // If a number was passed in, add the unit (except for certain CSS properties)
  67702. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  67703. // "px" to a few hardcoded values.
  67704. if ( type === "number" && !isCustomProp ) {
  67705. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  67706. }
  67707. // background-* props affect original clone's values
  67708. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  67709. style[ name ] = "inherit";
  67710. }
  67711. // If a hook was provided, use that value, otherwise just set the specified value
  67712. if ( !hooks || !( "set" in hooks ) ||
  67713. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  67714. if ( isCustomProp ) {
  67715. style.setProperty( name, value );
  67716. } else {
  67717. style[ name ] = value;
  67718. }
  67719. }
  67720. } else {
  67721. // If a hook was provided get the non-computed value from there
  67722. if ( hooks && "get" in hooks &&
  67723. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  67724. return ret;
  67725. }
  67726. // Otherwise just get the value from the style object
  67727. return style[ name ];
  67728. }
  67729. },
  67730. css: function( elem, name, extra, styles ) {
  67731. var val, num, hooks,
  67732. origName = camelCase( name ),
  67733. isCustomProp = rcustomProp.test( name );
  67734. // Make sure that we're working with the right name. We don't
  67735. // want to modify the value if it is a CSS custom property
  67736. // since they are user-defined.
  67737. if ( !isCustomProp ) {
  67738. name = finalPropName( origName );
  67739. }
  67740. // Try prefixed name followed by the unprefixed name
  67741. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  67742. // If a hook was provided get the computed value from there
  67743. if ( hooks && "get" in hooks ) {
  67744. val = hooks.get( elem, true, extra );
  67745. }
  67746. // Otherwise, if a way to get the computed value exists, use that
  67747. if ( val === undefined ) {
  67748. val = curCSS( elem, name, styles );
  67749. }
  67750. // Convert "normal" to computed value
  67751. if ( val === "normal" && name in cssNormalTransform ) {
  67752. val = cssNormalTransform[ name ];
  67753. }
  67754. // Make numeric if forced or a qualifier was provided and val looks numeric
  67755. if ( extra === "" || extra ) {
  67756. num = parseFloat( val );
  67757. return extra === true || isFinite( num ) ? num || 0 : val;
  67758. }
  67759. return val;
  67760. }
  67761. } );
  67762. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  67763. jQuery.cssHooks[ dimension ] = {
  67764. get: function( elem, computed, extra ) {
  67765. if ( computed ) {
  67766. // Certain elements can have dimension info if we invisibly show them
  67767. // but it must have a current display style that would benefit
  67768. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  67769. // Support: Safari 8+
  67770. // Table columns in Safari have non-zero offsetWidth & zero
  67771. // getBoundingClientRect().width unless display is changed.
  67772. // Support: IE <=11 only
  67773. // Running getBoundingClientRect on a disconnected node
  67774. // in IE throws an error.
  67775. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  67776. swap( elem, cssShow, function() {
  67777. return getWidthOrHeight( elem, dimension, extra );
  67778. } ) :
  67779. getWidthOrHeight( elem, dimension, extra );
  67780. }
  67781. },
  67782. set: function( elem, value, extra ) {
  67783. var matches,
  67784. styles = getStyles( elem ),
  67785. // Only read styles.position if the test has a chance to fail
  67786. // to avoid forcing a reflow.
  67787. scrollboxSizeBuggy = !support.scrollboxSize() &&
  67788. styles.position === "absolute",
  67789. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  67790. boxSizingNeeded = scrollboxSizeBuggy || extra,
  67791. isBorderBox = boxSizingNeeded &&
  67792. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  67793. subtract = extra ?
  67794. boxModelAdjustment(
  67795. elem,
  67796. dimension,
  67797. extra,
  67798. isBorderBox,
  67799. styles
  67800. ) :
  67801. 0;
  67802. // Account for unreliable border-box dimensions by comparing offset* to computed and
  67803. // faking a content-box to get border and padding (gh-3699)
  67804. if ( isBorderBox && scrollboxSizeBuggy ) {
  67805. subtract -= Math.ceil(
  67806. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  67807. parseFloat( styles[ dimension ] ) -
  67808. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  67809. 0.5
  67810. );
  67811. }
  67812. // Convert to pixels if value adjustment is needed
  67813. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  67814. ( matches[ 3 ] || "px" ) !== "px" ) {
  67815. elem.style[ dimension ] = value;
  67816. value = jQuery.css( elem, dimension );
  67817. }
  67818. return setPositiveNumber( elem, value, subtract );
  67819. }
  67820. };
  67821. } );
  67822. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  67823. function( elem, computed ) {
  67824. if ( computed ) {
  67825. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  67826. elem.getBoundingClientRect().left -
  67827. swap( elem, { marginLeft: 0 }, function() {
  67828. return elem.getBoundingClientRect().left;
  67829. } )
  67830. ) + "px";
  67831. }
  67832. }
  67833. );
  67834. // These hooks are used by animate to expand properties
  67835. jQuery.each( {
  67836. margin: "",
  67837. padding: "",
  67838. border: "Width"
  67839. }, function( prefix, suffix ) {
  67840. jQuery.cssHooks[ prefix + suffix ] = {
  67841. expand: function( value ) {
  67842. var i = 0,
  67843. expanded = {},
  67844. // Assumes a single number if not a string
  67845. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  67846. for ( ; i < 4; i++ ) {
  67847. expanded[ prefix + cssExpand[ i ] + suffix ] =
  67848. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  67849. }
  67850. return expanded;
  67851. }
  67852. };
  67853. if ( prefix !== "margin" ) {
  67854. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  67855. }
  67856. } );
  67857. jQuery.fn.extend( {
  67858. css: function( name, value ) {
  67859. return access( this, function( elem, name, value ) {
  67860. var styles, len,
  67861. map = {},
  67862. i = 0;
  67863. if ( Array.isArray( name ) ) {
  67864. styles = getStyles( elem );
  67865. len = name.length;
  67866. for ( ; i < len; i++ ) {
  67867. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  67868. }
  67869. return map;
  67870. }
  67871. return value !== undefined ?
  67872. jQuery.style( elem, name, value ) :
  67873. jQuery.css( elem, name );
  67874. }, name, value, arguments.length > 1 );
  67875. }
  67876. } );
  67877. function Tween( elem, options, prop, end, easing ) {
  67878. return new Tween.prototype.init( elem, options, prop, end, easing );
  67879. }
  67880. jQuery.Tween = Tween;
  67881. Tween.prototype = {
  67882. constructor: Tween,
  67883. init: function( elem, options, prop, end, easing, unit ) {
  67884. this.elem = elem;
  67885. this.prop = prop;
  67886. this.easing = easing || jQuery.easing._default;
  67887. this.options = options;
  67888. this.start = this.now = this.cur();
  67889. this.end = end;
  67890. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  67891. },
  67892. cur: function() {
  67893. var hooks = Tween.propHooks[ this.prop ];
  67894. return hooks && hooks.get ?
  67895. hooks.get( this ) :
  67896. Tween.propHooks._default.get( this );
  67897. },
  67898. run: function( percent ) {
  67899. var eased,
  67900. hooks = Tween.propHooks[ this.prop ];
  67901. if ( this.options.duration ) {
  67902. this.pos = eased = jQuery.easing[ this.easing ](
  67903. percent, this.options.duration * percent, 0, 1, this.options.duration
  67904. );
  67905. } else {
  67906. this.pos = eased = percent;
  67907. }
  67908. this.now = ( this.end - this.start ) * eased + this.start;
  67909. if ( this.options.step ) {
  67910. this.options.step.call( this.elem, this.now, this );
  67911. }
  67912. if ( hooks && hooks.set ) {
  67913. hooks.set( this );
  67914. } else {
  67915. Tween.propHooks._default.set( this );
  67916. }
  67917. return this;
  67918. }
  67919. };
  67920. Tween.prototype.init.prototype = Tween.prototype;
  67921. Tween.propHooks = {
  67922. _default: {
  67923. get: function( tween ) {
  67924. var result;
  67925. // Use a property on the element directly when it is not a DOM element,
  67926. // or when there is no matching style property that exists.
  67927. if ( tween.elem.nodeType !== 1 ||
  67928. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  67929. return tween.elem[ tween.prop ];
  67930. }
  67931. // Passing an empty string as a 3rd parameter to .css will automatically
  67932. // attempt a parseFloat and fallback to a string if the parse fails.
  67933. // Simple values such as "10px" are parsed to Float;
  67934. // complex values such as "rotate(1rad)" are returned as-is.
  67935. result = jQuery.css( tween.elem, tween.prop, "" );
  67936. // Empty strings, null, undefined and "auto" are converted to 0.
  67937. return !result || result === "auto" ? 0 : result;
  67938. },
  67939. set: function( tween ) {
  67940. // Use step hook for back compat.
  67941. // Use cssHook if its there.
  67942. // Use .style if available and use plain properties where available.
  67943. if ( jQuery.fx.step[ tween.prop ] ) {
  67944. jQuery.fx.step[ tween.prop ]( tween );
  67945. } else if ( tween.elem.nodeType === 1 && (
  67946. jQuery.cssHooks[ tween.prop ] ||
  67947. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  67948. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  67949. } else {
  67950. tween.elem[ tween.prop ] = tween.now;
  67951. }
  67952. }
  67953. }
  67954. };
  67955. // Support: IE <=9 only
  67956. // Panic based approach to setting things on disconnected nodes
  67957. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  67958. set: function( tween ) {
  67959. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  67960. tween.elem[ tween.prop ] = tween.now;
  67961. }
  67962. }
  67963. };
  67964. jQuery.easing = {
  67965. linear: function( p ) {
  67966. return p;
  67967. },
  67968. swing: function( p ) {
  67969. return 0.5 - Math.cos( p * Math.PI ) / 2;
  67970. },
  67971. _default: "swing"
  67972. };
  67973. jQuery.fx = Tween.prototype.init;
  67974. // Back compat <1.8 extension point
  67975. jQuery.fx.step = {};
  67976. var
  67977. fxNow, inProgress,
  67978. rfxtypes = /^(?:toggle|show|hide)$/,
  67979. rrun = /queueHooks$/;
  67980. function schedule() {
  67981. if ( inProgress ) {
  67982. if ( document.hidden === false && window.requestAnimationFrame ) {
  67983. window.requestAnimationFrame( schedule );
  67984. } else {
  67985. window.setTimeout( schedule, jQuery.fx.interval );
  67986. }
  67987. jQuery.fx.tick();
  67988. }
  67989. }
  67990. // Animations created synchronously will run synchronously
  67991. function createFxNow() {
  67992. window.setTimeout( function() {
  67993. fxNow = undefined;
  67994. } );
  67995. return ( fxNow = Date.now() );
  67996. }
  67997. // Generate parameters to create a standard animation
  67998. function genFx( type, includeWidth ) {
  67999. var which,
  68000. i = 0,
  68001. attrs = { height: type };
  68002. // If we include width, step value is 1 to do all cssExpand values,
  68003. // otherwise step value is 2 to skip over Left and Right
  68004. includeWidth = includeWidth ? 1 : 0;
  68005. for ( ; i < 4; i += 2 - includeWidth ) {
  68006. which = cssExpand[ i ];
  68007. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  68008. }
  68009. if ( includeWidth ) {
  68010. attrs.opacity = attrs.width = type;
  68011. }
  68012. return attrs;
  68013. }
  68014. function createTween( value, prop, animation ) {
  68015. var tween,
  68016. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  68017. index = 0,
  68018. length = collection.length;
  68019. for ( ; index < length; index++ ) {
  68020. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  68021. // We're done with this property
  68022. return tween;
  68023. }
  68024. }
  68025. }
  68026. function defaultPrefilter( elem, props, opts ) {
  68027. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  68028. isBox = "width" in props || "height" in props,
  68029. anim = this,
  68030. orig = {},
  68031. style = elem.style,
  68032. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  68033. dataShow = dataPriv.get( elem, "fxshow" );
  68034. // Queue-skipping animations hijack the fx hooks
  68035. if ( !opts.queue ) {
  68036. hooks = jQuery._queueHooks( elem, "fx" );
  68037. if ( hooks.unqueued == null ) {
  68038. hooks.unqueued = 0;
  68039. oldfire = hooks.empty.fire;
  68040. hooks.empty.fire = function() {
  68041. if ( !hooks.unqueued ) {
  68042. oldfire();
  68043. }
  68044. };
  68045. }
  68046. hooks.unqueued++;
  68047. anim.always( function() {
  68048. // Ensure the complete handler is called before this completes
  68049. anim.always( function() {
  68050. hooks.unqueued--;
  68051. if ( !jQuery.queue( elem, "fx" ).length ) {
  68052. hooks.empty.fire();
  68053. }
  68054. } );
  68055. } );
  68056. }
  68057. // Detect show/hide animations
  68058. for ( prop in props ) {
  68059. value = props[ prop ];
  68060. if ( rfxtypes.test( value ) ) {
  68061. delete props[ prop ];
  68062. toggle = toggle || value === "toggle";
  68063. if ( value === ( hidden ? "hide" : "show" ) ) {
  68064. // Pretend to be hidden if this is a "show" and
  68065. // there is still data from a stopped show/hide
  68066. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  68067. hidden = true;
  68068. // Ignore all other no-op show/hide data
  68069. } else {
  68070. continue;
  68071. }
  68072. }
  68073. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  68074. }
  68075. }
  68076. // Bail out if this is a no-op like .hide().hide()
  68077. propTween = !jQuery.isEmptyObject( props );
  68078. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  68079. return;
  68080. }
  68081. // Restrict "overflow" and "display" styles during box animations
  68082. if ( isBox && elem.nodeType === 1 ) {
  68083. // Support: IE <=9 - 11, Edge 12 - 15
  68084. // Record all 3 overflow attributes because IE does not infer the shorthand
  68085. // from identically-valued overflowX and overflowY and Edge just mirrors
  68086. // the overflowX value there.
  68087. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  68088. // Identify a display type, preferring old show/hide data over the CSS cascade
  68089. restoreDisplay = dataShow && dataShow.display;
  68090. if ( restoreDisplay == null ) {
  68091. restoreDisplay = dataPriv.get( elem, "display" );
  68092. }
  68093. display = jQuery.css( elem, "display" );
  68094. if ( display === "none" ) {
  68095. if ( restoreDisplay ) {
  68096. display = restoreDisplay;
  68097. } else {
  68098. // Get nonempty value(s) by temporarily forcing visibility
  68099. showHide( [ elem ], true );
  68100. restoreDisplay = elem.style.display || restoreDisplay;
  68101. display = jQuery.css( elem, "display" );
  68102. showHide( [ elem ] );
  68103. }
  68104. }
  68105. // Animate inline elements as inline-block
  68106. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  68107. if ( jQuery.css( elem, "float" ) === "none" ) {
  68108. // Restore the original display value at the end of pure show/hide animations
  68109. if ( !propTween ) {
  68110. anim.done( function() {
  68111. style.display = restoreDisplay;
  68112. } );
  68113. if ( restoreDisplay == null ) {
  68114. display = style.display;
  68115. restoreDisplay = display === "none" ? "" : display;
  68116. }
  68117. }
  68118. style.display = "inline-block";
  68119. }
  68120. }
  68121. }
  68122. if ( opts.overflow ) {
  68123. style.overflow = "hidden";
  68124. anim.always( function() {
  68125. style.overflow = opts.overflow[ 0 ];
  68126. style.overflowX = opts.overflow[ 1 ];
  68127. style.overflowY = opts.overflow[ 2 ];
  68128. } );
  68129. }
  68130. // Implement show/hide animations
  68131. propTween = false;
  68132. for ( prop in orig ) {
  68133. // General show/hide setup for this element animation
  68134. if ( !propTween ) {
  68135. if ( dataShow ) {
  68136. if ( "hidden" in dataShow ) {
  68137. hidden = dataShow.hidden;
  68138. }
  68139. } else {
  68140. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  68141. }
  68142. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  68143. if ( toggle ) {
  68144. dataShow.hidden = !hidden;
  68145. }
  68146. // Show elements before animating them
  68147. if ( hidden ) {
  68148. showHide( [ elem ], true );
  68149. }
  68150. /* eslint-disable no-loop-func */
  68151. anim.done( function() {
  68152. /* eslint-enable no-loop-func */
  68153. // The final step of a "hide" animation is actually hiding the element
  68154. if ( !hidden ) {
  68155. showHide( [ elem ] );
  68156. }
  68157. dataPriv.remove( elem, "fxshow" );
  68158. for ( prop in orig ) {
  68159. jQuery.style( elem, prop, orig[ prop ] );
  68160. }
  68161. } );
  68162. }
  68163. // Per-property setup
  68164. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  68165. if ( !( prop in dataShow ) ) {
  68166. dataShow[ prop ] = propTween.start;
  68167. if ( hidden ) {
  68168. propTween.end = propTween.start;
  68169. propTween.start = 0;
  68170. }
  68171. }
  68172. }
  68173. }
  68174. function propFilter( props, specialEasing ) {
  68175. var index, name, easing, value, hooks;
  68176. // camelCase, specialEasing and expand cssHook pass
  68177. for ( index in props ) {
  68178. name = camelCase( index );
  68179. easing = specialEasing[ name ];
  68180. value = props[ index ];
  68181. if ( Array.isArray( value ) ) {
  68182. easing = value[ 1 ];
  68183. value = props[ index ] = value[ 0 ];
  68184. }
  68185. if ( index !== name ) {
  68186. props[ name ] = value;
  68187. delete props[ index ];
  68188. }
  68189. hooks = jQuery.cssHooks[ name ];
  68190. if ( hooks && "expand" in hooks ) {
  68191. value = hooks.expand( value );
  68192. delete props[ name ];
  68193. // Not quite $.extend, this won't overwrite existing keys.
  68194. // Reusing 'index' because we have the correct "name"
  68195. for ( index in value ) {
  68196. if ( !( index in props ) ) {
  68197. props[ index ] = value[ index ];
  68198. specialEasing[ index ] = easing;
  68199. }
  68200. }
  68201. } else {
  68202. specialEasing[ name ] = easing;
  68203. }
  68204. }
  68205. }
  68206. function Animation( elem, properties, options ) {
  68207. var result,
  68208. stopped,
  68209. index = 0,
  68210. length = Animation.prefilters.length,
  68211. deferred = jQuery.Deferred().always( function() {
  68212. // Don't match elem in the :animated selector
  68213. delete tick.elem;
  68214. } ),
  68215. tick = function() {
  68216. if ( stopped ) {
  68217. return false;
  68218. }
  68219. var currentTime = fxNow || createFxNow(),
  68220. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  68221. // Support: Android 2.3 only
  68222. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  68223. temp = remaining / animation.duration || 0,
  68224. percent = 1 - temp,
  68225. index = 0,
  68226. length = animation.tweens.length;
  68227. for ( ; index < length; index++ ) {
  68228. animation.tweens[ index ].run( percent );
  68229. }
  68230. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  68231. // If there's more to do, yield
  68232. if ( percent < 1 && length ) {
  68233. return remaining;
  68234. }
  68235. // If this was an empty animation, synthesize a final progress notification
  68236. if ( !length ) {
  68237. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  68238. }
  68239. // Resolve the animation and report its conclusion
  68240. deferred.resolveWith( elem, [ animation ] );
  68241. return false;
  68242. },
  68243. animation = deferred.promise( {
  68244. elem: elem,
  68245. props: jQuery.extend( {}, properties ),
  68246. opts: jQuery.extend( true, {
  68247. specialEasing: {},
  68248. easing: jQuery.easing._default
  68249. }, options ),
  68250. originalProperties: properties,
  68251. originalOptions: options,
  68252. startTime: fxNow || createFxNow(),
  68253. duration: options.duration,
  68254. tweens: [],
  68255. createTween: function( prop, end ) {
  68256. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  68257. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  68258. animation.tweens.push( tween );
  68259. return tween;
  68260. },
  68261. stop: function( gotoEnd ) {
  68262. var index = 0,
  68263. // If we are going to the end, we want to run all the tweens
  68264. // otherwise we skip this part
  68265. length = gotoEnd ? animation.tweens.length : 0;
  68266. if ( stopped ) {
  68267. return this;
  68268. }
  68269. stopped = true;
  68270. for ( ; index < length; index++ ) {
  68271. animation.tweens[ index ].run( 1 );
  68272. }
  68273. // Resolve when we played the last frame; otherwise, reject
  68274. if ( gotoEnd ) {
  68275. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  68276. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  68277. } else {
  68278. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  68279. }
  68280. return this;
  68281. }
  68282. } ),
  68283. props = animation.props;
  68284. propFilter( props, animation.opts.specialEasing );
  68285. for ( ; index < length; index++ ) {
  68286. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  68287. if ( result ) {
  68288. if ( isFunction( result.stop ) ) {
  68289. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  68290. result.stop.bind( result );
  68291. }
  68292. return result;
  68293. }
  68294. }
  68295. jQuery.map( props, createTween, animation );
  68296. if ( isFunction( animation.opts.start ) ) {
  68297. animation.opts.start.call( elem, animation );
  68298. }
  68299. // Attach callbacks from options
  68300. animation
  68301. .progress( animation.opts.progress )
  68302. .done( animation.opts.done, animation.opts.complete )
  68303. .fail( animation.opts.fail )
  68304. .always( animation.opts.always );
  68305. jQuery.fx.timer(
  68306. jQuery.extend( tick, {
  68307. elem: elem,
  68308. anim: animation,
  68309. queue: animation.opts.queue
  68310. } )
  68311. );
  68312. return animation;
  68313. }
  68314. jQuery.Animation = jQuery.extend( Animation, {
  68315. tweeners: {
  68316. "*": [ function( prop, value ) {
  68317. var tween = this.createTween( prop, value );
  68318. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  68319. return tween;
  68320. } ]
  68321. },
  68322. tweener: function( props, callback ) {
  68323. if ( isFunction( props ) ) {
  68324. callback = props;
  68325. props = [ "*" ];
  68326. } else {
  68327. props = props.match( rnothtmlwhite );
  68328. }
  68329. var prop,
  68330. index = 0,
  68331. length = props.length;
  68332. for ( ; index < length; index++ ) {
  68333. prop = props[ index ];
  68334. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  68335. Animation.tweeners[ prop ].unshift( callback );
  68336. }
  68337. },
  68338. prefilters: [ defaultPrefilter ],
  68339. prefilter: function( callback, prepend ) {
  68340. if ( prepend ) {
  68341. Animation.prefilters.unshift( callback );
  68342. } else {
  68343. Animation.prefilters.push( callback );
  68344. }
  68345. }
  68346. } );
  68347. jQuery.speed = function( speed, easing, fn ) {
  68348. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  68349. complete: fn || !fn && easing ||
  68350. isFunction( speed ) && speed,
  68351. duration: speed,
  68352. easing: fn && easing || easing && !isFunction( easing ) && easing
  68353. };
  68354. // Go to the end state if fx are off
  68355. if ( jQuery.fx.off ) {
  68356. opt.duration = 0;
  68357. } else {
  68358. if ( typeof opt.duration !== "number" ) {
  68359. if ( opt.duration in jQuery.fx.speeds ) {
  68360. opt.duration = jQuery.fx.speeds[ opt.duration ];
  68361. } else {
  68362. opt.duration = jQuery.fx.speeds._default;
  68363. }
  68364. }
  68365. }
  68366. // Normalize opt.queue - true/undefined/null -> "fx"
  68367. if ( opt.queue == null || opt.queue === true ) {
  68368. opt.queue = "fx";
  68369. }
  68370. // Queueing
  68371. opt.old = opt.complete;
  68372. opt.complete = function() {
  68373. if ( isFunction( opt.old ) ) {
  68374. opt.old.call( this );
  68375. }
  68376. if ( opt.queue ) {
  68377. jQuery.dequeue( this, opt.queue );
  68378. }
  68379. };
  68380. return opt;
  68381. };
  68382. jQuery.fn.extend( {
  68383. fadeTo: function( speed, to, easing, callback ) {
  68384. // Show any hidden elements after setting opacity to 0
  68385. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  68386. // Animate to the value specified
  68387. .end().animate( { opacity: to }, speed, easing, callback );
  68388. },
  68389. animate: function( prop, speed, easing, callback ) {
  68390. var empty = jQuery.isEmptyObject( prop ),
  68391. optall = jQuery.speed( speed, easing, callback ),
  68392. doAnimation = function() {
  68393. // Operate on a copy of prop so per-property easing won't be lost
  68394. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  68395. // Empty animations, or finishing resolves immediately
  68396. if ( empty || dataPriv.get( this, "finish" ) ) {
  68397. anim.stop( true );
  68398. }
  68399. };
  68400. doAnimation.finish = doAnimation;
  68401. return empty || optall.queue === false ?
  68402. this.each( doAnimation ) :
  68403. this.queue( optall.queue, doAnimation );
  68404. },
  68405. stop: function( type, clearQueue, gotoEnd ) {
  68406. var stopQueue = function( hooks ) {
  68407. var stop = hooks.stop;
  68408. delete hooks.stop;
  68409. stop( gotoEnd );
  68410. };
  68411. if ( typeof type !== "string" ) {
  68412. gotoEnd = clearQueue;
  68413. clearQueue = type;
  68414. type = undefined;
  68415. }
  68416. if ( clearQueue ) {
  68417. this.queue( type || "fx", [] );
  68418. }
  68419. return this.each( function() {
  68420. var dequeue = true,
  68421. index = type != null && type + "queueHooks",
  68422. timers = jQuery.timers,
  68423. data = dataPriv.get( this );
  68424. if ( index ) {
  68425. if ( data[ index ] && data[ index ].stop ) {
  68426. stopQueue( data[ index ] );
  68427. }
  68428. } else {
  68429. for ( index in data ) {
  68430. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  68431. stopQueue( data[ index ] );
  68432. }
  68433. }
  68434. }
  68435. for ( index = timers.length; index--; ) {
  68436. if ( timers[ index ].elem === this &&
  68437. ( type == null || timers[ index ].queue === type ) ) {
  68438. timers[ index ].anim.stop( gotoEnd );
  68439. dequeue = false;
  68440. timers.splice( index, 1 );
  68441. }
  68442. }
  68443. // Start the next in the queue if the last step wasn't forced.
  68444. // Timers currently will call their complete callbacks, which
  68445. // will dequeue but only if they were gotoEnd.
  68446. if ( dequeue || !gotoEnd ) {
  68447. jQuery.dequeue( this, type );
  68448. }
  68449. } );
  68450. },
  68451. finish: function( type ) {
  68452. if ( type !== false ) {
  68453. type = type || "fx";
  68454. }
  68455. return this.each( function() {
  68456. var index,
  68457. data = dataPriv.get( this ),
  68458. queue = data[ type + "queue" ],
  68459. hooks = data[ type + "queueHooks" ],
  68460. timers = jQuery.timers,
  68461. length = queue ? queue.length : 0;
  68462. // Enable finishing flag on private data
  68463. data.finish = true;
  68464. // Empty the queue first
  68465. jQuery.queue( this, type, [] );
  68466. if ( hooks && hooks.stop ) {
  68467. hooks.stop.call( this, true );
  68468. }
  68469. // Look for any active animations, and finish them
  68470. for ( index = timers.length; index--; ) {
  68471. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  68472. timers[ index ].anim.stop( true );
  68473. timers.splice( index, 1 );
  68474. }
  68475. }
  68476. // Look for any animations in the old queue and finish them
  68477. for ( index = 0; index < length; index++ ) {
  68478. if ( queue[ index ] && queue[ index ].finish ) {
  68479. queue[ index ].finish.call( this );
  68480. }
  68481. }
  68482. // Turn off finishing flag
  68483. delete data.finish;
  68484. } );
  68485. }
  68486. } );
  68487. jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
  68488. var cssFn = jQuery.fn[ name ];
  68489. jQuery.fn[ name ] = function( speed, easing, callback ) {
  68490. return speed == null || typeof speed === "boolean" ?
  68491. cssFn.apply( this, arguments ) :
  68492. this.animate( genFx( name, true ), speed, easing, callback );
  68493. };
  68494. } );
  68495. // Generate shortcuts for custom animations
  68496. jQuery.each( {
  68497. slideDown: genFx( "show" ),
  68498. slideUp: genFx( "hide" ),
  68499. slideToggle: genFx( "toggle" ),
  68500. fadeIn: { opacity: "show" },
  68501. fadeOut: { opacity: "hide" },
  68502. fadeToggle: { opacity: "toggle" }
  68503. }, function( name, props ) {
  68504. jQuery.fn[ name ] = function( speed, easing, callback ) {
  68505. return this.animate( props, speed, easing, callback );
  68506. };
  68507. } );
  68508. jQuery.timers = [];
  68509. jQuery.fx.tick = function() {
  68510. var timer,
  68511. i = 0,
  68512. timers = jQuery.timers;
  68513. fxNow = Date.now();
  68514. for ( ; i < timers.length; i++ ) {
  68515. timer = timers[ i ];
  68516. // Run the timer and safely remove it when done (allowing for external removal)
  68517. if ( !timer() && timers[ i ] === timer ) {
  68518. timers.splice( i--, 1 );
  68519. }
  68520. }
  68521. if ( !timers.length ) {
  68522. jQuery.fx.stop();
  68523. }
  68524. fxNow = undefined;
  68525. };
  68526. jQuery.fx.timer = function( timer ) {
  68527. jQuery.timers.push( timer );
  68528. jQuery.fx.start();
  68529. };
  68530. jQuery.fx.interval = 13;
  68531. jQuery.fx.start = function() {
  68532. if ( inProgress ) {
  68533. return;
  68534. }
  68535. inProgress = true;
  68536. schedule();
  68537. };
  68538. jQuery.fx.stop = function() {
  68539. inProgress = null;
  68540. };
  68541. jQuery.fx.speeds = {
  68542. slow: 600,
  68543. fast: 200,
  68544. // Default speed
  68545. _default: 400
  68546. };
  68547. // Based off of the plugin by Clint Helfers, with permission.
  68548. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  68549. jQuery.fn.delay = function( time, type ) {
  68550. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  68551. type = type || "fx";
  68552. return this.queue( type, function( next, hooks ) {
  68553. var timeout = window.setTimeout( next, time );
  68554. hooks.stop = function() {
  68555. window.clearTimeout( timeout );
  68556. };
  68557. } );
  68558. };
  68559. ( function() {
  68560. var input = document.createElement( "input" ),
  68561. select = document.createElement( "select" ),
  68562. opt = select.appendChild( document.createElement( "option" ) );
  68563. input.type = "checkbox";
  68564. // Support: Android <=4.3 only
  68565. // Default value for a checkbox should be "on"
  68566. support.checkOn = input.value !== "";
  68567. // Support: IE <=11 only
  68568. // Must access selectedIndex to make default options select
  68569. support.optSelected = opt.selected;
  68570. // Support: IE <=11 only
  68571. // An input loses its value after becoming a radio
  68572. input = document.createElement( "input" );
  68573. input.value = "t";
  68574. input.type = "radio";
  68575. support.radioValue = input.value === "t";
  68576. } )();
  68577. var boolHook,
  68578. attrHandle = jQuery.expr.attrHandle;
  68579. jQuery.fn.extend( {
  68580. attr: function( name, value ) {
  68581. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  68582. },
  68583. removeAttr: function( name ) {
  68584. return this.each( function() {
  68585. jQuery.removeAttr( this, name );
  68586. } );
  68587. }
  68588. } );
  68589. jQuery.extend( {
  68590. attr: function( elem, name, value ) {
  68591. var ret, hooks,
  68592. nType = elem.nodeType;
  68593. // Don't get/set attributes on text, comment and attribute nodes
  68594. if ( nType === 3 || nType === 8 || nType === 2 ) {
  68595. return;
  68596. }
  68597. // Fallback to prop when attributes are not supported
  68598. if ( typeof elem.getAttribute === "undefined" ) {
  68599. return jQuery.prop( elem, name, value );
  68600. }
  68601. // Attribute hooks are determined by the lowercase version
  68602. // Grab necessary hook if one is defined
  68603. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  68604. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  68605. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  68606. }
  68607. if ( value !== undefined ) {
  68608. if ( value === null ) {
  68609. jQuery.removeAttr( elem, name );
  68610. return;
  68611. }
  68612. if ( hooks && "set" in hooks &&
  68613. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  68614. return ret;
  68615. }
  68616. elem.setAttribute( name, value + "" );
  68617. return value;
  68618. }
  68619. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  68620. return ret;
  68621. }
  68622. ret = jQuery.find.attr( elem, name );
  68623. // Non-existent attributes return null, we normalize to undefined
  68624. return ret == null ? undefined : ret;
  68625. },
  68626. attrHooks: {
  68627. type: {
  68628. set: function( elem, value ) {
  68629. if ( !support.radioValue && value === "radio" &&
  68630. nodeName( elem, "input" ) ) {
  68631. var val = elem.value;
  68632. elem.setAttribute( "type", value );
  68633. if ( val ) {
  68634. elem.value = val;
  68635. }
  68636. return value;
  68637. }
  68638. }
  68639. }
  68640. },
  68641. removeAttr: function( elem, value ) {
  68642. var name,
  68643. i = 0,
  68644. // Attribute names can contain non-HTML whitespace characters
  68645. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  68646. attrNames = value && value.match( rnothtmlwhite );
  68647. if ( attrNames && elem.nodeType === 1 ) {
  68648. while ( ( name = attrNames[ i++ ] ) ) {
  68649. elem.removeAttribute( name );
  68650. }
  68651. }
  68652. }
  68653. } );
  68654. // Hooks for boolean attributes
  68655. boolHook = {
  68656. set: function( elem, value, name ) {
  68657. if ( value === false ) {
  68658. // Remove boolean attributes when set to false
  68659. jQuery.removeAttr( elem, name );
  68660. } else {
  68661. elem.setAttribute( name, name );
  68662. }
  68663. return name;
  68664. }
  68665. };
  68666. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  68667. var getter = attrHandle[ name ] || jQuery.find.attr;
  68668. attrHandle[ name ] = function( elem, name, isXML ) {
  68669. var ret, handle,
  68670. lowercaseName = name.toLowerCase();
  68671. if ( !isXML ) {
  68672. // Avoid an infinite loop by temporarily removing this function from the getter
  68673. handle = attrHandle[ lowercaseName ];
  68674. attrHandle[ lowercaseName ] = ret;
  68675. ret = getter( elem, name, isXML ) != null ?
  68676. lowercaseName :
  68677. null;
  68678. attrHandle[ lowercaseName ] = handle;
  68679. }
  68680. return ret;
  68681. };
  68682. } );
  68683. var rfocusable = /^(?:input|select|textarea|button)$/i,
  68684. rclickable = /^(?:a|area)$/i;
  68685. jQuery.fn.extend( {
  68686. prop: function( name, value ) {
  68687. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  68688. },
  68689. removeProp: function( name ) {
  68690. return this.each( function() {
  68691. delete this[ jQuery.propFix[ name ] || name ];
  68692. } );
  68693. }
  68694. } );
  68695. jQuery.extend( {
  68696. prop: function( elem, name, value ) {
  68697. var ret, hooks,
  68698. nType = elem.nodeType;
  68699. // Don't get/set properties on text, comment and attribute nodes
  68700. if ( nType === 3 || nType === 8 || nType === 2 ) {
  68701. return;
  68702. }
  68703. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  68704. // Fix name and attach hooks
  68705. name = jQuery.propFix[ name ] || name;
  68706. hooks = jQuery.propHooks[ name ];
  68707. }
  68708. if ( value !== undefined ) {
  68709. if ( hooks && "set" in hooks &&
  68710. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  68711. return ret;
  68712. }
  68713. return ( elem[ name ] = value );
  68714. }
  68715. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  68716. return ret;
  68717. }
  68718. return elem[ name ];
  68719. },
  68720. propHooks: {
  68721. tabIndex: {
  68722. get: function( elem ) {
  68723. // Support: IE <=9 - 11 only
  68724. // elem.tabIndex doesn't always return the
  68725. // correct value when it hasn't been explicitly set
  68726. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  68727. // Use proper attribute retrieval(#12072)
  68728. var tabindex = jQuery.find.attr( elem, "tabindex" );
  68729. if ( tabindex ) {
  68730. return parseInt( tabindex, 10 );
  68731. }
  68732. if (
  68733. rfocusable.test( elem.nodeName ) ||
  68734. rclickable.test( elem.nodeName ) &&
  68735. elem.href
  68736. ) {
  68737. return 0;
  68738. }
  68739. return -1;
  68740. }
  68741. }
  68742. },
  68743. propFix: {
  68744. "for": "htmlFor",
  68745. "class": "className"
  68746. }
  68747. } );
  68748. // Support: IE <=11 only
  68749. // Accessing the selectedIndex property
  68750. // forces the browser to respect setting selected
  68751. // on the option
  68752. // The getter ensures a default option is selected
  68753. // when in an optgroup
  68754. // eslint rule "no-unused-expressions" is disabled for this code
  68755. // since it considers such accessions noop
  68756. if ( !support.optSelected ) {
  68757. jQuery.propHooks.selected = {
  68758. get: function( elem ) {
  68759. /* eslint no-unused-expressions: "off" */
  68760. var parent = elem.parentNode;
  68761. if ( parent && parent.parentNode ) {
  68762. parent.parentNode.selectedIndex;
  68763. }
  68764. return null;
  68765. },
  68766. set: function( elem ) {
  68767. /* eslint no-unused-expressions: "off" */
  68768. var parent = elem.parentNode;
  68769. if ( parent ) {
  68770. parent.selectedIndex;
  68771. if ( parent.parentNode ) {
  68772. parent.parentNode.selectedIndex;
  68773. }
  68774. }
  68775. }
  68776. };
  68777. }
  68778. jQuery.each( [
  68779. "tabIndex",
  68780. "readOnly",
  68781. "maxLength",
  68782. "cellSpacing",
  68783. "cellPadding",
  68784. "rowSpan",
  68785. "colSpan",
  68786. "useMap",
  68787. "frameBorder",
  68788. "contentEditable"
  68789. ], function() {
  68790. jQuery.propFix[ this.toLowerCase() ] = this;
  68791. } );
  68792. // Strip and collapse whitespace according to HTML spec
  68793. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  68794. function stripAndCollapse( value ) {
  68795. var tokens = value.match( rnothtmlwhite ) || [];
  68796. return tokens.join( " " );
  68797. }
  68798. function getClass( elem ) {
  68799. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  68800. }
  68801. function classesToArray( value ) {
  68802. if ( Array.isArray( value ) ) {
  68803. return value;
  68804. }
  68805. if ( typeof value === "string" ) {
  68806. return value.match( rnothtmlwhite ) || [];
  68807. }
  68808. return [];
  68809. }
  68810. jQuery.fn.extend( {
  68811. addClass: function( value ) {
  68812. var classes, elem, cur, curValue, clazz, j, finalValue,
  68813. i = 0;
  68814. if ( isFunction( value ) ) {
  68815. return this.each( function( j ) {
  68816. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  68817. } );
  68818. }
  68819. classes = classesToArray( value );
  68820. if ( classes.length ) {
  68821. while ( ( elem = this[ i++ ] ) ) {
  68822. curValue = getClass( elem );
  68823. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  68824. if ( cur ) {
  68825. j = 0;
  68826. while ( ( clazz = classes[ j++ ] ) ) {
  68827. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  68828. cur += clazz + " ";
  68829. }
  68830. }
  68831. // Only assign if different to avoid unneeded rendering.
  68832. finalValue = stripAndCollapse( cur );
  68833. if ( curValue !== finalValue ) {
  68834. elem.setAttribute( "class", finalValue );
  68835. }
  68836. }
  68837. }
  68838. }
  68839. return this;
  68840. },
  68841. removeClass: function( value ) {
  68842. var classes, elem, cur, curValue, clazz, j, finalValue,
  68843. i = 0;
  68844. if ( isFunction( value ) ) {
  68845. return this.each( function( j ) {
  68846. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  68847. } );
  68848. }
  68849. if ( !arguments.length ) {
  68850. return this.attr( "class", "" );
  68851. }
  68852. classes = classesToArray( value );
  68853. if ( classes.length ) {
  68854. while ( ( elem = this[ i++ ] ) ) {
  68855. curValue = getClass( elem );
  68856. // This expression is here for better compressibility (see addClass)
  68857. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  68858. if ( cur ) {
  68859. j = 0;
  68860. while ( ( clazz = classes[ j++ ] ) ) {
  68861. // Remove *all* instances
  68862. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  68863. cur = cur.replace( " " + clazz + " ", " " );
  68864. }
  68865. }
  68866. // Only assign if different to avoid unneeded rendering.
  68867. finalValue = stripAndCollapse( cur );
  68868. if ( curValue !== finalValue ) {
  68869. elem.setAttribute( "class", finalValue );
  68870. }
  68871. }
  68872. }
  68873. }
  68874. return this;
  68875. },
  68876. toggleClass: function( value, stateVal ) {
  68877. var type = typeof value,
  68878. isValidValue = type === "string" || Array.isArray( value );
  68879. if ( typeof stateVal === "boolean" && isValidValue ) {
  68880. return stateVal ? this.addClass( value ) : this.removeClass( value );
  68881. }
  68882. if ( isFunction( value ) ) {
  68883. return this.each( function( i ) {
  68884. jQuery( this ).toggleClass(
  68885. value.call( this, i, getClass( this ), stateVal ),
  68886. stateVal
  68887. );
  68888. } );
  68889. }
  68890. return this.each( function() {
  68891. var className, i, self, classNames;
  68892. if ( isValidValue ) {
  68893. // Toggle individual class names
  68894. i = 0;
  68895. self = jQuery( this );
  68896. classNames = classesToArray( value );
  68897. while ( ( className = classNames[ i++ ] ) ) {
  68898. // Check each className given, space separated list
  68899. if ( self.hasClass( className ) ) {
  68900. self.removeClass( className );
  68901. } else {
  68902. self.addClass( className );
  68903. }
  68904. }
  68905. // Toggle whole class name
  68906. } else if ( value === undefined || type === "boolean" ) {
  68907. className = getClass( this );
  68908. if ( className ) {
  68909. // Store className if set
  68910. dataPriv.set( this, "__className__", className );
  68911. }
  68912. // If the element has a class name or if we're passed `false`,
  68913. // then remove the whole classname (if there was one, the above saved it).
  68914. // Otherwise bring back whatever was previously saved (if anything),
  68915. // falling back to the empty string if nothing was stored.
  68916. if ( this.setAttribute ) {
  68917. this.setAttribute( "class",
  68918. className || value === false ?
  68919. "" :
  68920. dataPriv.get( this, "__className__" ) || ""
  68921. );
  68922. }
  68923. }
  68924. } );
  68925. },
  68926. hasClass: function( selector ) {
  68927. var className, elem,
  68928. i = 0;
  68929. className = " " + selector + " ";
  68930. while ( ( elem = this[ i++ ] ) ) {
  68931. if ( elem.nodeType === 1 &&
  68932. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  68933. return true;
  68934. }
  68935. }
  68936. return false;
  68937. }
  68938. } );
  68939. var rreturn = /\r/g;
  68940. jQuery.fn.extend( {
  68941. val: function( value ) {
  68942. var hooks, ret, valueIsFunction,
  68943. elem = this[ 0 ];
  68944. if ( !arguments.length ) {
  68945. if ( elem ) {
  68946. hooks = jQuery.valHooks[ elem.type ] ||
  68947. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  68948. if ( hooks &&
  68949. "get" in hooks &&
  68950. ( ret = hooks.get( elem, "value" ) ) !== undefined
  68951. ) {
  68952. return ret;
  68953. }
  68954. ret = elem.value;
  68955. // Handle most common string cases
  68956. if ( typeof ret === "string" ) {
  68957. return ret.replace( rreturn, "" );
  68958. }
  68959. // Handle cases where value is null/undef or number
  68960. return ret == null ? "" : ret;
  68961. }
  68962. return;
  68963. }
  68964. valueIsFunction = isFunction( value );
  68965. return this.each( function( i ) {
  68966. var val;
  68967. if ( this.nodeType !== 1 ) {
  68968. return;
  68969. }
  68970. if ( valueIsFunction ) {
  68971. val = value.call( this, i, jQuery( this ).val() );
  68972. } else {
  68973. val = value;
  68974. }
  68975. // Treat null/undefined as ""; convert numbers to string
  68976. if ( val == null ) {
  68977. val = "";
  68978. } else if ( typeof val === "number" ) {
  68979. val += "";
  68980. } else if ( Array.isArray( val ) ) {
  68981. val = jQuery.map( val, function( value ) {
  68982. return value == null ? "" : value + "";
  68983. } );
  68984. }
  68985. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  68986. // If set returns undefined, fall back to normal setting
  68987. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  68988. this.value = val;
  68989. }
  68990. } );
  68991. }
  68992. } );
  68993. jQuery.extend( {
  68994. valHooks: {
  68995. option: {
  68996. get: function( elem ) {
  68997. var val = jQuery.find.attr( elem, "value" );
  68998. return val != null ?
  68999. val :
  69000. // Support: IE <=10 - 11 only
  69001. // option.text throws exceptions (#14686, #14858)
  69002. // Strip and collapse whitespace
  69003. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  69004. stripAndCollapse( jQuery.text( elem ) );
  69005. }
  69006. },
  69007. select: {
  69008. get: function( elem ) {
  69009. var value, option, i,
  69010. options = elem.options,
  69011. index = elem.selectedIndex,
  69012. one = elem.type === "select-one",
  69013. values = one ? null : [],
  69014. max = one ? index + 1 : options.length;
  69015. if ( index < 0 ) {
  69016. i = max;
  69017. } else {
  69018. i = one ? index : 0;
  69019. }
  69020. // Loop through all the selected options
  69021. for ( ; i < max; i++ ) {
  69022. option = options[ i ];
  69023. // Support: IE <=9 only
  69024. // IE8-9 doesn't update selected after form reset (#2551)
  69025. if ( ( option.selected || i === index ) &&
  69026. // Don't return options that are disabled or in a disabled optgroup
  69027. !option.disabled &&
  69028. ( !option.parentNode.disabled ||
  69029. !nodeName( option.parentNode, "optgroup" ) ) ) {
  69030. // Get the specific value for the option
  69031. value = jQuery( option ).val();
  69032. // We don't need an array for one selects
  69033. if ( one ) {
  69034. return value;
  69035. }
  69036. // Multi-Selects return an array
  69037. values.push( value );
  69038. }
  69039. }
  69040. return values;
  69041. },
  69042. set: function( elem, value ) {
  69043. var optionSet, option,
  69044. options = elem.options,
  69045. values = jQuery.makeArray( value ),
  69046. i = options.length;
  69047. while ( i-- ) {
  69048. option = options[ i ];
  69049. /* eslint-disable no-cond-assign */
  69050. if ( option.selected =
  69051. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  69052. ) {
  69053. optionSet = true;
  69054. }
  69055. /* eslint-enable no-cond-assign */
  69056. }
  69057. // Force browsers to behave consistently when non-matching value is set
  69058. if ( !optionSet ) {
  69059. elem.selectedIndex = -1;
  69060. }
  69061. return values;
  69062. }
  69063. }
  69064. }
  69065. } );
  69066. // Radios and checkboxes getter/setter
  69067. jQuery.each( [ "radio", "checkbox" ], function() {
  69068. jQuery.valHooks[ this ] = {
  69069. set: function( elem, value ) {
  69070. if ( Array.isArray( value ) ) {
  69071. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  69072. }
  69073. }
  69074. };
  69075. if ( !support.checkOn ) {
  69076. jQuery.valHooks[ this ].get = function( elem ) {
  69077. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  69078. };
  69079. }
  69080. } );
  69081. // Return jQuery for attributes-only inclusion
  69082. support.focusin = "onfocusin" in window;
  69083. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  69084. stopPropagationCallback = function( e ) {
  69085. e.stopPropagation();
  69086. };
  69087. jQuery.extend( jQuery.event, {
  69088. trigger: function( event, data, elem, onlyHandlers ) {
  69089. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  69090. eventPath = [ elem || document ],
  69091. type = hasOwn.call( event, "type" ) ? event.type : event,
  69092. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  69093. cur = lastElement = tmp = elem = elem || document;
  69094. // Don't do events on text and comment nodes
  69095. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  69096. return;
  69097. }
  69098. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  69099. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  69100. return;
  69101. }
  69102. if ( type.indexOf( "." ) > -1 ) {
  69103. // Namespaced trigger; create a regexp to match event type in handle()
  69104. namespaces = type.split( "." );
  69105. type = namespaces.shift();
  69106. namespaces.sort();
  69107. }
  69108. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  69109. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  69110. event = event[ jQuery.expando ] ?
  69111. event :
  69112. new jQuery.Event( type, typeof event === "object" && event );
  69113. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  69114. event.isTrigger = onlyHandlers ? 2 : 3;
  69115. event.namespace = namespaces.join( "." );
  69116. event.rnamespace = event.namespace ?
  69117. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  69118. null;
  69119. // Clean up the event in case it is being reused
  69120. event.result = undefined;
  69121. if ( !event.target ) {
  69122. event.target = elem;
  69123. }
  69124. // Clone any incoming data and prepend the event, creating the handler arg list
  69125. data = data == null ?
  69126. [ event ] :
  69127. jQuery.makeArray( data, [ event ] );
  69128. // Allow special events to draw outside the lines
  69129. special = jQuery.event.special[ type ] || {};
  69130. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  69131. return;
  69132. }
  69133. // Determine event propagation path in advance, per W3C events spec (#9951)
  69134. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  69135. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  69136. bubbleType = special.delegateType || type;
  69137. if ( !rfocusMorph.test( bubbleType + type ) ) {
  69138. cur = cur.parentNode;
  69139. }
  69140. for ( ; cur; cur = cur.parentNode ) {
  69141. eventPath.push( cur );
  69142. tmp = cur;
  69143. }
  69144. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  69145. if ( tmp === ( elem.ownerDocument || document ) ) {
  69146. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  69147. }
  69148. }
  69149. // Fire handlers on the event path
  69150. i = 0;
  69151. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  69152. lastElement = cur;
  69153. event.type = i > 1 ?
  69154. bubbleType :
  69155. special.bindType || type;
  69156. // jQuery handler
  69157. handle = (
  69158. dataPriv.get( cur, "events" ) || Object.create( null )
  69159. )[ event.type ] &&
  69160. dataPriv.get( cur, "handle" );
  69161. if ( handle ) {
  69162. handle.apply( cur, data );
  69163. }
  69164. // Native handler
  69165. handle = ontype && cur[ ontype ];
  69166. if ( handle && handle.apply && acceptData( cur ) ) {
  69167. event.result = handle.apply( cur, data );
  69168. if ( event.result === false ) {
  69169. event.preventDefault();
  69170. }
  69171. }
  69172. }
  69173. event.type = type;
  69174. // If nobody prevented the default action, do it now
  69175. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  69176. if ( ( !special._default ||
  69177. special._default.apply( eventPath.pop(), data ) === false ) &&
  69178. acceptData( elem ) ) {
  69179. // Call a native DOM method on the target with the same name as the event.
  69180. // Don't do default actions on window, that's where global variables be (#6170)
  69181. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  69182. // Don't re-trigger an onFOO event when we call its FOO() method
  69183. tmp = elem[ ontype ];
  69184. if ( tmp ) {
  69185. elem[ ontype ] = null;
  69186. }
  69187. // Prevent re-triggering of the same event, since we already bubbled it above
  69188. jQuery.event.triggered = type;
  69189. if ( event.isPropagationStopped() ) {
  69190. lastElement.addEventListener( type, stopPropagationCallback );
  69191. }
  69192. elem[ type ]();
  69193. if ( event.isPropagationStopped() ) {
  69194. lastElement.removeEventListener( type, stopPropagationCallback );
  69195. }
  69196. jQuery.event.triggered = undefined;
  69197. if ( tmp ) {
  69198. elem[ ontype ] = tmp;
  69199. }
  69200. }
  69201. }
  69202. }
  69203. return event.result;
  69204. },
  69205. // Piggyback on a donor event to simulate a different one
  69206. // Used only for `focus(in | out)` events
  69207. simulate: function( type, elem, event ) {
  69208. var e = jQuery.extend(
  69209. new jQuery.Event(),
  69210. event,
  69211. {
  69212. type: type,
  69213. isSimulated: true
  69214. }
  69215. );
  69216. jQuery.event.trigger( e, null, elem );
  69217. }
  69218. } );
  69219. jQuery.fn.extend( {
  69220. trigger: function( type, data ) {
  69221. return this.each( function() {
  69222. jQuery.event.trigger( type, data, this );
  69223. } );
  69224. },
  69225. triggerHandler: function( type, data ) {
  69226. var elem = this[ 0 ];
  69227. if ( elem ) {
  69228. return jQuery.event.trigger( type, data, elem, true );
  69229. }
  69230. }
  69231. } );
  69232. // Support: Firefox <=44
  69233. // Firefox doesn't have focus(in | out) events
  69234. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  69235. //
  69236. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  69237. // focus(in | out) events fire after focus & blur events,
  69238. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  69239. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  69240. if ( !support.focusin ) {
  69241. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  69242. // Attach a single capturing handler on the document while someone wants focusin/focusout
  69243. var handler = function( event ) {
  69244. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  69245. };
  69246. jQuery.event.special[ fix ] = {
  69247. setup: function() {
  69248. // Handle: regular nodes (via `this.ownerDocument`), window
  69249. // (via `this.document`) & document (via `this`).
  69250. var doc = this.ownerDocument || this.document || this,
  69251. attaches = dataPriv.access( doc, fix );
  69252. if ( !attaches ) {
  69253. doc.addEventListener( orig, handler, true );
  69254. }
  69255. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  69256. },
  69257. teardown: function() {
  69258. var doc = this.ownerDocument || this.document || this,
  69259. attaches = dataPriv.access( doc, fix ) - 1;
  69260. if ( !attaches ) {
  69261. doc.removeEventListener( orig, handler, true );
  69262. dataPriv.remove( doc, fix );
  69263. } else {
  69264. dataPriv.access( doc, fix, attaches );
  69265. }
  69266. }
  69267. };
  69268. } );
  69269. }
  69270. var location = window.location;
  69271. var nonce = { guid: Date.now() };
  69272. var rquery = ( /\?/ );
  69273. // Cross-browser xml parsing
  69274. jQuery.parseXML = function( data ) {
  69275. var xml;
  69276. if ( !data || typeof data !== "string" ) {
  69277. return null;
  69278. }
  69279. // Support: IE 9 - 11 only
  69280. // IE throws on parseFromString with invalid input.
  69281. try {
  69282. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  69283. } catch ( e ) {
  69284. xml = undefined;
  69285. }
  69286. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  69287. jQuery.error( "Invalid XML: " + data );
  69288. }
  69289. return xml;
  69290. };
  69291. var
  69292. rbracket = /\[\]$/,
  69293. rCRLF = /\r?\n/g,
  69294. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  69295. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  69296. function buildParams( prefix, obj, traditional, add ) {
  69297. var name;
  69298. if ( Array.isArray( obj ) ) {
  69299. // Serialize array item.
  69300. jQuery.each( obj, function( i, v ) {
  69301. if ( traditional || rbracket.test( prefix ) ) {
  69302. // Treat each array item as a scalar.
  69303. add( prefix, v );
  69304. } else {
  69305. // Item is non-scalar (array or object), encode its numeric index.
  69306. buildParams(
  69307. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  69308. v,
  69309. traditional,
  69310. add
  69311. );
  69312. }
  69313. } );
  69314. } else if ( !traditional && toType( obj ) === "object" ) {
  69315. // Serialize object item.
  69316. for ( name in obj ) {
  69317. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  69318. }
  69319. } else {
  69320. // Serialize scalar item.
  69321. add( prefix, obj );
  69322. }
  69323. }
  69324. // Serialize an array of form elements or a set of
  69325. // key/values into a query string
  69326. jQuery.param = function( a, traditional ) {
  69327. var prefix,
  69328. s = [],
  69329. add = function( key, valueOrFunction ) {
  69330. // If value is a function, invoke it and use its return value
  69331. var value = isFunction( valueOrFunction ) ?
  69332. valueOrFunction() :
  69333. valueOrFunction;
  69334. s[ s.length ] = encodeURIComponent( key ) + "=" +
  69335. encodeURIComponent( value == null ? "" : value );
  69336. };
  69337. if ( a == null ) {
  69338. return "";
  69339. }
  69340. // If an array was passed in, assume that it is an array of form elements.
  69341. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  69342. // Serialize the form elements
  69343. jQuery.each( a, function() {
  69344. add( this.name, this.value );
  69345. } );
  69346. } else {
  69347. // If traditional, encode the "old" way (the way 1.3.2 or older
  69348. // did it), otherwise encode params recursively.
  69349. for ( prefix in a ) {
  69350. buildParams( prefix, a[ prefix ], traditional, add );
  69351. }
  69352. }
  69353. // Return the resulting serialization
  69354. return s.join( "&" );
  69355. };
  69356. jQuery.fn.extend( {
  69357. serialize: function() {
  69358. return jQuery.param( this.serializeArray() );
  69359. },
  69360. serializeArray: function() {
  69361. return this.map( function() {
  69362. // Can add propHook for "elements" to filter or add form elements
  69363. var elements = jQuery.prop( this, "elements" );
  69364. return elements ? jQuery.makeArray( elements ) : this;
  69365. } )
  69366. .filter( function() {
  69367. var type = this.type;
  69368. // Use .is( ":disabled" ) so that fieldset[disabled] works
  69369. return this.name && !jQuery( this ).is( ":disabled" ) &&
  69370. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  69371. ( this.checked || !rcheckableType.test( type ) );
  69372. } )
  69373. .map( function( _i, elem ) {
  69374. var val = jQuery( this ).val();
  69375. if ( val == null ) {
  69376. return null;
  69377. }
  69378. if ( Array.isArray( val ) ) {
  69379. return jQuery.map( val, function( val ) {
  69380. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  69381. } );
  69382. }
  69383. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  69384. } ).get();
  69385. }
  69386. } );
  69387. var
  69388. r20 = /%20/g,
  69389. rhash = /#.*$/,
  69390. rantiCache = /([?&])_=[^&]*/,
  69391. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  69392. // #7653, #8125, #8152: local protocol detection
  69393. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  69394. rnoContent = /^(?:GET|HEAD)$/,
  69395. rprotocol = /^\/\//,
  69396. /* Prefilters
  69397. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  69398. * 2) These are called:
  69399. * - BEFORE asking for a transport
  69400. * - AFTER param serialization (s.data is a string if s.processData is true)
  69401. * 3) key is the dataType
  69402. * 4) the catchall symbol "*" can be used
  69403. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  69404. */
  69405. prefilters = {},
  69406. /* Transports bindings
  69407. * 1) key is the dataType
  69408. * 2) the catchall symbol "*" can be used
  69409. * 3) selection will start with transport dataType and THEN go to "*" if needed
  69410. */
  69411. transports = {},
  69412. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  69413. allTypes = "*/".concat( "*" ),
  69414. // Anchor tag for parsing the document origin
  69415. originAnchor = document.createElement( "a" );
  69416. originAnchor.href = location.href;
  69417. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  69418. function addToPrefiltersOrTransports( structure ) {
  69419. // dataTypeExpression is optional and defaults to "*"
  69420. return function( dataTypeExpression, func ) {
  69421. if ( typeof dataTypeExpression !== "string" ) {
  69422. func = dataTypeExpression;
  69423. dataTypeExpression = "*";
  69424. }
  69425. var dataType,
  69426. i = 0,
  69427. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  69428. if ( isFunction( func ) ) {
  69429. // For each dataType in the dataTypeExpression
  69430. while ( ( dataType = dataTypes[ i++ ] ) ) {
  69431. // Prepend if requested
  69432. if ( dataType[ 0 ] === "+" ) {
  69433. dataType = dataType.slice( 1 ) || "*";
  69434. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  69435. // Otherwise append
  69436. } else {
  69437. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  69438. }
  69439. }
  69440. }
  69441. };
  69442. }
  69443. // Base inspection function for prefilters and transports
  69444. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  69445. var inspected = {},
  69446. seekingTransport = ( structure === transports );
  69447. function inspect( dataType ) {
  69448. var selected;
  69449. inspected[ dataType ] = true;
  69450. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  69451. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  69452. if ( typeof dataTypeOrTransport === "string" &&
  69453. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  69454. options.dataTypes.unshift( dataTypeOrTransport );
  69455. inspect( dataTypeOrTransport );
  69456. return false;
  69457. } else if ( seekingTransport ) {
  69458. return !( selected = dataTypeOrTransport );
  69459. }
  69460. } );
  69461. return selected;
  69462. }
  69463. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  69464. }
  69465. // A special extend for ajax options
  69466. // that takes "flat" options (not to be deep extended)
  69467. // Fixes #9887
  69468. function ajaxExtend( target, src ) {
  69469. var key, deep,
  69470. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  69471. for ( key in src ) {
  69472. if ( src[ key ] !== undefined ) {
  69473. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  69474. }
  69475. }
  69476. if ( deep ) {
  69477. jQuery.extend( true, target, deep );
  69478. }
  69479. return target;
  69480. }
  69481. /* Handles responses to an ajax request:
  69482. * - finds the right dataType (mediates between content-type and expected dataType)
  69483. * - returns the corresponding response
  69484. */
  69485. function ajaxHandleResponses( s, jqXHR, responses ) {
  69486. var ct, type, finalDataType, firstDataType,
  69487. contents = s.contents,
  69488. dataTypes = s.dataTypes;
  69489. // Remove auto dataType and get content-type in the process
  69490. while ( dataTypes[ 0 ] === "*" ) {
  69491. dataTypes.shift();
  69492. if ( ct === undefined ) {
  69493. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  69494. }
  69495. }
  69496. // Check if we're dealing with a known content-type
  69497. if ( ct ) {
  69498. for ( type in contents ) {
  69499. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  69500. dataTypes.unshift( type );
  69501. break;
  69502. }
  69503. }
  69504. }
  69505. // Check to see if we have a response for the expected dataType
  69506. if ( dataTypes[ 0 ] in responses ) {
  69507. finalDataType = dataTypes[ 0 ];
  69508. } else {
  69509. // Try convertible dataTypes
  69510. for ( type in responses ) {
  69511. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  69512. finalDataType = type;
  69513. break;
  69514. }
  69515. if ( !firstDataType ) {
  69516. firstDataType = type;
  69517. }
  69518. }
  69519. // Or just use first one
  69520. finalDataType = finalDataType || firstDataType;
  69521. }
  69522. // If we found a dataType
  69523. // We add the dataType to the list if needed
  69524. // and return the corresponding response
  69525. if ( finalDataType ) {
  69526. if ( finalDataType !== dataTypes[ 0 ] ) {
  69527. dataTypes.unshift( finalDataType );
  69528. }
  69529. return responses[ finalDataType ];
  69530. }
  69531. }
  69532. /* Chain conversions given the request and the original response
  69533. * Also sets the responseXXX fields on the jqXHR instance
  69534. */
  69535. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  69536. var conv2, current, conv, tmp, prev,
  69537. converters = {},
  69538. // Work with a copy of dataTypes in case we need to modify it for conversion
  69539. dataTypes = s.dataTypes.slice();
  69540. // Create converters map with lowercased keys
  69541. if ( dataTypes[ 1 ] ) {
  69542. for ( conv in s.converters ) {
  69543. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  69544. }
  69545. }
  69546. current = dataTypes.shift();
  69547. // Convert to each sequential dataType
  69548. while ( current ) {
  69549. if ( s.responseFields[ current ] ) {
  69550. jqXHR[ s.responseFields[ current ] ] = response;
  69551. }
  69552. // Apply the dataFilter if provided
  69553. if ( !prev && isSuccess && s.dataFilter ) {
  69554. response = s.dataFilter( response, s.dataType );
  69555. }
  69556. prev = current;
  69557. current = dataTypes.shift();
  69558. if ( current ) {
  69559. // There's only work to do if current dataType is non-auto
  69560. if ( current === "*" ) {
  69561. current = prev;
  69562. // Convert response if prev dataType is non-auto and differs from current
  69563. } else if ( prev !== "*" && prev !== current ) {
  69564. // Seek a direct converter
  69565. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  69566. // If none found, seek a pair
  69567. if ( !conv ) {
  69568. for ( conv2 in converters ) {
  69569. // If conv2 outputs current
  69570. tmp = conv2.split( " " );
  69571. if ( tmp[ 1 ] === current ) {
  69572. // If prev can be converted to accepted input
  69573. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  69574. converters[ "* " + tmp[ 0 ] ];
  69575. if ( conv ) {
  69576. // Condense equivalence converters
  69577. if ( conv === true ) {
  69578. conv = converters[ conv2 ];
  69579. // Otherwise, insert the intermediate dataType
  69580. } else if ( converters[ conv2 ] !== true ) {
  69581. current = tmp[ 0 ];
  69582. dataTypes.unshift( tmp[ 1 ] );
  69583. }
  69584. break;
  69585. }
  69586. }
  69587. }
  69588. }
  69589. // Apply converter (if not an equivalence)
  69590. if ( conv !== true ) {
  69591. // Unless errors are allowed to bubble, catch and return them
  69592. if ( conv && s.throws ) {
  69593. response = conv( response );
  69594. } else {
  69595. try {
  69596. response = conv( response );
  69597. } catch ( e ) {
  69598. return {
  69599. state: "parsererror",
  69600. error: conv ? e : "No conversion from " + prev + " to " + current
  69601. };
  69602. }
  69603. }
  69604. }
  69605. }
  69606. }
  69607. }
  69608. return { state: "success", data: response };
  69609. }
  69610. jQuery.extend( {
  69611. // Counter for holding the number of active queries
  69612. active: 0,
  69613. // Last-Modified header cache for next request
  69614. lastModified: {},
  69615. etag: {},
  69616. ajaxSettings: {
  69617. url: location.href,
  69618. type: "GET",
  69619. isLocal: rlocalProtocol.test( location.protocol ),
  69620. global: true,
  69621. processData: true,
  69622. async: true,
  69623. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  69624. /*
  69625. timeout: 0,
  69626. data: null,
  69627. dataType: null,
  69628. username: null,
  69629. password: null,
  69630. cache: null,
  69631. throws: false,
  69632. traditional: false,
  69633. headers: {},
  69634. */
  69635. accepts: {
  69636. "*": allTypes,
  69637. text: "text/plain",
  69638. html: "text/html",
  69639. xml: "application/xml, text/xml",
  69640. json: "application/json, text/javascript"
  69641. },
  69642. contents: {
  69643. xml: /\bxml\b/,
  69644. html: /\bhtml/,
  69645. json: /\bjson\b/
  69646. },
  69647. responseFields: {
  69648. xml: "responseXML",
  69649. text: "responseText",
  69650. json: "responseJSON"
  69651. },
  69652. // Data converters
  69653. // Keys separate source (or catchall "*") and destination types with a single space
  69654. converters: {
  69655. // Convert anything to text
  69656. "* text": String,
  69657. // Text to html (true = no transformation)
  69658. "text html": true,
  69659. // Evaluate text as a json expression
  69660. "text json": JSON.parse,
  69661. // Parse text as xml
  69662. "text xml": jQuery.parseXML
  69663. },
  69664. // For options that shouldn't be deep extended:
  69665. // you can add your own custom options here if
  69666. // and when you create one that shouldn't be
  69667. // deep extended (see ajaxExtend)
  69668. flatOptions: {
  69669. url: true,
  69670. context: true
  69671. }
  69672. },
  69673. // Creates a full fledged settings object into target
  69674. // with both ajaxSettings and settings fields.
  69675. // If target is omitted, writes into ajaxSettings.
  69676. ajaxSetup: function( target, settings ) {
  69677. return settings ?
  69678. // Building a settings object
  69679. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  69680. // Extending ajaxSettings
  69681. ajaxExtend( jQuery.ajaxSettings, target );
  69682. },
  69683. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  69684. ajaxTransport: addToPrefiltersOrTransports( transports ),
  69685. // Main method
  69686. ajax: function( url, options ) {
  69687. // If url is an object, simulate pre-1.5 signature
  69688. if ( typeof url === "object" ) {
  69689. options = url;
  69690. url = undefined;
  69691. }
  69692. // Force options to be an object
  69693. options = options || {};
  69694. var transport,
  69695. // URL without anti-cache param
  69696. cacheURL,
  69697. // Response headers
  69698. responseHeadersString,
  69699. responseHeaders,
  69700. // timeout handle
  69701. timeoutTimer,
  69702. // Url cleanup var
  69703. urlAnchor,
  69704. // Request state (becomes false upon send and true upon completion)
  69705. completed,
  69706. // To know if global events are to be dispatched
  69707. fireGlobals,
  69708. // Loop variable
  69709. i,
  69710. // uncached part of the url
  69711. uncached,
  69712. // Create the final options object
  69713. s = jQuery.ajaxSetup( {}, options ),
  69714. // Callbacks context
  69715. callbackContext = s.context || s,
  69716. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  69717. globalEventContext = s.context &&
  69718. ( callbackContext.nodeType || callbackContext.jquery ) ?
  69719. jQuery( callbackContext ) :
  69720. jQuery.event,
  69721. // Deferreds
  69722. deferred = jQuery.Deferred(),
  69723. completeDeferred = jQuery.Callbacks( "once memory" ),
  69724. // Status-dependent callbacks
  69725. statusCode = s.statusCode || {},
  69726. // Headers (they are sent all at once)
  69727. requestHeaders = {},
  69728. requestHeadersNames = {},
  69729. // Default abort message
  69730. strAbort = "canceled",
  69731. // Fake xhr
  69732. jqXHR = {
  69733. readyState: 0,
  69734. // Builds headers hashtable if needed
  69735. getResponseHeader: function( key ) {
  69736. var match;
  69737. if ( completed ) {
  69738. if ( !responseHeaders ) {
  69739. responseHeaders = {};
  69740. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  69741. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  69742. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  69743. .concat( match[ 2 ] );
  69744. }
  69745. }
  69746. match = responseHeaders[ key.toLowerCase() + " " ];
  69747. }
  69748. return match == null ? null : match.join( ", " );
  69749. },
  69750. // Raw string
  69751. getAllResponseHeaders: function() {
  69752. return completed ? responseHeadersString : null;
  69753. },
  69754. // Caches the header
  69755. setRequestHeader: function( name, value ) {
  69756. if ( completed == null ) {
  69757. name = requestHeadersNames[ name.toLowerCase() ] =
  69758. requestHeadersNames[ name.toLowerCase() ] || name;
  69759. requestHeaders[ name ] = value;
  69760. }
  69761. return this;
  69762. },
  69763. // Overrides response content-type header
  69764. overrideMimeType: function( type ) {
  69765. if ( completed == null ) {
  69766. s.mimeType = type;
  69767. }
  69768. return this;
  69769. },
  69770. // Status-dependent callbacks
  69771. statusCode: function( map ) {
  69772. var code;
  69773. if ( map ) {
  69774. if ( completed ) {
  69775. // Execute the appropriate callbacks
  69776. jqXHR.always( map[ jqXHR.status ] );
  69777. } else {
  69778. // Lazy-add the new callbacks in a way that preserves old ones
  69779. for ( code in map ) {
  69780. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  69781. }
  69782. }
  69783. }
  69784. return this;
  69785. },
  69786. // Cancel the request
  69787. abort: function( statusText ) {
  69788. var finalText = statusText || strAbort;
  69789. if ( transport ) {
  69790. transport.abort( finalText );
  69791. }
  69792. done( 0, finalText );
  69793. return this;
  69794. }
  69795. };
  69796. // Attach deferreds
  69797. deferred.promise( jqXHR );
  69798. // Add protocol if not provided (prefilters might expect it)
  69799. // Handle falsy url in the settings object (#10093: consistency with old signature)
  69800. // We also use the url parameter if available
  69801. s.url = ( ( url || s.url || location.href ) + "" )
  69802. .replace( rprotocol, location.protocol + "//" );
  69803. // Alias method option to type as per ticket #12004
  69804. s.type = options.method || options.type || s.method || s.type;
  69805. // Extract dataTypes list
  69806. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  69807. // A cross-domain request is in order when the origin doesn't match the current origin.
  69808. if ( s.crossDomain == null ) {
  69809. urlAnchor = document.createElement( "a" );
  69810. // Support: IE <=8 - 11, Edge 12 - 15
  69811. // IE throws exception on accessing the href property if url is malformed,
  69812. // e.g. http://example.com:80x/
  69813. try {
  69814. urlAnchor.href = s.url;
  69815. // Support: IE <=8 - 11 only
  69816. // Anchor's host property isn't correctly set when s.url is relative
  69817. urlAnchor.href = urlAnchor.href;
  69818. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  69819. urlAnchor.protocol + "//" + urlAnchor.host;
  69820. } catch ( e ) {
  69821. // If there is an error parsing the URL, assume it is crossDomain,
  69822. // it can be rejected by the transport if it is invalid
  69823. s.crossDomain = true;
  69824. }
  69825. }
  69826. // Convert data if not already a string
  69827. if ( s.data && s.processData && typeof s.data !== "string" ) {
  69828. s.data = jQuery.param( s.data, s.traditional );
  69829. }
  69830. // Apply prefilters
  69831. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  69832. // If request was aborted inside a prefilter, stop there
  69833. if ( completed ) {
  69834. return jqXHR;
  69835. }
  69836. // We can fire global events as of now if asked to
  69837. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  69838. fireGlobals = jQuery.event && s.global;
  69839. // Watch for a new set of requests
  69840. if ( fireGlobals && jQuery.active++ === 0 ) {
  69841. jQuery.event.trigger( "ajaxStart" );
  69842. }
  69843. // Uppercase the type
  69844. s.type = s.type.toUpperCase();
  69845. // Determine if request has content
  69846. s.hasContent = !rnoContent.test( s.type );
  69847. // Save the URL in case we're toying with the If-Modified-Since
  69848. // and/or If-None-Match header later on
  69849. // Remove hash to simplify url manipulation
  69850. cacheURL = s.url.replace( rhash, "" );
  69851. // More options handling for requests with no content
  69852. if ( !s.hasContent ) {
  69853. // Remember the hash so we can put it back
  69854. uncached = s.url.slice( cacheURL.length );
  69855. // If data is available and should be processed, append data to url
  69856. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  69857. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  69858. // #9682: remove data so that it's not used in an eventual retry
  69859. delete s.data;
  69860. }
  69861. // Add or update anti-cache param if needed
  69862. if ( s.cache === false ) {
  69863. cacheURL = cacheURL.replace( rantiCache, "$1" );
  69864. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
  69865. uncached;
  69866. }
  69867. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  69868. s.url = cacheURL + uncached;
  69869. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  69870. } else if ( s.data && s.processData &&
  69871. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  69872. s.data = s.data.replace( r20, "+" );
  69873. }
  69874. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  69875. if ( s.ifModified ) {
  69876. if ( jQuery.lastModified[ cacheURL ] ) {
  69877. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  69878. }
  69879. if ( jQuery.etag[ cacheURL ] ) {
  69880. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  69881. }
  69882. }
  69883. // Set the correct header, if data is being sent
  69884. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  69885. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  69886. }
  69887. // Set the Accepts header for the server, depending on the dataType
  69888. jqXHR.setRequestHeader(
  69889. "Accept",
  69890. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  69891. s.accepts[ s.dataTypes[ 0 ] ] +
  69892. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  69893. s.accepts[ "*" ]
  69894. );
  69895. // Check for headers option
  69896. for ( i in s.headers ) {
  69897. jqXHR.setRequestHeader( i, s.headers[ i ] );
  69898. }
  69899. // Allow custom headers/mimetypes and early abort
  69900. if ( s.beforeSend &&
  69901. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  69902. // Abort if not done already and return
  69903. return jqXHR.abort();
  69904. }
  69905. // Aborting is no longer a cancellation
  69906. strAbort = "abort";
  69907. // Install callbacks on deferreds
  69908. completeDeferred.add( s.complete );
  69909. jqXHR.done( s.success );
  69910. jqXHR.fail( s.error );
  69911. // Get transport
  69912. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  69913. // If no transport, we auto-abort
  69914. if ( !transport ) {
  69915. done( -1, "No Transport" );
  69916. } else {
  69917. jqXHR.readyState = 1;
  69918. // Send global event
  69919. if ( fireGlobals ) {
  69920. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  69921. }
  69922. // If request was aborted inside ajaxSend, stop there
  69923. if ( completed ) {
  69924. return jqXHR;
  69925. }
  69926. // Timeout
  69927. if ( s.async && s.timeout > 0 ) {
  69928. timeoutTimer = window.setTimeout( function() {
  69929. jqXHR.abort( "timeout" );
  69930. }, s.timeout );
  69931. }
  69932. try {
  69933. completed = false;
  69934. transport.send( requestHeaders, done );
  69935. } catch ( e ) {
  69936. // Rethrow post-completion exceptions
  69937. if ( completed ) {
  69938. throw e;
  69939. }
  69940. // Propagate others as results
  69941. done( -1, e );
  69942. }
  69943. }
  69944. // Callback for when everything is done
  69945. function done( status, nativeStatusText, responses, headers ) {
  69946. var isSuccess, success, error, response, modified,
  69947. statusText = nativeStatusText;
  69948. // Ignore repeat invocations
  69949. if ( completed ) {
  69950. return;
  69951. }
  69952. completed = true;
  69953. // Clear timeout if it exists
  69954. if ( timeoutTimer ) {
  69955. window.clearTimeout( timeoutTimer );
  69956. }
  69957. // Dereference transport for early garbage collection
  69958. // (no matter how long the jqXHR object will be used)
  69959. transport = undefined;
  69960. // Cache response headers
  69961. responseHeadersString = headers || "";
  69962. // Set readyState
  69963. jqXHR.readyState = status > 0 ? 4 : 0;
  69964. // Determine if successful
  69965. isSuccess = status >= 200 && status < 300 || status === 304;
  69966. // Get response data
  69967. if ( responses ) {
  69968. response = ajaxHandleResponses( s, jqXHR, responses );
  69969. }
  69970. // Use a noop converter for missing script
  69971. if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
  69972. s.converters[ "text script" ] = function() {};
  69973. }
  69974. // Convert no matter what (that way responseXXX fields are always set)
  69975. response = ajaxConvert( s, response, jqXHR, isSuccess );
  69976. // If successful, handle type chaining
  69977. if ( isSuccess ) {
  69978. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  69979. if ( s.ifModified ) {
  69980. modified = jqXHR.getResponseHeader( "Last-Modified" );
  69981. if ( modified ) {
  69982. jQuery.lastModified[ cacheURL ] = modified;
  69983. }
  69984. modified = jqXHR.getResponseHeader( "etag" );
  69985. if ( modified ) {
  69986. jQuery.etag[ cacheURL ] = modified;
  69987. }
  69988. }
  69989. // if no content
  69990. if ( status === 204 || s.type === "HEAD" ) {
  69991. statusText = "nocontent";
  69992. // if not modified
  69993. } else if ( status === 304 ) {
  69994. statusText = "notmodified";
  69995. // If we have data, let's convert it
  69996. } else {
  69997. statusText = response.state;
  69998. success = response.data;
  69999. error = response.error;
  70000. isSuccess = !error;
  70001. }
  70002. } else {
  70003. // Extract error from statusText and normalize for non-aborts
  70004. error = statusText;
  70005. if ( status || !statusText ) {
  70006. statusText = "error";
  70007. if ( status < 0 ) {
  70008. status = 0;
  70009. }
  70010. }
  70011. }
  70012. // Set data for the fake xhr object
  70013. jqXHR.status = status;
  70014. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  70015. // Success/Error
  70016. if ( isSuccess ) {
  70017. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  70018. } else {
  70019. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  70020. }
  70021. // Status-dependent callbacks
  70022. jqXHR.statusCode( statusCode );
  70023. statusCode = undefined;
  70024. if ( fireGlobals ) {
  70025. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  70026. [ jqXHR, s, isSuccess ? success : error ] );
  70027. }
  70028. // Complete
  70029. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  70030. if ( fireGlobals ) {
  70031. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  70032. // Handle the global AJAX counter
  70033. if ( !( --jQuery.active ) ) {
  70034. jQuery.event.trigger( "ajaxStop" );
  70035. }
  70036. }
  70037. }
  70038. return jqXHR;
  70039. },
  70040. getJSON: function( url, data, callback ) {
  70041. return jQuery.get( url, data, callback, "json" );
  70042. },
  70043. getScript: function( url, callback ) {
  70044. return jQuery.get( url, undefined, callback, "script" );
  70045. }
  70046. } );
  70047. jQuery.each( [ "get", "post" ], function( _i, method ) {
  70048. jQuery[ method ] = function( url, data, callback, type ) {
  70049. // Shift arguments if data argument was omitted
  70050. if ( isFunction( data ) ) {
  70051. type = type || callback;
  70052. callback = data;
  70053. data = undefined;
  70054. }
  70055. // The url can be an options object (which then must have .url)
  70056. return jQuery.ajax( jQuery.extend( {
  70057. url: url,
  70058. type: method,
  70059. dataType: type,
  70060. data: data,
  70061. success: callback
  70062. }, jQuery.isPlainObject( url ) && url ) );
  70063. };
  70064. } );
  70065. jQuery.ajaxPrefilter( function( s ) {
  70066. var i;
  70067. for ( i in s.headers ) {
  70068. if ( i.toLowerCase() === "content-type" ) {
  70069. s.contentType = s.headers[ i ] || "";
  70070. }
  70071. }
  70072. } );
  70073. jQuery._evalUrl = function( url, options, doc ) {
  70074. return jQuery.ajax( {
  70075. url: url,
  70076. // Make this explicit, since user can override this through ajaxSetup (#11264)
  70077. type: "GET",
  70078. dataType: "script",
  70079. cache: true,
  70080. async: false,
  70081. global: false,
  70082. // Only evaluate the response if it is successful (gh-4126)
  70083. // dataFilter is not invoked for failure responses, so using it instead
  70084. // of the default converter is kludgy but it works.
  70085. converters: {
  70086. "text script": function() {}
  70087. },
  70088. dataFilter: function( response ) {
  70089. jQuery.globalEval( response, options, doc );
  70090. }
  70091. } );
  70092. };
  70093. jQuery.fn.extend( {
  70094. wrapAll: function( html ) {
  70095. var wrap;
  70096. if ( this[ 0 ] ) {
  70097. if ( isFunction( html ) ) {
  70098. html = html.call( this[ 0 ] );
  70099. }
  70100. // The elements to wrap the target around
  70101. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  70102. if ( this[ 0 ].parentNode ) {
  70103. wrap.insertBefore( this[ 0 ] );
  70104. }
  70105. wrap.map( function() {
  70106. var elem = this;
  70107. while ( elem.firstElementChild ) {
  70108. elem = elem.firstElementChild;
  70109. }
  70110. return elem;
  70111. } ).append( this );
  70112. }
  70113. return this;
  70114. },
  70115. wrapInner: function( html ) {
  70116. if ( isFunction( html ) ) {
  70117. return this.each( function( i ) {
  70118. jQuery( this ).wrapInner( html.call( this, i ) );
  70119. } );
  70120. }
  70121. return this.each( function() {
  70122. var self = jQuery( this ),
  70123. contents = self.contents();
  70124. if ( contents.length ) {
  70125. contents.wrapAll( html );
  70126. } else {
  70127. self.append( html );
  70128. }
  70129. } );
  70130. },
  70131. wrap: function( html ) {
  70132. var htmlIsFunction = isFunction( html );
  70133. return this.each( function( i ) {
  70134. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  70135. } );
  70136. },
  70137. unwrap: function( selector ) {
  70138. this.parent( selector ).not( "body" ).each( function() {
  70139. jQuery( this ).replaceWith( this.childNodes );
  70140. } );
  70141. return this;
  70142. }
  70143. } );
  70144. jQuery.expr.pseudos.hidden = function( elem ) {
  70145. return !jQuery.expr.pseudos.visible( elem );
  70146. };
  70147. jQuery.expr.pseudos.visible = function( elem ) {
  70148. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  70149. };
  70150. jQuery.ajaxSettings.xhr = function() {
  70151. try {
  70152. return new window.XMLHttpRequest();
  70153. } catch ( e ) {}
  70154. };
  70155. var xhrSuccessStatus = {
  70156. // File protocol always yields status code 0, assume 200
  70157. 0: 200,
  70158. // Support: IE <=9 only
  70159. // #1450: sometimes IE returns 1223 when it should be 204
  70160. 1223: 204
  70161. },
  70162. xhrSupported = jQuery.ajaxSettings.xhr();
  70163. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  70164. support.ajax = xhrSupported = !!xhrSupported;
  70165. jQuery.ajaxTransport( function( options ) {
  70166. var callback, errorCallback;
  70167. // Cross domain only allowed if supported through XMLHttpRequest
  70168. if ( support.cors || xhrSupported && !options.crossDomain ) {
  70169. return {
  70170. send: function( headers, complete ) {
  70171. var i,
  70172. xhr = options.xhr();
  70173. xhr.open(
  70174. options.type,
  70175. options.url,
  70176. options.async,
  70177. options.username,
  70178. options.password
  70179. );
  70180. // Apply custom fields if provided
  70181. if ( options.xhrFields ) {
  70182. for ( i in options.xhrFields ) {
  70183. xhr[ i ] = options.xhrFields[ i ];
  70184. }
  70185. }
  70186. // Override mime type if needed
  70187. if ( options.mimeType && xhr.overrideMimeType ) {
  70188. xhr.overrideMimeType( options.mimeType );
  70189. }
  70190. // X-Requested-With header
  70191. // For cross-domain requests, seeing as conditions for a preflight are
  70192. // akin to a jigsaw puzzle, we simply never set it to be sure.
  70193. // (it can always be set on a per-request basis or even using ajaxSetup)
  70194. // For same-domain requests, won't change header if already provided.
  70195. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  70196. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  70197. }
  70198. // Set headers
  70199. for ( i in headers ) {
  70200. xhr.setRequestHeader( i, headers[ i ] );
  70201. }
  70202. // Callback
  70203. callback = function( type ) {
  70204. return function() {
  70205. if ( callback ) {
  70206. callback = errorCallback = xhr.onload =
  70207. xhr.onerror = xhr.onabort = xhr.ontimeout =
  70208. xhr.onreadystatechange = null;
  70209. if ( type === "abort" ) {
  70210. xhr.abort();
  70211. } else if ( type === "error" ) {
  70212. // Support: IE <=9 only
  70213. // On a manual native abort, IE9 throws
  70214. // errors on any property access that is not readyState
  70215. if ( typeof xhr.status !== "number" ) {
  70216. complete( 0, "error" );
  70217. } else {
  70218. complete(
  70219. // File: protocol always yields status 0; see #8605, #14207
  70220. xhr.status,
  70221. xhr.statusText
  70222. );
  70223. }
  70224. } else {
  70225. complete(
  70226. xhrSuccessStatus[ xhr.status ] || xhr.status,
  70227. xhr.statusText,
  70228. // Support: IE <=9 only
  70229. // IE9 has no XHR2 but throws on binary (trac-11426)
  70230. // For XHR2 non-text, let the caller handle it (gh-2498)
  70231. ( xhr.responseType || "text" ) !== "text" ||
  70232. typeof xhr.responseText !== "string" ?
  70233. { binary: xhr.response } :
  70234. { text: xhr.responseText },
  70235. xhr.getAllResponseHeaders()
  70236. );
  70237. }
  70238. }
  70239. };
  70240. };
  70241. // Listen to events
  70242. xhr.onload = callback();
  70243. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  70244. // Support: IE 9 only
  70245. // Use onreadystatechange to replace onabort
  70246. // to handle uncaught aborts
  70247. if ( xhr.onabort !== undefined ) {
  70248. xhr.onabort = errorCallback;
  70249. } else {
  70250. xhr.onreadystatechange = function() {
  70251. // Check readyState before timeout as it changes
  70252. if ( xhr.readyState === 4 ) {
  70253. // Allow onerror to be called first,
  70254. // but that will not handle a native abort
  70255. // Also, save errorCallback to a variable
  70256. // as xhr.onerror cannot be accessed
  70257. window.setTimeout( function() {
  70258. if ( callback ) {
  70259. errorCallback();
  70260. }
  70261. } );
  70262. }
  70263. };
  70264. }
  70265. // Create the abort callback
  70266. callback = callback( "abort" );
  70267. try {
  70268. // Do send the request (this may raise an exception)
  70269. xhr.send( options.hasContent && options.data || null );
  70270. } catch ( e ) {
  70271. // #14683: Only rethrow if this hasn't been notified as an error yet
  70272. if ( callback ) {
  70273. throw e;
  70274. }
  70275. }
  70276. },
  70277. abort: function() {
  70278. if ( callback ) {
  70279. callback();
  70280. }
  70281. }
  70282. };
  70283. }
  70284. } );
  70285. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  70286. jQuery.ajaxPrefilter( function( s ) {
  70287. if ( s.crossDomain ) {
  70288. s.contents.script = false;
  70289. }
  70290. } );
  70291. // Install script dataType
  70292. jQuery.ajaxSetup( {
  70293. accepts: {
  70294. script: "text/javascript, application/javascript, " +
  70295. "application/ecmascript, application/x-ecmascript"
  70296. },
  70297. contents: {
  70298. script: /\b(?:java|ecma)script\b/
  70299. },
  70300. converters: {
  70301. "text script": function( text ) {
  70302. jQuery.globalEval( text );
  70303. return text;
  70304. }
  70305. }
  70306. } );
  70307. // Handle cache's special case and crossDomain
  70308. jQuery.ajaxPrefilter( "script", function( s ) {
  70309. if ( s.cache === undefined ) {
  70310. s.cache = false;
  70311. }
  70312. if ( s.crossDomain ) {
  70313. s.type = "GET";
  70314. }
  70315. } );
  70316. // Bind script tag hack transport
  70317. jQuery.ajaxTransport( "script", function( s ) {
  70318. // This transport only deals with cross domain or forced-by-attrs requests
  70319. if ( s.crossDomain || s.scriptAttrs ) {
  70320. var script, callback;
  70321. return {
  70322. send: function( _, complete ) {
  70323. script = jQuery( "<script>" )
  70324. .attr( s.scriptAttrs || {} )
  70325. .prop( { charset: s.scriptCharset, src: s.url } )
  70326. .on( "load error", callback = function( evt ) {
  70327. script.remove();
  70328. callback = null;
  70329. if ( evt ) {
  70330. complete( evt.type === "error" ? 404 : 200, evt.type );
  70331. }
  70332. } );
  70333. // Use native DOM manipulation to avoid our domManip AJAX trickery
  70334. document.head.appendChild( script[ 0 ] );
  70335. },
  70336. abort: function() {
  70337. if ( callback ) {
  70338. callback();
  70339. }
  70340. }
  70341. };
  70342. }
  70343. } );
  70344. var oldCallbacks = [],
  70345. rjsonp = /(=)\?(?=&|$)|\?\?/;
  70346. // Default jsonp settings
  70347. jQuery.ajaxSetup( {
  70348. jsonp: "callback",
  70349. jsonpCallback: function() {
  70350. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
  70351. this[ callback ] = true;
  70352. return callback;
  70353. }
  70354. } );
  70355. // Detect, normalize options and install callbacks for jsonp requests
  70356. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  70357. var callbackName, overwritten, responseContainer,
  70358. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  70359. "url" :
  70360. typeof s.data === "string" &&
  70361. ( s.contentType || "" )
  70362. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  70363. rjsonp.test( s.data ) && "data"
  70364. );
  70365. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  70366. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  70367. // Get callback name, remembering preexisting value associated with it
  70368. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  70369. s.jsonpCallback() :
  70370. s.jsonpCallback;
  70371. // Insert callback into url or form data
  70372. if ( jsonProp ) {
  70373. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  70374. } else if ( s.jsonp !== false ) {
  70375. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  70376. }
  70377. // Use data converter to retrieve json after script execution
  70378. s.converters[ "script json" ] = function() {
  70379. if ( !responseContainer ) {
  70380. jQuery.error( callbackName + " was not called" );
  70381. }
  70382. return responseContainer[ 0 ];
  70383. };
  70384. // Force json dataType
  70385. s.dataTypes[ 0 ] = "json";
  70386. // Install callback
  70387. overwritten = window[ callbackName ];
  70388. window[ callbackName ] = function() {
  70389. responseContainer = arguments;
  70390. };
  70391. // Clean-up function (fires after converters)
  70392. jqXHR.always( function() {
  70393. // If previous value didn't exist - remove it
  70394. if ( overwritten === undefined ) {
  70395. jQuery( window ).removeProp( callbackName );
  70396. // Otherwise restore preexisting value
  70397. } else {
  70398. window[ callbackName ] = overwritten;
  70399. }
  70400. // Save back as free
  70401. if ( s[ callbackName ] ) {
  70402. // Make sure that re-using the options doesn't screw things around
  70403. s.jsonpCallback = originalSettings.jsonpCallback;
  70404. // Save the callback name for future use
  70405. oldCallbacks.push( callbackName );
  70406. }
  70407. // Call if it was a function and we have a response
  70408. if ( responseContainer && isFunction( overwritten ) ) {
  70409. overwritten( responseContainer[ 0 ] );
  70410. }
  70411. responseContainer = overwritten = undefined;
  70412. } );
  70413. // Delegate to script
  70414. return "script";
  70415. }
  70416. } );
  70417. // Support: Safari 8 only
  70418. // In Safari 8 documents created via document.implementation.createHTMLDocument
  70419. // collapse sibling forms: the second one becomes a child of the first one.
  70420. // Because of that, this security measure has to be disabled in Safari 8.
  70421. // https://bugs.webkit.org/show_bug.cgi?id=137337
  70422. support.createHTMLDocument = ( function() {
  70423. var body = document.implementation.createHTMLDocument( "" ).body;
  70424. body.innerHTML = "<form></form><form></form>";
  70425. return body.childNodes.length === 2;
  70426. } )();
  70427. // Argument "data" should be string of html
  70428. // context (optional): If specified, the fragment will be created in this context,
  70429. // defaults to document
  70430. // keepScripts (optional): If true, will include scripts passed in the html string
  70431. jQuery.parseHTML = function( data, context, keepScripts ) {
  70432. if ( typeof data !== "string" ) {
  70433. return [];
  70434. }
  70435. if ( typeof context === "boolean" ) {
  70436. keepScripts = context;
  70437. context = false;
  70438. }
  70439. var base, parsed, scripts;
  70440. if ( !context ) {
  70441. // Stop scripts or inline event handlers from being executed immediately
  70442. // by using document.implementation
  70443. if ( support.createHTMLDocument ) {
  70444. context = document.implementation.createHTMLDocument( "" );
  70445. // Set the base href for the created document
  70446. // so any parsed elements with URLs
  70447. // are based on the document's URL (gh-2965)
  70448. base = context.createElement( "base" );
  70449. base.href = document.location.href;
  70450. context.head.appendChild( base );
  70451. } else {
  70452. context = document;
  70453. }
  70454. }
  70455. parsed = rsingleTag.exec( data );
  70456. scripts = !keepScripts && [];
  70457. // Single tag
  70458. if ( parsed ) {
  70459. return [ context.createElement( parsed[ 1 ] ) ];
  70460. }
  70461. parsed = buildFragment( [ data ], context, scripts );
  70462. if ( scripts && scripts.length ) {
  70463. jQuery( scripts ).remove();
  70464. }
  70465. return jQuery.merge( [], parsed.childNodes );
  70466. };
  70467. /**
  70468. * Load a url into a page
  70469. */
  70470. jQuery.fn.load = function( url, params, callback ) {
  70471. var selector, type, response,
  70472. self = this,
  70473. off = url.indexOf( " " );
  70474. if ( off > -1 ) {
  70475. selector = stripAndCollapse( url.slice( off ) );
  70476. url = url.slice( 0, off );
  70477. }
  70478. // If it's a function
  70479. if ( isFunction( params ) ) {
  70480. // We assume that it's the callback
  70481. callback = params;
  70482. params = undefined;
  70483. // Otherwise, build a param string
  70484. } else if ( params && typeof params === "object" ) {
  70485. type = "POST";
  70486. }
  70487. // If we have elements to modify, make the request
  70488. if ( self.length > 0 ) {
  70489. jQuery.ajax( {
  70490. url: url,
  70491. // If "type" variable is undefined, then "GET" method will be used.
  70492. // Make value of this field explicit since
  70493. // user can override it through ajaxSetup method
  70494. type: type || "GET",
  70495. dataType: "html",
  70496. data: params
  70497. } ).done( function( responseText ) {
  70498. // Save response for use in complete callback
  70499. response = arguments;
  70500. self.html( selector ?
  70501. // If a selector was specified, locate the right elements in a dummy div
  70502. // Exclude scripts to avoid IE 'Permission Denied' errors
  70503. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  70504. // Otherwise use the full result
  70505. responseText );
  70506. // If the request succeeds, this function gets "data", "status", "jqXHR"
  70507. // but they are ignored because response was set above.
  70508. // If it fails, this function gets "jqXHR", "status", "error"
  70509. } ).always( callback && function( jqXHR, status ) {
  70510. self.each( function() {
  70511. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  70512. } );
  70513. } );
  70514. }
  70515. return this;
  70516. };
  70517. jQuery.expr.pseudos.animated = function( elem ) {
  70518. return jQuery.grep( jQuery.timers, function( fn ) {
  70519. return elem === fn.elem;
  70520. } ).length;
  70521. };
  70522. jQuery.offset = {
  70523. setOffset: function( elem, options, i ) {
  70524. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  70525. position = jQuery.css( elem, "position" ),
  70526. curElem = jQuery( elem ),
  70527. props = {};
  70528. // Set position first, in-case top/left are set even on static elem
  70529. if ( position === "static" ) {
  70530. elem.style.position = "relative";
  70531. }
  70532. curOffset = curElem.offset();
  70533. curCSSTop = jQuery.css( elem, "top" );
  70534. curCSSLeft = jQuery.css( elem, "left" );
  70535. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  70536. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  70537. // Need to be able to calculate position if either
  70538. // top or left is auto and position is either absolute or fixed
  70539. if ( calculatePosition ) {
  70540. curPosition = curElem.position();
  70541. curTop = curPosition.top;
  70542. curLeft = curPosition.left;
  70543. } else {
  70544. curTop = parseFloat( curCSSTop ) || 0;
  70545. curLeft = parseFloat( curCSSLeft ) || 0;
  70546. }
  70547. if ( isFunction( options ) ) {
  70548. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  70549. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  70550. }
  70551. if ( options.top != null ) {
  70552. props.top = ( options.top - curOffset.top ) + curTop;
  70553. }
  70554. if ( options.left != null ) {
  70555. props.left = ( options.left - curOffset.left ) + curLeft;
  70556. }
  70557. if ( "using" in options ) {
  70558. options.using.call( elem, props );
  70559. } else {
  70560. if ( typeof props.top === "number" ) {
  70561. props.top += "px";
  70562. }
  70563. if ( typeof props.left === "number" ) {
  70564. props.left += "px";
  70565. }
  70566. curElem.css( props );
  70567. }
  70568. }
  70569. };
  70570. jQuery.fn.extend( {
  70571. // offset() relates an element's border box to the document origin
  70572. offset: function( options ) {
  70573. // Preserve chaining for setter
  70574. if ( arguments.length ) {
  70575. return options === undefined ?
  70576. this :
  70577. this.each( function( i ) {
  70578. jQuery.offset.setOffset( this, options, i );
  70579. } );
  70580. }
  70581. var rect, win,
  70582. elem = this[ 0 ];
  70583. if ( !elem ) {
  70584. return;
  70585. }
  70586. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  70587. // Support: IE <=11 only
  70588. // Running getBoundingClientRect on a
  70589. // disconnected node in IE throws an error
  70590. if ( !elem.getClientRects().length ) {
  70591. return { top: 0, left: 0 };
  70592. }
  70593. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  70594. rect = elem.getBoundingClientRect();
  70595. win = elem.ownerDocument.defaultView;
  70596. return {
  70597. top: rect.top + win.pageYOffset,
  70598. left: rect.left + win.pageXOffset
  70599. };
  70600. },
  70601. // position() relates an element's margin box to its offset parent's padding box
  70602. // This corresponds to the behavior of CSS absolute positioning
  70603. position: function() {
  70604. if ( !this[ 0 ] ) {
  70605. return;
  70606. }
  70607. var offsetParent, offset, doc,
  70608. elem = this[ 0 ],
  70609. parentOffset = { top: 0, left: 0 };
  70610. // position:fixed elements are offset from the viewport, which itself always has zero offset
  70611. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  70612. // Assume position:fixed implies availability of getBoundingClientRect
  70613. offset = elem.getBoundingClientRect();
  70614. } else {
  70615. offset = this.offset();
  70616. // Account for the *real* offset parent, which can be the document or its root element
  70617. // when a statically positioned element is identified
  70618. doc = elem.ownerDocument;
  70619. offsetParent = elem.offsetParent || doc.documentElement;
  70620. while ( offsetParent &&
  70621. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  70622. jQuery.css( offsetParent, "position" ) === "static" ) {
  70623. offsetParent = offsetParent.parentNode;
  70624. }
  70625. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  70626. // Incorporate borders into its offset, since they are outside its content origin
  70627. parentOffset = jQuery( offsetParent ).offset();
  70628. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  70629. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  70630. }
  70631. }
  70632. // Subtract parent offsets and element margins
  70633. return {
  70634. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  70635. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  70636. };
  70637. },
  70638. // This method will return documentElement in the following cases:
  70639. // 1) For the element inside the iframe without offsetParent, this method will return
  70640. // documentElement of the parent window
  70641. // 2) For the hidden or detached element
  70642. // 3) For body or html element, i.e. in case of the html node - it will return itself
  70643. //
  70644. // but those exceptions were never presented as a real life use-cases
  70645. // and might be considered as more preferable results.
  70646. //
  70647. // This logic, however, is not guaranteed and can change at any point in the future
  70648. offsetParent: function() {
  70649. return this.map( function() {
  70650. var offsetParent = this.offsetParent;
  70651. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  70652. offsetParent = offsetParent.offsetParent;
  70653. }
  70654. return offsetParent || documentElement;
  70655. } );
  70656. }
  70657. } );
  70658. // Create scrollLeft and scrollTop methods
  70659. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  70660. var top = "pageYOffset" === prop;
  70661. jQuery.fn[ method ] = function( val ) {
  70662. return access( this, function( elem, method, val ) {
  70663. // Coalesce documents and windows
  70664. var win;
  70665. if ( isWindow( elem ) ) {
  70666. win = elem;
  70667. } else if ( elem.nodeType === 9 ) {
  70668. win = elem.defaultView;
  70669. }
  70670. if ( val === undefined ) {
  70671. return win ? win[ prop ] : elem[ method ];
  70672. }
  70673. if ( win ) {
  70674. win.scrollTo(
  70675. !top ? val : win.pageXOffset,
  70676. top ? val : win.pageYOffset
  70677. );
  70678. } else {
  70679. elem[ method ] = val;
  70680. }
  70681. }, method, val, arguments.length );
  70682. };
  70683. } );
  70684. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  70685. // Add the top/left cssHooks using jQuery.fn.position
  70686. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  70687. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  70688. // getComputedStyle returns percent when specified for top/left/bottom/right;
  70689. // rather than make the css module depend on the offset module, just check for it here
  70690. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  70691. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  70692. function( elem, computed ) {
  70693. if ( computed ) {
  70694. computed = curCSS( elem, prop );
  70695. // If curCSS returns percentage, fallback to offset
  70696. return rnumnonpx.test( computed ) ?
  70697. jQuery( elem ).position()[ prop ] + "px" :
  70698. computed;
  70699. }
  70700. }
  70701. );
  70702. } );
  70703. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  70704. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  70705. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  70706. function( defaultExtra, funcName ) {
  70707. // Margin is only for outerHeight, outerWidth
  70708. jQuery.fn[ funcName ] = function( margin, value ) {
  70709. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  70710. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  70711. return access( this, function( elem, type, value ) {
  70712. var doc;
  70713. if ( isWindow( elem ) ) {
  70714. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  70715. return funcName.indexOf( "outer" ) === 0 ?
  70716. elem[ "inner" + name ] :
  70717. elem.document.documentElement[ "client" + name ];
  70718. }
  70719. // Get document width or height
  70720. if ( elem.nodeType === 9 ) {
  70721. doc = elem.documentElement;
  70722. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  70723. // whichever is greatest
  70724. return Math.max(
  70725. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  70726. elem.body[ "offset" + name ], doc[ "offset" + name ],
  70727. doc[ "client" + name ]
  70728. );
  70729. }
  70730. return value === undefined ?
  70731. // Get width or height on the element, requesting but not forcing parseFloat
  70732. jQuery.css( elem, type, extra ) :
  70733. // Set width or height on the element
  70734. jQuery.style( elem, type, value, extra );
  70735. }, type, chainable ? margin : undefined, chainable );
  70736. };
  70737. } );
  70738. } );
  70739. jQuery.each( [
  70740. "ajaxStart",
  70741. "ajaxStop",
  70742. "ajaxComplete",
  70743. "ajaxError",
  70744. "ajaxSuccess",
  70745. "ajaxSend"
  70746. ], function( _i, type ) {
  70747. jQuery.fn[ type ] = function( fn ) {
  70748. return this.on( type, fn );
  70749. };
  70750. } );
  70751. jQuery.fn.extend( {
  70752. bind: function( types, data, fn ) {
  70753. return this.on( types, null, data, fn );
  70754. },
  70755. unbind: function( types, fn ) {
  70756. return this.off( types, null, fn );
  70757. },
  70758. delegate: function( selector, types, data, fn ) {
  70759. return this.on( types, selector, data, fn );
  70760. },
  70761. undelegate: function( selector, types, fn ) {
  70762. // ( namespace ) or ( selector, types [, fn] )
  70763. return arguments.length === 1 ?
  70764. this.off( selector, "**" ) :
  70765. this.off( types, selector || "**", fn );
  70766. },
  70767. hover: function( fnOver, fnOut ) {
  70768. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  70769. }
  70770. } );
  70771. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  70772. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  70773. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  70774. function( _i, name ) {
  70775. // Handle event binding
  70776. jQuery.fn[ name ] = function( data, fn ) {
  70777. return arguments.length > 0 ?
  70778. this.on( name, null, data, fn ) :
  70779. this.trigger( name );
  70780. };
  70781. } );
  70782. // Support: Android <=4.0 only
  70783. // Make sure we trim BOM and NBSP
  70784. var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  70785. // Bind a function to a context, optionally partially applying any
  70786. // arguments.
  70787. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  70788. // However, it is not slated for removal any time soon
  70789. jQuery.proxy = function( fn, context ) {
  70790. var tmp, args, proxy;
  70791. if ( typeof context === "string" ) {
  70792. tmp = fn[ context ];
  70793. context = fn;
  70794. fn = tmp;
  70795. }
  70796. // Quick check to determine if target is callable, in the spec
  70797. // this throws a TypeError, but we will just return undefined.
  70798. if ( !isFunction( fn ) ) {
  70799. return undefined;
  70800. }
  70801. // Simulated bind
  70802. args = slice.call( arguments, 2 );
  70803. proxy = function() {
  70804. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  70805. };
  70806. // Set the guid of unique handler to the same of original handler, so it can be removed
  70807. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  70808. return proxy;
  70809. };
  70810. jQuery.holdReady = function( hold ) {
  70811. if ( hold ) {
  70812. jQuery.readyWait++;
  70813. } else {
  70814. jQuery.ready( true );
  70815. }
  70816. };
  70817. jQuery.isArray = Array.isArray;
  70818. jQuery.parseJSON = JSON.parse;
  70819. jQuery.nodeName = nodeName;
  70820. jQuery.isFunction = isFunction;
  70821. jQuery.isWindow = isWindow;
  70822. jQuery.camelCase = camelCase;
  70823. jQuery.type = toType;
  70824. jQuery.now = Date.now;
  70825. jQuery.isNumeric = function( obj ) {
  70826. // As of jQuery 3.0, isNumeric is limited to
  70827. // strings and numbers (primitives or objects)
  70828. // that can be coerced to finite numbers (gh-2662)
  70829. var type = jQuery.type( obj );
  70830. return ( type === "number" || type === "string" ) &&
  70831. // parseFloat NaNs numeric-cast false positives ("")
  70832. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  70833. // subtraction forces infinities to NaN
  70834. !isNaN( obj - parseFloat( obj ) );
  70835. };
  70836. jQuery.trim = function( text ) {
  70837. return text == null ?
  70838. "" :
  70839. ( text + "" ).replace( rtrim, "" );
  70840. };
  70841. // Register as a named AMD module, since jQuery can be concatenated with other
  70842. // files that may use define, but not via a proper concatenation script that
  70843. // understands anonymous AMD modules. A named AMD is safest and most robust
  70844. // way to register. Lowercase jquery is used because AMD module names are
  70845. // derived from file names, and jQuery is normally delivered in a lowercase
  70846. // file name. Do this after creating the global so that if an AMD module wants
  70847. // to call noConflict to hide this version of jQuery, it will work.
  70848. // Note that for maximum portability, libraries that are not jQuery should
  70849. // declare themselves as anonymous modules, and avoid setting a global if an
  70850. // AMD loader is present. jQuery is a special case. For more information, see
  70851. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  70852. if ( true ) {
  70853. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  70854. return jQuery;
  70855. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  70856. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  70857. }
  70858. var
  70859. // Map over jQuery in case of overwrite
  70860. _jQuery = window.jQuery,
  70861. // Map over the $ in case of overwrite
  70862. _$ = window.$;
  70863. jQuery.noConflict = function( deep ) {
  70864. if ( window.$ === jQuery ) {
  70865. window.$ = _$;
  70866. }
  70867. if ( deep && window.jQuery === jQuery ) {
  70868. window.jQuery = _jQuery;
  70869. }
  70870. return jQuery;
  70871. };
  70872. // Expose jQuery and $ identifiers, even in AMD
  70873. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  70874. // and CommonJS for browser emulators (#13566)
  70875. if ( typeof noGlobal === "undefined" ) {
  70876. window.jQuery = window.$ = jQuery;
  70877. }
  70878. return jQuery;
  70879. } );
  70880. /***/ }),
  70881. /***/ "./node_modules/ms/index.js":
  70882. /*!**********************************!*\
  70883. !*** ./node_modules/ms/index.js ***!
  70884. \**********************************/
  70885. /*! no static exports found */
  70886. /*! all exports used */
  70887. /***/ (function(module, exports) {
  70888. /**
  70889. * Helpers.
  70890. */
  70891. var s = 1000;
  70892. var m = s * 60;
  70893. var h = m * 60;
  70894. var d = h * 24;
  70895. var w = d * 7;
  70896. var y = d * 365.25;
  70897. /**
  70898. * Parse or format the given `val`.
  70899. *
  70900. * Options:
  70901. *
  70902. * - `long` verbose formatting [false]
  70903. *
  70904. * @param {String|Number} val
  70905. * @param {Object} [options]
  70906. * @throws {Error} throw an error if val is not a non-empty string or a number
  70907. * @return {String|Number}
  70908. * @api public
  70909. */
  70910. module.exports = function(val, options) {
  70911. options = options || {};
  70912. var type = typeof val;
  70913. if (type === 'string' && val.length > 0) {
  70914. return parse(val);
  70915. } else if (type === 'number' && isFinite(val)) {
  70916. return options.long ? fmtLong(val) : fmtShort(val);
  70917. }
  70918. throw new Error(
  70919. 'val is not a non-empty string or a valid number. val=' +
  70920. JSON.stringify(val)
  70921. );
  70922. };
  70923. /**
  70924. * Parse the given `str` and return milliseconds.
  70925. *
  70926. * @param {String} str
  70927. * @return {Number}
  70928. * @api private
  70929. */
  70930. function parse(str) {
  70931. str = String(str);
  70932. if (str.length > 100) {
  70933. return;
  70934. }
  70935. var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  70936. str
  70937. );
  70938. if (!match) {
  70939. return;
  70940. }
  70941. var n = parseFloat(match[1]);
  70942. var type = (match[2] || 'ms').toLowerCase();
  70943. switch (type) {
  70944. case 'years':
  70945. case 'year':
  70946. case 'yrs':
  70947. case 'yr':
  70948. case 'y':
  70949. return n * y;
  70950. case 'weeks':
  70951. case 'week':
  70952. case 'w':
  70953. return n * w;
  70954. case 'days':
  70955. case 'day':
  70956. case 'd':
  70957. return n * d;
  70958. case 'hours':
  70959. case 'hour':
  70960. case 'hrs':
  70961. case 'hr':
  70962. case 'h':
  70963. return n * h;
  70964. case 'minutes':
  70965. case 'minute':
  70966. case 'mins':
  70967. case 'min':
  70968. case 'm':
  70969. return n * m;
  70970. case 'seconds':
  70971. case 'second':
  70972. case 'secs':
  70973. case 'sec':
  70974. case 's':
  70975. return n * s;
  70976. case 'milliseconds':
  70977. case 'millisecond':
  70978. case 'msecs':
  70979. case 'msec':
  70980. case 'ms':
  70981. return n;
  70982. default:
  70983. return undefined;
  70984. }
  70985. }
  70986. /**
  70987. * Short format for `ms`.
  70988. *
  70989. * @param {Number} ms
  70990. * @return {String}
  70991. * @api private
  70992. */
  70993. function fmtShort(ms) {
  70994. var msAbs = Math.abs(ms);
  70995. if (msAbs >= d) {
  70996. return Math.round(ms / d) + 'd';
  70997. }
  70998. if (msAbs >= h) {
  70999. return Math.round(ms / h) + 'h';
  71000. }
  71001. if (msAbs >= m) {
  71002. return Math.round(ms / m) + 'm';
  71003. }
  71004. if (msAbs >= s) {
  71005. return Math.round(ms / s) + 's';
  71006. }
  71007. return ms + 'ms';
  71008. }
  71009. /**
  71010. * Long format for `ms`.
  71011. *
  71012. * @param {Number} ms
  71013. * @return {String}
  71014. * @api private
  71015. */
  71016. function fmtLong(ms) {
  71017. var msAbs = Math.abs(ms);
  71018. if (msAbs >= d) {
  71019. return plural(ms, msAbs, d, 'day');
  71020. }
  71021. if (msAbs >= h) {
  71022. return plural(ms, msAbs, h, 'hour');
  71023. }
  71024. if (msAbs >= m) {
  71025. return plural(ms, msAbs, m, 'minute');
  71026. }
  71027. if (msAbs >= s) {
  71028. return plural(ms, msAbs, s, 'second');
  71029. }
  71030. return ms + ' ms';
  71031. }
  71032. /**
  71033. * Pluralization helper.
  71034. */
  71035. function plural(ms, msAbs, n, name) {
  71036. var isPlural = msAbs >= n * 1.5;
  71037. return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  71038. }
  71039. /***/ }),
  71040. /***/ "./node_modules/parseqs/index.js":
  71041. /*!***************************************!*\
  71042. !*** ./node_modules/parseqs/index.js ***!
  71043. \***************************************/
  71044. /*! no static exports found */
  71045. /*! all exports used */
  71046. /***/ (function(module, exports) {
  71047. /**
  71048. * Compiles a querystring
  71049. * Returns string representation of the object
  71050. *
  71051. * @param {Object}
  71052. * @api private
  71053. */
  71054. exports.encode = function (obj) {
  71055. var str = '';
  71056. for (var i in obj) {
  71057. if (obj.hasOwnProperty(i)) {
  71058. if (str.length) str += '&';
  71059. str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);
  71060. }
  71061. }
  71062. return str;
  71063. };
  71064. /**
  71065. * Parses a simple querystring into an object
  71066. *
  71067. * @param {String} qs
  71068. * @api private
  71069. */
  71070. exports.decode = function(qs){
  71071. var qry = {};
  71072. var pairs = qs.split('&');
  71073. for (var i = 0, l = pairs.length; i < l; i++) {
  71074. var pair = pairs[i].split('=');
  71075. qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
  71076. }
  71077. return qry;
  71078. };
  71079. /***/ }),
  71080. /***/ "./node_modules/parseuri/index.js":
  71081. /*!****************************************!*\
  71082. !*** ./node_modules/parseuri/index.js ***!
  71083. \****************************************/
  71084. /*! no static exports found */
  71085. /*! all exports used */
  71086. /***/ (function(module, exports) {
  71087. /**
  71088. * Parses an URI
  71089. *
  71090. * @author Steven Levithan <stevenlevithan.com> (MIT license)
  71091. * @api private
  71092. */
  71093. var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
  71094. var parts = [
  71095. 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'
  71096. ];
  71097. module.exports = function parseuri(str) {
  71098. var src = str,
  71099. b = str.indexOf('['),
  71100. e = str.indexOf(']');
  71101. if (b != -1 && e != -1) {
  71102. str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);
  71103. }
  71104. var m = re.exec(str || ''),
  71105. uri = {},
  71106. i = 14;
  71107. while (i--) {
  71108. uri[parts[i]] = m[i] || '';
  71109. }
  71110. if (b != -1 && e != -1) {
  71111. uri.source = src;
  71112. uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');
  71113. uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');
  71114. uri.ipv6uri = true;
  71115. }
  71116. return uri;
  71117. };
  71118. /***/ }),
  71119. /***/ "./node_modules/process/browser.js":
  71120. /*!*****************************************!*\
  71121. !*** ./node_modules/process/browser.js ***!
  71122. \*****************************************/
  71123. /*! no static exports found */
  71124. /*! all exports used */
  71125. /***/ (function(module, exports) {
  71126. // shim for using process in browser
  71127. var process = module.exports = {};
  71128. // cached from whatever global is present so that test runners that stub it
  71129. // don't break things. But we need to wrap it in a try catch in case it is
  71130. // wrapped in strict mode code which doesn't define any globals. It's inside a
  71131. // function because try/catches deoptimize in certain engines.
  71132. var cachedSetTimeout;
  71133. var cachedClearTimeout;
  71134. function defaultSetTimout() {
  71135. throw new Error('setTimeout has not been defined');
  71136. }
  71137. function defaultClearTimeout () {
  71138. throw new Error('clearTimeout has not been defined');
  71139. }
  71140. (function () {
  71141. try {
  71142. if (typeof setTimeout === 'function') {
  71143. cachedSetTimeout = setTimeout;
  71144. } else {
  71145. cachedSetTimeout = defaultSetTimout;
  71146. }
  71147. } catch (e) {
  71148. cachedSetTimeout = defaultSetTimout;
  71149. }
  71150. try {
  71151. if (typeof clearTimeout === 'function') {
  71152. cachedClearTimeout = clearTimeout;
  71153. } else {
  71154. cachedClearTimeout = defaultClearTimeout;
  71155. }
  71156. } catch (e) {
  71157. cachedClearTimeout = defaultClearTimeout;
  71158. }
  71159. } ())
  71160. function runTimeout(fun) {
  71161. if (cachedSetTimeout === setTimeout) {
  71162. //normal enviroments in sane situations
  71163. return setTimeout(fun, 0);
  71164. }
  71165. // if setTimeout wasn't available but was latter defined
  71166. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  71167. cachedSetTimeout = setTimeout;
  71168. return setTimeout(fun, 0);
  71169. }
  71170. try {
  71171. // when when somebody has screwed with setTimeout but no I.E. maddness
  71172. return cachedSetTimeout(fun, 0);
  71173. } catch(e){
  71174. try {
  71175. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  71176. return cachedSetTimeout.call(null, fun, 0);
  71177. } catch(e){
  71178. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  71179. return cachedSetTimeout.call(this, fun, 0);
  71180. }
  71181. }
  71182. }
  71183. function runClearTimeout(marker) {
  71184. if (cachedClearTimeout === clearTimeout) {
  71185. //normal enviroments in sane situations
  71186. return clearTimeout(marker);
  71187. }
  71188. // if clearTimeout wasn't available but was latter defined
  71189. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  71190. cachedClearTimeout = clearTimeout;
  71191. return clearTimeout(marker);
  71192. }
  71193. try {
  71194. // when when somebody has screwed with setTimeout but no I.E. maddness
  71195. return cachedClearTimeout(marker);
  71196. } catch (e){
  71197. try {
  71198. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  71199. return cachedClearTimeout.call(null, marker);
  71200. } catch (e){
  71201. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  71202. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  71203. return cachedClearTimeout.call(this, marker);
  71204. }
  71205. }
  71206. }
  71207. var queue = [];
  71208. var draining = false;
  71209. var currentQueue;
  71210. var queueIndex = -1;
  71211. function cleanUpNextTick() {
  71212. if (!draining || !currentQueue) {
  71213. return;
  71214. }
  71215. draining = false;
  71216. if (currentQueue.length) {
  71217. queue = currentQueue.concat(queue);
  71218. } else {
  71219. queueIndex = -1;
  71220. }
  71221. if (queue.length) {
  71222. drainQueue();
  71223. }
  71224. }
  71225. function drainQueue() {
  71226. if (draining) {
  71227. return;
  71228. }
  71229. var timeout = runTimeout(cleanUpNextTick);
  71230. draining = true;
  71231. var len = queue.length;
  71232. while(len) {
  71233. currentQueue = queue;
  71234. queue = [];
  71235. while (++queueIndex < len) {
  71236. if (currentQueue) {
  71237. currentQueue[queueIndex].run();
  71238. }
  71239. }
  71240. queueIndex = -1;
  71241. len = queue.length;
  71242. }
  71243. currentQueue = null;
  71244. draining = false;
  71245. runClearTimeout(timeout);
  71246. }
  71247. process.nextTick = function (fun) {
  71248. var args = new Array(arguments.length - 1);
  71249. if (arguments.length > 1) {
  71250. for (var i = 1; i < arguments.length; i++) {
  71251. args[i - 1] = arguments[i];
  71252. }
  71253. }
  71254. queue.push(new Item(fun, args));
  71255. if (queue.length === 1 && !draining) {
  71256. runTimeout(drainQueue);
  71257. }
  71258. };
  71259. // v8 likes predictible objects
  71260. function Item(fun, array) {
  71261. this.fun = fun;
  71262. this.array = array;
  71263. }
  71264. Item.prototype.run = function () {
  71265. this.fun.apply(null, this.array);
  71266. };
  71267. process.title = 'browser';
  71268. process.browser = true;
  71269. process.env = {};
  71270. process.argv = [];
  71271. process.version = ''; // empty string to avoid regexp issues
  71272. process.versions = {};
  71273. function noop() {}
  71274. process.on = noop;
  71275. process.addListener = noop;
  71276. process.once = noop;
  71277. process.off = noop;
  71278. process.removeListener = noop;
  71279. process.removeAllListeners = noop;
  71280. process.emit = noop;
  71281. process.prependListener = noop;
  71282. process.prependOnceListener = noop;
  71283. process.listeners = function (name) { return [] }
  71284. process.binding = function (name) {
  71285. throw new Error('process.binding is not supported');
  71286. };
  71287. process.cwd = function () { return '/' };
  71288. process.chdir = function (dir) {
  71289. throw new Error('process.chdir is not supported');
  71290. };
  71291. process.umask = function() { return 0; };
  71292. /***/ }),
  71293. /***/ "./node_modules/setimmediate/setImmediate.js":
  71294. /*!***************************************************!*\
  71295. !*** ./node_modules/setimmediate/setImmediate.js ***!
  71296. \***************************************************/
  71297. /*! no static exports found */
  71298. /*! all exports used */
  71299. /***/ (function(module, exports, __webpack_require__) {
  71300. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  71301. "use strict";
  71302. if (global.setImmediate) {
  71303. return;
  71304. }
  71305. var nextHandle = 1; // Spec says greater than zero
  71306. var tasksByHandle = {};
  71307. var currentlyRunningATask = false;
  71308. var doc = global.document;
  71309. var registerImmediate;
  71310. function setImmediate(callback) {
  71311. // Callback can either be a function or a string
  71312. if (typeof callback !== "function") {
  71313. callback = new Function("" + callback);
  71314. }
  71315. // Copy function arguments
  71316. var args = new Array(arguments.length - 1);
  71317. for (var i = 0; i < args.length; i++) {
  71318. args[i] = arguments[i + 1];
  71319. }
  71320. // Store and register the task
  71321. var task = { callback: callback, args: args };
  71322. tasksByHandle[nextHandle] = task;
  71323. registerImmediate(nextHandle);
  71324. return nextHandle++;
  71325. }
  71326. function clearImmediate(handle) {
  71327. delete tasksByHandle[handle];
  71328. }
  71329. function run(task) {
  71330. var callback = task.callback;
  71331. var args = task.args;
  71332. switch (args.length) {
  71333. case 0:
  71334. callback();
  71335. break;
  71336. case 1:
  71337. callback(args[0]);
  71338. break;
  71339. case 2:
  71340. callback(args[0], args[1]);
  71341. break;
  71342. case 3:
  71343. callback(args[0], args[1], args[2]);
  71344. break;
  71345. default:
  71346. callback.apply(undefined, args);
  71347. break;
  71348. }
  71349. }
  71350. function runIfPresent(handle) {
  71351. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  71352. // So if we're currently running a task, we'll need to delay this invocation.
  71353. if (currentlyRunningATask) {
  71354. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  71355. // "too much recursion" error.
  71356. setTimeout(runIfPresent, 0, handle);
  71357. } else {
  71358. var task = tasksByHandle[handle];
  71359. if (task) {
  71360. currentlyRunningATask = true;
  71361. try {
  71362. run(task);
  71363. } finally {
  71364. clearImmediate(handle);
  71365. currentlyRunningATask = false;
  71366. }
  71367. }
  71368. }
  71369. }
  71370. function installNextTickImplementation() {
  71371. registerImmediate = function(handle) {
  71372. process.nextTick(function () { runIfPresent(handle); });
  71373. };
  71374. }
  71375. function canUsePostMessage() {
  71376. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  71377. // where `global.postMessage` means something completely different and can't be used for this purpose.
  71378. if (global.postMessage && !global.importScripts) {
  71379. var postMessageIsAsynchronous = true;
  71380. var oldOnMessage = global.onmessage;
  71381. global.onmessage = function() {
  71382. postMessageIsAsynchronous = false;
  71383. };
  71384. global.postMessage("", "*");
  71385. global.onmessage = oldOnMessage;
  71386. return postMessageIsAsynchronous;
  71387. }
  71388. }
  71389. function installPostMessageImplementation() {
  71390. // Installs an event handler on `global` for the `message` event: see
  71391. // * https://developer.mozilla.org/en/DOM/window.postMessage
  71392. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  71393. var messagePrefix = "setImmediate$" + Math.random() + "$";
  71394. var onGlobalMessage = function(event) {
  71395. if (event.source === global &&
  71396. typeof event.data === "string" &&
  71397. event.data.indexOf(messagePrefix) === 0) {
  71398. runIfPresent(+event.data.slice(messagePrefix.length));
  71399. }
  71400. };
  71401. if (global.addEventListener) {
  71402. global.addEventListener("message", onGlobalMessage, false);
  71403. } else {
  71404. global.attachEvent("onmessage", onGlobalMessage);
  71405. }
  71406. registerImmediate = function(handle) {
  71407. global.postMessage(messagePrefix + handle, "*");
  71408. };
  71409. }
  71410. function installMessageChannelImplementation() {
  71411. var channel = new MessageChannel();
  71412. channel.port1.onmessage = function(event) {
  71413. var handle = event.data;
  71414. runIfPresent(handle);
  71415. };
  71416. registerImmediate = function(handle) {
  71417. channel.port2.postMessage(handle);
  71418. };
  71419. }
  71420. function installReadyStateChangeImplementation() {
  71421. var html = doc.documentElement;
  71422. registerImmediate = function(handle) {
  71423. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  71424. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  71425. var script = doc.createElement("script");
  71426. script.onreadystatechange = function () {
  71427. runIfPresent(handle);
  71428. script.onreadystatechange = null;
  71429. html.removeChild(script);
  71430. script = null;
  71431. };
  71432. html.appendChild(script);
  71433. };
  71434. }
  71435. function installSetTimeoutImplementation() {
  71436. registerImmediate = function(handle) {
  71437. setTimeout(runIfPresent, 0, handle);
  71438. };
  71439. }
  71440. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  71441. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  71442. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  71443. // Don't get fooled by e.g. browserify environments.
  71444. if ({}.toString.call(global.process) === "[object process]") {
  71445. // For Node.js before 0.9
  71446. installNextTickImplementation();
  71447. } else if (canUsePostMessage()) {
  71448. // For non-IE10 modern browsers
  71449. installPostMessageImplementation();
  71450. } else if (global.MessageChannel) {
  71451. // For web workers, where supported
  71452. installMessageChannelImplementation();
  71453. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  71454. // For IE 6–8
  71455. installReadyStateChangeImplementation();
  71456. } else {
  71457. // For older browsers
  71458. installSetTimeoutImplementation();
  71459. }
  71460. attachTo.setImmediate = setImmediate;
  71461. attachTo.clearImmediate = clearImmediate;
  71462. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  71463. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  71464. /***/ }),
  71465. /***/ "./node_modules/socket.io-client/lib/index.js":
  71466. /*!****************************************************!*\
  71467. !*** ./node_modules/socket.io-client/lib/index.js ***!
  71468. \****************************************************/
  71469. /*! no static exports found */
  71470. /*! exports used: default */
  71471. /***/ (function(module, exports, __webpack_require__) {
  71472. /**
  71473. * Module dependencies.
  71474. */
  71475. var url = __webpack_require__(/*! ./url */ "./node_modules/socket.io-client/lib/url.js");
  71476. var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/index.js");
  71477. var Manager = __webpack_require__(/*! ./manager */ "./node_modules/socket.io-client/lib/manager.js");
  71478. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('socket.io-client');
  71479. /**
  71480. * Module exports.
  71481. */
  71482. module.exports = exports = lookup;
  71483. /**
  71484. * Managers cache.
  71485. */
  71486. var cache = exports.managers = {};
  71487. /**
  71488. * Looks up an existing `Manager` for multiplexing.
  71489. * If the user summons:
  71490. *
  71491. * `io('http://localhost/a');`
  71492. * `io('http://localhost/b');`
  71493. *
  71494. * We reuse the existing instance based on same scheme/port/host,
  71495. * and we initialize sockets for each namespace.
  71496. *
  71497. * @api public
  71498. */
  71499. function lookup (uri, opts) {
  71500. if (typeof uri === 'object') {
  71501. opts = uri;
  71502. uri = undefined;
  71503. }
  71504. opts = opts || {};
  71505. var parsed = url(uri);
  71506. var source = parsed.source;
  71507. var id = parsed.id;
  71508. var path = parsed.path;
  71509. var sameNamespace = cache[id] && path in cache[id].nsps;
  71510. var newConnection = opts.forceNew || opts['force new connection'] ||
  71511. false === opts.multiplex || sameNamespace;
  71512. var io;
  71513. if (newConnection) {
  71514. debug('ignoring socket cache for %s', source);
  71515. io = Manager(source, opts);
  71516. } else {
  71517. if (!cache[id]) {
  71518. debug('new io instance for %s', source);
  71519. cache[id] = Manager(source, opts);
  71520. }
  71521. io = cache[id];
  71522. }
  71523. if (parsed.query && !opts.query) {
  71524. opts.query = parsed.query;
  71525. }
  71526. return io.socket(parsed.path, opts);
  71527. }
  71528. /**
  71529. * Protocol version.
  71530. *
  71531. * @api public
  71532. */
  71533. exports.protocol = parser.protocol;
  71534. /**
  71535. * `connect`.
  71536. *
  71537. * @param {String} uri
  71538. * @api public
  71539. */
  71540. exports.connect = lookup;
  71541. /**
  71542. * Expose constructors for standalone build.
  71543. *
  71544. * @api public
  71545. */
  71546. exports.Manager = __webpack_require__(/*! ./manager */ "./node_modules/socket.io-client/lib/manager.js");
  71547. exports.Socket = __webpack_require__(/*! ./socket */ "./node_modules/socket.io-client/lib/socket.js");
  71548. /***/ }),
  71549. /***/ "./node_modules/socket.io-client/lib/manager.js":
  71550. /*!******************************************************!*\
  71551. !*** ./node_modules/socket.io-client/lib/manager.js ***!
  71552. \******************************************************/
  71553. /*! no static exports found */
  71554. /*! all exports used */
  71555. /***/ (function(module, exports, __webpack_require__) {
  71556. /**
  71557. * Module dependencies.
  71558. */
  71559. var eio = __webpack_require__(/*! engine.io-client */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/index.js");
  71560. var Socket = __webpack_require__(/*! ./socket */ "./node_modules/socket.io-client/lib/socket.js");
  71561. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
  71562. var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/index.js");
  71563. var on = __webpack_require__(/*! ./on */ "./node_modules/socket.io-client/lib/on.js");
  71564. var bind = __webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js");
  71565. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('socket.io-client:manager');
  71566. var indexOf = __webpack_require__(/*! indexof */ "./node_modules/indexof/index.js");
  71567. var Backoff = __webpack_require__(/*! backo2 */ "./node_modules/backo2/index.js");
  71568. /**
  71569. * IE6+ hasOwnProperty
  71570. */
  71571. var has = Object.prototype.hasOwnProperty;
  71572. /**
  71573. * Module exports
  71574. */
  71575. module.exports = Manager;
  71576. /**
  71577. * `Manager` constructor.
  71578. *
  71579. * @param {String} engine instance or engine uri/opts
  71580. * @param {Object} options
  71581. * @api public
  71582. */
  71583. function Manager (uri, opts) {
  71584. if (!(this instanceof Manager)) return new Manager(uri, opts);
  71585. if (uri && ('object' === typeof uri)) {
  71586. opts = uri;
  71587. uri = undefined;
  71588. }
  71589. opts = opts || {};
  71590. opts.path = opts.path || '/socket.io';
  71591. this.nsps = {};
  71592. this.subs = [];
  71593. this.opts = opts;
  71594. this.reconnection(opts.reconnection !== false);
  71595. this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
  71596. this.reconnectionDelay(opts.reconnectionDelay || 1000);
  71597. this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);
  71598. this.randomizationFactor(opts.randomizationFactor || 0.5);
  71599. this.backoff = new Backoff({
  71600. min: this.reconnectionDelay(),
  71601. max: this.reconnectionDelayMax(),
  71602. jitter: this.randomizationFactor()
  71603. });
  71604. this.timeout(null == opts.timeout ? 20000 : opts.timeout);
  71605. this.readyState = 'closed';
  71606. this.uri = uri;
  71607. this.connecting = [];
  71608. this.lastPing = null;
  71609. this.encoding = false;
  71610. this.packetBuffer = [];
  71611. var _parser = opts.parser || parser;
  71612. this.encoder = new _parser.Encoder();
  71613. this.decoder = new _parser.Decoder();
  71614. this.autoConnect = opts.autoConnect !== false;
  71615. if (this.autoConnect) this.open();
  71616. }
  71617. /**
  71618. * Propagate given event to sockets and emit on `this`
  71619. *
  71620. * @api private
  71621. */
  71622. Manager.prototype.emitAll = function () {
  71623. this.emit.apply(this, arguments);
  71624. for (var nsp in this.nsps) {
  71625. if (has.call(this.nsps, nsp)) {
  71626. this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);
  71627. }
  71628. }
  71629. };
  71630. /**
  71631. * Update `socket.id` of all sockets
  71632. *
  71633. * @api private
  71634. */
  71635. Manager.prototype.updateSocketIds = function () {
  71636. for (var nsp in this.nsps) {
  71637. if (has.call(this.nsps, nsp)) {
  71638. this.nsps[nsp].id = this.generateId(nsp);
  71639. }
  71640. }
  71641. };
  71642. /**
  71643. * generate `socket.id` for the given `nsp`
  71644. *
  71645. * @param {String} nsp
  71646. * @return {String}
  71647. * @api private
  71648. */
  71649. Manager.prototype.generateId = function (nsp) {
  71650. return (nsp === '/' ? '' : (nsp + '#')) + this.engine.id;
  71651. };
  71652. /**
  71653. * Mix in `Emitter`.
  71654. */
  71655. Emitter(Manager.prototype);
  71656. /**
  71657. * Sets the `reconnection` config.
  71658. *
  71659. * @param {Boolean} true/false if it should automatically reconnect
  71660. * @return {Manager} self or value
  71661. * @api public
  71662. */
  71663. Manager.prototype.reconnection = function (v) {
  71664. if (!arguments.length) return this._reconnection;
  71665. this._reconnection = !!v;
  71666. return this;
  71667. };
  71668. /**
  71669. * Sets the reconnection attempts config.
  71670. *
  71671. * @param {Number} max reconnection attempts before giving up
  71672. * @return {Manager} self or value
  71673. * @api public
  71674. */
  71675. Manager.prototype.reconnectionAttempts = function (v) {
  71676. if (!arguments.length) return this._reconnectionAttempts;
  71677. this._reconnectionAttempts = v;
  71678. return this;
  71679. };
  71680. /**
  71681. * Sets the delay between reconnections.
  71682. *
  71683. * @param {Number} delay
  71684. * @return {Manager} self or value
  71685. * @api public
  71686. */
  71687. Manager.prototype.reconnectionDelay = function (v) {
  71688. if (!arguments.length) return this._reconnectionDelay;
  71689. this._reconnectionDelay = v;
  71690. this.backoff && this.backoff.setMin(v);
  71691. return this;
  71692. };
  71693. Manager.prototype.randomizationFactor = function (v) {
  71694. if (!arguments.length) return this._randomizationFactor;
  71695. this._randomizationFactor = v;
  71696. this.backoff && this.backoff.setJitter(v);
  71697. return this;
  71698. };
  71699. /**
  71700. * Sets the maximum delay between reconnections.
  71701. *
  71702. * @param {Number} delay
  71703. * @return {Manager} self or value
  71704. * @api public
  71705. */
  71706. Manager.prototype.reconnectionDelayMax = function (v) {
  71707. if (!arguments.length) return this._reconnectionDelayMax;
  71708. this._reconnectionDelayMax = v;
  71709. this.backoff && this.backoff.setMax(v);
  71710. return this;
  71711. };
  71712. /**
  71713. * Sets the connection timeout. `false` to disable
  71714. *
  71715. * @return {Manager} self or value
  71716. * @api public
  71717. */
  71718. Manager.prototype.timeout = function (v) {
  71719. if (!arguments.length) return this._timeout;
  71720. this._timeout = v;
  71721. return this;
  71722. };
  71723. /**
  71724. * Starts trying to reconnect if reconnection is enabled and we have not
  71725. * started reconnecting yet
  71726. *
  71727. * @api private
  71728. */
  71729. Manager.prototype.maybeReconnectOnOpen = function () {
  71730. // Only try to reconnect if it's the first time we're connecting
  71731. if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {
  71732. // keeps reconnection from firing twice for the same reconnection loop
  71733. this.reconnect();
  71734. }
  71735. };
  71736. /**
  71737. * Sets the current transport `socket`.
  71738. *
  71739. * @param {Function} optional, callback
  71740. * @return {Manager} self
  71741. * @api public
  71742. */
  71743. Manager.prototype.open =
  71744. Manager.prototype.connect = function (fn, opts) {
  71745. debug('readyState %s', this.readyState);
  71746. if (~this.readyState.indexOf('open')) return this;
  71747. debug('opening %s', this.uri);
  71748. this.engine = eio(this.uri, this.opts);
  71749. var socket = this.engine;
  71750. var self = this;
  71751. this.readyState = 'opening';
  71752. this.skipReconnect = false;
  71753. // emit `open`
  71754. var openSub = on(socket, 'open', function () {
  71755. self.onopen();
  71756. fn && fn();
  71757. });
  71758. // emit `connect_error`
  71759. var errorSub = on(socket, 'error', function (data) {
  71760. debug('connect_error');
  71761. self.cleanup();
  71762. self.readyState = 'closed';
  71763. self.emitAll('connect_error', data);
  71764. if (fn) {
  71765. var err = new Error('Connection error');
  71766. err.data = data;
  71767. fn(err);
  71768. } else {
  71769. // Only do this if there is no fn to handle the error
  71770. self.maybeReconnectOnOpen();
  71771. }
  71772. });
  71773. // emit `connect_timeout`
  71774. if (false !== this._timeout) {
  71775. var timeout = this._timeout;
  71776. debug('connect attempt will timeout after %d', timeout);
  71777. // set timer
  71778. var timer = setTimeout(function () {
  71779. debug('connect attempt timed out after %d', timeout);
  71780. openSub.destroy();
  71781. socket.close();
  71782. socket.emit('error', 'timeout');
  71783. self.emitAll('connect_timeout', timeout);
  71784. }, timeout);
  71785. this.subs.push({
  71786. destroy: function () {
  71787. clearTimeout(timer);
  71788. }
  71789. });
  71790. }
  71791. this.subs.push(openSub);
  71792. this.subs.push(errorSub);
  71793. return this;
  71794. };
  71795. /**
  71796. * Called upon transport open.
  71797. *
  71798. * @api private
  71799. */
  71800. Manager.prototype.onopen = function () {
  71801. debug('open');
  71802. // clear old subs
  71803. this.cleanup();
  71804. // mark as open
  71805. this.readyState = 'open';
  71806. this.emit('open');
  71807. // add new subs
  71808. var socket = this.engine;
  71809. this.subs.push(on(socket, 'data', bind(this, 'ondata')));
  71810. this.subs.push(on(socket, 'ping', bind(this, 'onping')));
  71811. this.subs.push(on(socket, 'pong', bind(this, 'onpong')));
  71812. this.subs.push(on(socket, 'error', bind(this, 'onerror')));
  71813. this.subs.push(on(socket, 'close', bind(this, 'onclose')));
  71814. this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));
  71815. };
  71816. /**
  71817. * Called upon a ping.
  71818. *
  71819. * @api private
  71820. */
  71821. Manager.prototype.onping = function () {
  71822. this.lastPing = new Date();
  71823. this.emitAll('ping');
  71824. };
  71825. /**
  71826. * Called upon a packet.
  71827. *
  71828. * @api private
  71829. */
  71830. Manager.prototype.onpong = function () {
  71831. this.emitAll('pong', new Date() - this.lastPing);
  71832. };
  71833. /**
  71834. * Called with data.
  71835. *
  71836. * @api private
  71837. */
  71838. Manager.prototype.ondata = function (data) {
  71839. this.decoder.add(data);
  71840. };
  71841. /**
  71842. * Called when parser fully decodes a packet.
  71843. *
  71844. * @api private
  71845. */
  71846. Manager.prototype.ondecoded = function (packet) {
  71847. this.emit('packet', packet);
  71848. };
  71849. /**
  71850. * Called upon socket error.
  71851. *
  71852. * @api private
  71853. */
  71854. Manager.prototype.onerror = function (err) {
  71855. debug('error', err);
  71856. this.emitAll('error', err);
  71857. };
  71858. /**
  71859. * Creates a new socket for the given `nsp`.
  71860. *
  71861. * @return {Socket}
  71862. * @api public
  71863. */
  71864. Manager.prototype.socket = function (nsp, opts) {
  71865. var socket = this.nsps[nsp];
  71866. if (!socket) {
  71867. socket = new Socket(this, nsp, opts);
  71868. this.nsps[nsp] = socket;
  71869. var self = this;
  71870. socket.on('connecting', onConnecting);
  71871. socket.on('connect', function () {
  71872. socket.id = self.generateId(nsp);
  71873. });
  71874. if (this.autoConnect) {
  71875. // manually call here since connecting event is fired before listening
  71876. onConnecting();
  71877. }
  71878. }
  71879. function onConnecting () {
  71880. if (!~indexOf(self.connecting, socket)) {
  71881. self.connecting.push(socket);
  71882. }
  71883. }
  71884. return socket;
  71885. };
  71886. /**
  71887. * Called upon a socket close.
  71888. *
  71889. * @param {Socket} socket
  71890. */
  71891. Manager.prototype.destroy = function (socket) {
  71892. var index = indexOf(this.connecting, socket);
  71893. if (~index) this.connecting.splice(index, 1);
  71894. if (this.connecting.length) return;
  71895. this.close();
  71896. };
  71897. /**
  71898. * Writes a packet.
  71899. *
  71900. * @param {Object} packet
  71901. * @api private
  71902. */
  71903. Manager.prototype.packet = function (packet) {
  71904. debug('writing packet %j', packet);
  71905. var self = this;
  71906. if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;
  71907. if (!self.encoding) {
  71908. // encode, then write to engine with result
  71909. self.encoding = true;
  71910. this.encoder.encode(packet, function (encodedPackets) {
  71911. for (var i = 0; i < encodedPackets.length; i++) {
  71912. self.engine.write(encodedPackets[i], packet.options);
  71913. }
  71914. self.encoding = false;
  71915. self.processPacketQueue();
  71916. });
  71917. } else { // add packet to the queue
  71918. self.packetBuffer.push(packet);
  71919. }
  71920. };
  71921. /**
  71922. * If packet buffer is non-empty, begins encoding the
  71923. * next packet in line.
  71924. *
  71925. * @api private
  71926. */
  71927. Manager.prototype.processPacketQueue = function () {
  71928. if (this.packetBuffer.length > 0 && !this.encoding) {
  71929. var pack = this.packetBuffer.shift();
  71930. this.packet(pack);
  71931. }
  71932. };
  71933. /**
  71934. * Clean up transport subscriptions and packet buffer.
  71935. *
  71936. * @api private
  71937. */
  71938. Manager.prototype.cleanup = function () {
  71939. debug('cleanup');
  71940. var subsLength = this.subs.length;
  71941. for (var i = 0; i < subsLength; i++) {
  71942. var sub = this.subs.shift();
  71943. sub.destroy();
  71944. }
  71945. this.packetBuffer = [];
  71946. this.encoding = false;
  71947. this.lastPing = null;
  71948. this.decoder.destroy();
  71949. };
  71950. /**
  71951. * Close the current socket.
  71952. *
  71953. * @api private
  71954. */
  71955. Manager.prototype.close =
  71956. Manager.prototype.disconnect = function () {
  71957. debug('disconnect');
  71958. this.skipReconnect = true;
  71959. this.reconnecting = false;
  71960. if ('opening' === this.readyState) {
  71961. // `onclose` will not fire because
  71962. // an open event never happened
  71963. this.cleanup();
  71964. }
  71965. this.backoff.reset();
  71966. this.readyState = 'closed';
  71967. if (this.engine) this.engine.close();
  71968. };
  71969. /**
  71970. * Called upon engine close.
  71971. *
  71972. * @api private
  71973. */
  71974. Manager.prototype.onclose = function (reason) {
  71975. debug('onclose');
  71976. this.cleanup();
  71977. this.backoff.reset();
  71978. this.readyState = 'closed';
  71979. this.emit('close', reason);
  71980. if (this._reconnection && !this.skipReconnect) {
  71981. this.reconnect();
  71982. }
  71983. };
  71984. /**
  71985. * Attempt a reconnection.
  71986. *
  71987. * @api private
  71988. */
  71989. Manager.prototype.reconnect = function () {
  71990. if (this.reconnecting || this.skipReconnect) return this;
  71991. var self = this;
  71992. if (this.backoff.attempts >= this._reconnectionAttempts) {
  71993. debug('reconnect failed');
  71994. this.backoff.reset();
  71995. this.emitAll('reconnect_failed');
  71996. this.reconnecting = false;
  71997. } else {
  71998. var delay = this.backoff.duration();
  71999. debug('will wait %dms before reconnect attempt', delay);
  72000. this.reconnecting = true;
  72001. var timer = setTimeout(function () {
  72002. if (self.skipReconnect) return;
  72003. debug('attempting reconnect');
  72004. self.emitAll('reconnect_attempt', self.backoff.attempts);
  72005. self.emitAll('reconnecting', self.backoff.attempts);
  72006. // check again for the case socket closed in above events
  72007. if (self.skipReconnect) return;
  72008. self.open(function (err) {
  72009. if (err) {
  72010. debug('reconnect attempt error');
  72011. self.reconnecting = false;
  72012. self.reconnect();
  72013. self.emitAll('reconnect_error', err.data);
  72014. } else {
  72015. debug('reconnect success');
  72016. self.onreconnect();
  72017. }
  72018. });
  72019. }, delay);
  72020. this.subs.push({
  72021. destroy: function () {
  72022. clearTimeout(timer);
  72023. }
  72024. });
  72025. }
  72026. };
  72027. /**
  72028. * Called upon successful reconnect.
  72029. *
  72030. * @api private
  72031. */
  72032. Manager.prototype.onreconnect = function () {
  72033. var attempt = this.backoff.attempts;
  72034. this.reconnecting = false;
  72035. this.backoff.reset();
  72036. this.updateSocketIds();
  72037. this.emitAll('reconnect', attempt);
  72038. };
  72039. /***/ }),
  72040. /***/ "./node_modules/socket.io-client/lib/on.js":
  72041. /*!*************************************************!*\
  72042. !*** ./node_modules/socket.io-client/lib/on.js ***!
  72043. \*************************************************/
  72044. /*! no static exports found */
  72045. /*! all exports used */
  72046. /***/ (function(module, exports) {
  72047. /**
  72048. * Module exports.
  72049. */
  72050. module.exports = on;
  72051. /**
  72052. * Helper for subscriptions.
  72053. *
  72054. * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`
  72055. * @param {String} event name
  72056. * @param {Function} callback
  72057. * @api public
  72058. */
  72059. function on (obj, ev, fn) {
  72060. obj.on(ev, fn);
  72061. return {
  72062. destroy: function () {
  72063. obj.removeListener(ev, fn);
  72064. }
  72065. };
  72066. }
  72067. /***/ }),
  72068. /***/ "./node_modules/socket.io-client/lib/socket.js":
  72069. /*!*****************************************************!*\
  72070. !*** ./node_modules/socket.io-client/lib/socket.js ***!
  72071. \*****************************************************/
  72072. /*! no static exports found */
  72073. /*! all exports used */
  72074. /***/ (function(module, exports, __webpack_require__) {
  72075. /**
  72076. * Module dependencies.
  72077. */
  72078. var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/index.js");
  72079. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
  72080. var toArray = __webpack_require__(/*! to-array */ "./node_modules/to-array/index.js");
  72081. var on = __webpack_require__(/*! ./on */ "./node_modules/socket.io-client/lib/on.js");
  72082. var bind = __webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js");
  72083. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('socket.io-client:socket');
  72084. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  72085. var hasBin = __webpack_require__(/*! has-binary2 */ "./node_modules/has-binary2/index.js");
  72086. /**
  72087. * Module exports.
  72088. */
  72089. module.exports = exports = Socket;
  72090. /**
  72091. * Internal events (blacklisted).
  72092. * These events can't be emitted by the user.
  72093. *
  72094. * @api private
  72095. */
  72096. var events = {
  72097. connect: 1,
  72098. connect_error: 1,
  72099. connect_timeout: 1,
  72100. connecting: 1,
  72101. disconnect: 1,
  72102. error: 1,
  72103. reconnect: 1,
  72104. reconnect_attempt: 1,
  72105. reconnect_failed: 1,
  72106. reconnect_error: 1,
  72107. reconnecting: 1,
  72108. ping: 1,
  72109. pong: 1
  72110. };
  72111. /**
  72112. * Shortcut to `Emitter#emit`.
  72113. */
  72114. var emit = Emitter.prototype.emit;
  72115. /**
  72116. * `Socket` constructor.
  72117. *
  72118. * @api public
  72119. */
  72120. function Socket (io, nsp, opts) {
  72121. this.io = io;
  72122. this.nsp = nsp;
  72123. this.json = this; // compat
  72124. this.ids = 0;
  72125. this.acks = {};
  72126. this.receiveBuffer = [];
  72127. this.sendBuffer = [];
  72128. this.connected = false;
  72129. this.disconnected = true;
  72130. this.flags = {};
  72131. if (opts && opts.query) {
  72132. this.query = opts.query;
  72133. }
  72134. if (this.io.autoConnect) this.open();
  72135. }
  72136. /**
  72137. * Mix in `Emitter`.
  72138. */
  72139. Emitter(Socket.prototype);
  72140. /**
  72141. * Subscribe to open, close and packet events
  72142. *
  72143. * @api private
  72144. */
  72145. Socket.prototype.subEvents = function () {
  72146. if (this.subs) return;
  72147. var io = this.io;
  72148. this.subs = [
  72149. on(io, 'open', bind(this, 'onopen')),
  72150. on(io, 'packet', bind(this, 'onpacket')),
  72151. on(io, 'close', bind(this, 'onclose'))
  72152. ];
  72153. };
  72154. /**
  72155. * "Opens" the socket.
  72156. *
  72157. * @api public
  72158. */
  72159. Socket.prototype.open =
  72160. Socket.prototype.connect = function () {
  72161. if (this.connected) return this;
  72162. this.subEvents();
  72163. this.io.open(); // ensure open
  72164. if ('open' === this.io.readyState) this.onopen();
  72165. this.emit('connecting');
  72166. return this;
  72167. };
  72168. /**
  72169. * Sends a `message` event.
  72170. *
  72171. * @return {Socket} self
  72172. * @api public
  72173. */
  72174. Socket.prototype.send = function () {
  72175. var args = toArray(arguments);
  72176. args.unshift('message');
  72177. this.emit.apply(this, args);
  72178. return this;
  72179. };
  72180. /**
  72181. * Override `emit`.
  72182. * If the event is in `events`, it's emitted normally.
  72183. *
  72184. * @param {String} event name
  72185. * @return {Socket} self
  72186. * @api public
  72187. */
  72188. Socket.prototype.emit = function (ev) {
  72189. if (events.hasOwnProperty(ev)) {
  72190. emit.apply(this, arguments);
  72191. return this;
  72192. }
  72193. var args = toArray(arguments);
  72194. var packet = {
  72195. type: (this.flags.binary !== undefined ? this.flags.binary : hasBin(args)) ? parser.BINARY_EVENT : parser.EVENT,
  72196. data: args
  72197. };
  72198. packet.options = {};
  72199. packet.options.compress = !this.flags || false !== this.flags.compress;
  72200. // event ack callback
  72201. if ('function' === typeof args[args.length - 1]) {
  72202. debug('emitting packet with ack id %d', this.ids);
  72203. this.acks[this.ids] = args.pop();
  72204. packet.id = this.ids++;
  72205. }
  72206. if (this.connected) {
  72207. this.packet(packet);
  72208. } else {
  72209. this.sendBuffer.push(packet);
  72210. }
  72211. this.flags = {};
  72212. return this;
  72213. };
  72214. /**
  72215. * Sends a packet.
  72216. *
  72217. * @param {Object} packet
  72218. * @api private
  72219. */
  72220. Socket.prototype.packet = function (packet) {
  72221. packet.nsp = this.nsp;
  72222. this.io.packet(packet);
  72223. };
  72224. /**
  72225. * Called upon engine `open`.
  72226. *
  72227. * @api private
  72228. */
  72229. Socket.prototype.onopen = function () {
  72230. debug('transport is open - connecting');
  72231. // write connect packet if necessary
  72232. if ('/' !== this.nsp) {
  72233. if (this.query) {
  72234. var query = typeof this.query === 'object' ? parseqs.encode(this.query) : this.query;
  72235. debug('sending connect packet with query %s', query);
  72236. this.packet({type: parser.CONNECT, query: query});
  72237. } else {
  72238. this.packet({type: parser.CONNECT});
  72239. }
  72240. }
  72241. };
  72242. /**
  72243. * Called upon engine `close`.
  72244. *
  72245. * @param {String} reason
  72246. * @api private
  72247. */
  72248. Socket.prototype.onclose = function (reason) {
  72249. debug('close (%s)', reason);
  72250. this.connected = false;
  72251. this.disconnected = true;
  72252. delete this.id;
  72253. this.emit('disconnect', reason);
  72254. };
  72255. /**
  72256. * Called with socket packet.
  72257. *
  72258. * @param {Object} packet
  72259. * @api private
  72260. */
  72261. Socket.prototype.onpacket = function (packet) {
  72262. var sameNamespace = packet.nsp === this.nsp;
  72263. var rootNamespaceError = packet.type === parser.ERROR && packet.nsp === '/';
  72264. if (!sameNamespace && !rootNamespaceError) return;
  72265. switch (packet.type) {
  72266. case parser.CONNECT:
  72267. this.onconnect();
  72268. break;
  72269. case parser.EVENT:
  72270. this.onevent(packet);
  72271. break;
  72272. case parser.BINARY_EVENT:
  72273. this.onevent(packet);
  72274. break;
  72275. case parser.ACK:
  72276. this.onack(packet);
  72277. break;
  72278. case parser.BINARY_ACK:
  72279. this.onack(packet);
  72280. break;
  72281. case parser.DISCONNECT:
  72282. this.ondisconnect();
  72283. break;
  72284. case parser.ERROR:
  72285. this.emit('error', packet.data);
  72286. break;
  72287. }
  72288. };
  72289. /**
  72290. * Called upon a server event.
  72291. *
  72292. * @param {Object} packet
  72293. * @api private
  72294. */
  72295. Socket.prototype.onevent = function (packet) {
  72296. var args = packet.data || [];
  72297. debug('emitting event %j', args);
  72298. if (null != packet.id) {
  72299. debug('attaching ack callback to event');
  72300. args.push(this.ack(packet.id));
  72301. }
  72302. if (this.connected) {
  72303. emit.apply(this, args);
  72304. } else {
  72305. this.receiveBuffer.push(args);
  72306. }
  72307. };
  72308. /**
  72309. * Produces an ack callback to emit with an event.
  72310. *
  72311. * @api private
  72312. */
  72313. Socket.prototype.ack = function (id) {
  72314. var self = this;
  72315. var sent = false;
  72316. return function () {
  72317. // prevent double callbacks
  72318. if (sent) return;
  72319. sent = true;
  72320. var args = toArray(arguments);
  72321. debug('sending ack %j', args);
  72322. self.packet({
  72323. type: hasBin(args) ? parser.BINARY_ACK : parser.ACK,
  72324. id: id,
  72325. data: args
  72326. });
  72327. };
  72328. };
  72329. /**
  72330. * Called upon a server acknowlegement.
  72331. *
  72332. * @param {Object} packet
  72333. * @api private
  72334. */
  72335. Socket.prototype.onack = function (packet) {
  72336. var ack = this.acks[packet.id];
  72337. if ('function' === typeof ack) {
  72338. debug('calling ack %s with %j', packet.id, packet.data);
  72339. ack.apply(this, packet.data);
  72340. delete this.acks[packet.id];
  72341. } else {
  72342. debug('bad ack %s', packet.id);
  72343. }
  72344. };
  72345. /**
  72346. * Called upon server connect.
  72347. *
  72348. * @api private
  72349. */
  72350. Socket.prototype.onconnect = function () {
  72351. this.connected = true;
  72352. this.disconnected = false;
  72353. this.emit('connect');
  72354. this.emitBuffered();
  72355. };
  72356. /**
  72357. * Emit buffered events (received and emitted).
  72358. *
  72359. * @api private
  72360. */
  72361. Socket.prototype.emitBuffered = function () {
  72362. var i;
  72363. for (i = 0; i < this.receiveBuffer.length; i++) {
  72364. emit.apply(this, this.receiveBuffer[i]);
  72365. }
  72366. this.receiveBuffer = [];
  72367. for (i = 0; i < this.sendBuffer.length; i++) {
  72368. this.packet(this.sendBuffer[i]);
  72369. }
  72370. this.sendBuffer = [];
  72371. };
  72372. /**
  72373. * Called upon server disconnect.
  72374. *
  72375. * @api private
  72376. */
  72377. Socket.prototype.ondisconnect = function () {
  72378. debug('server disconnect (%s)', this.nsp);
  72379. this.destroy();
  72380. this.onclose('io server disconnect');
  72381. };
  72382. /**
  72383. * Called upon forced client/server side disconnections,
  72384. * this method ensures the manager stops tracking us and
  72385. * that reconnections don't get triggered for this.
  72386. *
  72387. * @api private.
  72388. */
  72389. Socket.prototype.destroy = function () {
  72390. if (this.subs) {
  72391. // clean subscriptions to avoid reconnections
  72392. for (var i = 0; i < this.subs.length; i++) {
  72393. this.subs[i].destroy();
  72394. }
  72395. this.subs = null;
  72396. }
  72397. this.io.destroy(this);
  72398. };
  72399. /**
  72400. * Disconnects the socket manually.
  72401. *
  72402. * @return {Socket} self
  72403. * @api public
  72404. */
  72405. Socket.prototype.close =
  72406. Socket.prototype.disconnect = function () {
  72407. if (this.connected) {
  72408. debug('performing disconnect (%s)', this.nsp);
  72409. this.packet({ type: parser.DISCONNECT });
  72410. }
  72411. // remove socket from pool
  72412. this.destroy();
  72413. if (this.connected) {
  72414. // fire events
  72415. this.onclose('io client disconnect');
  72416. }
  72417. return this;
  72418. };
  72419. /**
  72420. * Sets the compress flag.
  72421. *
  72422. * @param {Boolean} if `true`, compresses the sending data
  72423. * @return {Socket} self
  72424. * @api public
  72425. */
  72426. Socket.prototype.compress = function (compress) {
  72427. this.flags.compress = compress;
  72428. return this;
  72429. };
  72430. /**
  72431. * Sets the binary flag
  72432. *
  72433. * @param {Boolean} whether the emitted data contains binary
  72434. * @return {Socket} self
  72435. * @api public
  72436. */
  72437. Socket.prototype.binary = function (binary) {
  72438. this.flags.binary = binary;
  72439. return this;
  72440. };
  72441. /***/ }),
  72442. /***/ "./node_modules/socket.io-client/lib/url.js":
  72443. /*!**************************************************!*\
  72444. !*** ./node_modules/socket.io-client/lib/url.js ***!
  72445. \**************************************************/
  72446. /*! no static exports found */
  72447. /*! all exports used */
  72448. /***/ (function(module, exports, __webpack_require__) {
  72449. /**
  72450. * Module dependencies.
  72451. */
  72452. var parseuri = __webpack_require__(/*! parseuri */ "./node_modules/parseuri/index.js");
  72453. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('socket.io-client:url');
  72454. /**
  72455. * Module exports.
  72456. */
  72457. module.exports = url;
  72458. /**
  72459. * URL parser.
  72460. *
  72461. * @param {String} url
  72462. * @param {Object} An object meant to mimic window.location.
  72463. * Defaults to window.location.
  72464. * @api public
  72465. */
  72466. function url (uri, loc) {
  72467. var obj = uri;
  72468. // default to window.location
  72469. loc = loc || (typeof location !== 'undefined' && location);
  72470. if (null == uri) uri = loc.protocol + '//' + loc.host;
  72471. // relative path support
  72472. if ('string' === typeof uri) {
  72473. if ('/' === uri.charAt(0)) {
  72474. if ('/' === uri.charAt(1)) {
  72475. uri = loc.protocol + uri;
  72476. } else {
  72477. uri = loc.host + uri;
  72478. }
  72479. }
  72480. if (!/^(https?|wss?):\/\//.test(uri)) {
  72481. debug('protocol-less url %s', uri);
  72482. if ('undefined' !== typeof loc) {
  72483. uri = loc.protocol + '//' + uri;
  72484. } else {
  72485. uri = 'https://' + uri;
  72486. }
  72487. }
  72488. // parse
  72489. debug('parse %s', uri);
  72490. obj = parseuri(uri);
  72491. }
  72492. // make sure we treat `localhost:80` and `localhost` equally
  72493. if (!obj.port) {
  72494. if (/^(http|ws)$/.test(obj.protocol)) {
  72495. obj.port = '80';
  72496. } else if (/^(http|ws)s$/.test(obj.protocol)) {
  72497. obj.port = '443';
  72498. }
  72499. }
  72500. obj.path = obj.path || '/';
  72501. var ipv6 = obj.host.indexOf(':') !== -1;
  72502. var host = ipv6 ? '[' + obj.host + ']' : obj.host;
  72503. // define unique id
  72504. obj.id = obj.protocol + '://' + host + ':' + obj.port;
  72505. // define href
  72506. obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : (':' + obj.port));
  72507. return obj;
  72508. }
  72509. /***/ }),
  72510. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/globalThis.browser.js":
  72511. /*!***********************************************************************************************!*\
  72512. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/globalThis.browser.js ***!
  72513. \***********************************************************************************************/
  72514. /*! no static exports found */
  72515. /*! all exports used */
  72516. /***/ (function(module, exports) {
  72517. module.exports = (function () {
  72518. if (typeof self !== 'undefined') {
  72519. return self;
  72520. } else if (typeof window !== 'undefined') {
  72521. return window;
  72522. } else {
  72523. return Function('return this')(); // eslint-disable-line no-new-func
  72524. }
  72525. })();
  72526. /***/ }),
  72527. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/index.js":
  72528. /*!**********************************************************************************!*\
  72529. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/index.js ***!
  72530. \**********************************************************************************/
  72531. /*! no static exports found */
  72532. /*! all exports used */
  72533. /***/ (function(module, exports, __webpack_require__) {
  72534. module.exports = __webpack_require__(/*! ./socket */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/socket.js");
  72535. /**
  72536. * Exports parser
  72537. *
  72538. * @api public
  72539. *
  72540. */
  72541. module.exports.parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  72542. /***/ }),
  72543. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/socket.js":
  72544. /*!***********************************************************************************!*\
  72545. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/socket.js ***!
  72546. \***********************************************************************************/
  72547. /*! no static exports found */
  72548. /*! all exports used */
  72549. /***/ (function(module, exports, __webpack_require__) {
  72550. /**
  72551. * Module dependencies.
  72552. */
  72553. var transports = __webpack_require__(/*! ./transports/index */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/index.js");
  72554. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/socket.io-client/node_modules/engine.io-client/node_modules/component-emitter/index.js");
  72555. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('engine.io-client:socket');
  72556. var index = __webpack_require__(/*! indexof */ "./node_modules/indexof/index.js");
  72557. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  72558. var parseuri = __webpack_require__(/*! parseuri */ "./node_modules/parseuri/index.js");
  72559. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  72560. /**
  72561. * Module exports.
  72562. */
  72563. module.exports = Socket;
  72564. /**
  72565. * Socket constructor.
  72566. *
  72567. * @param {String|Object} uri or options
  72568. * @param {Object} options
  72569. * @api public
  72570. */
  72571. function Socket (uri, opts) {
  72572. if (!(this instanceof Socket)) return new Socket(uri, opts);
  72573. opts = opts || {};
  72574. if (uri && 'object' === typeof uri) {
  72575. opts = uri;
  72576. uri = null;
  72577. }
  72578. if (uri) {
  72579. uri = parseuri(uri);
  72580. opts.hostname = uri.host;
  72581. opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';
  72582. opts.port = uri.port;
  72583. if (uri.query) opts.query = uri.query;
  72584. } else if (opts.host) {
  72585. opts.hostname = parseuri(opts.host).host;
  72586. }
  72587. this.secure = null != opts.secure ? opts.secure
  72588. : (typeof location !== 'undefined' && 'https:' === location.protocol);
  72589. if (opts.hostname && !opts.port) {
  72590. // if no port is specified manually, use the protocol default
  72591. opts.port = this.secure ? '443' : '80';
  72592. }
  72593. this.agent = opts.agent || false;
  72594. this.hostname = opts.hostname ||
  72595. (typeof location !== 'undefined' ? location.hostname : 'localhost');
  72596. this.port = opts.port || (typeof location !== 'undefined' && location.port
  72597. ? location.port
  72598. : (this.secure ? 443 : 80));
  72599. this.query = opts.query || {};
  72600. if ('string' === typeof this.query) this.query = parseqs.decode(this.query);
  72601. this.upgrade = false !== opts.upgrade;
  72602. this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';
  72603. this.forceJSONP = !!opts.forceJSONP;
  72604. this.jsonp = false !== opts.jsonp;
  72605. this.forceBase64 = !!opts.forceBase64;
  72606. this.enablesXDR = !!opts.enablesXDR;
  72607. this.withCredentials = false !== opts.withCredentials;
  72608. this.timestampParam = opts.timestampParam || 't';
  72609. this.timestampRequests = opts.timestampRequests;
  72610. this.transports = opts.transports || ['polling', 'websocket'];
  72611. this.transportOptions = opts.transportOptions || {};
  72612. this.readyState = '';
  72613. this.writeBuffer = [];
  72614. this.prevBufferLen = 0;
  72615. this.policyPort = opts.policyPort || 843;
  72616. this.rememberUpgrade = opts.rememberUpgrade || false;
  72617. this.binaryType = null;
  72618. this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
  72619. this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;
  72620. if (true === this.perMessageDeflate) this.perMessageDeflate = {};
  72621. if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {
  72622. this.perMessageDeflate.threshold = 1024;
  72623. }
  72624. // SSL options for Node.js client
  72625. this.pfx = opts.pfx || null;
  72626. this.key = opts.key || null;
  72627. this.passphrase = opts.passphrase || null;
  72628. this.cert = opts.cert || null;
  72629. this.ca = opts.ca || null;
  72630. this.ciphers = opts.ciphers || null;
  72631. this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;
  72632. this.forceNode = !!opts.forceNode;
  72633. // detect ReactNative environment
  72634. this.isReactNative = (typeof navigator !== 'undefined' && typeof navigator.product === 'string' && navigator.product.toLowerCase() === 'reactnative');
  72635. // other options for Node.js or ReactNative client
  72636. if (typeof self === 'undefined' || this.isReactNative) {
  72637. if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {
  72638. this.extraHeaders = opts.extraHeaders;
  72639. }
  72640. if (opts.localAddress) {
  72641. this.localAddress = opts.localAddress;
  72642. }
  72643. }
  72644. // set on handshake
  72645. this.id = null;
  72646. this.upgrades = null;
  72647. this.pingInterval = null;
  72648. this.pingTimeout = null;
  72649. // set on heartbeat
  72650. this.pingIntervalTimer = null;
  72651. this.pingTimeoutTimer = null;
  72652. this.open();
  72653. }
  72654. Socket.priorWebsocketSuccess = false;
  72655. /**
  72656. * Mix in `Emitter`.
  72657. */
  72658. Emitter(Socket.prototype);
  72659. /**
  72660. * Protocol version.
  72661. *
  72662. * @api public
  72663. */
  72664. Socket.protocol = parser.protocol; // this is an int
  72665. /**
  72666. * Expose deps for legacy compatibility
  72667. * and standalone browser access.
  72668. */
  72669. Socket.Socket = Socket;
  72670. Socket.Transport = __webpack_require__(/*! ./transport */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transport.js");
  72671. Socket.transports = __webpack_require__(/*! ./transports/index */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/index.js");
  72672. Socket.parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  72673. /**
  72674. * Creates transport of the given type.
  72675. *
  72676. * @param {String} transport name
  72677. * @return {Transport}
  72678. * @api private
  72679. */
  72680. Socket.prototype.createTransport = function (name) {
  72681. debug('creating transport "%s"', name);
  72682. var query = clone(this.query);
  72683. // append engine.io protocol identifier
  72684. query.EIO = parser.protocol;
  72685. // transport name
  72686. query.transport = name;
  72687. // per-transport options
  72688. var options = this.transportOptions[name] || {};
  72689. // session id if we already have one
  72690. if (this.id) query.sid = this.id;
  72691. var transport = new transports[name]({
  72692. query: query,
  72693. socket: this,
  72694. agent: options.agent || this.agent,
  72695. hostname: options.hostname || this.hostname,
  72696. port: options.port || this.port,
  72697. secure: options.secure || this.secure,
  72698. path: options.path || this.path,
  72699. forceJSONP: options.forceJSONP || this.forceJSONP,
  72700. jsonp: options.jsonp || this.jsonp,
  72701. forceBase64: options.forceBase64 || this.forceBase64,
  72702. enablesXDR: options.enablesXDR || this.enablesXDR,
  72703. withCredentials: options.withCredentials || this.withCredentials,
  72704. timestampRequests: options.timestampRequests || this.timestampRequests,
  72705. timestampParam: options.timestampParam || this.timestampParam,
  72706. policyPort: options.policyPort || this.policyPort,
  72707. pfx: options.pfx || this.pfx,
  72708. key: options.key || this.key,
  72709. passphrase: options.passphrase || this.passphrase,
  72710. cert: options.cert || this.cert,
  72711. ca: options.ca || this.ca,
  72712. ciphers: options.ciphers || this.ciphers,
  72713. rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,
  72714. perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,
  72715. extraHeaders: options.extraHeaders || this.extraHeaders,
  72716. forceNode: options.forceNode || this.forceNode,
  72717. localAddress: options.localAddress || this.localAddress,
  72718. requestTimeout: options.requestTimeout || this.requestTimeout,
  72719. protocols: options.protocols || void (0),
  72720. isReactNative: this.isReactNative
  72721. });
  72722. return transport;
  72723. };
  72724. function clone (obj) {
  72725. var o = {};
  72726. for (var i in obj) {
  72727. if (obj.hasOwnProperty(i)) {
  72728. o[i] = obj[i];
  72729. }
  72730. }
  72731. return o;
  72732. }
  72733. /**
  72734. * Initializes transport to use and starts probe.
  72735. *
  72736. * @api private
  72737. */
  72738. Socket.prototype.open = function () {
  72739. var transport;
  72740. if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {
  72741. transport = 'websocket';
  72742. } else if (0 === this.transports.length) {
  72743. // Emit error on next tick so it can be listened to
  72744. var self = this;
  72745. setTimeout(function () {
  72746. self.emit('error', 'No transports available');
  72747. }, 0);
  72748. return;
  72749. } else {
  72750. transport = this.transports[0];
  72751. }
  72752. this.readyState = 'opening';
  72753. // Retry with the next transport if the transport is disabled (jsonp: false)
  72754. try {
  72755. transport = this.createTransport(transport);
  72756. } catch (e) {
  72757. this.transports.shift();
  72758. this.open();
  72759. return;
  72760. }
  72761. transport.open();
  72762. this.setTransport(transport);
  72763. };
  72764. /**
  72765. * Sets the current transport. Disables the existing one (if any).
  72766. *
  72767. * @api private
  72768. */
  72769. Socket.prototype.setTransport = function (transport) {
  72770. debug('setting transport %s', transport.name);
  72771. var self = this;
  72772. if (this.transport) {
  72773. debug('clearing existing transport %s', this.transport.name);
  72774. this.transport.removeAllListeners();
  72775. }
  72776. // set up transport
  72777. this.transport = transport;
  72778. // set up transport listeners
  72779. transport
  72780. .on('drain', function () {
  72781. self.onDrain();
  72782. })
  72783. .on('packet', function (packet) {
  72784. self.onPacket(packet);
  72785. })
  72786. .on('error', function (e) {
  72787. self.onError(e);
  72788. })
  72789. .on('close', function () {
  72790. self.onClose('transport close');
  72791. });
  72792. };
  72793. /**
  72794. * Probes a transport.
  72795. *
  72796. * @param {String} transport name
  72797. * @api private
  72798. */
  72799. Socket.prototype.probe = function (name) {
  72800. debug('probing transport "%s"', name);
  72801. var transport = this.createTransport(name, { probe: 1 });
  72802. var failed = false;
  72803. var self = this;
  72804. Socket.priorWebsocketSuccess = false;
  72805. function onTransportOpen () {
  72806. if (self.onlyBinaryUpgrades) {
  72807. var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
  72808. failed = failed || upgradeLosesBinary;
  72809. }
  72810. if (failed) return;
  72811. debug('probe transport "%s" opened', name);
  72812. transport.send([{ type: 'ping', data: 'probe' }]);
  72813. transport.once('packet', function (msg) {
  72814. if (failed) return;
  72815. if ('pong' === msg.type && 'probe' === msg.data) {
  72816. debug('probe transport "%s" pong', name);
  72817. self.upgrading = true;
  72818. self.emit('upgrading', transport);
  72819. if (!transport) return;
  72820. Socket.priorWebsocketSuccess = 'websocket' === transport.name;
  72821. debug('pausing current transport "%s"', self.transport.name);
  72822. self.transport.pause(function () {
  72823. if (failed) return;
  72824. if ('closed' === self.readyState) return;
  72825. debug('changing transport and sending upgrade packet');
  72826. cleanup();
  72827. self.setTransport(transport);
  72828. transport.send([{ type: 'upgrade' }]);
  72829. self.emit('upgrade', transport);
  72830. transport = null;
  72831. self.upgrading = false;
  72832. self.flush();
  72833. });
  72834. } else {
  72835. debug('probe transport "%s" failed', name);
  72836. var err = new Error('probe error');
  72837. err.transport = transport.name;
  72838. self.emit('upgradeError', err);
  72839. }
  72840. });
  72841. }
  72842. function freezeTransport () {
  72843. if (failed) return;
  72844. // Any callback called by transport should be ignored since now
  72845. failed = true;
  72846. cleanup();
  72847. transport.close();
  72848. transport = null;
  72849. }
  72850. // Handle any error that happens while probing
  72851. function onerror (err) {
  72852. var error = new Error('probe error: ' + err);
  72853. error.transport = transport.name;
  72854. freezeTransport();
  72855. debug('probe transport "%s" failed because of error: %s', name, err);
  72856. self.emit('upgradeError', error);
  72857. }
  72858. function onTransportClose () {
  72859. onerror('transport closed');
  72860. }
  72861. // When the socket is closed while we're probing
  72862. function onclose () {
  72863. onerror('socket closed');
  72864. }
  72865. // When the socket is upgraded while we're probing
  72866. function onupgrade (to) {
  72867. if (transport && to.name !== transport.name) {
  72868. debug('"%s" works - aborting "%s"', to.name, transport.name);
  72869. freezeTransport();
  72870. }
  72871. }
  72872. // Remove all listeners on the transport and on self
  72873. function cleanup () {
  72874. transport.removeListener('open', onTransportOpen);
  72875. transport.removeListener('error', onerror);
  72876. transport.removeListener('close', onTransportClose);
  72877. self.removeListener('close', onclose);
  72878. self.removeListener('upgrading', onupgrade);
  72879. }
  72880. transport.once('open', onTransportOpen);
  72881. transport.once('error', onerror);
  72882. transport.once('close', onTransportClose);
  72883. this.once('close', onclose);
  72884. this.once('upgrading', onupgrade);
  72885. transport.open();
  72886. };
  72887. /**
  72888. * Called when connection is deemed open.
  72889. *
  72890. * @api public
  72891. */
  72892. Socket.prototype.onOpen = function () {
  72893. debug('socket open');
  72894. this.readyState = 'open';
  72895. Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;
  72896. this.emit('open');
  72897. this.flush();
  72898. // we check for `readyState` in case an `open`
  72899. // listener already closed the socket
  72900. if ('open' === this.readyState && this.upgrade && this.transport.pause) {
  72901. debug('starting upgrade probes');
  72902. for (var i = 0, l = this.upgrades.length; i < l; i++) {
  72903. this.probe(this.upgrades[i]);
  72904. }
  72905. }
  72906. };
  72907. /**
  72908. * Handles a packet.
  72909. *
  72910. * @api private
  72911. */
  72912. Socket.prototype.onPacket = function (packet) {
  72913. if ('opening' === this.readyState || 'open' === this.readyState ||
  72914. 'closing' === this.readyState) {
  72915. debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
  72916. this.emit('packet', packet);
  72917. // Socket is live - any packet counts
  72918. this.emit('heartbeat');
  72919. switch (packet.type) {
  72920. case 'open':
  72921. this.onHandshake(JSON.parse(packet.data));
  72922. break;
  72923. case 'pong':
  72924. this.setPing();
  72925. this.emit('pong');
  72926. break;
  72927. case 'error':
  72928. var err = new Error('server error');
  72929. err.code = packet.data;
  72930. this.onError(err);
  72931. break;
  72932. case 'message':
  72933. this.emit('data', packet.data);
  72934. this.emit('message', packet.data);
  72935. break;
  72936. }
  72937. } else {
  72938. debug('packet received with socket readyState "%s"', this.readyState);
  72939. }
  72940. };
  72941. /**
  72942. * Called upon handshake completion.
  72943. *
  72944. * @param {Object} handshake obj
  72945. * @api private
  72946. */
  72947. Socket.prototype.onHandshake = function (data) {
  72948. this.emit('handshake', data);
  72949. this.id = data.sid;
  72950. this.transport.query.sid = data.sid;
  72951. this.upgrades = this.filterUpgrades(data.upgrades);
  72952. this.pingInterval = data.pingInterval;
  72953. this.pingTimeout = data.pingTimeout;
  72954. this.onOpen();
  72955. // In case open handler closes socket
  72956. if ('closed' === this.readyState) return;
  72957. this.setPing();
  72958. // Prolong liveness of socket on heartbeat
  72959. this.removeListener('heartbeat', this.onHeartbeat);
  72960. this.on('heartbeat', this.onHeartbeat);
  72961. };
  72962. /**
  72963. * Resets ping timeout.
  72964. *
  72965. * @api private
  72966. */
  72967. Socket.prototype.onHeartbeat = function (timeout) {
  72968. clearTimeout(this.pingTimeoutTimer);
  72969. var self = this;
  72970. self.pingTimeoutTimer = setTimeout(function () {
  72971. if ('closed' === self.readyState) return;
  72972. self.onClose('ping timeout');
  72973. }, timeout || (self.pingInterval + self.pingTimeout));
  72974. };
  72975. /**
  72976. * Pings server every `this.pingInterval` and expects response
  72977. * within `this.pingTimeout` or closes connection.
  72978. *
  72979. * @api private
  72980. */
  72981. Socket.prototype.setPing = function () {
  72982. var self = this;
  72983. clearTimeout(self.pingIntervalTimer);
  72984. self.pingIntervalTimer = setTimeout(function () {
  72985. debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
  72986. self.ping();
  72987. self.onHeartbeat(self.pingTimeout);
  72988. }, self.pingInterval);
  72989. };
  72990. /**
  72991. * Sends a ping packet.
  72992. *
  72993. * @api private
  72994. */
  72995. Socket.prototype.ping = function () {
  72996. var self = this;
  72997. this.sendPacket('ping', function () {
  72998. self.emit('ping');
  72999. });
  73000. };
  73001. /**
  73002. * Called on `drain` event
  73003. *
  73004. * @api private
  73005. */
  73006. Socket.prototype.onDrain = function () {
  73007. this.writeBuffer.splice(0, this.prevBufferLen);
  73008. // setting prevBufferLen = 0 is very important
  73009. // for example, when upgrading, upgrade packet is sent over,
  73010. // and a nonzero prevBufferLen could cause problems on `drain`
  73011. this.prevBufferLen = 0;
  73012. if (0 === this.writeBuffer.length) {
  73013. this.emit('drain');
  73014. } else {
  73015. this.flush();
  73016. }
  73017. };
  73018. /**
  73019. * Flush write buffers.
  73020. *
  73021. * @api private
  73022. */
  73023. Socket.prototype.flush = function () {
  73024. if ('closed' !== this.readyState && this.transport.writable &&
  73025. !this.upgrading && this.writeBuffer.length) {
  73026. debug('flushing %d packets in socket', this.writeBuffer.length);
  73027. this.transport.send(this.writeBuffer);
  73028. // keep track of current length of writeBuffer
  73029. // splice writeBuffer and callbackBuffer on `drain`
  73030. this.prevBufferLen = this.writeBuffer.length;
  73031. this.emit('flush');
  73032. }
  73033. };
  73034. /**
  73035. * Sends a message.
  73036. *
  73037. * @param {String} message.
  73038. * @param {Function} callback function.
  73039. * @param {Object} options.
  73040. * @return {Socket} for chaining.
  73041. * @api public
  73042. */
  73043. Socket.prototype.write =
  73044. Socket.prototype.send = function (msg, options, fn) {
  73045. this.sendPacket('message', msg, options, fn);
  73046. return this;
  73047. };
  73048. /**
  73049. * Sends a packet.
  73050. *
  73051. * @param {String} packet type.
  73052. * @param {String} data.
  73053. * @param {Object} options.
  73054. * @param {Function} callback function.
  73055. * @api private
  73056. */
  73057. Socket.prototype.sendPacket = function (type, data, options, fn) {
  73058. if ('function' === typeof data) {
  73059. fn = data;
  73060. data = undefined;
  73061. }
  73062. if ('function' === typeof options) {
  73063. fn = options;
  73064. options = null;
  73065. }
  73066. if ('closing' === this.readyState || 'closed' === this.readyState) {
  73067. return;
  73068. }
  73069. options = options || {};
  73070. options.compress = false !== options.compress;
  73071. var packet = {
  73072. type: type,
  73073. data: data,
  73074. options: options
  73075. };
  73076. this.emit('packetCreate', packet);
  73077. this.writeBuffer.push(packet);
  73078. if (fn) this.once('flush', fn);
  73079. this.flush();
  73080. };
  73081. /**
  73082. * Closes the connection.
  73083. *
  73084. * @api private
  73085. */
  73086. Socket.prototype.close = function () {
  73087. if ('opening' === this.readyState || 'open' === this.readyState) {
  73088. this.readyState = 'closing';
  73089. var self = this;
  73090. if (this.writeBuffer.length) {
  73091. this.once('drain', function () {
  73092. if (this.upgrading) {
  73093. waitForUpgrade();
  73094. } else {
  73095. close();
  73096. }
  73097. });
  73098. } else if (this.upgrading) {
  73099. waitForUpgrade();
  73100. } else {
  73101. close();
  73102. }
  73103. }
  73104. function close () {
  73105. self.onClose('forced close');
  73106. debug('socket closing - telling transport to close');
  73107. self.transport.close();
  73108. }
  73109. function cleanupAndClose () {
  73110. self.removeListener('upgrade', cleanupAndClose);
  73111. self.removeListener('upgradeError', cleanupAndClose);
  73112. close();
  73113. }
  73114. function waitForUpgrade () {
  73115. // wait for upgrade to finish since we can't send packets while pausing a transport
  73116. self.once('upgrade', cleanupAndClose);
  73117. self.once('upgradeError', cleanupAndClose);
  73118. }
  73119. return this;
  73120. };
  73121. /**
  73122. * Called upon transport error
  73123. *
  73124. * @api private
  73125. */
  73126. Socket.prototype.onError = function (err) {
  73127. debug('socket error %j', err);
  73128. Socket.priorWebsocketSuccess = false;
  73129. this.emit('error', err);
  73130. this.onClose('transport error', err);
  73131. };
  73132. /**
  73133. * Called upon transport close.
  73134. *
  73135. * @api private
  73136. */
  73137. Socket.prototype.onClose = function (reason, desc) {
  73138. if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {
  73139. debug('socket close with reason: "%s"', reason);
  73140. var self = this;
  73141. // clear timers
  73142. clearTimeout(this.pingIntervalTimer);
  73143. clearTimeout(this.pingTimeoutTimer);
  73144. // stop event from firing again for transport
  73145. this.transport.removeAllListeners('close');
  73146. // ensure transport won't stay open
  73147. this.transport.close();
  73148. // ignore further transport communication
  73149. this.transport.removeAllListeners();
  73150. // set ready state
  73151. this.readyState = 'closed';
  73152. // clear session id
  73153. this.id = null;
  73154. // emit close event
  73155. this.emit('close', reason, desc);
  73156. // clean buffers after, so users can still
  73157. // grab the buffers on `close` event
  73158. self.writeBuffer = [];
  73159. self.prevBufferLen = 0;
  73160. }
  73161. };
  73162. /**
  73163. * Filters upgrades, returning only those matching client transports.
  73164. *
  73165. * @param {Array} server upgrades
  73166. * @api private
  73167. *
  73168. */
  73169. Socket.prototype.filterUpgrades = function (upgrades) {
  73170. var filteredUpgrades = [];
  73171. for (var i = 0, j = upgrades.length; i < j; i++) {
  73172. if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);
  73173. }
  73174. return filteredUpgrades;
  73175. };
  73176. /***/ }),
  73177. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transport.js":
  73178. /*!**************************************************************************************!*\
  73179. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/transport.js ***!
  73180. \**************************************************************************************/
  73181. /*! no static exports found */
  73182. /*! all exports used */
  73183. /***/ (function(module, exports, __webpack_require__) {
  73184. /**
  73185. * Module dependencies.
  73186. */
  73187. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  73188. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/socket.io-client/node_modules/engine.io-client/node_modules/component-emitter/index.js");
  73189. /**
  73190. * Module exports.
  73191. */
  73192. module.exports = Transport;
  73193. /**
  73194. * Transport abstract constructor.
  73195. *
  73196. * @param {Object} options.
  73197. * @api private
  73198. */
  73199. function Transport (opts) {
  73200. this.path = opts.path;
  73201. this.hostname = opts.hostname;
  73202. this.port = opts.port;
  73203. this.secure = opts.secure;
  73204. this.query = opts.query;
  73205. this.timestampParam = opts.timestampParam;
  73206. this.timestampRequests = opts.timestampRequests;
  73207. this.readyState = '';
  73208. this.agent = opts.agent || false;
  73209. this.socket = opts.socket;
  73210. this.enablesXDR = opts.enablesXDR;
  73211. this.withCredentials = opts.withCredentials;
  73212. // SSL options for Node.js client
  73213. this.pfx = opts.pfx;
  73214. this.key = opts.key;
  73215. this.passphrase = opts.passphrase;
  73216. this.cert = opts.cert;
  73217. this.ca = opts.ca;
  73218. this.ciphers = opts.ciphers;
  73219. this.rejectUnauthorized = opts.rejectUnauthorized;
  73220. this.forceNode = opts.forceNode;
  73221. // results of ReactNative environment detection
  73222. this.isReactNative = opts.isReactNative;
  73223. // other options for Node.js client
  73224. this.extraHeaders = opts.extraHeaders;
  73225. this.localAddress = opts.localAddress;
  73226. }
  73227. /**
  73228. * Mix in `Emitter`.
  73229. */
  73230. Emitter(Transport.prototype);
  73231. /**
  73232. * Emits an error.
  73233. *
  73234. * @param {String} str
  73235. * @return {Transport} for chaining
  73236. * @api public
  73237. */
  73238. Transport.prototype.onError = function (msg, desc) {
  73239. var err = new Error(msg);
  73240. err.type = 'TransportError';
  73241. err.description = desc;
  73242. this.emit('error', err);
  73243. return this;
  73244. };
  73245. /**
  73246. * Opens the transport.
  73247. *
  73248. * @api public
  73249. */
  73250. Transport.prototype.open = function () {
  73251. if ('closed' === this.readyState || '' === this.readyState) {
  73252. this.readyState = 'opening';
  73253. this.doOpen();
  73254. }
  73255. return this;
  73256. };
  73257. /**
  73258. * Closes the transport.
  73259. *
  73260. * @api private
  73261. */
  73262. Transport.prototype.close = function () {
  73263. if ('opening' === this.readyState || 'open' === this.readyState) {
  73264. this.doClose();
  73265. this.onClose();
  73266. }
  73267. return this;
  73268. };
  73269. /**
  73270. * Sends multiple packets.
  73271. *
  73272. * @param {Array} packets
  73273. * @api private
  73274. */
  73275. Transport.prototype.send = function (packets) {
  73276. if ('open' === this.readyState) {
  73277. this.write(packets);
  73278. } else {
  73279. throw new Error('Transport not open');
  73280. }
  73281. };
  73282. /**
  73283. * Called upon open
  73284. *
  73285. * @api private
  73286. */
  73287. Transport.prototype.onOpen = function () {
  73288. this.readyState = 'open';
  73289. this.writable = true;
  73290. this.emit('open');
  73291. };
  73292. /**
  73293. * Called with data.
  73294. *
  73295. * @param {String} data
  73296. * @api private
  73297. */
  73298. Transport.prototype.onData = function (data) {
  73299. var packet = parser.decodePacket(data, this.socket.binaryType);
  73300. this.onPacket(packet);
  73301. };
  73302. /**
  73303. * Called with a decoded packet.
  73304. */
  73305. Transport.prototype.onPacket = function (packet) {
  73306. this.emit('packet', packet);
  73307. };
  73308. /**
  73309. * Called upon close.
  73310. *
  73311. * @api private
  73312. */
  73313. Transport.prototype.onClose = function () {
  73314. this.readyState = 'closed';
  73315. this.emit('close');
  73316. };
  73317. /***/ }),
  73318. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/index.js":
  73319. /*!*********************************************************************************************!*\
  73320. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/index.js ***!
  73321. \*********************************************************************************************/
  73322. /*! no static exports found */
  73323. /*! all exports used */
  73324. /***/ (function(module, exports, __webpack_require__) {
  73325. /**
  73326. * Module dependencies
  73327. */
  73328. var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/xmlhttprequest.js");
  73329. var XHR = __webpack_require__(/*! ./polling-xhr */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-xhr.js");
  73330. var JSONP = __webpack_require__(/*! ./polling-jsonp */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-jsonp.js");
  73331. var websocket = __webpack_require__(/*! ./websocket */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/websocket.js");
  73332. /**
  73333. * Export transports.
  73334. */
  73335. exports.polling = polling;
  73336. exports.websocket = websocket;
  73337. /**
  73338. * Polling transport polymorphic constructor.
  73339. * Decides on xhr vs jsonp based on feature detection.
  73340. *
  73341. * @api private
  73342. */
  73343. function polling (opts) {
  73344. var xhr;
  73345. var xd = false;
  73346. var xs = false;
  73347. var jsonp = false !== opts.jsonp;
  73348. if (typeof location !== 'undefined') {
  73349. var isSSL = 'https:' === location.protocol;
  73350. var port = location.port;
  73351. // some user agents have empty `location.port`
  73352. if (!port) {
  73353. port = isSSL ? 443 : 80;
  73354. }
  73355. xd = opts.hostname !== location.hostname || port !== opts.port;
  73356. xs = opts.secure !== isSSL;
  73357. }
  73358. opts.xdomain = xd;
  73359. opts.xscheme = xs;
  73360. xhr = new XMLHttpRequest(opts);
  73361. if ('open' in xhr && !opts.forceJSONP) {
  73362. return new XHR(opts);
  73363. } else {
  73364. if (!jsonp) throw new Error('JSONP disabled');
  73365. return new JSONP(opts);
  73366. }
  73367. }
  73368. /***/ }),
  73369. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-jsonp.js":
  73370. /*!*****************************************************************************************************!*\
  73371. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-jsonp.js ***!
  73372. \*****************************************************************************************************/
  73373. /*! no static exports found */
  73374. /*! all exports used */
  73375. /***/ (function(module, exports, __webpack_require__) {
  73376. /**
  73377. * Module requirements.
  73378. */
  73379. var Polling = __webpack_require__(/*! ./polling */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling.js");
  73380. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  73381. var globalThis = __webpack_require__(/*! ../globalThis */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/globalThis.browser.js");
  73382. /**
  73383. * Module exports.
  73384. */
  73385. module.exports = JSONPPolling;
  73386. /**
  73387. * Cached regular expressions.
  73388. */
  73389. var rNewline = /\n/g;
  73390. var rEscapedNewline = /\\n/g;
  73391. /**
  73392. * Global JSONP callbacks.
  73393. */
  73394. var callbacks;
  73395. /**
  73396. * Noop.
  73397. */
  73398. function empty () { }
  73399. /**
  73400. * JSONP Polling constructor.
  73401. *
  73402. * @param {Object} opts.
  73403. * @api public
  73404. */
  73405. function JSONPPolling (opts) {
  73406. Polling.call(this, opts);
  73407. this.query = this.query || {};
  73408. // define global callbacks array if not present
  73409. // we do this here (lazily) to avoid unneeded global pollution
  73410. if (!callbacks) {
  73411. // we need to consider multiple engines in the same page
  73412. callbacks = globalThis.___eio = (globalThis.___eio || []);
  73413. }
  73414. // callback identifier
  73415. this.index = callbacks.length;
  73416. // add callback to jsonp global
  73417. var self = this;
  73418. callbacks.push(function (msg) {
  73419. self.onData(msg);
  73420. });
  73421. // append to query string
  73422. this.query.j = this.index;
  73423. // prevent spurious errors from being emitted when the window is unloaded
  73424. if (typeof addEventListener === 'function') {
  73425. addEventListener('beforeunload', function () {
  73426. if (self.script) self.script.onerror = empty;
  73427. }, false);
  73428. }
  73429. }
  73430. /**
  73431. * Inherits from Polling.
  73432. */
  73433. inherit(JSONPPolling, Polling);
  73434. /*
  73435. * JSONP only supports binary as base64 encoded strings
  73436. */
  73437. JSONPPolling.prototype.supportsBinary = false;
  73438. /**
  73439. * Closes the socket.
  73440. *
  73441. * @api private
  73442. */
  73443. JSONPPolling.prototype.doClose = function () {
  73444. if (this.script) {
  73445. this.script.parentNode.removeChild(this.script);
  73446. this.script = null;
  73447. }
  73448. if (this.form) {
  73449. this.form.parentNode.removeChild(this.form);
  73450. this.form = null;
  73451. this.iframe = null;
  73452. }
  73453. Polling.prototype.doClose.call(this);
  73454. };
  73455. /**
  73456. * Starts a poll cycle.
  73457. *
  73458. * @api private
  73459. */
  73460. JSONPPolling.prototype.doPoll = function () {
  73461. var self = this;
  73462. var script = document.createElement('script');
  73463. if (this.script) {
  73464. this.script.parentNode.removeChild(this.script);
  73465. this.script = null;
  73466. }
  73467. script.async = true;
  73468. script.src = this.uri();
  73469. script.onerror = function (e) {
  73470. self.onError('jsonp poll error', e);
  73471. };
  73472. var insertAt = document.getElementsByTagName('script')[0];
  73473. if (insertAt) {
  73474. insertAt.parentNode.insertBefore(script, insertAt);
  73475. } else {
  73476. (document.head || document.body).appendChild(script);
  73477. }
  73478. this.script = script;
  73479. var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);
  73480. if (isUAgecko) {
  73481. setTimeout(function () {
  73482. var iframe = document.createElement('iframe');
  73483. document.body.appendChild(iframe);
  73484. document.body.removeChild(iframe);
  73485. }, 100);
  73486. }
  73487. };
  73488. /**
  73489. * Writes with a hidden iframe.
  73490. *
  73491. * @param {String} data to send
  73492. * @param {Function} called upon flush.
  73493. * @api private
  73494. */
  73495. JSONPPolling.prototype.doWrite = function (data, fn) {
  73496. var self = this;
  73497. if (!this.form) {
  73498. var form = document.createElement('form');
  73499. var area = document.createElement('textarea');
  73500. var id = this.iframeId = 'eio_iframe_' + this.index;
  73501. var iframe;
  73502. form.className = 'socketio';
  73503. form.style.position = 'absolute';
  73504. form.style.top = '-1000px';
  73505. form.style.left = '-1000px';
  73506. form.target = id;
  73507. form.method = 'POST';
  73508. form.setAttribute('accept-charset', 'utf-8');
  73509. area.name = 'd';
  73510. form.appendChild(area);
  73511. document.body.appendChild(form);
  73512. this.form = form;
  73513. this.area = area;
  73514. }
  73515. this.form.action = this.uri();
  73516. function complete () {
  73517. initIframe();
  73518. fn();
  73519. }
  73520. function initIframe () {
  73521. if (self.iframe) {
  73522. try {
  73523. self.form.removeChild(self.iframe);
  73524. } catch (e) {
  73525. self.onError('jsonp polling iframe removal error', e);
  73526. }
  73527. }
  73528. try {
  73529. // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
  73530. var html = '<iframe src="javascript:0" name="' + self.iframeId + '">';
  73531. iframe = document.createElement(html);
  73532. } catch (e) {
  73533. iframe = document.createElement('iframe');
  73534. iframe.name = self.iframeId;
  73535. iframe.src = 'javascript:0';
  73536. }
  73537. iframe.id = self.iframeId;
  73538. self.form.appendChild(iframe);
  73539. self.iframe = iframe;
  73540. }
  73541. initIframe();
  73542. // escape \n to prevent it from being converted into \r\n by some UAs
  73543. // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side
  73544. data = data.replace(rEscapedNewline, '\\\n');
  73545. this.area.value = data.replace(rNewline, '\\n');
  73546. try {
  73547. this.form.submit();
  73548. } catch (e) {}
  73549. if (this.iframe.attachEvent) {
  73550. this.iframe.onreadystatechange = function () {
  73551. if (self.iframe.readyState === 'complete') {
  73552. complete();
  73553. }
  73554. };
  73555. } else {
  73556. this.iframe.onload = complete;
  73557. }
  73558. };
  73559. /***/ }),
  73560. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-xhr.js":
  73561. /*!***************************************************************************************************!*\
  73562. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-xhr.js ***!
  73563. \***************************************************************************************************/
  73564. /*! no static exports found */
  73565. /*! all exports used */
  73566. /***/ (function(module, exports, __webpack_require__) {
  73567. /* global attachEvent */
  73568. /**
  73569. * Module requirements.
  73570. */
  73571. var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/xmlhttprequest.js");
  73572. var Polling = __webpack_require__(/*! ./polling */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling.js");
  73573. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/socket.io-client/node_modules/engine.io-client/node_modules/component-emitter/index.js");
  73574. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  73575. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('engine.io-client:polling-xhr');
  73576. var globalThis = __webpack_require__(/*! ../globalThis */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/globalThis.browser.js");
  73577. /**
  73578. * Module exports.
  73579. */
  73580. module.exports = XHR;
  73581. module.exports.Request = Request;
  73582. /**
  73583. * Empty function
  73584. */
  73585. function empty () {}
  73586. /**
  73587. * XHR Polling constructor.
  73588. *
  73589. * @param {Object} opts
  73590. * @api public
  73591. */
  73592. function XHR (opts) {
  73593. Polling.call(this, opts);
  73594. this.requestTimeout = opts.requestTimeout;
  73595. this.extraHeaders = opts.extraHeaders;
  73596. if (typeof location !== 'undefined') {
  73597. var isSSL = 'https:' === location.protocol;
  73598. var port = location.port;
  73599. // some user agents have empty `location.port`
  73600. if (!port) {
  73601. port = isSSL ? 443 : 80;
  73602. }
  73603. this.xd = (typeof location !== 'undefined' && opts.hostname !== location.hostname) ||
  73604. port !== opts.port;
  73605. this.xs = opts.secure !== isSSL;
  73606. }
  73607. }
  73608. /**
  73609. * Inherits from Polling.
  73610. */
  73611. inherit(XHR, Polling);
  73612. /**
  73613. * XHR supports binary
  73614. */
  73615. XHR.prototype.supportsBinary = true;
  73616. /**
  73617. * Creates a request.
  73618. *
  73619. * @param {String} method
  73620. * @api private
  73621. */
  73622. XHR.prototype.request = function (opts) {
  73623. opts = opts || {};
  73624. opts.uri = this.uri();
  73625. opts.xd = this.xd;
  73626. opts.xs = this.xs;
  73627. opts.agent = this.agent || false;
  73628. opts.supportsBinary = this.supportsBinary;
  73629. opts.enablesXDR = this.enablesXDR;
  73630. opts.withCredentials = this.withCredentials;
  73631. // SSL options for Node.js client
  73632. opts.pfx = this.pfx;
  73633. opts.key = this.key;
  73634. opts.passphrase = this.passphrase;
  73635. opts.cert = this.cert;
  73636. opts.ca = this.ca;
  73637. opts.ciphers = this.ciphers;
  73638. opts.rejectUnauthorized = this.rejectUnauthorized;
  73639. opts.requestTimeout = this.requestTimeout;
  73640. // other options for Node.js client
  73641. opts.extraHeaders = this.extraHeaders;
  73642. return new Request(opts);
  73643. };
  73644. /**
  73645. * Sends data.
  73646. *
  73647. * @param {String} data to send.
  73648. * @param {Function} called upon flush.
  73649. * @api private
  73650. */
  73651. XHR.prototype.doWrite = function (data, fn) {
  73652. var isBinary = typeof data !== 'string' && data !== undefined;
  73653. var req = this.request({ method: 'POST', data: data, isBinary: isBinary });
  73654. var self = this;
  73655. req.on('success', fn);
  73656. req.on('error', function (err) {
  73657. self.onError('xhr post error', err);
  73658. });
  73659. this.sendXhr = req;
  73660. };
  73661. /**
  73662. * Starts a poll cycle.
  73663. *
  73664. * @api private
  73665. */
  73666. XHR.prototype.doPoll = function () {
  73667. debug('xhr poll');
  73668. var req = this.request();
  73669. var self = this;
  73670. req.on('data', function (data) {
  73671. self.onData(data);
  73672. });
  73673. req.on('error', function (err) {
  73674. self.onError('xhr poll error', err);
  73675. });
  73676. this.pollXhr = req;
  73677. };
  73678. /**
  73679. * Request constructor
  73680. *
  73681. * @param {Object} options
  73682. * @api public
  73683. */
  73684. function Request (opts) {
  73685. this.method = opts.method || 'GET';
  73686. this.uri = opts.uri;
  73687. this.xd = !!opts.xd;
  73688. this.xs = !!opts.xs;
  73689. this.async = false !== opts.async;
  73690. this.data = undefined !== opts.data ? opts.data : null;
  73691. this.agent = opts.agent;
  73692. this.isBinary = opts.isBinary;
  73693. this.supportsBinary = opts.supportsBinary;
  73694. this.enablesXDR = opts.enablesXDR;
  73695. this.withCredentials = opts.withCredentials;
  73696. this.requestTimeout = opts.requestTimeout;
  73697. // SSL options for Node.js client
  73698. this.pfx = opts.pfx;
  73699. this.key = opts.key;
  73700. this.passphrase = opts.passphrase;
  73701. this.cert = opts.cert;
  73702. this.ca = opts.ca;
  73703. this.ciphers = opts.ciphers;
  73704. this.rejectUnauthorized = opts.rejectUnauthorized;
  73705. // other options for Node.js client
  73706. this.extraHeaders = opts.extraHeaders;
  73707. this.create();
  73708. }
  73709. /**
  73710. * Mix in `Emitter`.
  73711. */
  73712. Emitter(Request.prototype);
  73713. /**
  73714. * Creates the XHR object and sends the request.
  73715. *
  73716. * @api private
  73717. */
  73718. Request.prototype.create = function () {
  73719. var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
  73720. // SSL options for Node.js client
  73721. opts.pfx = this.pfx;
  73722. opts.key = this.key;
  73723. opts.passphrase = this.passphrase;
  73724. opts.cert = this.cert;
  73725. opts.ca = this.ca;
  73726. opts.ciphers = this.ciphers;
  73727. opts.rejectUnauthorized = this.rejectUnauthorized;
  73728. var xhr = this.xhr = new XMLHttpRequest(opts);
  73729. var self = this;
  73730. try {
  73731. debug('xhr open %s: %s', this.method, this.uri);
  73732. xhr.open(this.method, this.uri, this.async);
  73733. try {
  73734. if (this.extraHeaders) {
  73735. xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
  73736. for (var i in this.extraHeaders) {
  73737. if (this.extraHeaders.hasOwnProperty(i)) {
  73738. xhr.setRequestHeader(i, this.extraHeaders[i]);
  73739. }
  73740. }
  73741. }
  73742. } catch (e) {}
  73743. if ('POST' === this.method) {
  73744. try {
  73745. if (this.isBinary) {
  73746. xhr.setRequestHeader('Content-type', 'application/octet-stream');
  73747. } else {
  73748. xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
  73749. }
  73750. } catch (e) {}
  73751. }
  73752. try {
  73753. xhr.setRequestHeader('Accept', '*/*');
  73754. } catch (e) {}
  73755. // ie6 check
  73756. if ('withCredentials' in xhr) {
  73757. xhr.withCredentials = this.withCredentials;
  73758. }
  73759. if (this.requestTimeout) {
  73760. xhr.timeout = this.requestTimeout;
  73761. }
  73762. if (this.hasXDR()) {
  73763. xhr.onload = function () {
  73764. self.onLoad();
  73765. };
  73766. xhr.onerror = function () {
  73767. self.onError(xhr.responseText);
  73768. };
  73769. } else {
  73770. xhr.onreadystatechange = function () {
  73771. if (xhr.readyState === 2) {
  73772. try {
  73773. var contentType = xhr.getResponseHeader('Content-Type');
  73774. if (self.supportsBinary && contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
  73775. xhr.responseType = 'arraybuffer';
  73776. }
  73777. } catch (e) {}
  73778. }
  73779. if (4 !== xhr.readyState) return;
  73780. if (200 === xhr.status || 1223 === xhr.status) {
  73781. self.onLoad();
  73782. } else {
  73783. // make sure the `error` event handler that's user-set
  73784. // does not throw in the same tick and gets caught here
  73785. setTimeout(function () {
  73786. self.onError(typeof xhr.status === 'number' ? xhr.status : 0);
  73787. }, 0);
  73788. }
  73789. };
  73790. }
  73791. debug('xhr data %s', this.data);
  73792. xhr.send(this.data);
  73793. } catch (e) {
  73794. // Need to defer since .create() is called directly fhrom the constructor
  73795. // and thus the 'error' event can only be only bound *after* this exception
  73796. // occurs. Therefore, also, we cannot throw here at all.
  73797. setTimeout(function () {
  73798. self.onError(e);
  73799. }, 0);
  73800. return;
  73801. }
  73802. if (typeof document !== 'undefined') {
  73803. this.index = Request.requestsCount++;
  73804. Request.requests[this.index] = this;
  73805. }
  73806. };
  73807. /**
  73808. * Called upon successful response.
  73809. *
  73810. * @api private
  73811. */
  73812. Request.prototype.onSuccess = function () {
  73813. this.emit('success');
  73814. this.cleanup();
  73815. };
  73816. /**
  73817. * Called if we have data.
  73818. *
  73819. * @api private
  73820. */
  73821. Request.prototype.onData = function (data) {
  73822. this.emit('data', data);
  73823. this.onSuccess();
  73824. };
  73825. /**
  73826. * Called upon error.
  73827. *
  73828. * @api private
  73829. */
  73830. Request.prototype.onError = function (err) {
  73831. this.emit('error', err);
  73832. this.cleanup(true);
  73833. };
  73834. /**
  73835. * Cleans up house.
  73836. *
  73837. * @api private
  73838. */
  73839. Request.prototype.cleanup = function (fromError) {
  73840. if ('undefined' === typeof this.xhr || null === this.xhr) {
  73841. return;
  73842. }
  73843. // xmlhttprequest
  73844. if (this.hasXDR()) {
  73845. this.xhr.onload = this.xhr.onerror = empty;
  73846. } else {
  73847. this.xhr.onreadystatechange = empty;
  73848. }
  73849. if (fromError) {
  73850. try {
  73851. this.xhr.abort();
  73852. } catch (e) {}
  73853. }
  73854. if (typeof document !== 'undefined') {
  73855. delete Request.requests[this.index];
  73856. }
  73857. this.xhr = null;
  73858. };
  73859. /**
  73860. * Called upon load.
  73861. *
  73862. * @api private
  73863. */
  73864. Request.prototype.onLoad = function () {
  73865. var data;
  73866. try {
  73867. var contentType;
  73868. try {
  73869. contentType = this.xhr.getResponseHeader('Content-Type');
  73870. } catch (e) {}
  73871. if (contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
  73872. data = this.xhr.response || this.xhr.responseText;
  73873. } else {
  73874. data = this.xhr.responseText;
  73875. }
  73876. } catch (e) {
  73877. this.onError(e);
  73878. }
  73879. if (null != data) {
  73880. this.onData(data);
  73881. }
  73882. };
  73883. /**
  73884. * Check if it has XDomainRequest.
  73885. *
  73886. * @api private
  73887. */
  73888. Request.prototype.hasXDR = function () {
  73889. return typeof XDomainRequest !== 'undefined' && !this.xs && this.enablesXDR;
  73890. };
  73891. /**
  73892. * Aborts the request.
  73893. *
  73894. * @api public
  73895. */
  73896. Request.prototype.abort = function () {
  73897. this.cleanup();
  73898. };
  73899. /**
  73900. * Aborts pending requests when unloading the window. This is needed to prevent
  73901. * memory leaks (e.g. when using IE) and to ensure that no spurious error is
  73902. * emitted.
  73903. */
  73904. Request.requestsCount = 0;
  73905. Request.requests = {};
  73906. if (typeof document !== 'undefined') {
  73907. if (typeof attachEvent === 'function') {
  73908. attachEvent('onunload', unloadHandler);
  73909. } else if (typeof addEventListener === 'function') {
  73910. var terminationEvent = 'onpagehide' in globalThis ? 'pagehide' : 'unload';
  73911. addEventListener(terminationEvent, unloadHandler, false);
  73912. }
  73913. }
  73914. function unloadHandler () {
  73915. for (var i in Request.requests) {
  73916. if (Request.requests.hasOwnProperty(i)) {
  73917. Request.requests[i].abort();
  73918. }
  73919. }
  73920. }
  73921. /***/ }),
  73922. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling.js":
  73923. /*!***********************************************************************************************!*\
  73924. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling.js ***!
  73925. \***********************************************************************************************/
  73926. /*! no static exports found */
  73927. /*! all exports used */
  73928. /***/ (function(module, exports, __webpack_require__) {
  73929. /**
  73930. * Module dependencies.
  73931. */
  73932. var Transport = __webpack_require__(/*! ../transport */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transport.js");
  73933. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  73934. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  73935. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  73936. var yeast = __webpack_require__(/*! yeast */ "./node_modules/yeast/index.js");
  73937. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('engine.io-client:polling');
  73938. /**
  73939. * Module exports.
  73940. */
  73941. module.exports = Polling;
  73942. /**
  73943. * Is XHR2 supported?
  73944. */
  73945. var hasXHR2 = (function () {
  73946. var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/xmlhttprequest.js");
  73947. var xhr = new XMLHttpRequest({ xdomain: false });
  73948. return null != xhr.responseType;
  73949. })();
  73950. /**
  73951. * Polling interface.
  73952. *
  73953. * @param {Object} opts
  73954. * @api private
  73955. */
  73956. function Polling (opts) {
  73957. var forceBase64 = (opts && opts.forceBase64);
  73958. if (!hasXHR2 || forceBase64) {
  73959. this.supportsBinary = false;
  73960. }
  73961. Transport.call(this, opts);
  73962. }
  73963. /**
  73964. * Inherits from Transport.
  73965. */
  73966. inherit(Polling, Transport);
  73967. /**
  73968. * Transport name.
  73969. */
  73970. Polling.prototype.name = 'polling';
  73971. /**
  73972. * Opens the socket (triggers polling). We write a PING message to determine
  73973. * when the transport is open.
  73974. *
  73975. * @api private
  73976. */
  73977. Polling.prototype.doOpen = function () {
  73978. this.poll();
  73979. };
  73980. /**
  73981. * Pauses polling.
  73982. *
  73983. * @param {Function} callback upon buffers are flushed and transport is paused
  73984. * @api private
  73985. */
  73986. Polling.prototype.pause = function (onPause) {
  73987. var self = this;
  73988. this.readyState = 'pausing';
  73989. function pause () {
  73990. debug('paused');
  73991. self.readyState = 'paused';
  73992. onPause();
  73993. }
  73994. if (this.polling || !this.writable) {
  73995. var total = 0;
  73996. if (this.polling) {
  73997. debug('we are currently polling - waiting to pause');
  73998. total++;
  73999. this.once('pollComplete', function () {
  74000. debug('pre-pause polling complete');
  74001. --total || pause();
  74002. });
  74003. }
  74004. if (!this.writable) {
  74005. debug('we are currently writing - waiting to pause');
  74006. total++;
  74007. this.once('drain', function () {
  74008. debug('pre-pause writing complete');
  74009. --total || pause();
  74010. });
  74011. }
  74012. } else {
  74013. pause();
  74014. }
  74015. };
  74016. /**
  74017. * Starts polling cycle.
  74018. *
  74019. * @api public
  74020. */
  74021. Polling.prototype.poll = function () {
  74022. debug('polling');
  74023. this.polling = true;
  74024. this.doPoll();
  74025. this.emit('poll');
  74026. };
  74027. /**
  74028. * Overloads onData to detect payloads.
  74029. *
  74030. * @api private
  74031. */
  74032. Polling.prototype.onData = function (data) {
  74033. var self = this;
  74034. debug('polling got data %s', data);
  74035. var callback = function (packet, index, total) {
  74036. // if its the first message we consider the transport open
  74037. if ('opening' === self.readyState) {
  74038. self.onOpen();
  74039. }
  74040. // if its a close packet, we close the ongoing requests
  74041. if ('close' === packet.type) {
  74042. self.onClose();
  74043. return false;
  74044. }
  74045. // otherwise bypass onData and handle the message
  74046. self.onPacket(packet);
  74047. };
  74048. // decode payload
  74049. parser.decodePayload(data, this.socket.binaryType, callback);
  74050. // if an event did not trigger closing
  74051. if ('closed' !== this.readyState) {
  74052. // if we got data we're not polling
  74053. this.polling = false;
  74054. this.emit('pollComplete');
  74055. if ('open' === this.readyState) {
  74056. this.poll();
  74057. } else {
  74058. debug('ignoring poll - transport state "%s"', this.readyState);
  74059. }
  74060. }
  74061. };
  74062. /**
  74063. * For polling, send a close packet.
  74064. *
  74065. * @api private
  74066. */
  74067. Polling.prototype.doClose = function () {
  74068. var self = this;
  74069. function close () {
  74070. debug('writing close packet');
  74071. self.write([{ type: 'close' }]);
  74072. }
  74073. if ('open' === this.readyState) {
  74074. debug('transport open - closing');
  74075. close();
  74076. } else {
  74077. // in case we're trying to close while
  74078. // handshaking is in progress (GH-164)
  74079. debug('transport not open - deferring close');
  74080. this.once('open', close);
  74081. }
  74082. };
  74083. /**
  74084. * Writes a packets payload.
  74085. *
  74086. * @param {Array} data packets
  74087. * @param {Function} drain callback
  74088. * @api private
  74089. */
  74090. Polling.prototype.write = function (packets) {
  74091. var self = this;
  74092. this.writable = false;
  74093. var callbackfn = function () {
  74094. self.writable = true;
  74095. self.emit('drain');
  74096. };
  74097. parser.encodePayload(packets, this.supportsBinary, function (data) {
  74098. self.doWrite(data, callbackfn);
  74099. });
  74100. };
  74101. /**
  74102. * Generates uri for connection.
  74103. *
  74104. * @api private
  74105. */
  74106. Polling.prototype.uri = function () {
  74107. var query = this.query || {};
  74108. var schema = this.secure ? 'https' : 'http';
  74109. var port = '';
  74110. // cache busting is forced
  74111. if (false !== this.timestampRequests) {
  74112. query[this.timestampParam] = yeast();
  74113. }
  74114. if (!this.supportsBinary && !query.sid) {
  74115. query.b64 = 1;
  74116. }
  74117. query = parseqs.encode(query);
  74118. // avoid port if default for schema
  74119. if (this.port && (('https' === schema && Number(this.port) !== 443) ||
  74120. ('http' === schema && Number(this.port) !== 80))) {
  74121. port = ':' + this.port;
  74122. }
  74123. // prepend ? to query
  74124. if (query.length) {
  74125. query = '?' + query;
  74126. }
  74127. var ipv6 = this.hostname.indexOf(':') !== -1;
  74128. return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
  74129. };
  74130. /***/ }),
  74131. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/websocket.js":
  74132. /*!*************************************************************************************************!*\
  74133. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/websocket.js ***!
  74134. \*************************************************************************************************/
  74135. /*! no static exports found */
  74136. /*! all exports used */
  74137. /***/ (function(module, exports, __webpack_require__) {
  74138. /* WEBPACK VAR INJECTION */(function(Buffer) {/**
  74139. * Module dependencies.
  74140. */
  74141. var Transport = __webpack_require__(/*! ../transport */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/transport.js");
  74142. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  74143. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  74144. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  74145. var yeast = __webpack_require__(/*! yeast */ "./node_modules/yeast/index.js");
  74146. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('engine.io-client:websocket');
  74147. var BrowserWebSocket, NodeWebSocket;
  74148. if (typeof WebSocket !== 'undefined') {
  74149. BrowserWebSocket = WebSocket;
  74150. } else if (typeof self !== 'undefined') {
  74151. BrowserWebSocket = self.WebSocket || self.MozWebSocket;
  74152. }
  74153. if (typeof window === 'undefined') {
  74154. try {
  74155. NodeWebSocket = __webpack_require__(/*! ws */ 1);
  74156. } catch (e) { }
  74157. }
  74158. /**
  74159. * Get either the `WebSocket` or `MozWebSocket` globals
  74160. * in the browser or try to resolve WebSocket-compatible
  74161. * interface exposed by `ws` for Node-like environment.
  74162. */
  74163. var WebSocketImpl = BrowserWebSocket || NodeWebSocket;
  74164. /**
  74165. * Module exports.
  74166. */
  74167. module.exports = WS;
  74168. /**
  74169. * WebSocket transport constructor.
  74170. *
  74171. * @api {Object} connection options
  74172. * @api public
  74173. */
  74174. function WS (opts) {
  74175. var forceBase64 = (opts && opts.forceBase64);
  74176. if (forceBase64) {
  74177. this.supportsBinary = false;
  74178. }
  74179. this.perMessageDeflate = opts.perMessageDeflate;
  74180. this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;
  74181. this.protocols = opts.protocols;
  74182. if (!this.usingBrowserWebSocket) {
  74183. WebSocketImpl = NodeWebSocket;
  74184. }
  74185. Transport.call(this, opts);
  74186. }
  74187. /**
  74188. * Inherits from Transport.
  74189. */
  74190. inherit(WS, Transport);
  74191. /**
  74192. * Transport name.
  74193. *
  74194. * @api public
  74195. */
  74196. WS.prototype.name = 'websocket';
  74197. /*
  74198. * WebSockets support binary
  74199. */
  74200. WS.prototype.supportsBinary = true;
  74201. /**
  74202. * Opens socket.
  74203. *
  74204. * @api private
  74205. */
  74206. WS.prototype.doOpen = function () {
  74207. if (!this.check()) {
  74208. // let probe timeout
  74209. return;
  74210. }
  74211. var uri = this.uri();
  74212. var protocols = this.protocols;
  74213. var opts = {
  74214. agent: this.agent,
  74215. perMessageDeflate: this.perMessageDeflate
  74216. };
  74217. // SSL options for Node.js client
  74218. opts.pfx = this.pfx;
  74219. opts.key = this.key;
  74220. opts.passphrase = this.passphrase;
  74221. opts.cert = this.cert;
  74222. opts.ca = this.ca;
  74223. opts.ciphers = this.ciphers;
  74224. opts.rejectUnauthorized = this.rejectUnauthorized;
  74225. if (this.extraHeaders) {
  74226. opts.headers = this.extraHeaders;
  74227. }
  74228. if (this.localAddress) {
  74229. opts.localAddress = this.localAddress;
  74230. }
  74231. try {
  74232. this.ws =
  74233. this.usingBrowserWebSocket && !this.isReactNative
  74234. ? protocols
  74235. ? new WebSocketImpl(uri, protocols)
  74236. : new WebSocketImpl(uri)
  74237. : new WebSocketImpl(uri, protocols, opts);
  74238. } catch (err) {
  74239. return this.emit('error', err);
  74240. }
  74241. if (this.ws.binaryType === undefined) {
  74242. this.supportsBinary = false;
  74243. }
  74244. if (this.ws.supports && this.ws.supports.binary) {
  74245. this.supportsBinary = true;
  74246. this.ws.binaryType = 'nodebuffer';
  74247. } else {
  74248. this.ws.binaryType = 'arraybuffer';
  74249. }
  74250. this.addEventListeners();
  74251. };
  74252. /**
  74253. * Adds event listeners to the socket
  74254. *
  74255. * @api private
  74256. */
  74257. WS.prototype.addEventListeners = function () {
  74258. var self = this;
  74259. this.ws.onopen = function () {
  74260. self.onOpen();
  74261. };
  74262. this.ws.onclose = function () {
  74263. self.onClose();
  74264. };
  74265. this.ws.onmessage = function (ev) {
  74266. self.onData(ev.data);
  74267. };
  74268. this.ws.onerror = function (e) {
  74269. self.onError('websocket error', e);
  74270. };
  74271. };
  74272. /**
  74273. * Writes data to socket.
  74274. *
  74275. * @param {Array} array of packets.
  74276. * @api private
  74277. */
  74278. WS.prototype.write = function (packets) {
  74279. var self = this;
  74280. this.writable = false;
  74281. // encodePacket efficient as it uses WS framing
  74282. // no need for encodePayload
  74283. var total = packets.length;
  74284. for (var i = 0, l = total; i < l; i++) {
  74285. (function (packet) {
  74286. parser.encodePacket(packet, self.supportsBinary, function (data) {
  74287. if (!self.usingBrowserWebSocket) {
  74288. // always create a new object (GH-437)
  74289. var opts = {};
  74290. if (packet.options) {
  74291. opts.compress = packet.options.compress;
  74292. }
  74293. if (self.perMessageDeflate) {
  74294. var len = 'string' === typeof data ? Buffer.byteLength(data) : data.length;
  74295. if (len < self.perMessageDeflate.threshold) {
  74296. opts.compress = false;
  74297. }
  74298. }
  74299. }
  74300. // Sometimes the websocket has already been closed but the browser didn't
  74301. // have a chance of informing us about it yet, in that case send will
  74302. // throw an error
  74303. try {
  74304. if (self.usingBrowserWebSocket) {
  74305. // TypeError is thrown when passing the second argument on Safari
  74306. self.ws.send(data);
  74307. } else {
  74308. self.ws.send(data, opts);
  74309. }
  74310. } catch (e) {
  74311. debug('websocket closed before onclose event');
  74312. }
  74313. --total || done();
  74314. });
  74315. })(packets[i]);
  74316. }
  74317. function done () {
  74318. self.emit('flush');
  74319. // fake drain
  74320. // defer to next tick to allow Socket to clear writeBuffer
  74321. setTimeout(function () {
  74322. self.writable = true;
  74323. self.emit('drain');
  74324. }, 0);
  74325. }
  74326. };
  74327. /**
  74328. * Called upon close
  74329. *
  74330. * @api private
  74331. */
  74332. WS.prototype.onClose = function () {
  74333. Transport.prototype.onClose.call(this);
  74334. };
  74335. /**
  74336. * Closes socket.
  74337. *
  74338. * @api private
  74339. */
  74340. WS.prototype.doClose = function () {
  74341. if (typeof this.ws !== 'undefined') {
  74342. this.ws.close();
  74343. }
  74344. };
  74345. /**
  74346. * Generates uri for connection.
  74347. *
  74348. * @api private
  74349. */
  74350. WS.prototype.uri = function () {
  74351. var query = this.query || {};
  74352. var schema = this.secure ? 'wss' : 'ws';
  74353. var port = '';
  74354. // avoid port if default for schema
  74355. if (this.port && (('wss' === schema && Number(this.port) !== 443) ||
  74356. ('ws' === schema && Number(this.port) !== 80))) {
  74357. port = ':' + this.port;
  74358. }
  74359. // append timestamp to URI
  74360. if (this.timestampRequests) {
  74361. query[this.timestampParam] = yeast();
  74362. }
  74363. // communicate binary support capabilities
  74364. if (!this.supportsBinary) {
  74365. query.b64 = 1;
  74366. }
  74367. query = parseqs.encode(query);
  74368. // prepend ? to query
  74369. if (query.length) {
  74370. query = '?' + query;
  74371. }
  74372. var ipv6 = this.hostname.indexOf(':') !== -1;
  74373. return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
  74374. };
  74375. /**
  74376. * Feature detection for WebSocket.
  74377. *
  74378. * @return {Boolean} whether this transport is available.
  74379. * @api public
  74380. */
  74381. WS.prototype.check = function () {
  74382. return !!WebSocketImpl && !('__initialize' in WebSocketImpl && this.name === WS.prototype.name);
  74383. };
  74384. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  74385. /***/ }),
  74386. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/xmlhttprequest.js":
  74387. /*!*******************************************************************************************!*\
  74388. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/xmlhttprequest.js ***!
  74389. \*******************************************************************************************/
  74390. /*! no static exports found */
  74391. /*! all exports used */
  74392. /***/ (function(module, exports, __webpack_require__) {
  74393. // browser shim for xmlhttprequest module
  74394. var hasCORS = __webpack_require__(/*! has-cors */ "./node_modules/has-cors/index.js");
  74395. var globalThis = __webpack_require__(/*! ./globalThis */ "./node_modules/socket.io-client/node_modules/engine.io-client/lib/globalThis.browser.js");
  74396. module.exports = function (opts) {
  74397. var xdomain = opts.xdomain;
  74398. // scheme must be same when usign XDomainRequest
  74399. // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
  74400. var xscheme = opts.xscheme;
  74401. // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.
  74402. // https://github.com/Automattic/engine.io-client/pull/217
  74403. var enablesXDR = opts.enablesXDR;
  74404. // XMLHttpRequest can be disabled on IE
  74405. try {
  74406. if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
  74407. return new XMLHttpRequest();
  74408. }
  74409. } catch (e) { }
  74410. // Use XDomainRequest for IE8 if enablesXDR is true
  74411. // because loading bar keeps flashing when using jsonp-polling
  74412. // https://github.com/yujiosaka/socke.io-ie8-loading-example
  74413. try {
  74414. if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {
  74415. return new XDomainRequest();
  74416. }
  74417. } catch (e) { }
  74418. if (!xdomain) {
  74419. try {
  74420. return new globalThis[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');
  74421. } catch (e) { }
  74422. }
  74423. };
  74424. /***/ }),
  74425. /***/ "./node_modules/socket.io-client/node_modules/engine.io-client/node_modules/component-emitter/index.js":
  74426. /*!*************************************************************************************************************!*\
  74427. !*** ./node_modules/socket.io-client/node_modules/engine.io-client/node_modules/component-emitter/index.js ***!
  74428. \*************************************************************************************************************/
  74429. /*! no static exports found */
  74430. /*! all exports used */
  74431. /***/ (function(module, exports, __webpack_require__) {
  74432. /**
  74433. * Expose `Emitter`.
  74434. */
  74435. if (true) {
  74436. module.exports = Emitter;
  74437. }
  74438. /**
  74439. * Initialize a new `Emitter`.
  74440. *
  74441. * @api public
  74442. */
  74443. function Emitter(obj) {
  74444. if (obj) return mixin(obj);
  74445. };
  74446. /**
  74447. * Mixin the emitter properties.
  74448. *
  74449. * @param {Object} obj
  74450. * @return {Object}
  74451. * @api private
  74452. */
  74453. function mixin(obj) {
  74454. for (var key in Emitter.prototype) {
  74455. obj[key] = Emitter.prototype[key];
  74456. }
  74457. return obj;
  74458. }
  74459. /**
  74460. * Listen on the given `event` with `fn`.
  74461. *
  74462. * @param {String} event
  74463. * @param {Function} fn
  74464. * @return {Emitter}
  74465. * @api public
  74466. */
  74467. Emitter.prototype.on =
  74468. Emitter.prototype.addEventListener = function(event, fn){
  74469. this._callbacks = this._callbacks || {};
  74470. (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
  74471. .push(fn);
  74472. return this;
  74473. };
  74474. /**
  74475. * Adds an `event` listener that will be invoked a single
  74476. * time then automatically removed.
  74477. *
  74478. * @param {String} event
  74479. * @param {Function} fn
  74480. * @return {Emitter}
  74481. * @api public
  74482. */
  74483. Emitter.prototype.once = function(event, fn){
  74484. function on() {
  74485. this.off(event, on);
  74486. fn.apply(this, arguments);
  74487. }
  74488. on.fn = fn;
  74489. this.on(event, on);
  74490. return this;
  74491. };
  74492. /**
  74493. * Remove the given callback for `event` or all
  74494. * registered callbacks.
  74495. *
  74496. * @param {String} event
  74497. * @param {Function} fn
  74498. * @return {Emitter}
  74499. * @api public
  74500. */
  74501. Emitter.prototype.off =
  74502. Emitter.prototype.removeListener =
  74503. Emitter.prototype.removeAllListeners =
  74504. Emitter.prototype.removeEventListener = function(event, fn){
  74505. this._callbacks = this._callbacks || {};
  74506. // all
  74507. if (0 == arguments.length) {
  74508. this._callbacks = {};
  74509. return this;
  74510. }
  74511. // specific event
  74512. var callbacks = this._callbacks['$' + event];
  74513. if (!callbacks) return this;
  74514. // remove all handlers
  74515. if (1 == arguments.length) {
  74516. delete this._callbacks['$' + event];
  74517. return this;
  74518. }
  74519. // remove specific handler
  74520. var cb;
  74521. for (var i = 0; i < callbacks.length; i++) {
  74522. cb = callbacks[i];
  74523. if (cb === fn || cb.fn === fn) {
  74524. callbacks.splice(i, 1);
  74525. break;
  74526. }
  74527. }
  74528. // Remove event specific arrays for event types that no
  74529. // one is subscribed for to avoid memory leak.
  74530. if (callbacks.length === 0) {
  74531. delete this._callbacks['$' + event];
  74532. }
  74533. return this;
  74534. };
  74535. /**
  74536. * Emit `event` with the given args.
  74537. *
  74538. * @param {String} event
  74539. * @param {Mixed} ...
  74540. * @return {Emitter}
  74541. */
  74542. Emitter.prototype.emit = function(event){
  74543. this._callbacks = this._callbacks || {};
  74544. var args = new Array(arguments.length - 1)
  74545. , callbacks = this._callbacks['$' + event];
  74546. for (var i = 1; i < arguments.length; i++) {
  74547. args[i - 1] = arguments[i];
  74548. }
  74549. if (callbacks) {
  74550. callbacks = callbacks.slice(0);
  74551. for (var i = 0, len = callbacks.length; i < len; ++i) {
  74552. callbacks[i].apply(this, args);
  74553. }
  74554. }
  74555. return this;
  74556. };
  74557. /**
  74558. * Return array of callbacks for `event`.
  74559. *
  74560. * @param {String} event
  74561. * @return {Array}
  74562. * @api public
  74563. */
  74564. Emitter.prototype.listeners = function(event){
  74565. this._callbacks = this._callbacks || {};
  74566. return this._callbacks['$' + event] || [];
  74567. };
  74568. /**
  74569. * Check if this emitter has `event` handlers.
  74570. *
  74571. * @param {String} event
  74572. * @return {Boolean}
  74573. * @api public
  74574. */
  74575. Emitter.prototype.hasListeners = function(event){
  74576. return !! this.listeners(event).length;
  74577. };
  74578. /***/ }),
  74579. /***/ "./node_modules/socket.io-parser/binary.js":
  74580. /*!*************************************************!*\
  74581. !*** ./node_modules/socket.io-parser/binary.js ***!
  74582. \*************************************************/
  74583. /*! no static exports found */
  74584. /*! all exports used */
  74585. /***/ (function(module, exports, __webpack_require__) {
  74586. /*global Blob,File*/
  74587. /**
  74588. * Module requirements
  74589. */
  74590. var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js");
  74591. var isBuf = __webpack_require__(/*! ./is-buffer */ "./node_modules/socket.io-parser/is-buffer.js");
  74592. var toString = Object.prototype.toString;
  74593. var withNativeBlob = typeof Blob === 'function' || (typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]');
  74594. var withNativeFile = typeof File === 'function' || (typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]');
  74595. /**
  74596. * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.
  74597. * Anything with blobs or files should be fed through removeBlobs before coming
  74598. * here.
  74599. *
  74600. * @param {Object} packet - socket.io event packet
  74601. * @return {Object} with deconstructed packet and list of buffers
  74602. * @api public
  74603. */
  74604. exports.deconstructPacket = function(packet) {
  74605. var buffers = [];
  74606. var packetData = packet.data;
  74607. var pack = packet;
  74608. pack.data = _deconstructPacket(packetData, buffers);
  74609. pack.attachments = buffers.length; // number of binary 'attachments'
  74610. return {packet: pack, buffers: buffers};
  74611. };
  74612. function _deconstructPacket(data, buffers) {
  74613. if (!data) return data;
  74614. if (isBuf(data)) {
  74615. var placeholder = { _placeholder: true, num: buffers.length };
  74616. buffers.push(data);
  74617. return placeholder;
  74618. } else if (isArray(data)) {
  74619. var newData = new Array(data.length);
  74620. for (var i = 0; i < data.length; i++) {
  74621. newData[i] = _deconstructPacket(data[i], buffers);
  74622. }
  74623. return newData;
  74624. } else if (typeof data === 'object' && !(data instanceof Date)) {
  74625. var newData = {};
  74626. for (var key in data) {
  74627. newData[key] = _deconstructPacket(data[key], buffers);
  74628. }
  74629. return newData;
  74630. }
  74631. return data;
  74632. }
  74633. /**
  74634. * Reconstructs a binary packet from its placeholder packet and buffers
  74635. *
  74636. * @param {Object} packet - event packet with placeholders
  74637. * @param {Array} buffers - binary buffers to put in placeholder positions
  74638. * @return {Object} reconstructed packet
  74639. * @api public
  74640. */
  74641. exports.reconstructPacket = function(packet, buffers) {
  74642. packet.data = _reconstructPacket(packet.data, buffers);
  74643. packet.attachments = undefined; // no longer useful
  74644. return packet;
  74645. };
  74646. function _reconstructPacket(data, buffers) {
  74647. if (!data) return data;
  74648. if (data && data._placeholder) {
  74649. return buffers[data.num]; // appropriate buffer (should be natural order anyway)
  74650. } else if (isArray(data)) {
  74651. for (var i = 0; i < data.length; i++) {
  74652. data[i] = _reconstructPacket(data[i], buffers);
  74653. }
  74654. } else if (typeof data === 'object') {
  74655. for (var key in data) {
  74656. data[key] = _reconstructPacket(data[key], buffers);
  74657. }
  74658. }
  74659. return data;
  74660. }
  74661. /**
  74662. * Asynchronously removes Blobs or Files from data via
  74663. * FileReader's readAsArrayBuffer method. Used before encoding
  74664. * data as msgpack. Calls callback with the blobless data.
  74665. *
  74666. * @param {Object} data
  74667. * @param {Function} callback
  74668. * @api private
  74669. */
  74670. exports.removeBlobs = function(data, callback) {
  74671. function _removeBlobs(obj, curKey, containingObject) {
  74672. if (!obj) return obj;
  74673. // convert any blob
  74674. if ((withNativeBlob && obj instanceof Blob) ||
  74675. (withNativeFile && obj instanceof File)) {
  74676. pendingBlobs++;
  74677. // async filereader
  74678. var fileReader = new FileReader();
  74679. fileReader.onload = function() { // this.result == arraybuffer
  74680. if (containingObject) {
  74681. containingObject[curKey] = this.result;
  74682. }
  74683. else {
  74684. bloblessData = this.result;
  74685. }
  74686. // if nothing pending its callback time
  74687. if(! --pendingBlobs) {
  74688. callback(bloblessData);
  74689. }
  74690. };
  74691. fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer
  74692. } else if (isArray(obj)) { // handle array
  74693. for (var i = 0; i < obj.length; i++) {
  74694. _removeBlobs(obj[i], i, obj);
  74695. }
  74696. } else if (typeof obj === 'object' && !isBuf(obj)) { // and object
  74697. for (var key in obj) {
  74698. _removeBlobs(obj[key], key, obj);
  74699. }
  74700. }
  74701. }
  74702. var pendingBlobs = 0;
  74703. var bloblessData = data;
  74704. _removeBlobs(bloblessData);
  74705. if (!pendingBlobs) {
  74706. callback(bloblessData);
  74707. }
  74708. };
  74709. /***/ }),
  74710. /***/ "./node_modules/socket.io-parser/index.js":
  74711. /*!************************************************!*\
  74712. !*** ./node_modules/socket.io-parser/index.js ***!
  74713. \************************************************/
  74714. /*! no static exports found */
  74715. /*! all exports used */
  74716. /***/ (function(module, exports, __webpack_require__) {
  74717. /**
  74718. * Module dependencies.
  74719. */
  74720. var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-parser/node_modules/debug/src/browser.js")('socket.io-parser');
  74721. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
  74722. var binary = __webpack_require__(/*! ./binary */ "./node_modules/socket.io-parser/binary.js");
  74723. var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js");
  74724. var isBuf = __webpack_require__(/*! ./is-buffer */ "./node_modules/socket.io-parser/is-buffer.js");
  74725. /**
  74726. * Protocol version.
  74727. *
  74728. * @api public
  74729. */
  74730. exports.protocol = 4;
  74731. /**
  74732. * Packet types.
  74733. *
  74734. * @api public
  74735. */
  74736. exports.types = [
  74737. 'CONNECT',
  74738. 'DISCONNECT',
  74739. 'EVENT',
  74740. 'ACK',
  74741. 'ERROR',
  74742. 'BINARY_EVENT',
  74743. 'BINARY_ACK'
  74744. ];
  74745. /**
  74746. * Packet type `connect`.
  74747. *
  74748. * @api public
  74749. */
  74750. exports.CONNECT = 0;
  74751. /**
  74752. * Packet type `disconnect`.
  74753. *
  74754. * @api public
  74755. */
  74756. exports.DISCONNECT = 1;
  74757. /**
  74758. * Packet type `event`.
  74759. *
  74760. * @api public
  74761. */
  74762. exports.EVENT = 2;
  74763. /**
  74764. * Packet type `ack`.
  74765. *
  74766. * @api public
  74767. */
  74768. exports.ACK = 3;
  74769. /**
  74770. * Packet type `error`.
  74771. *
  74772. * @api public
  74773. */
  74774. exports.ERROR = 4;
  74775. /**
  74776. * Packet type 'binary event'
  74777. *
  74778. * @api public
  74779. */
  74780. exports.BINARY_EVENT = 5;
  74781. /**
  74782. * Packet type `binary ack`. For acks with binary arguments.
  74783. *
  74784. * @api public
  74785. */
  74786. exports.BINARY_ACK = 6;
  74787. /**
  74788. * Encoder constructor.
  74789. *
  74790. * @api public
  74791. */
  74792. exports.Encoder = Encoder;
  74793. /**
  74794. * Decoder constructor.
  74795. *
  74796. * @api public
  74797. */
  74798. exports.Decoder = Decoder;
  74799. /**
  74800. * A socket.io Encoder instance
  74801. *
  74802. * @api public
  74803. */
  74804. function Encoder() {}
  74805. var ERROR_PACKET = exports.ERROR + '"encode error"';
  74806. /**
  74807. * Encode a packet as a single string if non-binary, or as a
  74808. * buffer sequence, depending on packet type.
  74809. *
  74810. * @param {Object} obj - packet object
  74811. * @param {Function} callback - function to handle encodings (likely engine.write)
  74812. * @return Calls callback with Array of encodings
  74813. * @api public
  74814. */
  74815. Encoder.prototype.encode = function(obj, callback){
  74816. debug('encoding packet %j', obj);
  74817. if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
  74818. encodeAsBinary(obj, callback);
  74819. } else {
  74820. var encoding = encodeAsString(obj);
  74821. callback([encoding]);
  74822. }
  74823. };
  74824. /**
  74825. * Encode packet as string.
  74826. *
  74827. * @param {Object} packet
  74828. * @return {String} encoded
  74829. * @api private
  74830. */
  74831. function encodeAsString(obj) {
  74832. // first is type
  74833. var str = '' + obj.type;
  74834. // attachments if we have them
  74835. if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
  74836. str += obj.attachments + '-';
  74837. }
  74838. // if we have a namespace other than `/`
  74839. // we append it followed by a comma `,`
  74840. if (obj.nsp && '/' !== obj.nsp) {
  74841. str += obj.nsp + ',';
  74842. }
  74843. // immediately followed by the id
  74844. if (null != obj.id) {
  74845. str += obj.id;
  74846. }
  74847. // json data
  74848. if (null != obj.data) {
  74849. var payload = tryStringify(obj.data);
  74850. if (payload !== false) {
  74851. str += payload;
  74852. } else {
  74853. return ERROR_PACKET;
  74854. }
  74855. }
  74856. debug('encoded %j as %s', obj, str);
  74857. return str;
  74858. }
  74859. function tryStringify(str) {
  74860. try {
  74861. return JSON.stringify(str);
  74862. } catch(e){
  74863. return false;
  74864. }
  74865. }
  74866. /**
  74867. * Encode packet as 'buffer sequence' by removing blobs, and
  74868. * deconstructing packet into object with placeholders and
  74869. * a list of buffers.
  74870. *
  74871. * @param {Object} packet
  74872. * @return {Buffer} encoded
  74873. * @api private
  74874. */
  74875. function encodeAsBinary(obj, callback) {
  74876. function writeEncoding(bloblessData) {
  74877. var deconstruction = binary.deconstructPacket(bloblessData);
  74878. var pack = encodeAsString(deconstruction.packet);
  74879. var buffers = deconstruction.buffers;
  74880. buffers.unshift(pack); // add packet info to beginning of data list
  74881. callback(buffers); // write all the buffers
  74882. }
  74883. binary.removeBlobs(obj, writeEncoding);
  74884. }
  74885. /**
  74886. * A socket.io Decoder instance
  74887. *
  74888. * @return {Object} decoder
  74889. * @api public
  74890. */
  74891. function Decoder() {
  74892. this.reconstructor = null;
  74893. }
  74894. /**
  74895. * Mix in `Emitter` with Decoder.
  74896. */
  74897. Emitter(Decoder.prototype);
  74898. /**
  74899. * Decodes an encoded packet string into packet JSON.
  74900. *
  74901. * @param {String} obj - encoded packet
  74902. * @return {Object} packet
  74903. * @api public
  74904. */
  74905. Decoder.prototype.add = function(obj) {
  74906. var packet;
  74907. if (typeof obj === 'string') {
  74908. packet = decodeString(obj);
  74909. if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json
  74910. this.reconstructor = new BinaryReconstructor(packet);
  74911. // no attachments, labeled binary but no binary data to follow
  74912. if (this.reconstructor.reconPack.attachments === 0) {
  74913. this.emit('decoded', packet);
  74914. }
  74915. } else { // non-binary full packet
  74916. this.emit('decoded', packet);
  74917. }
  74918. } else if (isBuf(obj) || obj.base64) { // raw binary data
  74919. if (!this.reconstructor) {
  74920. throw new Error('got binary data when not reconstructing a packet');
  74921. } else {
  74922. packet = this.reconstructor.takeBinaryData(obj);
  74923. if (packet) { // received final buffer
  74924. this.reconstructor = null;
  74925. this.emit('decoded', packet);
  74926. }
  74927. }
  74928. } else {
  74929. throw new Error('Unknown type: ' + obj);
  74930. }
  74931. };
  74932. /**
  74933. * Decode a packet String (JSON data)
  74934. *
  74935. * @param {String} str
  74936. * @return {Object} packet
  74937. * @api private
  74938. */
  74939. function decodeString(str) {
  74940. var i = 0;
  74941. // look up type
  74942. var p = {
  74943. type: Number(str.charAt(0))
  74944. };
  74945. if (null == exports.types[p.type]) {
  74946. return error('unknown packet type ' + p.type);
  74947. }
  74948. // look up attachments if type binary
  74949. if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {
  74950. var buf = '';
  74951. while (str.charAt(++i) !== '-') {
  74952. buf += str.charAt(i);
  74953. if (i == str.length) break;
  74954. }
  74955. if (buf != Number(buf) || str.charAt(i) !== '-') {
  74956. throw new Error('Illegal attachments');
  74957. }
  74958. p.attachments = Number(buf);
  74959. }
  74960. // look up namespace (if any)
  74961. if ('/' === str.charAt(i + 1)) {
  74962. p.nsp = '';
  74963. while (++i) {
  74964. var c = str.charAt(i);
  74965. if (',' === c) break;
  74966. p.nsp += c;
  74967. if (i === str.length) break;
  74968. }
  74969. } else {
  74970. p.nsp = '/';
  74971. }
  74972. // look up id
  74973. var next = str.charAt(i + 1);
  74974. if ('' !== next && Number(next) == next) {
  74975. p.id = '';
  74976. while (++i) {
  74977. var c = str.charAt(i);
  74978. if (null == c || Number(c) != c) {
  74979. --i;
  74980. break;
  74981. }
  74982. p.id += str.charAt(i);
  74983. if (i === str.length) break;
  74984. }
  74985. p.id = Number(p.id);
  74986. }
  74987. // look up json data
  74988. if (str.charAt(++i)) {
  74989. var payload = tryParse(str.substr(i));
  74990. var isPayloadValid = payload !== false && (p.type === exports.ERROR || isArray(payload));
  74991. if (isPayloadValid) {
  74992. p.data = payload;
  74993. } else {
  74994. return error('invalid payload');
  74995. }
  74996. }
  74997. debug('decoded %s as %j', str, p);
  74998. return p;
  74999. }
  75000. function tryParse(str) {
  75001. try {
  75002. return JSON.parse(str);
  75003. } catch(e){
  75004. return false;
  75005. }
  75006. }
  75007. /**
  75008. * Deallocates a parser's resources
  75009. *
  75010. * @api public
  75011. */
  75012. Decoder.prototype.destroy = function() {
  75013. if (this.reconstructor) {
  75014. this.reconstructor.finishedReconstruction();
  75015. }
  75016. };
  75017. /**
  75018. * A manager of a binary event's 'buffer sequence'. Should
  75019. * be constructed whenever a packet of type BINARY_EVENT is
  75020. * decoded.
  75021. *
  75022. * @param {Object} packet
  75023. * @return {BinaryReconstructor} initialized reconstructor
  75024. * @api private
  75025. */
  75026. function BinaryReconstructor(packet) {
  75027. this.reconPack = packet;
  75028. this.buffers = [];
  75029. }
  75030. /**
  75031. * Method to be called when binary data received from connection
  75032. * after a BINARY_EVENT packet.
  75033. *
  75034. * @param {Buffer | ArrayBuffer} binData - the raw binary data received
  75035. * @return {null | Object} returns null if more binary data is expected or
  75036. * a reconstructed packet object if all buffers have been received.
  75037. * @api private
  75038. */
  75039. BinaryReconstructor.prototype.takeBinaryData = function(binData) {
  75040. this.buffers.push(binData);
  75041. if (this.buffers.length === this.reconPack.attachments) { // done with buffer list
  75042. var packet = binary.reconstructPacket(this.reconPack, this.buffers);
  75043. this.finishedReconstruction();
  75044. return packet;
  75045. }
  75046. return null;
  75047. };
  75048. /**
  75049. * Cleans up binary packet reconstruction variables.
  75050. *
  75051. * @api private
  75052. */
  75053. BinaryReconstructor.prototype.finishedReconstruction = function() {
  75054. this.reconPack = null;
  75055. this.buffers = [];
  75056. };
  75057. function error(msg) {
  75058. return {
  75059. type: exports.ERROR,
  75060. data: 'parser error: ' + msg
  75061. };
  75062. }
  75063. /***/ }),
  75064. /***/ "./node_modules/socket.io-parser/is-buffer.js":
  75065. /*!****************************************************!*\
  75066. !*** ./node_modules/socket.io-parser/is-buffer.js ***!
  75067. \****************************************************/
  75068. /*! no static exports found */
  75069. /*! all exports used */
  75070. /***/ (function(module, exports, __webpack_require__) {
  75071. /* WEBPACK VAR INJECTION */(function(Buffer) {
  75072. module.exports = isBuf;
  75073. var withNativeBuffer = typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function';
  75074. var withNativeArrayBuffer = typeof ArrayBuffer === 'function';
  75075. var isView = function (obj) {
  75076. return typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView(obj) : (obj.buffer instanceof ArrayBuffer);
  75077. };
  75078. /**
  75079. * Returns true if obj is a buffer or an arraybuffer.
  75080. *
  75081. * @api private
  75082. */
  75083. function isBuf(obj) {
  75084. return (withNativeBuffer && Buffer.isBuffer(obj)) ||
  75085. (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));
  75086. }
  75087. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  75088. /***/ }),
  75089. /***/ "./node_modules/socket.io-parser/node_modules/debug/src/browser.js":
  75090. /*!*************************************************************************!*\
  75091. !*** ./node_modules/socket.io-parser/node_modules/debug/src/browser.js ***!
  75092. \*************************************************************************/
  75093. /*! no static exports found */
  75094. /*! all exports used */
  75095. /***/ (function(module, exports, __webpack_require__) {
  75096. /* WEBPACK VAR INJECTION */(function(process) {/**
  75097. * This is the web browser implementation of `debug()`.
  75098. *
  75099. * Expose `debug()` as the module.
  75100. */
  75101. exports = module.exports = __webpack_require__(/*! ./debug */ "./node_modules/socket.io-parser/node_modules/debug/src/debug.js");
  75102. exports.log = log;
  75103. exports.formatArgs = formatArgs;
  75104. exports.save = save;
  75105. exports.load = load;
  75106. exports.useColors = useColors;
  75107. exports.storage = 'undefined' != typeof chrome
  75108. && 'undefined' != typeof chrome.storage
  75109. ? chrome.storage.local
  75110. : localstorage();
  75111. /**
  75112. * Colors.
  75113. */
  75114. exports.colors = [
  75115. '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
  75116. '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
  75117. '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
  75118. '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
  75119. '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
  75120. '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
  75121. '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
  75122. '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
  75123. '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
  75124. '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
  75125. '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
  75126. ];
  75127. /**
  75128. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  75129. * and the Firebug extension (any Firefox version) are known
  75130. * to support "%c" CSS customizations.
  75131. *
  75132. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  75133. */
  75134. function useColors() {
  75135. // NB: In an Electron preload script, document will be defined but not fully
  75136. // initialized. Since we know we're in Chrome, we'll just detect this case
  75137. // explicitly
  75138. if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
  75139. return true;
  75140. }
  75141. // Internet Explorer and Edge do not support colors.
  75142. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  75143. return false;
  75144. }
  75145. // is webkit? http://stackoverflow.com/a/16459606/376773
  75146. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  75147. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  75148. // is firebug? http://stackoverflow.com/a/398120/376773
  75149. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  75150. // is firefox >= v31?
  75151. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  75152. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  75153. // double check webkit in userAgent just in case we are in a worker
  75154. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  75155. }
  75156. /**
  75157. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  75158. */
  75159. exports.formatters.j = function(v) {
  75160. try {
  75161. return JSON.stringify(v);
  75162. } catch (err) {
  75163. return '[UnexpectedJSONParseError]: ' + err.message;
  75164. }
  75165. };
  75166. /**
  75167. * Colorize log arguments if enabled.
  75168. *
  75169. * @api public
  75170. */
  75171. function formatArgs(args) {
  75172. var useColors = this.useColors;
  75173. args[0] = (useColors ? '%c' : '')
  75174. + this.namespace
  75175. + (useColors ? ' %c' : ' ')
  75176. + args[0]
  75177. + (useColors ? '%c ' : ' ')
  75178. + '+' + exports.humanize(this.diff);
  75179. if (!useColors) return;
  75180. var c = 'color: ' + this.color;
  75181. args.splice(1, 0, c, 'color: inherit')
  75182. // the final "%c" is somewhat tricky, because there could be other
  75183. // arguments passed either before or after the %c, so we need to
  75184. // figure out the correct index to insert the CSS into
  75185. var index = 0;
  75186. var lastC = 0;
  75187. args[0].replace(/%[a-zA-Z%]/g, function(match) {
  75188. if ('%%' === match) return;
  75189. index++;
  75190. if ('%c' === match) {
  75191. // we only are interested in the *last* %c
  75192. // (the user may have provided their own)
  75193. lastC = index;
  75194. }
  75195. });
  75196. args.splice(lastC, 0, c);
  75197. }
  75198. /**
  75199. * Invokes `console.log()` when available.
  75200. * No-op when `console.log` is not a "function".
  75201. *
  75202. * @api public
  75203. */
  75204. function log() {
  75205. // this hackery is required for IE8/9, where
  75206. // the `console.log` function doesn't have 'apply'
  75207. return 'object' === typeof console
  75208. && console.log
  75209. && Function.prototype.apply.call(console.log, console, arguments);
  75210. }
  75211. /**
  75212. * Save `namespaces`.
  75213. *
  75214. * @param {String} namespaces
  75215. * @api private
  75216. */
  75217. function save(namespaces) {
  75218. try {
  75219. if (null == namespaces) {
  75220. exports.storage.removeItem('debug');
  75221. } else {
  75222. exports.storage.debug = namespaces;
  75223. }
  75224. } catch(e) {}
  75225. }
  75226. /**
  75227. * Load `namespaces`.
  75228. *
  75229. * @return {String} returns the previously persisted debug modes
  75230. * @api private
  75231. */
  75232. function load() {
  75233. var r;
  75234. try {
  75235. r = exports.storage.debug;
  75236. } catch(e) {}
  75237. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  75238. if (!r && typeof process !== 'undefined' && 'env' in process) {
  75239. r = process.env.DEBUG;
  75240. }
  75241. return r;
  75242. }
  75243. /**
  75244. * Enable namespaces listed in `localStorage.debug` initially.
  75245. */
  75246. exports.enable(load());
  75247. /**
  75248. * Localstorage attempts to return the localstorage.
  75249. *
  75250. * This is necessary because safari throws
  75251. * when a user disables cookies/localstorage
  75252. * and you attempt to access it.
  75253. *
  75254. * @return {LocalStorage}
  75255. * @api private
  75256. */
  75257. function localstorage() {
  75258. try {
  75259. return window.localStorage;
  75260. } catch (e) {}
  75261. }
  75262. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js")))
  75263. /***/ }),
  75264. /***/ "./node_modules/socket.io-parser/node_modules/debug/src/debug.js":
  75265. /*!***********************************************************************!*\
  75266. !*** ./node_modules/socket.io-parser/node_modules/debug/src/debug.js ***!
  75267. \***********************************************************************/
  75268. /*! no static exports found */
  75269. /*! all exports used */
  75270. /***/ (function(module, exports, __webpack_require__) {
  75271. /**
  75272. * This is the common logic for both the Node.js and web browser
  75273. * implementations of `debug()`.
  75274. *
  75275. * Expose `debug()` as the module.
  75276. */
  75277. exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
  75278. exports.coerce = coerce;
  75279. exports.disable = disable;
  75280. exports.enable = enable;
  75281. exports.enabled = enabled;
  75282. exports.humanize = __webpack_require__(/*! ms */ "./node_modules/socket.io-parser/node_modules/ms/index.js");
  75283. /**
  75284. * Active `debug` instances.
  75285. */
  75286. exports.instances = [];
  75287. /**
  75288. * The currently active debug mode names, and names to skip.
  75289. */
  75290. exports.names = [];
  75291. exports.skips = [];
  75292. /**
  75293. * Map of special "%n" handling functions, for the debug "format" argument.
  75294. *
  75295. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  75296. */
  75297. exports.formatters = {};
  75298. /**
  75299. * Select a color.
  75300. * @param {String} namespace
  75301. * @return {Number}
  75302. * @api private
  75303. */
  75304. function selectColor(namespace) {
  75305. var hash = 0, i;
  75306. for (i in namespace) {
  75307. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  75308. hash |= 0; // Convert to 32bit integer
  75309. }
  75310. return exports.colors[Math.abs(hash) % exports.colors.length];
  75311. }
  75312. /**
  75313. * Create a debugger with the given `namespace`.
  75314. *
  75315. * @param {String} namespace
  75316. * @return {Function}
  75317. * @api public
  75318. */
  75319. function createDebug(namespace) {
  75320. var prevTime;
  75321. function debug() {
  75322. // disabled?
  75323. if (!debug.enabled) return;
  75324. var self = debug;
  75325. // set `diff` timestamp
  75326. var curr = +new Date();
  75327. var ms = curr - (prevTime || curr);
  75328. self.diff = ms;
  75329. self.prev = prevTime;
  75330. self.curr = curr;
  75331. prevTime = curr;
  75332. // turn the `arguments` into a proper Array
  75333. var args = new Array(arguments.length);
  75334. for (var i = 0; i < args.length; i++) {
  75335. args[i] = arguments[i];
  75336. }
  75337. args[0] = exports.coerce(args[0]);
  75338. if ('string' !== typeof args[0]) {
  75339. // anything else let's inspect with %O
  75340. args.unshift('%O');
  75341. }
  75342. // apply any `formatters` transformations
  75343. var index = 0;
  75344. args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
  75345. // if we encounter an escaped % then don't increase the array index
  75346. if (match === '%%') return match;
  75347. index++;
  75348. var formatter = exports.formatters[format];
  75349. if ('function' === typeof formatter) {
  75350. var val = args[index];
  75351. match = formatter.call(self, val);
  75352. // now we need to remove `args[index]` since it's inlined in the `format`
  75353. args.splice(index, 1);
  75354. index--;
  75355. }
  75356. return match;
  75357. });
  75358. // apply env-specific formatting (colors, etc.)
  75359. exports.formatArgs.call(self, args);
  75360. var logFn = debug.log || exports.log || console.log.bind(console);
  75361. logFn.apply(self, args);
  75362. }
  75363. debug.namespace = namespace;
  75364. debug.enabled = exports.enabled(namespace);
  75365. debug.useColors = exports.useColors();
  75366. debug.color = selectColor(namespace);
  75367. debug.destroy = destroy;
  75368. // env-specific initialization logic for debug instances
  75369. if ('function' === typeof exports.init) {
  75370. exports.init(debug);
  75371. }
  75372. exports.instances.push(debug);
  75373. return debug;
  75374. }
  75375. function destroy () {
  75376. var index = exports.instances.indexOf(this);
  75377. if (index !== -1) {
  75378. exports.instances.splice(index, 1);
  75379. return true;
  75380. } else {
  75381. return false;
  75382. }
  75383. }
  75384. /**
  75385. * Enables a debug mode by namespaces. This can include modes
  75386. * separated by a colon and wildcards.
  75387. *
  75388. * @param {String} namespaces
  75389. * @api public
  75390. */
  75391. function enable(namespaces) {
  75392. exports.save(namespaces);
  75393. exports.names = [];
  75394. exports.skips = [];
  75395. var i;
  75396. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  75397. var len = split.length;
  75398. for (i = 0; i < len; i++) {
  75399. if (!split[i]) continue; // ignore empty strings
  75400. namespaces = split[i].replace(/\*/g, '.*?');
  75401. if (namespaces[0] === '-') {
  75402. exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  75403. } else {
  75404. exports.names.push(new RegExp('^' + namespaces + '$'));
  75405. }
  75406. }
  75407. for (i = 0; i < exports.instances.length; i++) {
  75408. var instance = exports.instances[i];
  75409. instance.enabled = exports.enabled(instance.namespace);
  75410. }
  75411. }
  75412. /**
  75413. * Disable debug output.
  75414. *
  75415. * @api public
  75416. */
  75417. function disable() {
  75418. exports.enable('');
  75419. }
  75420. /**
  75421. * Returns true if the given mode name is enabled, false otherwise.
  75422. *
  75423. * @param {String} name
  75424. * @return {Boolean}
  75425. * @api public
  75426. */
  75427. function enabled(name) {
  75428. if (name[name.length - 1] === '*') {
  75429. return true;
  75430. }
  75431. var i, len;
  75432. for (i = 0, len = exports.skips.length; i < len; i++) {
  75433. if (exports.skips[i].test(name)) {
  75434. return false;
  75435. }
  75436. }
  75437. for (i = 0, len = exports.names.length; i < len; i++) {
  75438. if (exports.names[i].test(name)) {
  75439. return true;
  75440. }
  75441. }
  75442. return false;
  75443. }
  75444. /**
  75445. * Coerce `val`.
  75446. *
  75447. * @param {Mixed} val
  75448. * @return {Mixed}
  75449. * @api private
  75450. */
  75451. function coerce(val) {
  75452. if (val instanceof Error) return val.stack || val.message;
  75453. return val;
  75454. }
  75455. /***/ }),
  75456. /***/ "./node_modules/socket.io-parser/node_modules/ms/index.js":
  75457. /*!****************************************************************!*\
  75458. !*** ./node_modules/socket.io-parser/node_modules/ms/index.js ***!
  75459. \****************************************************************/
  75460. /*! no static exports found */
  75461. /*! all exports used */
  75462. /***/ (function(module, exports) {
  75463. /**
  75464. * Helpers.
  75465. */
  75466. var s = 1000;
  75467. var m = s * 60;
  75468. var h = m * 60;
  75469. var d = h * 24;
  75470. var y = d * 365.25;
  75471. /**
  75472. * Parse or format the given `val`.
  75473. *
  75474. * Options:
  75475. *
  75476. * - `long` verbose formatting [false]
  75477. *
  75478. * @param {String|Number} val
  75479. * @param {Object} [options]
  75480. * @throws {Error} throw an error if val is not a non-empty string or a number
  75481. * @return {String|Number}
  75482. * @api public
  75483. */
  75484. module.exports = function(val, options) {
  75485. options = options || {};
  75486. var type = typeof val;
  75487. if (type === 'string' && val.length > 0) {
  75488. return parse(val);
  75489. } else if (type === 'number' && isNaN(val) === false) {
  75490. return options.long ? fmtLong(val) : fmtShort(val);
  75491. }
  75492. throw new Error(
  75493. 'val is not a non-empty string or a valid number. val=' +
  75494. JSON.stringify(val)
  75495. );
  75496. };
  75497. /**
  75498. * Parse the given `str` and return milliseconds.
  75499. *
  75500. * @param {String} str
  75501. * @return {Number}
  75502. * @api private
  75503. */
  75504. function parse(str) {
  75505. str = String(str);
  75506. if (str.length > 100) {
  75507. return;
  75508. }
  75509. var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
  75510. str
  75511. );
  75512. if (!match) {
  75513. return;
  75514. }
  75515. var n = parseFloat(match[1]);
  75516. var type = (match[2] || 'ms').toLowerCase();
  75517. switch (type) {
  75518. case 'years':
  75519. case 'year':
  75520. case 'yrs':
  75521. case 'yr':
  75522. case 'y':
  75523. return n * y;
  75524. case 'days':
  75525. case 'day':
  75526. case 'd':
  75527. return n * d;
  75528. case 'hours':
  75529. case 'hour':
  75530. case 'hrs':
  75531. case 'hr':
  75532. case 'h':
  75533. return n * h;
  75534. case 'minutes':
  75535. case 'minute':
  75536. case 'mins':
  75537. case 'min':
  75538. case 'm':
  75539. return n * m;
  75540. case 'seconds':
  75541. case 'second':
  75542. case 'secs':
  75543. case 'sec':
  75544. case 's':
  75545. return n * s;
  75546. case 'milliseconds':
  75547. case 'millisecond':
  75548. case 'msecs':
  75549. case 'msec':
  75550. case 'ms':
  75551. return n;
  75552. default:
  75553. return undefined;
  75554. }
  75555. }
  75556. /**
  75557. * Short format for `ms`.
  75558. *
  75559. * @param {Number} ms
  75560. * @return {String}
  75561. * @api private
  75562. */
  75563. function fmtShort(ms) {
  75564. if (ms >= d) {
  75565. return Math.round(ms / d) + 'd';
  75566. }
  75567. if (ms >= h) {
  75568. return Math.round(ms / h) + 'h';
  75569. }
  75570. if (ms >= m) {
  75571. return Math.round(ms / m) + 'm';
  75572. }
  75573. if (ms >= s) {
  75574. return Math.round(ms / s) + 's';
  75575. }
  75576. return ms + 'ms';
  75577. }
  75578. /**
  75579. * Long format for `ms`.
  75580. *
  75581. * @param {Number} ms
  75582. * @return {String}
  75583. * @api private
  75584. */
  75585. function fmtLong(ms) {
  75586. return plural(ms, d, 'day') ||
  75587. plural(ms, h, 'hour') ||
  75588. plural(ms, m, 'minute') ||
  75589. plural(ms, s, 'second') ||
  75590. ms + ' ms';
  75591. }
  75592. /**
  75593. * Pluralization helper.
  75594. */
  75595. function plural(ms, n, name) {
  75596. if (ms < n) {
  75597. return;
  75598. }
  75599. if (ms < n * 1.5) {
  75600. return Math.floor(ms / n) + ' ' + name;
  75601. }
  75602. return Math.ceil(ms / n) + ' ' + name + 's';
  75603. }
  75604. /***/ }),
  75605. /***/ "./node_modules/style-loader/lib/addStyles.js":
  75606. /*!****************************************************!*\
  75607. !*** ./node_modules/style-loader/lib/addStyles.js ***!
  75608. \****************************************************/
  75609. /*! no static exports found */
  75610. /*! all exports used */
  75611. /***/ (function(module, exports, __webpack_require__) {
  75612. /*
  75613. MIT License http://www.opensource.org/licenses/mit-license.php
  75614. Author Tobias Koppers @sokra
  75615. */
  75616. var stylesInDom = {};
  75617. var memoize = function (fn) {
  75618. var memo;
  75619. return function () {
  75620. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  75621. return memo;
  75622. };
  75623. };
  75624. var isOldIE = memoize(function () {
  75625. // Test for IE <= 9 as proposed by Browserhacks
  75626. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  75627. // Tests for existence of standard globals is to allow style-loader
  75628. // to operate correctly into non-standard environments
  75629. // @see https://github.com/webpack-contrib/style-loader/issues/177
  75630. return window && document && document.all && !window.atob;
  75631. });
  75632. var getTarget = function (target, parent) {
  75633. if (parent){
  75634. return parent.querySelector(target);
  75635. }
  75636. return document.querySelector(target);
  75637. };
  75638. var getElement = (function (fn) {
  75639. var memo = {};
  75640. return function(target, parent) {
  75641. // If passing function in options, then use it for resolve "head" element.
  75642. // Useful for Shadow Root style i.e
  75643. // {
  75644. // insertInto: function () { return document.querySelector("#foo").shadowRoot }
  75645. // }
  75646. if (typeof target === 'function') {
  75647. return target();
  75648. }
  75649. if (typeof memo[target] === "undefined") {
  75650. var styleTarget = getTarget.call(this, target, parent);
  75651. // Special case to return head of iframe instead of iframe itself
  75652. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  75653. try {
  75654. // This will throw an exception if access to iframe is blocked
  75655. // due to cross-origin restrictions
  75656. styleTarget = styleTarget.contentDocument.head;
  75657. } catch(e) {
  75658. styleTarget = null;
  75659. }
  75660. }
  75661. memo[target] = styleTarget;
  75662. }
  75663. return memo[target]
  75664. };
  75665. })();
  75666. var singleton = null;
  75667. var singletonCounter = 0;
  75668. var stylesInsertedAtTop = [];
  75669. var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js");
  75670. module.exports = function(list, options) {
  75671. if (typeof DEBUG !== "undefined" && DEBUG) {
  75672. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  75673. }
  75674. options = options || {};
  75675. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  75676. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  75677. // tags it will allow on a page
  75678. if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
  75679. // By default, add <style> tags to the <head> element
  75680. if (!options.insertInto) options.insertInto = "head";
  75681. // By default, add <style> tags to the bottom of the target
  75682. if (!options.insertAt) options.insertAt = "bottom";
  75683. var styles = listToStyles(list, options);
  75684. addStylesToDom(styles, options);
  75685. return function update (newList) {
  75686. var mayRemove = [];
  75687. for (var i = 0; i < styles.length; i++) {
  75688. var item = styles[i];
  75689. var domStyle = stylesInDom[item.id];
  75690. domStyle.refs--;
  75691. mayRemove.push(domStyle);
  75692. }
  75693. if(newList) {
  75694. var newStyles = listToStyles(newList, options);
  75695. addStylesToDom(newStyles, options);
  75696. }
  75697. for (var i = 0; i < mayRemove.length; i++) {
  75698. var domStyle = mayRemove[i];
  75699. if(domStyle.refs === 0) {
  75700. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  75701. delete stylesInDom[domStyle.id];
  75702. }
  75703. }
  75704. };
  75705. };
  75706. function addStylesToDom (styles, options) {
  75707. for (var i = 0; i < styles.length; i++) {
  75708. var item = styles[i];
  75709. var domStyle = stylesInDom[item.id];
  75710. if(domStyle) {
  75711. domStyle.refs++;
  75712. for(var j = 0; j < domStyle.parts.length; j++) {
  75713. domStyle.parts[j](item.parts[j]);
  75714. }
  75715. for(; j < item.parts.length; j++) {
  75716. domStyle.parts.push(addStyle(item.parts[j], options));
  75717. }
  75718. } else {
  75719. var parts = [];
  75720. for(var j = 0; j < item.parts.length; j++) {
  75721. parts.push(addStyle(item.parts[j], options));
  75722. }
  75723. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  75724. }
  75725. }
  75726. }
  75727. function listToStyles (list, options) {
  75728. var styles = [];
  75729. var newStyles = {};
  75730. for (var i = 0; i < list.length; i++) {
  75731. var item = list[i];
  75732. var id = options.base ? item[0] + options.base : item[0];
  75733. var css = item[1];
  75734. var media = item[2];
  75735. var sourceMap = item[3];
  75736. var part = {css: css, media: media, sourceMap: sourceMap};
  75737. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  75738. else newStyles[id].parts.push(part);
  75739. }
  75740. return styles;
  75741. }
  75742. function insertStyleElement (options, style) {
  75743. var target = getElement(options.insertInto)
  75744. if (!target) {
  75745. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  75746. }
  75747. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  75748. if (options.insertAt === "top") {
  75749. if (!lastStyleElementInsertedAtTop) {
  75750. target.insertBefore(style, target.firstChild);
  75751. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  75752. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  75753. } else {
  75754. target.appendChild(style);
  75755. }
  75756. stylesInsertedAtTop.push(style);
  75757. } else if (options.insertAt === "bottom") {
  75758. target.appendChild(style);
  75759. } else if (typeof options.insertAt === "object" && options.insertAt.before) {
  75760. var nextSibling = getElement(options.insertAt.before, target);
  75761. target.insertBefore(style, nextSibling);
  75762. } else {
  75763. throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
  75764. }
  75765. }
  75766. function removeStyleElement (style) {
  75767. if (style.parentNode === null) return false;
  75768. style.parentNode.removeChild(style);
  75769. var idx = stylesInsertedAtTop.indexOf(style);
  75770. if(idx >= 0) {
  75771. stylesInsertedAtTop.splice(idx, 1);
  75772. }
  75773. }
  75774. function createStyleElement (options) {
  75775. var style = document.createElement("style");
  75776. if(options.attrs.type === undefined) {
  75777. options.attrs.type = "text/css";
  75778. }
  75779. if(options.attrs.nonce === undefined) {
  75780. var nonce = getNonce();
  75781. if (nonce) {
  75782. options.attrs.nonce = nonce;
  75783. }
  75784. }
  75785. addAttrs(style, options.attrs);
  75786. insertStyleElement(options, style);
  75787. return style;
  75788. }
  75789. function createLinkElement (options) {
  75790. var link = document.createElement("link");
  75791. if(options.attrs.type === undefined) {
  75792. options.attrs.type = "text/css";
  75793. }
  75794. options.attrs.rel = "stylesheet";
  75795. addAttrs(link, options.attrs);
  75796. insertStyleElement(options, link);
  75797. return link;
  75798. }
  75799. function addAttrs (el, attrs) {
  75800. Object.keys(attrs).forEach(function (key) {
  75801. el.setAttribute(key, attrs[key]);
  75802. });
  75803. }
  75804. function getNonce() {
  75805. if (false) {}
  75806. return __webpack_require__.nc;
  75807. }
  75808. function addStyle (obj, options) {
  75809. var style, update, remove, result;
  75810. // If a transform function was defined, run it on the css
  75811. if (options.transform && obj.css) {
  75812. result = typeof options.transform === 'function'
  75813. ? options.transform(obj.css)
  75814. : options.transform.default(obj.css);
  75815. if (result) {
  75816. // If transform returns a value, use that instead of the original css.
  75817. // This allows running runtime transformations on the css.
  75818. obj.css = result;
  75819. } else {
  75820. // If the transform function returns a falsy value, don't add this css.
  75821. // This allows conditional loading of css
  75822. return function() {
  75823. // noop
  75824. };
  75825. }
  75826. }
  75827. if (options.singleton) {
  75828. var styleIndex = singletonCounter++;
  75829. style = singleton || (singleton = createStyleElement(options));
  75830. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  75831. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  75832. } else if (
  75833. obj.sourceMap &&
  75834. typeof URL === "function" &&
  75835. typeof URL.createObjectURL === "function" &&
  75836. typeof URL.revokeObjectURL === "function" &&
  75837. typeof Blob === "function" &&
  75838. typeof btoa === "function"
  75839. ) {
  75840. style = createLinkElement(options);
  75841. update = updateLink.bind(null, style, options);
  75842. remove = function () {
  75843. removeStyleElement(style);
  75844. if(style.href) URL.revokeObjectURL(style.href);
  75845. };
  75846. } else {
  75847. style = createStyleElement(options);
  75848. update = applyToTag.bind(null, style);
  75849. remove = function () {
  75850. removeStyleElement(style);
  75851. };
  75852. }
  75853. update(obj);
  75854. return function updateStyle (newObj) {
  75855. if (newObj) {
  75856. if (
  75857. newObj.css === obj.css &&
  75858. newObj.media === obj.media &&
  75859. newObj.sourceMap === obj.sourceMap
  75860. ) {
  75861. return;
  75862. }
  75863. update(obj = newObj);
  75864. } else {
  75865. remove();
  75866. }
  75867. };
  75868. }
  75869. var replaceText = (function () {
  75870. var textStore = [];
  75871. return function (index, replacement) {
  75872. textStore[index] = replacement;
  75873. return textStore.filter(Boolean).join('\n');
  75874. };
  75875. })();
  75876. function applyToSingletonTag (style, index, remove, obj) {
  75877. var css = remove ? "" : obj.css;
  75878. if (style.styleSheet) {
  75879. style.styleSheet.cssText = replaceText(index, css);
  75880. } else {
  75881. var cssNode = document.createTextNode(css);
  75882. var childNodes = style.childNodes;
  75883. if (childNodes[index]) style.removeChild(childNodes[index]);
  75884. if (childNodes.length) {
  75885. style.insertBefore(cssNode, childNodes[index]);
  75886. } else {
  75887. style.appendChild(cssNode);
  75888. }
  75889. }
  75890. }
  75891. function applyToTag (style, obj) {
  75892. var css = obj.css;
  75893. var media = obj.media;
  75894. if(media) {
  75895. style.setAttribute("media", media)
  75896. }
  75897. if(style.styleSheet) {
  75898. style.styleSheet.cssText = css;
  75899. } else {
  75900. while(style.firstChild) {
  75901. style.removeChild(style.firstChild);
  75902. }
  75903. style.appendChild(document.createTextNode(css));
  75904. }
  75905. }
  75906. function updateLink (link, options, obj) {
  75907. var css = obj.css;
  75908. var sourceMap = obj.sourceMap;
  75909. /*
  75910. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  75911. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  75912. on by default. Otherwise default to the convertToAbsoluteUrls option
  75913. directly
  75914. */
  75915. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  75916. if (options.convertToAbsoluteUrls || autoFixUrls) {
  75917. css = fixUrls(css);
  75918. }
  75919. if (sourceMap) {
  75920. // http://stackoverflow.com/a/26603875
  75921. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  75922. }
  75923. var blob = new Blob([css], { type: "text/css" });
  75924. var oldSrc = link.href;
  75925. link.href = URL.createObjectURL(blob);
  75926. if(oldSrc) URL.revokeObjectURL(oldSrc);
  75927. }
  75928. /***/ }),
  75929. /***/ "./node_modules/style-loader/lib/urls.js":
  75930. /*!***********************************************!*\
  75931. !*** ./node_modules/style-loader/lib/urls.js ***!
  75932. \***********************************************/
  75933. /*! no static exports found */
  75934. /*! all exports used */
  75935. /***/ (function(module, exports) {
  75936. /**
  75937. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  75938. * embed the css on the page. This breaks all relative urls because now they are relative to a
  75939. * bundle instead of the current page.
  75940. *
  75941. * One solution is to only use full urls, but that may be impossible.
  75942. *
  75943. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  75944. *
  75945. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  75946. *
  75947. */
  75948. module.exports = function (css) {
  75949. // get current location
  75950. var location = typeof window !== "undefined" && window.location;
  75951. if (!location) {
  75952. throw new Error("fixUrls requires window.location");
  75953. }
  75954. // blank or null?
  75955. if (!css || typeof css !== "string") {
  75956. return css;
  75957. }
  75958. var baseUrl = location.protocol + "//" + location.host;
  75959. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  75960. // convert each url(...)
  75961. /*
  75962. This regular expression is just a way to recursively match brackets within
  75963. a string.
  75964. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  75965. ( = Start a capturing group
  75966. (?: = Start a non-capturing group
  75967. [^)(] = Match anything that isn't a parentheses
  75968. | = OR
  75969. \( = Match a start parentheses
  75970. (?: = Start another non-capturing groups
  75971. [^)(]+ = Match anything that isn't a parentheses
  75972. | = OR
  75973. \( = Match a start parentheses
  75974. [^)(]* = Match anything that isn't a parentheses
  75975. \) = Match a end parentheses
  75976. ) = End Group
  75977. *\) = Match anything and then a close parens
  75978. ) = Close non-capturing group
  75979. * = Match anything
  75980. ) = Close capturing group
  75981. \) = Match a close parens
  75982. /gi = Get all matches, not the first. Be case insensitive.
  75983. */
  75984. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  75985. // strip quotes (if they exist)
  75986. var unquotedOrigUrl = origUrl
  75987. .trim()
  75988. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  75989. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  75990. // already a full url? no change
  75991. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
  75992. return fullMatch;
  75993. }
  75994. // convert the url to a full url
  75995. var newUrl;
  75996. if (unquotedOrigUrl.indexOf("//") === 0) {
  75997. //TODO: should we add protocol?
  75998. newUrl = unquotedOrigUrl;
  75999. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  76000. // path should be relative to the base url
  76001. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  76002. } else {
  76003. // path should be relative to current directory
  76004. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  76005. }
  76006. // send back the fixed url(...)
  76007. return "url(" + JSON.stringify(newUrl) + ")";
  76008. });
  76009. // send back the fixed css
  76010. return fixedCss;
  76011. };
  76012. /***/ }),
  76013. /***/ "./node_modules/timers-browserify/main.js":
  76014. /*!************************************************!*\
  76015. !*** ./node_modules/timers-browserify/main.js ***!
  76016. \************************************************/
  76017. /*! no static exports found */
  76018. /*! all exports used */
  76019. /***/ (function(module, exports, __webpack_require__) {
  76020. /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
  76021. (typeof self !== "undefined" && self) ||
  76022. window;
  76023. var apply = Function.prototype.apply;
  76024. // DOM APIs, for completeness
  76025. exports.setTimeout = function() {
  76026. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  76027. };
  76028. exports.setInterval = function() {
  76029. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  76030. };
  76031. exports.clearTimeout =
  76032. exports.clearInterval = function(timeout) {
  76033. if (timeout) {
  76034. timeout.close();
  76035. }
  76036. };
  76037. function Timeout(id, clearFn) {
  76038. this._id = id;
  76039. this._clearFn = clearFn;
  76040. }
  76041. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  76042. Timeout.prototype.close = function() {
  76043. this._clearFn.call(scope, this._id);
  76044. };
  76045. // Does not start the time, just sets up the members needed.
  76046. exports.enroll = function(item, msecs) {
  76047. clearTimeout(item._idleTimeoutId);
  76048. item._idleTimeout = msecs;
  76049. };
  76050. exports.unenroll = function(item) {
  76051. clearTimeout(item._idleTimeoutId);
  76052. item._idleTimeout = -1;
  76053. };
  76054. exports._unrefActive = exports.active = function(item) {
  76055. clearTimeout(item._idleTimeoutId);
  76056. var msecs = item._idleTimeout;
  76057. if (msecs >= 0) {
  76058. item._idleTimeoutId = setTimeout(function onTimeout() {
  76059. if (item._onTimeout)
  76060. item._onTimeout();
  76061. }, msecs);
  76062. }
  76063. };
  76064. // setimmediate attaches itself to the global object
  76065. __webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js");
  76066. // On some exotic environments, it's not clear which object `setimmediate` was
  76067. // able to install onto. Search each possibility in the same order as the
  76068. // `setimmediate` library.
  76069. exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
  76070. (typeof global !== "undefined" && global.setImmediate) ||
  76071. (this && this.setImmediate);
  76072. exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
  76073. (typeof global !== "undefined" && global.clearImmediate) ||
  76074. (this && this.clearImmediate);
  76075. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  76076. /***/ }),
  76077. /***/ "./node_modules/to-array/index.js":
  76078. /*!****************************************!*\
  76079. !*** ./node_modules/to-array/index.js ***!
  76080. \****************************************/
  76081. /*! no static exports found */
  76082. /*! all exports used */
  76083. /***/ (function(module, exports) {
  76084. module.exports = toArray
  76085. function toArray(list, index) {
  76086. var array = []
  76087. index = index || 0
  76088. for (var i = index || 0; i < list.length; i++) {
  76089. array[i - index] = list[i]
  76090. }
  76091. return array
  76092. }
  76093. /***/ }),
  76094. /***/ "./node_modules/vue-socket.io/dist/vue-socketio.js":
  76095. /*!*********************************************************!*\
  76096. !*** ./node_modules/vue-socket.io/dist/vue-socketio.js ***!
  76097. \*********************************************************/
  76098. /*! no static exports found */
  76099. /*! exports used: default */
  76100. /***/ (function(module, exports, __webpack_require__) {
  76101. !function(t,e){ true?module.exports=e():undefined}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=22)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(n){function o(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(e=t.exports=r(25)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),!r)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&"%c"===t&&(i=++o)}),t.splice(i,0,n)},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=o,e.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(o())}).call(this,r(24))},function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),r=this._callbacks["$"+t];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e);return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,r){(function(t){var n,o=r(32),i=r(15),s=r(37),a=r(38),c=r(39);t&&t.ArrayBuffer&&(n=r(41));var u="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),h="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),f=u||h;e.protocol=3;var p=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},l=o(p),d={type:"error",data:"parser error"},y=r(42);function g(t,e,r){for(var n=new Array(t.length),o=a(t.length,r),i=function(t,r,o){e(r,function(e,r){n[t]=r,o(e,n)})},s=0;s<t.length;s++)i(s,t[s],o)}e.encodePacket=function(r,n,o,i){"function"==typeof n&&(i=n,n=!1),"function"==typeof o&&(i=o,o=null);var s=void 0===r.data?void 0:r.data.buffer||r.data;if(t.ArrayBuffer&&s instanceof ArrayBuffer)return function(t,r,n){if(!r)return e.encodeBase64Packet(t,n);var o=t.data,i=new Uint8Array(o),s=new Uint8Array(1+o.byteLength);s[0]=p[t.type];for(var a=0;a<i.length;a++)s[a+1]=i[a];return n(s.buffer)}(r,n,i);if(y&&s instanceof t.Blob)return function(t,r,n){if(!r)return e.encodeBase64Packet(t,n);if(f)return function(t,r,n){if(!r)return e.encodeBase64Packet(t,n);var o=new FileReader;return o.onload=function(){t.data=o.result,e.encodePacket(t,r,!0,n)},o.readAsArrayBuffer(t.data)}(t,r,n);var o=new Uint8Array(1);o[0]=p[t.type];var i=new y([o.buffer,t.data]);return n(i)}(r,n,i);if(s&&s.base64)return function(t,r){var n="b"+e.packets[t.type]+t.data.data;return r(n)}(r,i);var a=p[r.type];return void 0!==r.data&&(a+=o?c.encode(String(r.data),{strict:!1}):String(r.data)),i(""+a)},e.encodeBase64Packet=function(r,n){var o,i="b"+e.packets[r.type];if(y&&r.data instanceof t.Blob){var s=new FileReader;return s.onload=function(){var t=s.result.split(",")[1];n(i+t)},s.readAsDataURL(r.data)}try{o=String.fromCharCode.apply(null,new Uint8Array(r.data))}catch(t){for(var a=new Uint8Array(r.data),c=new Array(a.length),u=0;u<a.length;u++)c[u]=a[u];o=String.fromCharCode.apply(null,c)}return i+=t.btoa(o),n(i)},e.decodePacket=function(t,r,n){if(void 0===t)return d;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),r);if(n&&!1===(t=function(t){try{t=c.decode(t,{strict:!1})}catch(t){return!1}return t}(t)))return d;var o=t.charAt(0);return Number(o)==o&&l[o]?t.length>1?{type:l[o],data:t.substring(1)}:{type:l[o]}:d}o=new Uint8Array(t)[0];var i=s(t,1);return y&&"blob"===r&&(i=new y([i])),{type:l[o],data:i}},e.decodeBase64Packet=function(t,e){var r=l[t.charAt(0)];if(!n)return{type:r,data:{base64:!0,data:t.substr(1)}};var o=n.decode(t.substr(1));return"blob"===e&&y&&(o=new y([o])),{type:r,data:o}},e.encodePayload=function(t,r,n){"function"==typeof r&&(n=r,r=null);var o=i(t);if(r&&o)return y&&!f?e.encodePayloadAsBlob(t,n):e.encodePayloadAsArrayBuffer(t,n);if(!t.length)return n("0:");g(t,function(t,n){e.encodePacket(t,!!o&&r,!1,function(t){n(null,function(t){return t.length+":"+t}(t))})},function(t,e){return n(e.join(""))})},e.decodePayload=function(t,r,n){if("string"!=typeof t)return e.decodePayloadAsBinary(t,r,n);var o;if("function"==typeof r&&(n=r,r=null),""===t)return n(d,0,1);for(var i,s,a="",c=0,u=t.length;c<u;c++){var h=t.charAt(c);if(":"===h){if(""===a||a!=(i=Number(a)))return n(d,0,1);if(a!=(s=t.substr(c+1,i)).length)return n(d,0,1);if(s.length){if(o=e.decodePacket(s,r,!1),d.type===o.type&&d.data===o.data)return n(d,0,1);if(!1===n(o,c+i,u))return}c+=i,a=""}else a+=h}return""!==a?n(d,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,r){if(!t.length)return r(new ArrayBuffer(0));g(t,function(t,r){e.encodePacket(t,!0,!0,function(t){return r(null,t)})},function(t,e){var n=e.reduce(function(t,e){var r;return t+(r="string"==typeof e?e.length:e.byteLength).toString().length+r+2},0),o=new Uint8Array(n),i=0;return e.forEach(function(t){var e="string"==typeof t,r=t;if(e){for(var n=new Uint8Array(t.length),s=0;s<t.length;s++)n[s]=t.charCodeAt(s);r=n.buffer}o[i++]=e?0:1;var a=r.byteLength.toString();for(s=0;s<a.length;s++)o[i++]=parseInt(a[s]);o[i++]=255;for(n=new Uint8Array(r),s=0;s<n.length;s++)o[i++]=n[s]}),r(o.buffer)})},e.encodePayloadAsBlob=function(t,r){g(t,function(t,r){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var n=new Uint8Array(t.length),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);t=n.buffer,e[0]=0}var i=(t instanceof ArrayBuffer?t.byteLength:t.size).toString(),s=new Uint8Array(i.length+1);for(o=0;o<i.length;o++)s[o]=parseInt(i[o]);if(s[i.length]=255,y){var a=new y([e.buffer,s.buffer,t]);r(null,a)}})},function(t,e){return r(new y(e))})},e.decodePayloadAsBinary=function(t,r,n){"function"==typeof r&&(n=r,r=null);for(var o=t,i=[];o.byteLength>0;){for(var a=new Uint8Array(o),c=0===a[0],u="",h=1;255!==a[h];h++){if(u.length>310)return n(d,0,1);u+=a[h]}o=s(o,2+u.length),u=parseInt(u);var f=s(o,0,u);if(c)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(t){var p=new Uint8Array(f);f="";for(h=0;h<p.length;h++)f+=String.fromCharCode(p[h])}i.push(f),o=s(o,u)}var l=i.length;i.forEach(function(t,o){n(e.decodePacket(t,r,!0),o,l)})}}).call(this,r(0))},function(t,e){e.encode=function(t){var e="";for(var r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e},e.decode=function(t){for(var e={},r=t.split("&"),n=0,o=r.length;n<o;n++){var i=r[n].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}},function(t,e){t.exports=function(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){var n=r(1)("socket.io-parser"),o=r(2),i=r(27),s=r(7),a=r(11);function c(){}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=c,e.Decoder=f;var u=e.ERROR+'"encode error"';function h(t){var r=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(r+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(r+=t.nsp+","),null!=t.id&&(r+=t.id),null!=t.data){var o=function(t){try{return JSON.stringify(t)}catch(t){return!1}}(t.data);if(!1===o)return u;r+=o}return n("encoded %j as %s",t,r),r}function f(){this.reconstructor=null}function p(t){this.reconPack=t,this.buffers=[]}function l(t){return{type:e.ERROR,data:"parser error: "+t}}c.prototype.encode=function(t,r){(n("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type)?function(t,e){i.removeBlobs(t,function(t){var r=i.deconstructPacket(t),n=h(r.packet),o=r.buffers;o.unshift(n),e(o)})}(t,r):r([h(t)])},o(f.prototype),f.prototype.add=function(t){var r;if("string"==typeof t)r=function(t){var r=0,o={type:Number(t.charAt(0))};if(null==e.types[o.type])return l("unknown packet type "+o.type);if(e.BINARY_EVENT===o.type||e.BINARY_ACK===o.type){for(var i="";"-"!==t.charAt(++r)&&(i+=t.charAt(r),r!=t.length););if(i!=Number(i)||"-"!==t.charAt(r))throw new Error("Illegal attachments");o.attachments=Number(i)}if("/"===t.charAt(r+1))for(o.nsp="";++r;){var a=t.charAt(r);if(","===a)break;if(o.nsp+=a,r===t.length)break}else o.nsp="/";var c=t.charAt(r+1);if(""!==c&&Number(c)==c){for(o.id="";++r;){var a=t.charAt(r);if(null==a||Number(a)!=a){--r;break}if(o.id+=t.charAt(r),r===t.length)break}o.id=Number(o.id)}if(t.charAt(++r)){var u=function(t){try{return JSON.parse(t)}catch(t){return!1}}(t.substr(r)),h=!1!==u&&(o.type===e.ERROR||s(u));if(!h)return l("invalid payload");o.data=u}return n("decoded %s as %j",t,o),o}(t),e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type?(this.reconstructor=new p(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!a(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(r=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",r))}},f.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=i.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(e){var n=r(30);t.exports=function(t){var r=t.xdomain,o=t.xscheme,i=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!r||n))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!o&&i)return new XDomainRequest}catch(t){}if(!r)try{return new(e[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}}).call(this,r(0))},function(t,e,r){var n=r(3),o=r(2);function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}t.exports=i,o(i.prototype),i.prototype.onError=function(t,e){var r=new Error(t);return r.type="TransportError",r.description=e,this.emit("error",r),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){var e=n.decodePacket(t,this.socket.binaryType);this.onPacket(e)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,o=t.indexOf("["),i=t.indexOf("]");-1!=o&&-1!=i&&(t=t.substring(0,o)+t.substring(o,i).replace(/:/g,";")+t.substring(i,t.length));for(var s=r.exec(t||""),a={},c=14;c--;)a[n[c]]=s[c]||"";return-1!=o&&-1!=i&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(t,e,r){(function(e){t.exports=function(t){return r&&e.Buffer.isBuffer(t)||n&&(t instanceof e.ArrayBuffer||o(t))};var r="function"==typeof e.Buffer&&"function"==typeof e.Buffer.isBuffer,n="function"==typeof e.ArrayBuffer,o=n&&"function"==typeof e.ArrayBuffer.isView?e.ArrayBuffer.isView:function(t){return t.buffer instanceof e.ArrayBuffer}}).call(this,r(0))},function(t,e,r){var n=r(28),o=r(18),i=r(2),s=r(6),a=r(19),c=r(20),u=r(1)("socket.io-client:manager"),h=r(17),f=r(47),p=Object.prototype.hasOwnProperty;function l(t,e){if(!(this instanceof l))return new l(t,e);t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=e.parser||s;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==e.autoConnect,this.autoConnect&&this.open()}t.exports=l,l.prototype.emitAll=function(){for(var t in this.emit.apply(this,arguments),this.nsps)p.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},l.prototype.updateSocketIds=function(){for(var t in this.nsps)p.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},l.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},i(l.prototype),l.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},l.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},l.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},l.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},l.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},l.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},l.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},l.prototype.open=l.prototype.connect=function(t,e){if(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;u("opening %s",this.uri),this.engine=n(this.uri,this.opts);var r=this.engine,o=this;this.readyState="opening",this.skipReconnect=!1;var i=a(r,"open",function(){o.onopen(),t&&t()}),s=a(r,"error",function(e){if(u("connect_error"),o.cleanup(),o.readyState="closed",o.emitAll("connect_error",e),t){var r=new Error("Connection error");r.data=e,t(r)}else o.maybeReconnectOnOpen()});if(!1!==this._timeout){var c=this._timeout;u("connect attempt will timeout after %d",c);var h=setTimeout(function(){u("connect attempt timed out after %d",c),i.destroy(),r.close(),r.emit("error","timeout"),o.emitAll("connect_timeout",c)},c);this.subs.push({destroy:function(){clearTimeout(h)}})}return this.subs.push(i),this.subs.push(s),this},l.prototype.onopen=function(){u("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(a(t,"data",c(this,"ondata"))),this.subs.push(a(t,"ping",c(this,"onping"))),this.subs.push(a(t,"pong",c(this,"onpong"))),this.subs.push(a(t,"error",c(this,"onerror"))),this.subs.push(a(t,"close",c(this,"onclose"))),this.subs.push(a(this.decoder,"decoded",c(this,"ondecoded")))},l.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},l.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},l.prototype.ondata=function(t){this.decoder.add(t)},l.prototype.ondecoded=function(t){this.emit("packet",t)},l.prototype.onerror=function(t){u("error",t),this.emitAll("error",t)},l.prototype.socket=function(t,e){var r=this.nsps[t];if(!r){r=new o(this,t,e),this.nsps[t]=r;var n=this;r.on("connecting",i),r.on("connect",function(){r.id=n.generateId(t)}),this.autoConnect&&i()}function i(){~h(n.connecting,r)||n.connecting.push(r)}return r},l.prototype.destroy=function(t){var e=h(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},l.prototype.packet=function(t){u("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(r){for(var n=0;n<r.length;n++)e.engine.write(r[n],t.options);e.encoding=!1,e.processPacketQueue()}))},l.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},l.prototype.cleanup=function(){u("cleanup");for(var t=this.subs.length,e=0;e<t;e++){this.subs.shift().destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},l.prototype.close=l.prototype.disconnect=function(){u("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},l.prototype.onclose=function(t){u("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},l.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();u("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var r=setTimeout(function(){t.skipReconnect||(u("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(u("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(u("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(r)}})}},l.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,r){(function(t){var n=r(8),o=r(31),i=r(43),s=r(44);e.polling=function(e){var r=!1,s=!1,a=!1!==e.jsonp;if(t.location){var c="https:"===location.protocol,u=location.port;u||(u=c?443:80),r=e.hostname!==location.hostname||u!==e.port,s=e.secure!==c}if(e.xdomain=r,e.xscheme=s,"open"in new n(e)&&!e.forceJSONP)return new o(e);if(!a)throw new Error("JSONP disabled");return new i(e)},e.websocket=s}).call(this,r(0))},function(t,e,r){var n=r(9),o=r(4),i=r(3),s=r(5),a=r(16),c=r(1)("engine.io-client:polling");t.exports=h;var u=null!=new(r(8))({xdomain:!1}).responseType;function h(t){var e=t&&t.forceBase64;u&&!e||(this.supportsBinary=!1),n.call(this,t)}s(h,n),h.prototype.name="polling",h.prototype.doOpen=function(){this.poll()},h.prototype.pause=function(t){var e=this;function r(){c("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(c("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){c("pre-pause polling complete"),--n||r()})),this.writable||(c("we are currently writing - waiting to pause"),n++,this.once("drain",function(){c("pre-pause writing complete"),--n||r()}))}else r()},h.prototype.poll=function(){c("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},h.prototype.onData=function(t){var e=this;c("polling got data %s",t);i.decodePayload(t,this.socket.binaryType,function(t,r,n){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():c('ignoring poll - transport state "%s"',this.readyState))},h.prototype.doClose=function(){var t=this;function e(){c("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(c("transport open - closing"),e()):(c("transport not open - deferring close"),this.once("open",e))},h.prototype.write=function(t){var e=this;this.writable=!1;var r=function(){e.writable=!0,e.emit("drain")};i.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,r)})},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(t[this.timestampParam]=a()),this.supportsBinary||t.sid||(t.b64=1),t=o.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(r=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+t}},function(t,e,r){(function(e){var n=r(7),o=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);t.exports=function t(r){if(!r||"object"!=typeof r)return!1;if(n(r)){for(var o=0,a=r.length;o<a;o++)if(t(r[o]))return!0;return!1}if("function"==typeof e&&e.isBuffer&&e.isBuffer(r)||"function"==typeof ArrayBuffer&&r instanceof ArrayBuffer||i&&r instanceof Blob||s&&r instanceof File)return!0;if(r.toJSON&&"function"==typeof r.toJSON&&1===arguments.length)return t(r.toJSON(),!0);for(var c in r)if(Object.prototype.hasOwnProperty.call(r,c)&&t(r[c]))return!0;return!1}}).call(this,r(33).Buffer)},function(t,e,r){"use strict";var n,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i=64,s={},a=0,c=0;function u(t){var e="";do{e=o[t%i]+e,t=Math.floor(t/i)}while(t>0);return e}function h(){var t=u(+new Date);return t!==n?(a=0,n=t):t+"."+u(a++)}for(;c<i;c++)s[o[c]]=c;h.encode=u,h.decode=function(t){var e=0;for(c=0;c<t.length;c++)e=e*i+s[t.charAt(c)];return e},t.exports=h},function(t,e){var r=[].indexOf;t.exports=function(t,e){if(r)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},function(t,e,r){var n=r(6),o=r(2),i=r(46),s=r(19),a=r(20),c=r(1)("socket.io-client:socket"),u=r(4),h=r(15);t.exports=l;var f={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=o.prototype.emit;function l(t,e,r){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},r&&r.query&&(this.query=r.query),this.io.autoConnect&&this.open()}o(l.prototype),l.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[s(t,"open",a(this,"onopen")),s(t,"packet",a(this,"onpacket")),s(t,"close",a(this,"onclose"))]}},l.prototype.open=l.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},l.prototype.send=function(){var t=i(arguments);return t.unshift("message"),this.emit.apply(this,t),this},l.prototype.emit=function(t){if(f.hasOwnProperty(t))return p.apply(this,arguments),this;var e=i(arguments),r={type:(void 0!==this.flags.binary?this.flags.binary:h(e))?n.BINARY_EVENT:n.EVENT,data:e,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this.flags={},this},l.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},l.prototype.onopen=function(){if(c("transport is open - connecting"),"/"!==this.nsp)if(this.query){var t="object"==typeof this.query?u.encode(this.query):this.query;c("sending connect packet with query %s",t),this.packet({type:n.CONNECT,query:t})}else this.packet({type:n.CONNECT})},l.prototype.onclose=function(t){c("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},l.prototype.onpacket=function(t){var e=t.nsp===this.nsp,r=t.type===n.ERROR&&"/"===t.nsp;if(e||r)switch(t.type){case n.CONNECT:this.onconnect();break;case n.EVENT:case n.BINARY_EVENT:this.onevent(t);break;case n.ACK:case n.BINARY_ACK:this.onack(t);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",t.data)}},l.prototype.onevent=function(t){var e=t.data||[];c("emitting event %j",e),null!=t.id&&(c("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?p.apply(this,e):this.receiveBuffer.push(e)},l.prototype.ack=function(t){var e=this,r=!1;return function(){if(!r){r=!0;var o=i(arguments);c("sending ack %j",o),e.packet({type:h(o)?n.BINARY_ACK:n.ACK,id:t,data:o})}}},l.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(c("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):c("bad ack %s",t.id)},l.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},l.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)p.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},l.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},l.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},l.prototype.close=l.prototype.disconnect=function(){return this.connected&&(c("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},l.prototype.compress=function(t){return this.flags.compress=t,this},l.prototype.binary=function(t){return this.flags.binary=t,this}},function(t,e){t.exports=function(t,e,r){return t.on(e,r),{destroy:function(){t.removeListener(e,r)}}}},function(t,e){var r=[].slice;t.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var n=r.call(arguments,2);return function(){return e.apply(t,n.concat(r.call(arguments)))}}},function(t,e,r){var n=r(23),o=r(6),i=r(12),s=r(1)("socket.io-client");t.exports=e=c;var a=e.managers={};function c(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,o=n(t),c=o.source,u=o.id,h=o.path,f=a[u]&&h in a[u].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||f?(s("ignoring socket cache for %s",c),r=i(c,e)):(a[u]||(s("new io instance for %s",c),a[u]=i(c,e)),r=a[u]),o.query&&!e.query&&(e.query=o.query),r.socket(o.path,e)}e.protocol=o.protocol,e.connect=c,e.Manager=r(12),e.Socket=r(18)},function(t,e,r){t.exports=r(48)},function(t,e,r){(function(e){var n=r(10),o=r(1)("socket.io-client:url");t.exports=function(t,r){var i=t;r=r||e.location,null==t&&(t=r.protocol+"//"+r.host);"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(o("protocol-less url %s",t),t=void 0!==r?r.protocol+"//"+t:"https://"+t),o("parse %s",t),i=n(t));i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443"));i.path=i.path||"/";var s=-1!==i.host.indexOf(":")?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+s+":"+i.port,i.href=i.protocol+"://"+s+(r&&r.port===i.port?"":":"+i.port),i}}).call(this,r(0))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var c,u=[],h=!1,f=-1;function p(){h&&c&&(h=!1,c.length?u=c.concat(u):f=-1,u.length&&l())}function l(){if(!h){var t=a(p);h=!0;for(var e=u.length;e;){for(c=u,u=[];++f<e;)c&&c[f].run();f=-1,e=u.length}c=null,h=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new d(t,e)),1!==u.length||h||a(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){function n(t){var r;function n(){if(n.enabled){var t=n,o=+new Date,i=o-(r||o);t.diff=i,t.prev=r,t.curr=o,r=o;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=e.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;c++;var o=e.formatters[n];if("function"==typeof o){var i=s[c];r=o.call(t,i),s.splice(c,1),c--}return r}),e.formatArgs.call(t,s),(n.log||e.log||console.log.bind(console)).apply(t,s)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=function(t){var r,n=0;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}(t),n.destroy=o,"function"==typeof e.init&&e.init(n),e.instances.push(n),n}function o(){var t=e.instances.indexOf(this);return-1!==t&&(e.instances.splice(t,1),!0)}(e=t.exports=n.debug=n.default=n).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){var r;e.save(t),e.names=[],e.skips=[];var n=("string"==typeof t?t:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(r=0;r<e.instances.length;r++){var i=e.instances[r];i.enabled=e.enabled(i.namespace)}},e.enabled=function(t){if("*"===t[t.length-1])return!0;var r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(26),e.instances=[],e.names=[],e.skips=[],e.formatters={}},function(t,e){var r=1e3,n=60*r,o=60*n,i=24*o,s=365.25*i;function a(t,e,r){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+r:Math.ceil(t/e)+" "+r+"s"}t.exports=function(t,e){e=e||{};var c=typeof t;if("string"===c&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(t);if("number"===c&&!1===isNaN(t))return e.long?function(t){return a(t,i,"day")||a(t,o,"hour")||a(t,n,"minute")||a(t,r,"second")||t+" ms"}(t):function(t){if(t>=i)return Math.round(t/i)+"d";if(t>=o)return Math.round(t/o)+"h";if(t>=n)return Math.round(t/n)+"m";if(t>=r)return Math.round(t/r)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,r){(function(t){var n=r(7),o=r(11),i=Object.prototype.toString,s="function"==typeof t.Blob||"[object BlobConstructor]"===i.call(t.Blob),a="function"==typeof t.File||"[object FileConstructor]"===i.call(t.File);e.deconstructPacket=function(t){var e=[],r=t.data,i=t;return i.data=function t(e,r){if(!e)return e;if(o(e)){var i={_placeholder:!0,num:r.length};return r.push(e),i}if(n(e)){for(var s=new Array(e.length),a=0;a<e.length;a++)s[a]=t(e[a],r);return s}if("object"==typeof e&&!(e instanceof Date)){var s={};for(var c in e)s[c]=t(e[c],r);return s}return e}(r,e),i.attachments=e.length,{packet:i,buffers:e}},e.reconstructPacket=function(t,e){return t.data=function t(e,r){if(!e)return e;if(e&&e._placeholder)return r[e.num];if(n(e))for(var o=0;o<e.length;o++)e[o]=t(e[o],r);else if("object"==typeof e)for(var i in e)e[i]=t(e[i],r);return e}(t.data,e),t.attachments=void 0,t},e.removeBlobs=function(t,e){var r=0,i=t;!function t(c,u,h){if(!c)return c;if(s&&c instanceof Blob||a&&c instanceof File){r++;var f=new FileReader;f.onload=function(){h?h[u]=this.result:i=this.result,--r||e(i)},f.readAsArrayBuffer(c)}else if(n(c))for(var p=0;p<c.length;p++)t(c[p],p,c);else if("object"==typeof c&&!o(c))for(var l in c)t(c[l],l,c)}(i),r||e(i)}}).call(this,r(0))},function(t,e,r){t.exports=r(29),t.exports.parser=r(3)},function(t,e,r){(function(e){var n=r(13),o=r(2),i=r(1)("engine.io-client:socket"),s=r(17),a=r(3),c=r(10),u=r(4);function h(t,r){if(!(this instanceof h))return new h(t,r);r=r||{},t&&"object"==typeof t&&(r=t,t=null),t?(t=c(t),r.hostname=t.host,r.secure="https"===t.protocol||"wss"===t.protocol,r.port=t.port,t.query&&(r.query=t.query)):r.host&&(r.hostname=c(r.host).host),this.secure=null!=r.secure?r.secure:e.location&&"https:"===location.protocol,r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.agent=r.agent||!1,this.hostname=r.hostname||(e.location?location.hostname:"localhost"),this.port=r.port||(e.location&&location.port?location.port:this.secure?443:80),this.query=r.query||{},"string"==typeof this.query&&(this.query=u.decode(this.query)),this.upgrade=!1!==r.upgrade,this.path=(r.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!r.forceJSONP,this.jsonp=!1!==r.jsonp,this.forceBase64=!!r.forceBase64,this.enablesXDR=!!r.enablesXDR,this.timestampParam=r.timestampParam||"t",this.timestampRequests=r.timestampRequests,this.transports=r.transports||["polling","websocket"],this.transportOptions=r.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=r.policyPort||843,this.rememberUpgrade=r.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=r.onlyBinaryUpgrades,this.perMessageDeflate=!1!==r.perMessageDeflate&&(r.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=r.pfx||null,this.key=r.key||null,this.passphrase=r.passphrase||null,this.cert=r.cert||null,this.ca=r.ca||null,this.ciphers=r.ciphers||null,this.rejectUnauthorized=void 0===r.rejectUnauthorized||r.rejectUnauthorized,this.forceNode=!!r.forceNode;var n="object"==typeof e&&e;n.global===n&&(r.extraHeaders&&Object.keys(r.extraHeaders).length>0&&(this.extraHeaders=r.extraHeaders),r.localAddress&&(this.localAddress=r.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}t.exports=h,h.priorWebsocketSuccess=!1,o(h.prototype),h.protocol=a.protocol,h.Socket=h,h.Transport=r(9),h.transports=r(13),h.parser=r(3),h.prototype.createTransport=function(t){i('creating transport "%s"',t);var e=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}(this.query);e.EIO=a.protocol,e.transport=t;var r=this.transportOptions[t]||{};return this.id&&(e.sid=this.id),new n[t]({query:e,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0})},h.prototype.open=function(){var t;if(this.rememberUpgrade&&h.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},h.prototype.setTransport=function(t){i("setting transport %s",t.name);var e=this;this.transport&&(i("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},h.prototype.probe=function(t){i('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),r=!1,n=this;function o(){if(n.onlyBinaryUpgrades){var o=!this.supportsBinary&&n.transport.supportsBinary;r=r||o}r||(i('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",function(o){if(!r)if("pong"===o.type&&"probe"===o.data){if(i('probe transport "%s" pong',t),n.upgrading=!0,n.emit("upgrading",e),!e)return;h.priorWebsocketSuccess="websocket"===e.name,i('pausing current transport "%s"',n.transport.name),n.transport.pause(function(){r||"closed"!==n.readyState&&(i("changing transport and sending upgrade packet"),p(),n.setTransport(e),e.send([{type:"upgrade"}]),n.emit("upgrade",e),e=null,n.upgrading=!1,n.flush())})}else{i('probe transport "%s" failed',t);var s=new Error("probe error");s.transport=e.name,n.emit("upgradeError",s)}}))}function s(){r||(r=!0,p(),e.close(),e=null)}function a(r){var o=new Error("probe error: "+r);o.transport=e.name,s(),i('probe transport "%s" failed because of error: %s',t,r),n.emit("upgradeError",o)}function c(){a("transport closed")}function u(){a("socket closed")}function f(t){e&&t.name!==e.name&&(i('"%s" works - aborting "%s"',t.name,e.name),s())}function p(){e.removeListener("open",o),e.removeListener("error",a),e.removeListener("close",c),n.removeListener("close",u),n.removeListener("upgrading",f)}h.priorWebsocketSuccess=!1,e.once("open",o),e.once("error",a),e.once("close",c),this.once("close",u),this.once("upgrading",f),e.open()},h.prototype.onOpen=function(){if(i("socket open"),this.readyState="open",h.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){i("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},h.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(i('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else i('packet received with socket readyState "%s"',this.readyState)},h.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},h.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!==e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},h.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){i("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},h.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})},h.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},h.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(i("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},h.prototype.write=h.prototype.send=function(t,e,r){return this.sendPacket("message",t,e,r),this},h.prototype.sendPacket=function(t,e,r,n){if("function"==typeof e&&(n=e,e=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){(r=r||{}).compress=!1!==r.compress;var o={type:t,data:e,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}},h.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var t=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():e()}):this.upgrading?n():e()}function e(){t.onClose("forced close"),i("socket closing - telling transport to close"),t.transport.close()}function r(){t.removeListener("upgrade",r),t.removeListener("upgradeError",r),e()}function n(){t.once("upgrade",r),t.once("upgradeError",r)}return this},h.prototype.onError=function(t){i("socket error %j",t),h.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},h.prototype.onClose=function(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){i('socket close with reason: "%s"',t);clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),this.writeBuffer=[],this.prevBufferLen=0}},h.prototype.filterUpgrades=function(t){for(var e=[],r=0,n=t.length;r<n;r++)~s(this.transports,t[r])&&e.push(t[r]);return e}}).call(this,r(0))},function(t,e){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){t.exports=!1}},function(t,e,r){(function(e){var n=r(8),o=r(14),i=r(2),s=r(5),a=r(1)("engine.io-client:polling-xhr");function c(){}function u(t){if(o.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,e.location){var r="https:"===location.protocol,n=location.port;n||(n=r?443:80),this.xd=t.hostname!==e.location.hostname||n!==t.port,this.xs=t.secure!==r}}function h(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}function f(){for(var t in h.requests)h.requests.hasOwnProperty(t)&&h.requests[t].abort()}t.exports=u,t.exports.Request=h,s(u,o),u.prototype.supportsBinary=!0,u.prototype.request=function(t){return(t=t||{}).uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new h(t)},u.prototype.doWrite=function(t,e){var r="string"!=typeof t&&void 0!==t,n=this.request({method:"POST",data:t,isBinary:r}),o=this;n.on("success",e),n.on("error",function(t){o.onError("xhr post error",t)}),this.sendXhr=n},u.prototype.doPoll=function(){a("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},i(h.prototype),h.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var r=this.xhr=new n(t),o=this;try{a("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var i in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.extraHeaders[i])}catch(t){}if("POST"===this.method)try{this.isBinary?r.setRequestHeader("Content-type","application/octet-stream"):r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{r.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in r&&(r.withCredentials=!0),this.requestTimeout&&(r.timeout=this.requestTimeout),this.hasXDR()?(r.onload=function(){o.onLoad()},r.onerror=function(){o.onError(r.responseText)}):r.onreadystatechange=function(){if(2===r.readyState)try{var t=r.getResponseHeader("Content-Type");o.supportsBinary&&"application/octet-stream"===t&&(r.responseType="arraybuffer")}catch(t){}4===r.readyState&&(200===r.status||1223===r.status?o.onLoad():setTimeout(function(){o.onError(r.status)},0))},a("xhr data %s",this.data),r.send(this.data)}catch(t){return void setTimeout(function(){o.onError(t)},0)}e.document&&(this.index=h.requestsCount++,h.requests[this.index]=this)},h.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},h.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},h.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},h.prototype.cleanup=function(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=c:this.xhr.onreadystatechange=c,t)try{this.xhr.abort()}catch(t){}e.document&&delete h.requests[this.index],this.xhr=null}},h.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch(t){}t="application/octet-stream"===e&&this.xhr.response||this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},h.prototype.hasXDR=function(){return void 0!==e.XDomainRequest&&!this.xs&&this.enablesXDR},h.prototype.abort=function(){this.cleanup()},h.requestsCount=0,h.requests={},e.document&&(e.attachEvent?e.attachEvent("onunload",f):e.addEventListener&&e.addEventListener("beforeunload",f,!1))}).call(this,r(0))},function(t,e){t.exports=Object.keys||function(t){var e=[],r=Object.prototype.hasOwnProperty;for(var n in t)r.call(t,n)&&e.push(n);return e}},function(t,e,r){"use strict";(function(t){
  76102. /*!
  76103. * The buffer module from node.js, for the browser.
  76104. *
  76105. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  76106. * @license MIT
  76107. */
  76108. var n=r(34),o=r(35),i=r(36);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|l(e.length);return 0===(t=a(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?a(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(h(e),t=a(t,e<0?0:0|l(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|l(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function l(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return M(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){var i,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var h=-1;for(i=r;i<a;i++)if(u(t,i)===u(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===c)return h*s}else-1!==h&&(i-=i-h),h=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(u(t,i+p)!==u(e,p)){f=!1;break}if(f)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function b(t,e,r,n){return Y(M(e,t.length-r),t,r,n)}function w(t,e,r,n){return Y(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function k(t,e,r,n){return w(t,e,r,n)}function A(t,e,r,n){return Y(q(e),t,r,n)}function C(t,e,r,n){return Y(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,c,u=t[o],h=null,f=u>239?4:u>223?3:u>191?2:1;if(o+f<=r)switch(f){case 1:u<128&&(h=u);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&u)<<6|63&i)>127&&(h=c);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(h=c)}null===h?(h=65533,f=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=f}return function(t){var e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=x));return r}(n)}e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return u(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return h(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?B(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,s=r-e,a=Math.min(i,s),u=this.slice(n,o),h=t.slice(e,r),f=0;f<a;++f)if(u[f]!==h[f]){i=u[f],s=h[f];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return k(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function R(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function T(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function P(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function S(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function _(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function U(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function D(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,i){return i||D(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return i||D(t,0,r,8),o.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||_(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||_(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||_(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||_(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||_(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||_(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||_(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||_(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||_(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||_(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||_(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||_(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||_(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||_(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||_(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):U(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):U(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);O(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);O(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):U(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):U(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=c.isBuffer(t)?t:M(new c(t,n).toString()),a=s.length;for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function M(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function q(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(0))},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){for(var e,r=u(t),n=r[0],s=r[1],a=new i(function(t,e,r){return 3*(e+r)/4-r}(0,n,s)),c=0,h=s>0?n-4:n,f=0;f<h;f+=4)e=o[t.charCodeAt(f)]<<18|o[t.charCodeAt(f+1)]<<12|o[t.charCodeAt(f+2)]<<6|o[t.charCodeAt(f+3)],a[c++]=e>>16&255,a[c++]=e>>8&255,a[c++]=255&e;2===s&&(e=o[t.charCodeAt(f)]<<2|o[t.charCodeAt(f+1)]>>4,a[c++]=255&e);1===s&&(e=o[t.charCodeAt(f)]<<10|o[t.charCodeAt(f+1)]<<4|o[t.charCodeAt(f+2)]>>2,a[c++]=e>>8&255,a[c++]=255&e);return a},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],s=0,a=r-o;s<a;s+=16383)i.push(f(t,s,s+16383>a?a:s+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)n[a]=s[a],o[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function f(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(h(n));return o.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,u=c>>1,h=-7,f=r?o-1:0,p=r?-1:1,l=t[e+f];for(f+=p,i=l&(1<<-h)-1,l>>=-h,h+=a;h>0;i=256*i+t[e+f],f+=p,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=n;h>0;s=256*s+t[e+f],f+=p,h-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),i-=u}return(l?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,c,u=8*i-o-1,h=(1<<u)-1,f=h>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(e*c-1)*Math.pow(2,o),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;t[r+l]=255&a,l+=d,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;t[r+l]=255&s,l+=d,s/=256,u-=8);t[r+l-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){t.exports=function(t,e,r){var n=t.byteLength;if(e=e||0,r=r||n,t.slice)return t.slice(e,r);if(e<0&&(e+=n),r<0&&(r+=n),r>n&&(r=n),e>=n||e>=r||0===n)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(r-e),s=e,a=0;s<r;s++,a++)i[a]=o[s];return i.buffer}},function(t,e){function r(){}t.exports=function(t,e,n){var o=!1;return n=n||r,i.count=t,0===t?e():i;function i(t,r){if(i.count<=0)throw new Error("after called too many times");--i.count,t?(o=!0,e(t),e=n):0!==i.count||o||e(null,r)}}},function(t,e,r){(function(t,n){var o;/*! https://mths.be/utf8js v2.1.2 by @mathias */!function(i){var s=e,a=(t&&t.exports,"object"==typeof n&&n);a.global!==a&&a.window;var c,u,h,f=String.fromCharCode;function p(t){for(var e,r,n=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(r=t.charCodeAt(o++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--):n.push(e);return n}function l(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function d(t,e){return f(t>>e&63|128)}function y(t,e){if(0==(4294967168&t))return f(t);var r="";return 0==(4294965248&t)?r=f(t>>6&31|192):0==(4294901760&t)?(l(t,e)||(t=65533),r=f(t>>12&15|224),r+=d(t,6)):0==(4292870144&t)&&(r=f(t>>18&7|240),r+=d(t,12),r+=d(t,6)),r+=f(63&t|128)}function g(){if(h>=u)throw Error("Invalid byte index");var t=255&c[h];if(h++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function m(t){var e,r;if(h>u)throw Error("Invalid byte index");if(h==u)return!1;if(e=255&c[h],h++,0==(128&e))return e;if(192==(224&e)){if((r=(31&e)<<6|g())>=128)return r;throw Error("Invalid continuation byte")}if(224==(240&e)){if((r=(15&e)<<12|g()<<6|g())>=2048)return l(r,t)?r:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&(r=(7&e)<<18|g()<<12|g()<<6|g())>=65536&&r<=1114111)return r;throw Error("Invalid UTF-8 detected")}var v={version:"2.1.2",encode:function(t,e){for(var r=!1!==(e=e||{}).strict,n=p(t),o=n.length,i=-1,s="";++i<o;)s+=y(n[i],r);return s},decode:function(t,e){var r=!1!==(e=e||{}).strict;c=p(t),u=c.length,h=0;for(var n,o=[];!1!==(n=m(r));)o.push(n);return function(t){for(var e,r=t.length,n=-1,o="";++n<r;)(e=t[n])>65535&&(o+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=f(e);return o}(o)}};void 0===(o=function(){return v}.call(e,r,e,t))||(t.exports=o)}()}).call(this,r(40)(t),r(0))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;e.encode=function(e){var r,n=new Uint8Array(e),o=n.length,i="";for(r=0;r<o;r+=3)i+=t[n[r]>>2],i+=t[(3&n[r])<<4|n[r+1]>>4],i+=t[(15&n[r+1])<<2|n[r+2]>>6],i+=t[63&n[r+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,n,o,i,s,a=.75*t.length,c=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var h=new ArrayBuffer(a),f=new Uint8Array(h);for(e=0;e<c;e+=4)n=r[t.charCodeAt(e)],o=r[t.charCodeAt(e+1)],i=r[t.charCodeAt(e+2)],s=r[t.charCodeAt(e+3)],f[u++]=n<<2|o>>4,f[u++]=(15&o)<<4|i>>2,f[u++]=(3&i)<<6|63&s;return h}}()},function(t,e,r){(function(e){var r=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,n=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),o=n&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),i=r&&r.prototype.append&&r.prototype.getBlob;function s(t){for(var e=0;e<t.length;e++){var r=t[e];if(r.buffer instanceof ArrayBuffer){var n=r.buffer;if(r.byteLength!==n.byteLength){var o=new Uint8Array(r.byteLength);o.set(new Uint8Array(n,r.byteOffset,r.byteLength)),n=o.buffer}t[e]=n}}}function a(t,e){e=e||{};var n=new r;s(t);for(var o=0;o<t.length;o++)n.append(t[o]);return e.type?n.getBlob(e.type):n.getBlob()}function c(t,e){return s(t),new Blob(t,e||{})}t.exports=n?o?e.Blob:c:i?a:void 0}).call(this,r(0))},function(t,e,r){(function(e){var n=r(14),o=r(5);t.exports=u;var i,s=/\n/g,a=/\\n/g;function c(){}function u(t){n.call(this,t),this.query=this.query||{},i||(e.___eio||(e.___eio=[]),i=e.___eio),this.index=i.length;var r=this;i.push(function(t){r.onData(t)}),this.query.j=this.index,e.document&&e.addEventListener&&e.addEventListener("beforeunload",function(){r.script&&(r.script.onerror=c)},!1)}o(u,n),u.prototype.supportsBinary=!1,u.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),n.prototype.doClose.call(this)},u.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(e,r):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},u.prototype.doWrite=function(t,e){var r=this;if(!this.form){var n,o=document.createElement("form"),i=document.createElement("textarea"),c=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=c,o.method="POST",o.setAttribute("accept-charset","utf-8"),i.name="d",o.appendChild(i),document.body.appendChild(o),this.form=o,this.area=i}function u(){h(),e()}function h(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(t){r.onError("jsonp polling iframe removal error",t)}try{var t='<iframe src="javascript:0" name="'+r.iframeId+'">';n=document.createElement(t)}catch(t){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form.action=this.uri(),h(),t=t.replace(a,"\\\n"),this.area.value=t.replace(s,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&u()}:this.iframe.onload=u}}).call(this,r(0))},function(t,e,r){(function(e){var n,o=r(9),i=r(3),s=r(4),a=r(5),c=r(16),u=r(1)("engine.io-client:websocket"),h=e.WebSocket||e.MozWebSocket;if("undefined"==typeof window)try{n=r(45)}catch(t){}var f=h;function p(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=h&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(f=n),o.call(this,t)}f||"undefined"!=typeof window||(f=n),t.exports=p,a(p,o),p.prototype.name="websocket",p.prototype.supportsBinary=!0,p.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?e?new f(t,e):new f(t):new f(t,e,r)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},p.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},p.prototype.write=function(t){var r=this;this.writable=!1;for(var n=t.length,o=0,s=n;o<s;o++)!function(t){i.encodePacket(t,r.supportsBinary,function(o){if(!r.usingBrowserWebSocket){var i={};if(t.options&&(i.compress=t.options.compress),r.perMessageDeflate)("string"==typeof o?e.Buffer.byteLength(o):o.length)<r.perMessageDeflate.threshold&&(i.compress=!1)}try{r.usingBrowserWebSocket?r.ws.send(o):r.ws.send(o,i)}catch(t){u("websocket closed before onclose event")}--n||a()})}(t[o]);function a(){r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0)}},p.prototype.onClose=function(){o.prototype.onClose.call(this)},p.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},p.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",r="";return this.port&&("wss"===e&&443!==Number(this.port)||"ws"===e&&80!==Number(this.port))&&(r=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||(t.b64=1),(t=s.encode(t)).length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+t},p.prototype.check=function(){return!(!f||"__initialize"in f&&this.name===p.prototype.name)}}).call(this,r(0))},function(t,e){},function(t,e){t.exports=function(t,e){for(var r=[],n=(e=e||0)||0;n<t.length;n++)r[n-e]=t[n];return r}},function(t,e){function r(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=r,r.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-r:t+r}return 0|Math.min(t,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(t){this.ms=t},r.prototype.setMax=function(t){this.max=t},r.prototype.setJitter=function(t){this.jitter=t}},function(t,e,r){"use strict";r.r(e);var n={created(){this.$options.sockets&&(Object.keys(this.$options.sockets).forEach(t=>{"subscribe"!==t&&"unsubscribe"!==t&&this.$vueSocketIo.emitter.addListener(t,this.$options.sockets[t],this)}),this.sockets={subscribe:(t,e)=>{this.$vueSocketIo.emitter.addListener(t,e,this)},unsubscribe:t=>{this.$vueSocketIo.emitter.removeListener(t,this)}})},beforeDestroy(){this.$options.sockets&&Object.keys(this.$options.sockets).forEach(t=>{this.$vueSocketIo.emitter.removeListener(t,this)})}};function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var i=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.debug=!1,this.prefix="%cVue-Socket.io: "}return function(t,e,r){e&&o(t.prototype,e),r&&o(t,r)}(t,[{key:"info",value:function(t,e=""){this.debug&&window.console.info(this.prefix+`%c${t}`,"color: blue; font-weight: 600","color: #333333",e)}},{key:"error",value:function(){this.debug&&window.console.error(this.prefix,...arguments)}},{key:"warn",value:function(){this.debug&&window.console.warn(this.prefix,...arguments)}},{key:"event",value:function(t,e=""){this.debug&&window.console.info(this.prefix+`%c${t}`,"color: blue; font-weight: 600","color: #333333",e)}}]),t}());function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}let a=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.io=e,this.register(),this.emitter=r}return function(t,e,r){e&&s(t.prototype,e),r&&s(t,r)}(t,[{key:"register",value:function(){this.io.onevent=(t=>{let[e,...r]=t.data;1===r.length&&(r=r[0]),this.onEvent(e,r)}),t.staticEvents.forEach(t=>this.io.on(t,()=>this.onEvent(t)))}},{key:"onEvent",value:function(t,e){this.emitter.emit(t,e)}}]),t}();function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}!function(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(a,"staticEvents",["connect","error","disconnect","reconnect","reconnect_attempt","reconnecting","reconnect_error","reconnect_failed","connect_error","connect_timeout","connecting","ping","pong"]);let u=function(){function t(e={}){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i.info(e?"Vuex adapter enabled":"Vuex adapter disabled"),i.info(e.mutationPrefix?"Vuex socket mutations enabled":"Vuex socket mutations disabled"),i.info(e?"Vuex socket actions enabled":"Vuex socket actions disabled"),this.store=e.store,this.actionPrefix=e.actionPrefix?e.actionPrefix:"SOCKET_",this.mutationPrefix=e.mutationPrefix,this.listeners=new Map}return function(t,e,r){e&&c(t.prototype,e),r&&c(t,r)}(t,[{key:"addListener",value:function(t,e,r){if("function"!=typeof e)throw new Error("callback must be a function");this.listeners.has(t)||this.listeners.set(t,[]),this.listeners.get(t).push({callback:e,component:r}),i.info(`#${t} subscribe, component: ${r.$options.name}`)}},{key:"removeListener",value:function(t,e){if(this.listeners.has(t)){const r=this.listeners.get(t).filter(t=>t.component!==e);r.length>0?this.listeners.set(t,r):this.listeners.delete(t),i.info(`#${t} unsubscribe, component: ${e.$options.name}`)}}},{key:"emit",value:function(t,e){this.listeners.has(t)&&(i.info(`Broadcasting: #${t}, Data:`,e),this.listeners.get(t).forEach(t=>{t.callback.call(t.component,e)})),this.dispatchStore(t,e)}},{key:"dispatchStore",value:function(t,e){if(this.store&&this.store._actions){for(let r in this.store._actions){r.split("/").pop()===this.actionPrefix+t&&(i.info(`Dispatching Action: ${r}, Data:`,e),this.store.dispatch(r,e))}if(this.mutationPrefix)for(let r in this.store._mutations){r.split("/").pop()===this.mutationPrefix+t&&(i.info(`Commiting Mutation: ${r}, Data:`,e),this.store.commit(r,e))}}}}]),t}();var h=r(21),f=r.n(h);function p(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}r.d(e,"default",function(){return l});let l=function(){function t({connection:e,vuex:r,debug:n}){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i.debug=n,this.io=this.connect(e),this.emitter=new u(r),this.listener=new a(this.io,this.emitter)}return function(t,e,r){e&&p(t.prototype,e),r&&p(t,r)}(t,[{key:"install",value:function(t){t.prototype.$socket=this.io,t.prototype.$vueSocketIo=this,t.mixin(n),i.info("Vue-Socket.io plugin enabled")}},{key:"connect",value:function(t){if(t&&"object"==typeof t)return i.info("Received socket.io-client instance"),t;if("string"==typeof t)return i.info("Received connection string"),this.io=f()(t);throw new Error("Unsupported connection type")}}]),t}()}]).default});
  76109. /***/ }),
  76110. /***/ "./node_modules/vue/dist/vue.common.dev.js":
  76111. /*!*************************************************!*\
  76112. !*** ./node_modules/vue/dist/vue.common.dev.js ***!
  76113. \*************************************************/
  76114. /*! no static exports found */
  76115. /*! all exports used */
  76116. /***/ (function(module, exports, __webpack_require__) {
  76117. "use strict";
  76118. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*!
  76119. * Vue.js v2.6.11
  76120. * (c) 2014-2019 Evan You
  76121. * Released under the MIT License.
  76122. */
  76123. /* */
  76124. var emptyObject = Object.freeze({});
  76125. // These helpers produce better VM code in JS engines due to their
  76126. // explicitness and function inlining.
  76127. function isUndef (v) {
  76128. return v === undefined || v === null
  76129. }
  76130. function isDef (v) {
  76131. return v !== undefined && v !== null
  76132. }
  76133. function isTrue (v) {
  76134. return v === true
  76135. }
  76136. function isFalse (v) {
  76137. return v === false
  76138. }
  76139. /**
  76140. * Check if value is primitive.
  76141. */
  76142. function isPrimitive (value) {
  76143. return (
  76144. typeof value === 'string' ||
  76145. typeof value === 'number' ||
  76146. // $flow-disable-line
  76147. typeof value === 'symbol' ||
  76148. typeof value === 'boolean'
  76149. )
  76150. }
  76151. /**
  76152. * Quick object check - this is primarily used to tell
  76153. * Objects from primitive values when we know the value
  76154. * is a JSON-compliant type.
  76155. */
  76156. function isObject (obj) {
  76157. return obj !== null && typeof obj === 'object'
  76158. }
  76159. /**
  76160. * Get the raw type string of a value, e.g., [object Object].
  76161. */
  76162. var _toString = Object.prototype.toString;
  76163. function toRawType (value) {
  76164. return _toString.call(value).slice(8, -1)
  76165. }
  76166. /**
  76167. * Strict object type check. Only returns true
  76168. * for plain JavaScript objects.
  76169. */
  76170. function isPlainObject (obj) {
  76171. return _toString.call(obj) === '[object Object]'
  76172. }
  76173. function isRegExp (v) {
  76174. return _toString.call(v) === '[object RegExp]'
  76175. }
  76176. /**
  76177. * Check if val is a valid array index.
  76178. */
  76179. function isValidArrayIndex (val) {
  76180. var n = parseFloat(String(val));
  76181. return n >= 0 && Math.floor(n) === n && isFinite(val)
  76182. }
  76183. function isPromise (val) {
  76184. return (
  76185. isDef(val) &&
  76186. typeof val.then === 'function' &&
  76187. typeof val.catch === 'function'
  76188. )
  76189. }
  76190. /**
  76191. * Convert a value to a string that is actually rendered.
  76192. */
  76193. function toString (val) {
  76194. return val == null
  76195. ? ''
  76196. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  76197. ? JSON.stringify(val, null, 2)
  76198. : String(val)
  76199. }
  76200. /**
  76201. * Convert an input value to a number for persistence.
  76202. * If the conversion fails, return original string.
  76203. */
  76204. function toNumber (val) {
  76205. var n = parseFloat(val);
  76206. return isNaN(n) ? val : n
  76207. }
  76208. /**
  76209. * Make a map and return a function for checking if a key
  76210. * is in that map.
  76211. */
  76212. function makeMap (
  76213. str,
  76214. expectsLowerCase
  76215. ) {
  76216. var map = Object.create(null);
  76217. var list = str.split(',');
  76218. for (var i = 0; i < list.length; i++) {
  76219. map[list[i]] = true;
  76220. }
  76221. return expectsLowerCase
  76222. ? function (val) { return map[val.toLowerCase()]; }
  76223. : function (val) { return map[val]; }
  76224. }
  76225. /**
  76226. * Check if a tag is a built-in tag.
  76227. */
  76228. var isBuiltInTag = makeMap('slot,component', true);
  76229. /**
  76230. * Check if an attribute is a reserved attribute.
  76231. */
  76232. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  76233. /**
  76234. * Remove an item from an array.
  76235. */
  76236. function remove (arr, item) {
  76237. if (arr.length) {
  76238. var index = arr.indexOf(item);
  76239. if (index > -1) {
  76240. return arr.splice(index, 1)
  76241. }
  76242. }
  76243. }
  76244. /**
  76245. * Check whether an object has the property.
  76246. */
  76247. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76248. function hasOwn (obj, key) {
  76249. return hasOwnProperty.call(obj, key)
  76250. }
  76251. /**
  76252. * Create a cached version of a pure function.
  76253. */
  76254. function cached (fn) {
  76255. var cache = Object.create(null);
  76256. return (function cachedFn (str) {
  76257. var hit = cache[str];
  76258. return hit || (cache[str] = fn(str))
  76259. })
  76260. }
  76261. /**
  76262. * Camelize a hyphen-delimited string.
  76263. */
  76264. var camelizeRE = /-(\w)/g;
  76265. var camelize = cached(function (str) {
  76266. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  76267. });
  76268. /**
  76269. * Capitalize a string.
  76270. */
  76271. var capitalize = cached(function (str) {
  76272. return str.charAt(0).toUpperCase() + str.slice(1)
  76273. });
  76274. /**
  76275. * Hyphenate a camelCase string.
  76276. */
  76277. var hyphenateRE = /\B([A-Z])/g;
  76278. var hyphenate = cached(function (str) {
  76279. return str.replace(hyphenateRE, '-$1').toLowerCase()
  76280. });
  76281. /**
  76282. * Simple bind polyfill for environments that do not support it,
  76283. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  76284. * since native bind is now performant enough in most browsers.
  76285. * But removing it would mean breaking code that was able to run in
  76286. * PhantomJS 1.x, so this must be kept for backward compatibility.
  76287. */
  76288. /* istanbul ignore next */
  76289. function polyfillBind (fn, ctx) {
  76290. function boundFn (a) {
  76291. var l = arguments.length;
  76292. return l
  76293. ? l > 1
  76294. ? fn.apply(ctx, arguments)
  76295. : fn.call(ctx, a)
  76296. : fn.call(ctx)
  76297. }
  76298. boundFn._length = fn.length;
  76299. return boundFn
  76300. }
  76301. function nativeBind (fn, ctx) {
  76302. return fn.bind(ctx)
  76303. }
  76304. var bind = Function.prototype.bind
  76305. ? nativeBind
  76306. : polyfillBind;
  76307. /**
  76308. * Convert an Array-like object to a real Array.
  76309. */
  76310. function toArray (list, start) {
  76311. start = start || 0;
  76312. var i = list.length - start;
  76313. var ret = new Array(i);
  76314. while (i--) {
  76315. ret[i] = list[i + start];
  76316. }
  76317. return ret
  76318. }
  76319. /**
  76320. * Mix properties into target object.
  76321. */
  76322. function extend (to, _from) {
  76323. for (var key in _from) {
  76324. to[key] = _from[key];
  76325. }
  76326. return to
  76327. }
  76328. /**
  76329. * Merge an Array of Objects into a single Object.
  76330. */
  76331. function toObject (arr) {
  76332. var res = {};
  76333. for (var i = 0; i < arr.length; i++) {
  76334. if (arr[i]) {
  76335. extend(res, arr[i]);
  76336. }
  76337. }
  76338. return res
  76339. }
  76340. /* eslint-disable no-unused-vars */
  76341. /**
  76342. * Perform no operation.
  76343. * Stubbing args to make Flow happy without leaving useless transpiled code
  76344. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  76345. */
  76346. function noop (a, b, c) {}
  76347. /**
  76348. * Always return false.
  76349. */
  76350. var no = function (a, b, c) { return false; };
  76351. /* eslint-enable no-unused-vars */
  76352. /**
  76353. * Return the same value.
  76354. */
  76355. var identity = function (_) { return _; };
  76356. /**
  76357. * Generate a string containing static keys from compiler modules.
  76358. */
  76359. function genStaticKeys (modules) {
  76360. return modules.reduce(function (keys, m) {
  76361. return keys.concat(m.staticKeys || [])
  76362. }, []).join(',')
  76363. }
  76364. /**
  76365. * Check if two values are loosely equal - that is,
  76366. * if they are plain objects, do they have the same shape?
  76367. */
  76368. function looseEqual (a, b) {
  76369. if (a === b) { return true }
  76370. var isObjectA = isObject(a);
  76371. var isObjectB = isObject(b);
  76372. if (isObjectA && isObjectB) {
  76373. try {
  76374. var isArrayA = Array.isArray(a);
  76375. var isArrayB = Array.isArray(b);
  76376. if (isArrayA && isArrayB) {
  76377. return a.length === b.length && a.every(function (e, i) {
  76378. return looseEqual(e, b[i])
  76379. })
  76380. } else if (a instanceof Date && b instanceof Date) {
  76381. return a.getTime() === b.getTime()
  76382. } else if (!isArrayA && !isArrayB) {
  76383. var keysA = Object.keys(a);
  76384. var keysB = Object.keys(b);
  76385. return keysA.length === keysB.length && keysA.every(function (key) {
  76386. return looseEqual(a[key], b[key])
  76387. })
  76388. } else {
  76389. /* istanbul ignore next */
  76390. return false
  76391. }
  76392. } catch (e) {
  76393. /* istanbul ignore next */
  76394. return false
  76395. }
  76396. } else if (!isObjectA && !isObjectB) {
  76397. return String(a) === String(b)
  76398. } else {
  76399. return false
  76400. }
  76401. }
  76402. /**
  76403. * Return the first index at which a loosely equal value can be
  76404. * found in the array (if value is a plain object, the array must
  76405. * contain an object of the same shape), or -1 if it is not present.
  76406. */
  76407. function looseIndexOf (arr, val) {
  76408. for (var i = 0; i < arr.length; i++) {
  76409. if (looseEqual(arr[i], val)) { return i }
  76410. }
  76411. return -1
  76412. }
  76413. /**
  76414. * Ensure a function is called only once.
  76415. */
  76416. function once (fn) {
  76417. var called = false;
  76418. return function () {
  76419. if (!called) {
  76420. called = true;
  76421. fn.apply(this, arguments);
  76422. }
  76423. }
  76424. }
  76425. var SSR_ATTR = 'data-server-rendered';
  76426. var ASSET_TYPES = [
  76427. 'component',
  76428. 'directive',
  76429. 'filter'
  76430. ];
  76431. var LIFECYCLE_HOOKS = [
  76432. 'beforeCreate',
  76433. 'created',
  76434. 'beforeMount',
  76435. 'mounted',
  76436. 'beforeUpdate',
  76437. 'updated',
  76438. 'beforeDestroy',
  76439. 'destroyed',
  76440. 'activated',
  76441. 'deactivated',
  76442. 'errorCaptured',
  76443. 'serverPrefetch'
  76444. ];
  76445. /* */
  76446. var config = ({
  76447. /**
  76448. * Option merge strategies (used in core/util/options)
  76449. */
  76450. // $flow-disable-line
  76451. optionMergeStrategies: Object.create(null),
  76452. /**
  76453. * Whether to suppress warnings.
  76454. */
  76455. silent: false,
  76456. /**
  76457. * Show production mode tip message on boot?
  76458. */
  76459. productionTip: "development" !== 'production',
  76460. /**
  76461. * Whether to enable devtools
  76462. */
  76463. devtools: "development" !== 'production',
  76464. /**
  76465. * Whether to record perf
  76466. */
  76467. performance: false,
  76468. /**
  76469. * Error handler for watcher errors
  76470. */
  76471. errorHandler: null,
  76472. /**
  76473. * Warn handler for watcher warns
  76474. */
  76475. warnHandler: null,
  76476. /**
  76477. * Ignore certain custom elements
  76478. */
  76479. ignoredElements: [],
  76480. /**
  76481. * Custom user key aliases for v-on
  76482. */
  76483. // $flow-disable-line
  76484. keyCodes: Object.create(null),
  76485. /**
  76486. * Check if a tag is reserved so that it cannot be registered as a
  76487. * component. This is platform-dependent and may be overwritten.
  76488. */
  76489. isReservedTag: no,
  76490. /**
  76491. * Check if an attribute is reserved so that it cannot be used as a component
  76492. * prop. This is platform-dependent and may be overwritten.
  76493. */
  76494. isReservedAttr: no,
  76495. /**
  76496. * Check if a tag is an unknown element.
  76497. * Platform-dependent.
  76498. */
  76499. isUnknownElement: no,
  76500. /**
  76501. * Get the namespace of an element
  76502. */
  76503. getTagNamespace: noop,
  76504. /**
  76505. * Parse the real tag name for the specific platform.
  76506. */
  76507. parsePlatformTagName: identity,
  76508. /**
  76509. * Check if an attribute must be bound using property, e.g. value
  76510. * Platform-dependent.
  76511. */
  76512. mustUseProp: no,
  76513. /**
  76514. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  76515. * This will significantly reduce performance if set to false.
  76516. */
  76517. async: true,
  76518. /**
  76519. * Exposed for legacy reasons
  76520. */
  76521. _lifecycleHooks: LIFECYCLE_HOOKS
  76522. });
  76523. /* */
  76524. /**
  76525. * unicode letters used for parsing html tags, component names and property paths.
  76526. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  76527. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  76528. */
  76529. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  76530. /**
  76531. * Check if a string starts with $ or _
  76532. */
  76533. function isReserved (str) {
  76534. var c = (str + '').charCodeAt(0);
  76535. return c === 0x24 || c === 0x5F
  76536. }
  76537. /**
  76538. * Define a property.
  76539. */
  76540. function def (obj, key, val, enumerable) {
  76541. Object.defineProperty(obj, key, {
  76542. value: val,
  76543. enumerable: !!enumerable,
  76544. writable: true,
  76545. configurable: true
  76546. });
  76547. }
  76548. /**
  76549. * Parse simple path.
  76550. */
  76551. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  76552. function parsePath (path) {
  76553. if (bailRE.test(path)) {
  76554. return
  76555. }
  76556. var segments = path.split('.');
  76557. return function (obj) {
  76558. for (var i = 0; i < segments.length; i++) {
  76559. if (!obj) { return }
  76560. obj = obj[segments[i]];
  76561. }
  76562. return obj
  76563. }
  76564. }
  76565. /* */
  76566. // can we use __proto__?
  76567. var hasProto = '__proto__' in {};
  76568. // Browser environment sniffing
  76569. var inBrowser = typeof window !== 'undefined';
  76570. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  76571. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  76572. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  76573. var isIE = UA && /msie|trident/.test(UA);
  76574. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  76575. var isEdge = UA && UA.indexOf('edge/') > 0;
  76576. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  76577. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  76578. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  76579. var isPhantomJS = UA && /phantomjs/.test(UA);
  76580. var isFF = UA && UA.match(/firefox\/(\d+)/);
  76581. // Firefox has a "watch" function on Object.prototype...
  76582. var nativeWatch = ({}).watch;
  76583. var supportsPassive = false;
  76584. if (inBrowser) {
  76585. try {
  76586. var opts = {};
  76587. Object.defineProperty(opts, 'passive', ({
  76588. get: function get () {
  76589. /* istanbul ignore next */
  76590. supportsPassive = true;
  76591. }
  76592. })); // https://github.com/facebook/flow/issues/285
  76593. window.addEventListener('test-passive', null, opts);
  76594. } catch (e) {}
  76595. }
  76596. // this needs to be lazy-evaled because vue may be required before
  76597. // vue-server-renderer can set VUE_ENV
  76598. var _isServer;
  76599. var isServerRendering = function () {
  76600. if (_isServer === undefined) {
  76601. /* istanbul ignore if */
  76602. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  76603. // detect presence of vue-server-renderer and avoid
  76604. // Webpack shimming the process
  76605. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  76606. } else {
  76607. _isServer = false;
  76608. }
  76609. }
  76610. return _isServer
  76611. };
  76612. // detect devtools
  76613. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  76614. /* istanbul ignore next */
  76615. function isNative (Ctor) {
  76616. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  76617. }
  76618. var hasSymbol =
  76619. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  76620. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  76621. var _Set;
  76622. /* istanbul ignore if */ // $flow-disable-line
  76623. if (typeof Set !== 'undefined' && isNative(Set)) {
  76624. // use native Set when available.
  76625. _Set = Set;
  76626. } else {
  76627. // a non-standard Set polyfill that only works with primitive keys.
  76628. _Set = /*@__PURE__*/(function () {
  76629. function Set () {
  76630. this.set = Object.create(null);
  76631. }
  76632. Set.prototype.has = function has (key) {
  76633. return this.set[key] === true
  76634. };
  76635. Set.prototype.add = function add (key) {
  76636. this.set[key] = true;
  76637. };
  76638. Set.prototype.clear = function clear () {
  76639. this.set = Object.create(null);
  76640. };
  76641. return Set;
  76642. }());
  76643. }
  76644. /* */
  76645. var warn = noop;
  76646. var tip = noop;
  76647. var generateComponentTrace = (noop); // work around flow check
  76648. var formatComponentName = (noop);
  76649. {
  76650. var hasConsole = typeof console !== 'undefined';
  76651. var classifyRE = /(?:^|[-_])(\w)/g;
  76652. var classify = function (str) { return str
  76653. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  76654. .replace(/[-_]/g, ''); };
  76655. warn = function (msg, vm) {
  76656. var trace = vm ? generateComponentTrace(vm) : '';
  76657. if (config.warnHandler) {
  76658. config.warnHandler.call(null, msg, vm, trace);
  76659. } else if (hasConsole && (!config.silent)) {
  76660. console.error(("[Vue warn]: " + msg + trace));
  76661. }
  76662. };
  76663. tip = function (msg, vm) {
  76664. if (hasConsole && (!config.silent)) {
  76665. console.warn("[Vue tip]: " + msg + (
  76666. vm ? generateComponentTrace(vm) : ''
  76667. ));
  76668. }
  76669. };
  76670. formatComponentName = function (vm, includeFile) {
  76671. if (vm.$root === vm) {
  76672. return '<Root>'
  76673. }
  76674. var options = typeof vm === 'function' && vm.cid != null
  76675. ? vm.options
  76676. : vm._isVue
  76677. ? vm.$options || vm.constructor.options
  76678. : vm;
  76679. var name = options.name || options._componentTag;
  76680. var file = options.__file;
  76681. if (!name && file) {
  76682. var match = file.match(/([^/\\]+)\.vue$/);
  76683. name = match && match[1];
  76684. }
  76685. return (
  76686. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  76687. (file && includeFile !== false ? (" at " + file) : '')
  76688. )
  76689. };
  76690. var repeat = function (str, n) {
  76691. var res = '';
  76692. while (n) {
  76693. if (n % 2 === 1) { res += str; }
  76694. if (n > 1) { str += str; }
  76695. n >>= 1;
  76696. }
  76697. return res
  76698. };
  76699. generateComponentTrace = function (vm) {
  76700. if (vm._isVue && vm.$parent) {
  76701. var tree = [];
  76702. var currentRecursiveSequence = 0;
  76703. while (vm) {
  76704. if (tree.length > 0) {
  76705. var last = tree[tree.length - 1];
  76706. if (last.constructor === vm.constructor) {
  76707. currentRecursiveSequence++;
  76708. vm = vm.$parent;
  76709. continue
  76710. } else if (currentRecursiveSequence > 0) {
  76711. tree[tree.length - 1] = [last, currentRecursiveSequence];
  76712. currentRecursiveSequence = 0;
  76713. }
  76714. }
  76715. tree.push(vm);
  76716. vm = vm.$parent;
  76717. }
  76718. return '\n\nfound in\n\n' + tree
  76719. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  76720. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  76721. : formatComponentName(vm))); })
  76722. .join('\n')
  76723. } else {
  76724. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  76725. }
  76726. };
  76727. }
  76728. /* */
  76729. var uid = 0;
  76730. /**
  76731. * A dep is an observable that can have multiple
  76732. * directives subscribing to it.
  76733. */
  76734. var Dep = function Dep () {
  76735. this.id = uid++;
  76736. this.subs = [];
  76737. };
  76738. Dep.prototype.addSub = function addSub (sub) {
  76739. this.subs.push(sub);
  76740. };
  76741. Dep.prototype.removeSub = function removeSub (sub) {
  76742. remove(this.subs, sub);
  76743. };
  76744. Dep.prototype.depend = function depend () {
  76745. if (Dep.target) {
  76746. Dep.target.addDep(this);
  76747. }
  76748. };
  76749. Dep.prototype.notify = function notify () {
  76750. // stabilize the subscriber list first
  76751. var subs = this.subs.slice();
  76752. if (!config.async) {
  76753. // subs aren't sorted in scheduler if not running async
  76754. // we need to sort them now to make sure they fire in correct
  76755. // order
  76756. subs.sort(function (a, b) { return a.id - b.id; });
  76757. }
  76758. for (var i = 0, l = subs.length; i < l; i++) {
  76759. subs[i].update();
  76760. }
  76761. };
  76762. // The current target watcher being evaluated.
  76763. // This is globally unique because only one watcher
  76764. // can be evaluated at a time.
  76765. Dep.target = null;
  76766. var targetStack = [];
  76767. function pushTarget (target) {
  76768. targetStack.push(target);
  76769. Dep.target = target;
  76770. }
  76771. function popTarget () {
  76772. targetStack.pop();
  76773. Dep.target = targetStack[targetStack.length - 1];
  76774. }
  76775. /* */
  76776. var VNode = function VNode (
  76777. tag,
  76778. data,
  76779. children,
  76780. text,
  76781. elm,
  76782. context,
  76783. componentOptions,
  76784. asyncFactory
  76785. ) {
  76786. this.tag = tag;
  76787. this.data = data;
  76788. this.children = children;
  76789. this.text = text;
  76790. this.elm = elm;
  76791. this.ns = undefined;
  76792. this.context = context;
  76793. this.fnContext = undefined;
  76794. this.fnOptions = undefined;
  76795. this.fnScopeId = undefined;
  76796. this.key = data && data.key;
  76797. this.componentOptions = componentOptions;
  76798. this.componentInstance = undefined;
  76799. this.parent = undefined;
  76800. this.raw = false;
  76801. this.isStatic = false;
  76802. this.isRootInsert = true;
  76803. this.isComment = false;
  76804. this.isCloned = false;
  76805. this.isOnce = false;
  76806. this.asyncFactory = asyncFactory;
  76807. this.asyncMeta = undefined;
  76808. this.isAsyncPlaceholder = false;
  76809. };
  76810. var prototypeAccessors = { child: { configurable: true } };
  76811. // DEPRECATED: alias for componentInstance for backwards compat.
  76812. /* istanbul ignore next */
  76813. prototypeAccessors.child.get = function () {
  76814. return this.componentInstance
  76815. };
  76816. Object.defineProperties( VNode.prototype, prototypeAccessors );
  76817. var createEmptyVNode = function (text) {
  76818. if ( text === void 0 ) text = '';
  76819. var node = new VNode();
  76820. node.text = text;
  76821. node.isComment = true;
  76822. return node
  76823. };
  76824. function createTextVNode (val) {
  76825. return new VNode(undefined, undefined, undefined, String(val))
  76826. }
  76827. // optimized shallow clone
  76828. // used for static nodes and slot nodes because they may be reused across
  76829. // multiple renders, cloning them avoids errors when DOM manipulations rely
  76830. // on their elm reference.
  76831. function cloneVNode (vnode) {
  76832. var cloned = new VNode(
  76833. vnode.tag,
  76834. vnode.data,
  76835. // #7975
  76836. // clone children array to avoid mutating original in case of cloning
  76837. // a child.
  76838. vnode.children && vnode.children.slice(),
  76839. vnode.text,
  76840. vnode.elm,
  76841. vnode.context,
  76842. vnode.componentOptions,
  76843. vnode.asyncFactory
  76844. );
  76845. cloned.ns = vnode.ns;
  76846. cloned.isStatic = vnode.isStatic;
  76847. cloned.key = vnode.key;
  76848. cloned.isComment = vnode.isComment;
  76849. cloned.fnContext = vnode.fnContext;
  76850. cloned.fnOptions = vnode.fnOptions;
  76851. cloned.fnScopeId = vnode.fnScopeId;
  76852. cloned.asyncMeta = vnode.asyncMeta;
  76853. cloned.isCloned = true;
  76854. return cloned
  76855. }
  76856. /*
  76857. * not type checking this file because flow doesn't play well with
  76858. * dynamically accessing methods on Array prototype
  76859. */
  76860. var arrayProto = Array.prototype;
  76861. var arrayMethods = Object.create(arrayProto);
  76862. var methodsToPatch = [
  76863. 'push',
  76864. 'pop',
  76865. 'shift',
  76866. 'unshift',
  76867. 'splice',
  76868. 'sort',
  76869. 'reverse'
  76870. ];
  76871. /**
  76872. * Intercept mutating methods and emit events
  76873. */
  76874. methodsToPatch.forEach(function (method) {
  76875. // cache original method
  76876. var original = arrayProto[method];
  76877. def(arrayMethods, method, function mutator () {
  76878. var args = [], len = arguments.length;
  76879. while ( len-- ) args[ len ] = arguments[ len ];
  76880. var result = original.apply(this, args);
  76881. var ob = this.__ob__;
  76882. var inserted;
  76883. switch (method) {
  76884. case 'push':
  76885. case 'unshift':
  76886. inserted = args;
  76887. break
  76888. case 'splice':
  76889. inserted = args.slice(2);
  76890. break
  76891. }
  76892. if (inserted) { ob.observeArray(inserted); }
  76893. // notify change
  76894. ob.dep.notify();
  76895. return result
  76896. });
  76897. });
  76898. /* */
  76899. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  76900. /**
  76901. * In some cases we may want to disable observation inside a component's
  76902. * update computation.
  76903. */
  76904. var shouldObserve = true;
  76905. function toggleObserving (value) {
  76906. shouldObserve = value;
  76907. }
  76908. /**
  76909. * Observer class that is attached to each observed
  76910. * object. Once attached, the observer converts the target
  76911. * object's property keys into getter/setters that
  76912. * collect dependencies and dispatch updates.
  76913. */
  76914. var Observer = function Observer (value) {
  76915. this.value = value;
  76916. this.dep = new Dep();
  76917. this.vmCount = 0;
  76918. def(value, '__ob__', this);
  76919. if (Array.isArray(value)) {
  76920. if (hasProto) {
  76921. protoAugment(value, arrayMethods);
  76922. } else {
  76923. copyAugment(value, arrayMethods, arrayKeys);
  76924. }
  76925. this.observeArray(value);
  76926. } else {
  76927. this.walk(value);
  76928. }
  76929. };
  76930. /**
  76931. * Walk through all properties and convert them into
  76932. * getter/setters. This method should only be called when
  76933. * value type is Object.
  76934. */
  76935. Observer.prototype.walk = function walk (obj) {
  76936. var keys = Object.keys(obj);
  76937. for (var i = 0; i < keys.length; i++) {
  76938. defineReactive$$1(obj, keys[i]);
  76939. }
  76940. };
  76941. /**
  76942. * Observe a list of Array items.
  76943. */
  76944. Observer.prototype.observeArray = function observeArray (items) {
  76945. for (var i = 0, l = items.length; i < l; i++) {
  76946. observe(items[i]);
  76947. }
  76948. };
  76949. // helpers
  76950. /**
  76951. * Augment a target Object or Array by intercepting
  76952. * the prototype chain using __proto__
  76953. */
  76954. function protoAugment (target, src) {
  76955. /* eslint-disable no-proto */
  76956. target.__proto__ = src;
  76957. /* eslint-enable no-proto */
  76958. }
  76959. /**
  76960. * Augment a target Object or Array by defining
  76961. * hidden properties.
  76962. */
  76963. /* istanbul ignore next */
  76964. function copyAugment (target, src, keys) {
  76965. for (var i = 0, l = keys.length; i < l; i++) {
  76966. var key = keys[i];
  76967. def(target, key, src[key]);
  76968. }
  76969. }
  76970. /**
  76971. * Attempt to create an observer instance for a value,
  76972. * returns the new observer if successfully observed,
  76973. * or the existing observer if the value already has one.
  76974. */
  76975. function observe (value, asRootData) {
  76976. if (!isObject(value) || value instanceof VNode) {
  76977. return
  76978. }
  76979. var ob;
  76980. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  76981. ob = value.__ob__;
  76982. } else if (
  76983. shouldObserve &&
  76984. !isServerRendering() &&
  76985. (Array.isArray(value) || isPlainObject(value)) &&
  76986. Object.isExtensible(value) &&
  76987. !value._isVue
  76988. ) {
  76989. ob = new Observer(value);
  76990. }
  76991. if (asRootData && ob) {
  76992. ob.vmCount++;
  76993. }
  76994. return ob
  76995. }
  76996. /**
  76997. * Define a reactive property on an Object.
  76998. */
  76999. function defineReactive$$1 (
  77000. obj,
  77001. key,
  77002. val,
  77003. customSetter,
  77004. shallow
  77005. ) {
  77006. var dep = new Dep();
  77007. var property = Object.getOwnPropertyDescriptor(obj, key);
  77008. if (property && property.configurable === false) {
  77009. return
  77010. }
  77011. // cater for pre-defined getter/setters
  77012. var getter = property && property.get;
  77013. var setter = property && property.set;
  77014. if ((!getter || setter) && arguments.length === 2) {
  77015. val = obj[key];
  77016. }
  77017. var childOb = !shallow && observe(val);
  77018. Object.defineProperty(obj, key, {
  77019. enumerable: true,
  77020. configurable: true,
  77021. get: function reactiveGetter () {
  77022. var value = getter ? getter.call(obj) : val;
  77023. if (Dep.target) {
  77024. dep.depend();
  77025. if (childOb) {
  77026. childOb.dep.depend();
  77027. if (Array.isArray(value)) {
  77028. dependArray(value);
  77029. }
  77030. }
  77031. }
  77032. return value
  77033. },
  77034. set: function reactiveSetter (newVal) {
  77035. var value = getter ? getter.call(obj) : val;
  77036. /* eslint-disable no-self-compare */
  77037. if (newVal === value || (newVal !== newVal && value !== value)) {
  77038. return
  77039. }
  77040. /* eslint-enable no-self-compare */
  77041. if (customSetter) {
  77042. customSetter();
  77043. }
  77044. // #7981: for accessor properties without setter
  77045. if (getter && !setter) { return }
  77046. if (setter) {
  77047. setter.call(obj, newVal);
  77048. } else {
  77049. val = newVal;
  77050. }
  77051. childOb = !shallow && observe(newVal);
  77052. dep.notify();
  77053. }
  77054. });
  77055. }
  77056. /**
  77057. * Set a property on an object. Adds the new property and
  77058. * triggers change notification if the property doesn't
  77059. * already exist.
  77060. */
  77061. function set (target, key, val) {
  77062. if (isUndef(target) || isPrimitive(target)
  77063. ) {
  77064. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  77065. }
  77066. if (Array.isArray(target) && isValidArrayIndex(key)) {
  77067. target.length = Math.max(target.length, key);
  77068. target.splice(key, 1, val);
  77069. return val
  77070. }
  77071. if (key in target && !(key in Object.prototype)) {
  77072. target[key] = val;
  77073. return val
  77074. }
  77075. var ob = (target).__ob__;
  77076. if (target._isVue || (ob && ob.vmCount)) {
  77077. warn(
  77078. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  77079. 'at runtime - declare it upfront in the data option.'
  77080. );
  77081. return val
  77082. }
  77083. if (!ob) {
  77084. target[key] = val;
  77085. return val
  77086. }
  77087. defineReactive$$1(ob.value, key, val);
  77088. ob.dep.notify();
  77089. return val
  77090. }
  77091. /**
  77092. * Delete a property and trigger change if necessary.
  77093. */
  77094. function del (target, key) {
  77095. if (isUndef(target) || isPrimitive(target)
  77096. ) {
  77097. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  77098. }
  77099. if (Array.isArray(target) && isValidArrayIndex(key)) {
  77100. target.splice(key, 1);
  77101. return
  77102. }
  77103. var ob = (target).__ob__;
  77104. if (target._isVue || (ob && ob.vmCount)) {
  77105. warn(
  77106. 'Avoid deleting properties on a Vue instance or its root $data ' +
  77107. '- just set it to null.'
  77108. );
  77109. return
  77110. }
  77111. if (!hasOwn(target, key)) {
  77112. return
  77113. }
  77114. delete target[key];
  77115. if (!ob) {
  77116. return
  77117. }
  77118. ob.dep.notify();
  77119. }
  77120. /**
  77121. * Collect dependencies on array elements when the array is touched, since
  77122. * we cannot intercept array element access like property getters.
  77123. */
  77124. function dependArray (value) {
  77125. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  77126. e = value[i];
  77127. e && e.__ob__ && e.__ob__.dep.depend();
  77128. if (Array.isArray(e)) {
  77129. dependArray(e);
  77130. }
  77131. }
  77132. }
  77133. /* */
  77134. /**
  77135. * Option overwriting strategies are functions that handle
  77136. * how to merge a parent option value and a child option
  77137. * value into the final value.
  77138. */
  77139. var strats = config.optionMergeStrategies;
  77140. /**
  77141. * Options with restrictions
  77142. */
  77143. {
  77144. strats.el = strats.propsData = function (parent, child, vm, key) {
  77145. if (!vm) {
  77146. warn(
  77147. "option \"" + key + "\" can only be used during instance " +
  77148. 'creation with the `new` keyword.'
  77149. );
  77150. }
  77151. return defaultStrat(parent, child)
  77152. };
  77153. }
  77154. /**
  77155. * Helper that recursively merges two data objects together.
  77156. */
  77157. function mergeData (to, from) {
  77158. if (!from) { return to }
  77159. var key, toVal, fromVal;
  77160. var keys = hasSymbol
  77161. ? Reflect.ownKeys(from)
  77162. : Object.keys(from);
  77163. for (var i = 0; i < keys.length; i++) {
  77164. key = keys[i];
  77165. // in case the object is already observed...
  77166. if (key === '__ob__') { continue }
  77167. toVal = to[key];
  77168. fromVal = from[key];
  77169. if (!hasOwn(to, key)) {
  77170. set(to, key, fromVal);
  77171. } else if (
  77172. toVal !== fromVal &&
  77173. isPlainObject(toVal) &&
  77174. isPlainObject(fromVal)
  77175. ) {
  77176. mergeData(toVal, fromVal);
  77177. }
  77178. }
  77179. return to
  77180. }
  77181. /**
  77182. * Data
  77183. */
  77184. function mergeDataOrFn (
  77185. parentVal,
  77186. childVal,
  77187. vm
  77188. ) {
  77189. if (!vm) {
  77190. // in a Vue.extend merge, both should be functions
  77191. if (!childVal) {
  77192. return parentVal
  77193. }
  77194. if (!parentVal) {
  77195. return childVal
  77196. }
  77197. // when parentVal & childVal are both present,
  77198. // we need to return a function that returns the
  77199. // merged result of both functions... no need to
  77200. // check if parentVal is a function here because
  77201. // it has to be a function to pass previous merges.
  77202. return function mergedDataFn () {
  77203. return mergeData(
  77204. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  77205. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  77206. )
  77207. }
  77208. } else {
  77209. return function mergedInstanceDataFn () {
  77210. // instance merge
  77211. var instanceData = typeof childVal === 'function'
  77212. ? childVal.call(vm, vm)
  77213. : childVal;
  77214. var defaultData = typeof parentVal === 'function'
  77215. ? parentVal.call(vm, vm)
  77216. : parentVal;
  77217. if (instanceData) {
  77218. return mergeData(instanceData, defaultData)
  77219. } else {
  77220. return defaultData
  77221. }
  77222. }
  77223. }
  77224. }
  77225. strats.data = function (
  77226. parentVal,
  77227. childVal,
  77228. vm
  77229. ) {
  77230. if (!vm) {
  77231. if (childVal && typeof childVal !== 'function') {
  77232. warn(
  77233. 'The "data" option should be a function ' +
  77234. 'that returns a per-instance value in component ' +
  77235. 'definitions.',
  77236. vm
  77237. );
  77238. return parentVal
  77239. }
  77240. return mergeDataOrFn(parentVal, childVal)
  77241. }
  77242. return mergeDataOrFn(parentVal, childVal, vm)
  77243. };
  77244. /**
  77245. * Hooks and props are merged as arrays.
  77246. */
  77247. function mergeHook (
  77248. parentVal,
  77249. childVal
  77250. ) {
  77251. var res = childVal
  77252. ? parentVal
  77253. ? parentVal.concat(childVal)
  77254. : Array.isArray(childVal)
  77255. ? childVal
  77256. : [childVal]
  77257. : parentVal;
  77258. return res
  77259. ? dedupeHooks(res)
  77260. : res
  77261. }
  77262. function dedupeHooks (hooks) {
  77263. var res = [];
  77264. for (var i = 0; i < hooks.length; i++) {
  77265. if (res.indexOf(hooks[i]) === -1) {
  77266. res.push(hooks[i]);
  77267. }
  77268. }
  77269. return res
  77270. }
  77271. LIFECYCLE_HOOKS.forEach(function (hook) {
  77272. strats[hook] = mergeHook;
  77273. });
  77274. /**
  77275. * Assets
  77276. *
  77277. * When a vm is present (instance creation), we need to do
  77278. * a three-way merge between constructor options, instance
  77279. * options and parent options.
  77280. */
  77281. function mergeAssets (
  77282. parentVal,
  77283. childVal,
  77284. vm,
  77285. key
  77286. ) {
  77287. var res = Object.create(parentVal || null);
  77288. if (childVal) {
  77289. assertObjectType(key, childVal, vm);
  77290. return extend(res, childVal)
  77291. } else {
  77292. return res
  77293. }
  77294. }
  77295. ASSET_TYPES.forEach(function (type) {
  77296. strats[type + 's'] = mergeAssets;
  77297. });
  77298. /**
  77299. * Watchers.
  77300. *
  77301. * Watchers hashes should not overwrite one
  77302. * another, so we merge them as arrays.
  77303. */
  77304. strats.watch = function (
  77305. parentVal,
  77306. childVal,
  77307. vm,
  77308. key
  77309. ) {
  77310. // work around Firefox's Object.prototype.watch...
  77311. if (parentVal === nativeWatch) { parentVal = undefined; }
  77312. if (childVal === nativeWatch) { childVal = undefined; }
  77313. /* istanbul ignore if */
  77314. if (!childVal) { return Object.create(parentVal || null) }
  77315. {
  77316. assertObjectType(key, childVal, vm);
  77317. }
  77318. if (!parentVal) { return childVal }
  77319. var ret = {};
  77320. extend(ret, parentVal);
  77321. for (var key$1 in childVal) {
  77322. var parent = ret[key$1];
  77323. var child = childVal[key$1];
  77324. if (parent && !Array.isArray(parent)) {
  77325. parent = [parent];
  77326. }
  77327. ret[key$1] = parent
  77328. ? parent.concat(child)
  77329. : Array.isArray(child) ? child : [child];
  77330. }
  77331. return ret
  77332. };
  77333. /**
  77334. * Other object hashes.
  77335. */
  77336. strats.props =
  77337. strats.methods =
  77338. strats.inject =
  77339. strats.computed = function (
  77340. parentVal,
  77341. childVal,
  77342. vm,
  77343. key
  77344. ) {
  77345. if (childVal && "development" !== 'production') {
  77346. assertObjectType(key, childVal, vm);
  77347. }
  77348. if (!parentVal) { return childVal }
  77349. var ret = Object.create(null);
  77350. extend(ret, parentVal);
  77351. if (childVal) { extend(ret, childVal); }
  77352. return ret
  77353. };
  77354. strats.provide = mergeDataOrFn;
  77355. /**
  77356. * Default strategy.
  77357. */
  77358. var defaultStrat = function (parentVal, childVal) {
  77359. return childVal === undefined
  77360. ? parentVal
  77361. : childVal
  77362. };
  77363. /**
  77364. * Validate component names
  77365. */
  77366. function checkComponents (options) {
  77367. for (var key in options.components) {
  77368. validateComponentName(key);
  77369. }
  77370. }
  77371. function validateComponentName (name) {
  77372. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  77373. warn(
  77374. 'Invalid component name: "' + name + '". Component names ' +
  77375. 'should conform to valid custom element name in html5 specification.'
  77376. );
  77377. }
  77378. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  77379. warn(
  77380. 'Do not use built-in or reserved HTML elements as component ' +
  77381. 'id: ' + name
  77382. );
  77383. }
  77384. }
  77385. /**
  77386. * Ensure all props option syntax are normalized into the
  77387. * Object-based format.
  77388. */
  77389. function normalizeProps (options, vm) {
  77390. var props = options.props;
  77391. if (!props) { return }
  77392. var res = {};
  77393. var i, val, name;
  77394. if (Array.isArray(props)) {
  77395. i = props.length;
  77396. while (i--) {
  77397. val = props[i];
  77398. if (typeof val === 'string') {
  77399. name = camelize(val);
  77400. res[name] = { type: null };
  77401. } else {
  77402. warn('props must be strings when using array syntax.');
  77403. }
  77404. }
  77405. } else if (isPlainObject(props)) {
  77406. for (var key in props) {
  77407. val = props[key];
  77408. name = camelize(key);
  77409. res[name] = isPlainObject(val)
  77410. ? val
  77411. : { type: val };
  77412. }
  77413. } else {
  77414. warn(
  77415. "Invalid value for option \"props\": expected an Array or an Object, " +
  77416. "but got " + (toRawType(props)) + ".",
  77417. vm
  77418. );
  77419. }
  77420. options.props = res;
  77421. }
  77422. /**
  77423. * Normalize all injections into Object-based format
  77424. */
  77425. function normalizeInject (options, vm) {
  77426. var inject = options.inject;
  77427. if (!inject) { return }
  77428. var normalized = options.inject = {};
  77429. if (Array.isArray(inject)) {
  77430. for (var i = 0; i < inject.length; i++) {
  77431. normalized[inject[i]] = { from: inject[i] };
  77432. }
  77433. } else if (isPlainObject(inject)) {
  77434. for (var key in inject) {
  77435. var val = inject[key];
  77436. normalized[key] = isPlainObject(val)
  77437. ? extend({ from: key }, val)
  77438. : { from: val };
  77439. }
  77440. } else {
  77441. warn(
  77442. "Invalid value for option \"inject\": expected an Array or an Object, " +
  77443. "but got " + (toRawType(inject)) + ".",
  77444. vm
  77445. );
  77446. }
  77447. }
  77448. /**
  77449. * Normalize raw function directives into object format.
  77450. */
  77451. function normalizeDirectives (options) {
  77452. var dirs = options.directives;
  77453. if (dirs) {
  77454. for (var key in dirs) {
  77455. var def$$1 = dirs[key];
  77456. if (typeof def$$1 === 'function') {
  77457. dirs[key] = { bind: def$$1, update: def$$1 };
  77458. }
  77459. }
  77460. }
  77461. }
  77462. function assertObjectType (name, value, vm) {
  77463. if (!isPlainObject(value)) {
  77464. warn(
  77465. "Invalid value for option \"" + name + "\": expected an Object, " +
  77466. "but got " + (toRawType(value)) + ".",
  77467. vm
  77468. );
  77469. }
  77470. }
  77471. /**
  77472. * Merge two option objects into a new one.
  77473. * Core utility used in both instantiation and inheritance.
  77474. */
  77475. function mergeOptions (
  77476. parent,
  77477. child,
  77478. vm
  77479. ) {
  77480. {
  77481. checkComponents(child);
  77482. }
  77483. if (typeof child === 'function') {
  77484. child = child.options;
  77485. }
  77486. normalizeProps(child, vm);
  77487. normalizeInject(child, vm);
  77488. normalizeDirectives(child);
  77489. // Apply extends and mixins on the child options,
  77490. // but only if it is a raw options object that isn't
  77491. // the result of another mergeOptions call.
  77492. // Only merged options has the _base property.
  77493. if (!child._base) {
  77494. if (child.extends) {
  77495. parent = mergeOptions(parent, child.extends, vm);
  77496. }
  77497. if (child.mixins) {
  77498. for (var i = 0, l = child.mixins.length; i < l; i++) {
  77499. parent = mergeOptions(parent, child.mixins[i], vm);
  77500. }
  77501. }
  77502. }
  77503. var options = {};
  77504. var key;
  77505. for (key in parent) {
  77506. mergeField(key);
  77507. }
  77508. for (key in child) {
  77509. if (!hasOwn(parent, key)) {
  77510. mergeField(key);
  77511. }
  77512. }
  77513. function mergeField (key) {
  77514. var strat = strats[key] || defaultStrat;
  77515. options[key] = strat(parent[key], child[key], vm, key);
  77516. }
  77517. return options
  77518. }
  77519. /**
  77520. * Resolve an asset.
  77521. * This function is used because child instances need access
  77522. * to assets defined in its ancestor chain.
  77523. */
  77524. function resolveAsset (
  77525. options,
  77526. type,
  77527. id,
  77528. warnMissing
  77529. ) {
  77530. /* istanbul ignore if */
  77531. if (typeof id !== 'string') {
  77532. return
  77533. }
  77534. var assets = options[type];
  77535. // check local registration variations first
  77536. if (hasOwn(assets, id)) { return assets[id] }
  77537. var camelizedId = camelize(id);
  77538. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  77539. var PascalCaseId = capitalize(camelizedId);
  77540. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  77541. // fallback to prototype chain
  77542. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  77543. if (warnMissing && !res) {
  77544. warn(
  77545. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  77546. options
  77547. );
  77548. }
  77549. return res
  77550. }
  77551. /* */
  77552. function validateProp (
  77553. key,
  77554. propOptions,
  77555. propsData,
  77556. vm
  77557. ) {
  77558. var prop = propOptions[key];
  77559. var absent = !hasOwn(propsData, key);
  77560. var value = propsData[key];
  77561. // boolean casting
  77562. var booleanIndex = getTypeIndex(Boolean, prop.type);
  77563. if (booleanIndex > -1) {
  77564. if (absent && !hasOwn(prop, 'default')) {
  77565. value = false;
  77566. } else if (value === '' || value === hyphenate(key)) {
  77567. // only cast empty string / same name to boolean if
  77568. // boolean has higher priority
  77569. var stringIndex = getTypeIndex(String, prop.type);
  77570. if (stringIndex < 0 || booleanIndex < stringIndex) {
  77571. value = true;
  77572. }
  77573. }
  77574. }
  77575. // check default value
  77576. if (value === undefined) {
  77577. value = getPropDefaultValue(vm, prop, key);
  77578. // since the default value is a fresh copy,
  77579. // make sure to observe it.
  77580. var prevShouldObserve = shouldObserve;
  77581. toggleObserving(true);
  77582. observe(value);
  77583. toggleObserving(prevShouldObserve);
  77584. }
  77585. {
  77586. assertProp(prop, key, value, vm, absent);
  77587. }
  77588. return value
  77589. }
  77590. /**
  77591. * Get the default value of a prop.
  77592. */
  77593. function getPropDefaultValue (vm, prop, key) {
  77594. // no default, return undefined
  77595. if (!hasOwn(prop, 'default')) {
  77596. return undefined
  77597. }
  77598. var def = prop.default;
  77599. // warn against non-factory defaults for Object & Array
  77600. if (isObject(def)) {
  77601. warn(
  77602. 'Invalid default value for prop "' + key + '": ' +
  77603. 'Props with type Object/Array must use a factory function ' +
  77604. 'to return the default value.',
  77605. vm
  77606. );
  77607. }
  77608. // the raw prop value was also undefined from previous render,
  77609. // return previous default value to avoid unnecessary watcher trigger
  77610. if (vm && vm.$options.propsData &&
  77611. vm.$options.propsData[key] === undefined &&
  77612. vm._props[key] !== undefined
  77613. ) {
  77614. return vm._props[key]
  77615. }
  77616. // call factory function for non-Function types
  77617. // a value is Function if its prototype is function even across different execution context
  77618. return typeof def === 'function' && getType(prop.type) !== 'Function'
  77619. ? def.call(vm)
  77620. : def
  77621. }
  77622. /**
  77623. * Assert whether a prop is valid.
  77624. */
  77625. function assertProp (
  77626. prop,
  77627. name,
  77628. value,
  77629. vm,
  77630. absent
  77631. ) {
  77632. if (prop.required && absent) {
  77633. warn(
  77634. 'Missing required prop: "' + name + '"',
  77635. vm
  77636. );
  77637. return
  77638. }
  77639. if (value == null && !prop.required) {
  77640. return
  77641. }
  77642. var type = prop.type;
  77643. var valid = !type || type === true;
  77644. var expectedTypes = [];
  77645. if (type) {
  77646. if (!Array.isArray(type)) {
  77647. type = [type];
  77648. }
  77649. for (var i = 0; i < type.length && !valid; i++) {
  77650. var assertedType = assertType(value, type[i]);
  77651. expectedTypes.push(assertedType.expectedType || '');
  77652. valid = assertedType.valid;
  77653. }
  77654. }
  77655. if (!valid) {
  77656. warn(
  77657. getInvalidTypeMessage(name, value, expectedTypes),
  77658. vm
  77659. );
  77660. return
  77661. }
  77662. var validator = prop.validator;
  77663. if (validator) {
  77664. if (!validator(value)) {
  77665. warn(
  77666. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  77667. vm
  77668. );
  77669. }
  77670. }
  77671. }
  77672. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  77673. function assertType (value, type) {
  77674. var valid;
  77675. var expectedType = getType(type);
  77676. if (simpleCheckRE.test(expectedType)) {
  77677. var t = typeof value;
  77678. valid = t === expectedType.toLowerCase();
  77679. // for primitive wrapper objects
  77680. if (!valid && t === 'object') {
  77681. valid = value instanceof type;
  77682. }
  77683. } else if (expectedType === 'Object') {
  77684. valid = isPlainObject(value);
  77685. } else if (expectedType === 'Array') {
  77686. valid = Array.isArray(value);
  77687. } else {
  77688. valid = value instanceof type;
  77689. }
  77690. return {
  77691. valid: valid,
  77692. expectedType: expectedType
  77693. }
  77694. }
  77695. /**
  77696. * Use function string name to check built-in types,
  77697. * because a simple equality check will fail when running
  77698. * across different vms / iframes.
  77699. */
  77700. function getType (fn) {
  77701. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  77702. return match ? match[1] : ''
  77703. }
  77704. function isSameType (a, b) {
  77705. return getType(a) === getType(b)
  77706. }
  77707. function getTypeIndex (type, expectedTypes) {
  77708. if (!Array.isArray(expectedTypes)) {
  77709. return isSameType(expectedTypes, type) ? 0 : -1
  77710. }
  77711. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  77712. if (isSameType(expectedTypes[i], type)) {
  77713. return i
  77714. }
  77715. }
  77716. return -1
  77717. }
  77718. function getInvalidTypeMessage (name, value, expectedTypes) {
  77719. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  77720. " Expected " + (expectedTypes.map(capitalize).join(', '));
  77721. var expectedType = expectedTypes[0];
  77722. var receivedType = toRawType(value);
  77723. var expectedValue = styleValue(value, expectedType);
  77724. var receivedValue = styleValue(value, receivedType);
  77725. // check if we need to specify expected value
  77726. if (expectedTypes.length === 1 &&
  77727. isExplicable(expectedType) &&
  77728. !isBoolean(expectedType, receivedType)) {
  77729. message += " with value " + expectedValue;
  77730. }
  77731. message += ", got " + receivedType + " ";
  77732. // check if we need to specify received value
  77733. if (isExplicable(receivedType)) {
  77734. message += "with value " + receivedValue + ".";
  77735. }
  77736. return message
  77737. }
  77738. function styleValue (value, type) {
  77739. if (type === 'String') {
  77740. return ("\"" + value + "\"")
  77741. } else if (type === 'Number') {
  77742. return ("" + (Number(value)))
  77743. } else {
  77744. return ("" + value)
  77745. }
  77746. }
  77747. function isExplicable (value) {
  77748. var explicitTypes = ['string', 'number', 'boolean'];
  77749. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  77750. }
  77751. function isBoolean () {
  77752. var args = [], len = arguments.length;
  77753. while ( len-- ) args[ len ] = arguments[ len ];
  77754. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  77755. }
  77756. /* */
  77757. function handleError (err, vm, info) {
  77758. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  77759. // See: https://github.com/vuejs/vuex/issues/1505
  77760. pushTarget();
  77761. try {
  77762. if (vm) {
  77763. var cur = vm;
  77764. while ((cur = cur.$parent)) {
  77765. var hooks = cur.$options.errorCaptured;
  77766. if (hooks) {
  77767. for (var i = 0; i < hooks.length; i++) {
  77768. try {
  77769. var capture = hooks[i].call(cur, err, vm, info) === false;
  77770. if (capture) { return }
  77771. } catch (e) {
  77772. globalHandleError(e, cur, 'errorCaptured hook');
  77773. }
  77774. }
  77775. }
  77776. }
  77777. }
  77778. globalHandleError(err, vm, info);
  77779. } finally {
  77780. popTarget();
  77781. }
  77782. }
  77783. function invokeWithErrorHandling (
  77784. handler,
  77785. context,
  77786. args,
  77787. vm,
  77788. info
  77789. ) {
  77790. var res;
  77791. try {
  77792. res = args ? handler.apply(context, args) : handler.call(context);
  77793. if (res && !res._isVue && isPromise(res) && !res._handled) {
  77794. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  77795. // issue #9511
  77796. // avoid catch triggering multiple times when nested calls
  77797. res._handled = true;
  77798. }
  77799. } catch (e) {
  77800. handleError(e, vm, info);
  77801. }
  77802. return res
  77803. }
  77804. function globalHandleError (err, vm, info) {
  77805. if (config.errorHandler) {
  77806. try {
  77807. return config.errorHandler.call(null, err, vm, info)
  77808. } catch (e) {
  77809. // if the user intentionally throws the original error in the handler,
  77810. // do not log it twice
  77811. if (e !== err) {
  77812. logError(e, null, 'config.errorHandler');
  77813. }
  77814. }
  77815. }
  77816. logError(err, vm, info);
  77817. }
  77818. function logError (err, vm, info) {
  77819. {
  77820. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  77821. }
  77822. /* istanbul ignore else */
  77823. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  77824. console.error(err);
  77825. } else {
  77826. throw err
  77827. }
  77828. }
  77829. /* */
  77830. var isUsingMicroTask = false;
  77831. var callbacks = [];
  77832. var pending = false;
  77833. function flushCallbacks () {
  77834. pending = false;
  77835. var copies = callbacks.slice(0);
  77836. callbacks.length = 0;
  77837. for (var i = 0; i < copies.length; i++) {
  77838. copies[i]();
  77839. }
  77840. }
  77841. // Here we have async deferring wrappers using microtasks.
  77842. // In 2.5 we used (macro) tasks (in combination with microtasks).
  77843. // However, it has subtle problems when state is changed right before repaint
  77844. // (e.g. #6813, out-in transitions).
  77845. // Also, using (macro) tasks in event handler would cause some weird behaviors
  77846. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  77847. // So we now use microtasks everywhere, again.
  77848. // A major drawback of this tradeoff is that there are some scenarios
  77849. // where microtasks have too high a priority and fire in between supposedly
  77850. // sequential events (e.g. #4521, #6690, which have workarounds)
  77851. // or even between bubbling of the same event (#6566).
  77852. var timerFunc;
  77853. // The nextTick behavior leverages the microtask queue, which can be accessed
  77854. // via either native Promise.then or MutationObserver.
  77855. // MutationObserver has wider support, however it is seriously bugged in
  77856. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  77857. // completely stops working after triggering a few times... so, if native
  77858. // Promise is available, we will use it:
  77859. /* istanbul ignore next, $flow-disable-line */
  77860. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  77861. var p = Promise.resolve();
  77862. timerFunc = function () {
  77863. p.then(flushCallbacks);
  77864. // In problematic UIWebViews, Promise.then doesn't completely break, but
  77865. // it can get stuck in a weird state where callbacks are pushed into the
  77866. // microtask queue but the queue isn't being flushed, until the browser
  77867. // needs to do some other work, e.g. handle a timer. Therefore we can
  77868. // "force" the microtask queue to be flushed by adding an empty timer.
  77869. if (isIOS) { setTimeout(noop); }
  77870. };
  77871. isUsingMicroTask = true;
  77872. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  77873. isNative(MutationObserver) ||
  77874. // PhantomJS and iOS 7.x
  77875. MutationObserver.toString() === '[object MutationObserverConstructor]'
  77876. )) {
  77877. // Use MutationObserver where native Promise is not available,
  77878. // e.g. PhantomJS, iOS7, Android 4.4
  77879. // (#6466 MutationObserver is unreliable in IE11)
  77880. var counter = 1;
  77881. var observer = new MutationObserver(flushCallbacks);
  77882. var textNode = document.createTextNode(String(counter));
  77883. observer.observe(textNode, {
  77884. characterData: true
  77885. });
  77886. timerFunc = function () {
  77887. counter = (counter + 1) % 2;
  77888. textNode.data = String(counter);
  77889. };
  77890. isUsingMicroTask = true;
  77891. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  77892. // Fallback to setImmediate.
  77893. // Technically it leverages the (macro) task queue,
  77894. // but it is still a better choice than setTimeout.
  77895. timerFunc = function () {
  77896. setImmediate(flushCallbacks);
  77897. };
  77898. } else {
  77899. // Fallback to setTimeout.
  77900. timerFunc = function () {
  77901. setTimeout(flushCallbacks, 0);
  77902. };
  77903. }
  77904. function nextTick (cb, ctx) {
  77905. var _resolve;
  77906. callbacks.push(function () {
  77907. if (cb) {
  77908. try {
  77909. cb.call(ctx);
  77910. } catch (e) {
  77911. handleError(e, ctx, 'nextTick');
  77912. }
  77913. } else if (_resolve) {
  77914. _resolve(ctx);
  77915. }
  77916. });
  77917. if (!pending) {
  77918. pending = true;
  77919. timerFunc();
  77920. }
  77921. // $flow-disable-line
  77922. if (!cb && typeof Promise !== 'undefined') {
  77923. return new Promise(function (resolve) {
  77924. _resolve = resolve;
  77925. })
  77926. }
  77927. }
  77928. /* */
  77929. var mark;
  77930. var measure;
  77931. {
  77932. var perf = inBrowser && window.performance;
  77933. /* istanbul ignore if */
  77934. if (
  77935. perf &&
  77936. perf.mark &&
  77937. perf.measure &&
  77938. perf.clearMarks &&
  77939. perf.clearMeasures
  77940. ) {
  77941. mark = function (tag) { return perf.mark(tag); };
  77942. measure = function (name, startTag, endTag) {
  77943. perf.measure(name, startTag, endTag);
  77944. perf.clearMarks(startTag);
  77945. perf.clearMarks(endTag);
  77946. // perf.clearMeasures(name)
  77947. };
  77948. }
  77949. }
  77950. /* not type checking this file because flow doesn't play well with Proxy */
  77951. var initProxy;
  77952. {
  77953. var allowedGlobals = makeMap(
  77954. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  77955. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  77956. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  77957. 'require' // for Webpack/Browserify
  77958. );
  77959. var warnNonPresent = function (target, key) {
  77960. warn(
  77961. "Property or method \"" + key + "\" is not defined on the instance but " +
  77962. 'referenced during render. Make sure that this property is reactive, ' +
  77963. 'either in the data option, or for class-based components, by ' +
  77964. 'initializing the property. ' +
  77965. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  77966. target
  77967. );
  77968. };
  77969. var warnReservedPrefix = function (target, key) {
  77970. warn(
  77971. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  77972. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  77973. 'prevent conflicts with Vue internals. ' +
  77974. 'See: https://vuejs.org/v2/api/#data',
  77975. target
  77976. );
  77977. };
  77978. var hasProxy =
  77979. typeof Proxy !== 'undefined' && isNative(Proxy);
  77980. if (hasProxy) {
  77981. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  77982. config.keyCodes = new Proxy(config.keyCodes, {
  77983. set: function set (target, key, value) {
  77984. if (isBuiltInModifier(key)) {
  77985. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  77986. return false
  77987. } else {
  77988. target[key] = value;
  77989. return true
  77990. }
  77991. }
  77992. });
  77993. }
  77994. var hasHandler = {
  77995. has: function has (target, key) {
  77996. var has = key in target;
  77997. var isAllowed = allowedGlobals(key) ||
  77998. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  77999. if (!has && !isAllowed) {
  78000. if (key in target.$data) { warnReservedPrefix(target, key); }
  78001. else { warnNonPresent(target, key); }
  78002. }
  78003. return has || !isAllowed
  78004. }
  78005. };
  78006. var getHandler = {
  78007. get: function get (target, key) {
  78008. if (typeof key === 'string' && !(key in target)) {
  78009. if (key in target.$data) { warnReservedPrefix(target, key); }
  78010. else { warnNonPresent(target, key); }
  78011. }
  78012. return target[key]
  78013. }
  78014. };
  78015. initProxy = function initProxy (vm) {
  78016. if (hasProxy) {
  78017. // determine which proxy handler to use
  78018. var options = vm.$options;
  78019. var handlers = options.render && options.render._withStripped
  78020. ? getHandler
  78021. : hasHandler;
  78022. vm._renderProxy = new Proxy(vm, handlers);
  78023. } else {
  78024. vm._renderProxy = vm;
  78025. }
  78026. };
  78027. }
  78028. /* */
  78029. var seenObjects = new _Set();
  78030. /**
  78031. * Recursively traverse an object to evoke all converted
  78032. * getters, so that every nested property inside the object
  78033. * is collected as a "deep" dependency.
  78034. */
  78035. function traverse (val) {
  78036. _traverse(val, seenObjects);
  78037. seenObjects.clear();
  78038. }
  78039. function _traverse (val, seen) {
  78040. var i, keys;
  78041. var isA = Array.isArray(val);
  78042. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  78043. return
  78044. }
  78045. if (val.__ob__) {
  78046. var depId = val.__ob__.dep.id;
  78047. if (seen.has(depId)) {
  78048. return
  78049. }
  78050. seen.add(depId);
  78051. }
  78052. if (isA) {
  78053. i = val.length;
  78054. while (i--) { _traverse(val[i], seen); }
  78055. } else {
  78056. keys = Object.keys(val);
  78057. i = keys.length;
  78058. while (i--) { _traverse(val[keys[i]], seen); }
  78059. }
  78060. }
  78061. /* */
  78062. var normalizeEvent = cached(function (name) {
  78063. var passive = name.charAt(0) === '&';
  78064. name = passive ? name.slice(1) : name;
  78065. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  78066. name = once$$1 ? name.slice(1) : name;
  78067. var capture = name.charAt(0) === '!';
  78068. name = capture ? name.slice(1) : name;
  78069. return {
  78070. name: name,
  78071. once: once$$1,
  78072. capture: capture,
  78073. passive: passive
  78074. }
  78075. });
  78076. function createFnInvoker (fns, vm) {
  78077. function invoker () {
  78078. var arguments$1 = arguments;
  78079. var fns = invoker.fns;
  78080. if (Array.isArray(fns)) {
  78081. var cloned = fns.slice();
  78082. for (var i = 0; i < cloned.length; i++) {
  78083. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  78084. }
  78085. } else {
  78086. // return handler return value for single handlers
  78087. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  78088. }
  78089. }
  78090. invoker.fns = fns;
  78091. return invoker
  78092. }
  78093. function updateListeners (
  78094. on,
  78095. oldOn,
  78096. add,
  78097. remove$$1,
  78098. createOnceHandler,
  78099. vm
  78100. ) {
  78101. var name, def$$1, cur, old, event;
  78102. for (name in on) {
  78103. def$$1 = cur = on[name];
  78104. old = oldOn[name];
  78105. event = normalizeEvent(name);
  78106. if (isUndef(cur)) {
  78107. warn(
  78108. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  78109. vm
  78110. );
  78111. } else if (isUndef(old)) {
  78112. if (isUndef(cur.fns)) {
  78113. cur = on[name] = createFnInvoker(cur, vm);
  78114. }
  78115. if (isTrue(event.once)) {
  78116. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  78117. }
  78118. add(event.name, cur, event.capture, event.passive, event.params);
  78119. } else if (cur !== old) {
  78120. old.fns = cur;
  78121. on[name] = old;
  78122. }
  78123. }
  78124. for (name in oldOn) {
  78125. if (isUndef(on[name])) {
  78126. event = normalizeEvent(name);
  78127. remove$$1(event.name, oldOn[name], event.capture);
  78128. }
  78129. }
  78130. }
  78131. /* */
  78132. function mergeVNodeHook (def, hookKey, hook) {
  78133. if (def instanceof VNode) {
  78134. def = def.data.hook || (def.data.hook = {});
  78135. }
  78136. var invoker;
  78137. var oldHook = def[hookKey];
  78138. function wrappedHook () {
  78139. hook.apply(this, arguments);
  78140. // important: remove merged hook to ensure it's called only once
  78141. // and prevent memory leak
  78142. remove(invoker.fns, wrappedHook);
  78143. }
  78144. if (isUndef(oldHook)) {
  78145. // no existing hook
  78146. invoker = createFnInvoker([wrappedHook]);
  78147. } else {
  78148. /* istanbul ignore if */
  78149. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  78150. // already a merged invoker
  78151. invoker = oldHook;
  78152. invoker.fns.push(wrappedHook);
  78153. } else {
  78154. // existing plain hook
  78155. invoker = createFnInvoker([oldHook, wrappedHook]);
  78156. }
  78157. }
  78158. invoker.merged = true;
  78159. def[hookKey] = invoker;
  78160. }
  78161. /* */
  78162. function extractPropsFromVNodeData (
  78163. data,
  78164. Ctor,
  78165. tag
  78166. ) {
  78167. // we are only extracting raw values here.
  78168. // validation and default values are handled in the child
  78169. // component itself.
  78170. var propOptions = Ctor.options.props;
  78171. if (isUndef(propOptions)) {
  78172. return
  78173. }
  78174. var res = {};
  78175. var attrs = data.attrs;
  78176. var props = data.props;
  78177. if (isDef(attrs) || isDef(props)) {
  78178. for (var key in propOptions) {
  78179. var altKey = hyphenate(key);
  78180. {
  78181. var keyInLowerCase = key.toLowerCase();
  78182. if (
  78183. key !== keyInLowerCase &&
  78184. attrs && hasOwn(attrs, keyInLowerCase)
  78185. ) {
  78186. tip(
  78187. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  78188. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  78189. " \"" + key + "\". " +
  78190. "Note that HTML attributes are case-insensitive and camelCased " +
  78191. "props need to use their kebab-case equivalents when using in-DOM " +
  78192. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  78193. );
  78194. }
  78195. }
  78196. checkProp(res, props, key, altKey, true) ||
  78197. checkProp(res, attrs, key, altKey, false);
  78198. }
  78199. }
  78200. return res
  78201. }
  78202. function checkProp (
  78203. res,
  78204. hash,
  78205. key,
  78206. altKey,
  78207. preserve
  78208. ) {
  78209. if (isDef(hash)) {
  78210. if (hasOwn(hash, key)) {
  78211. res[key] = hash[key];
  78212. if (!preserve) {
  78213. delete hash[key];
  78214. }
  78215. return true
  78216. } else if (hasOwn(hash, altKey)) {
  78217. res[key] = hash[altKey];
  78218. if (!preserve) {
  78219. delete hash[altKey];
  78220. }
  78221. return true
  78222. }
  78223. }
  78224. return false
  78225. }
  78226. /* */
  78227. // The template compiler attempts to minimize the need for normalization by
  78228. // statically analyzing the template at compile time.
  78229. //
  78230. // For plain HTML markup, normalization can be completely skipped because the
  78231. // generated render function is guaranteed to return Array<VNode>. There are
  78232. // two cases where extra normalization is needed:
  78233. // 1. When the children contains components - because a functional component
  78234. // may return an Array instead of a single root. In this case, just a simple
  78235. // normalization is needed - if any child is an Array, we flatten the whole
  78236. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  78237. // because functional components already normalize their own children.
  78238. function simpleNormalizeChildren (children) {
  78239. for (var i = 0; i < children.length; i++) {
  78240. if (Array.isArray(children[i])) {
  78241. return Array.prototype.concat.apply([], children)
  78242. }
  78243. }
  78244. return children
  78245. }
  78246. // 2. When the children contains constructs that always generated nested Arrays,
  78247. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  78248. // with hand-written render functions / JSX. In such cases a full normalization
  78249. // is needed to cater to all possible types of children values.
  78250. function normalizeChildren (children) {
  78251. return isPrimitive(children)
  78252. ? [createTextVNode(children)]
  78253. : Array.isArray(children)
  78254. ? normalizeArrayChildren(children)
  78255. : undefined
  78256. }
  78257. function isTextNode (node) {
  78258. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  78259. }
  78260. function normalizeArrayChildren (children, nestedIndex) {
  78261. var res = [];
  78262. var i, c, lastIndex, last;
  78263. for (i = 0; i < children.length; i++) {
  78264. c = children[i];
  78265. if (isUndef(c) || typeof c === 'boolean') { continue }
  78266. lastIndex = res.length - 1;
  78267. last = res[lastIndex];
  78268. // nested
  78269. if (Array.isArray(c)) {
  78270. if (c.length > 0) {
  78271. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  78272. // merge adjacent text nodes
  78273. if (isTextNode(c[0]) && isTextNode(last)) {
  78274. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  78275. c.shift();
  78276. }
  78277. res.push.apply(res, c);
  78278. }
  78279. } else if (isPrimitive(c)) {
  78280. if (isTextNode(last)) {
  78281. // merge adjacent text nodes
  78282. // this is necessary for SSR hydration because text nodes are
  78283. // essentially merged when rendered to HTML strings
  78284. res[lastIndex] = createTextVNode(last.text + c);
  78285. } else if (c !== '') {
  78286. // convert primitive to vnode
  78287. res.push(createTextVNode(c));
  78288. }
  78289. } else {
  78290. if (isTextNode(c) && isTextNode(last)) {
  78291. // merge adjacent text nodes
  78292. res[lastIndex] = createTextVNode(last.text + c.text);
  78293. } else {
  78294. // default key for nested array children (likely generated by v-for)
  78295. if (isTrue(children._isVList) &&
  78296. isDef(c.tag) &&
  78297. isUndef(c.key) &&
  78298. isDef(nestedIndex)) {
  78299. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  78300. }
  78301. res.push(c);
  78302. }
  78303. }
  78304. }
  78305. return res
  78306. }
  78307. /* */
  78308. function initProvide (vm) {
  78309. var provide = vm.$options.provide;
  78310. if (provide) {
  78311. vm._provided = typeof provide === 'function'
  78312. ? provide.call(vm)
  78313. : provide;
  78314. }
  78315. }
  78316. function initInjections (vm) {
  78317. var result = resolveInject(vm.$options.inject, vm);
  78318. if (result) {
  78319. toggleObserving(false);
  78320. Object.keys(result).forEach(function (key) {
  78321. /* istanbul ignore else */
  78322. {
  78323. defineReactive$$1(vm, key, result[key], function () {
  78324. warn(
  78325. "Avoid mutating an injected value directly since the changes will be " +
  78326. "overwritten whenever the provided component re-renders. " +
  78327. "injection being mutated: \"" + key + "\"",
  78328. vm
  78329. );
  78330. });
  78331. }
  78332. });
  78333. toggleObserving(true);
  78334. }
  78335. }
  78336. function resolveInject (inject, vm) {
  78337. if (inject) {
  78338. // inject is :any because flow is not smart enough to figure out cached
  78339. var result = Object.create(null);
  78340. var keys = hasSymbol
  78341. ? Reflect.ownKeys(inject)
  78342. : Object.keys(inject);
  78343. for (var i = 0; i < keys.length; i++) {
  78344. var key = keys[i];
  78345. // #6574 in case the inject object is observed...
  78346. if (key === '__ob__') { continue }
  78347. var provideKey = inject[key].from;
  78348. var source = vm;
  78349. while (source) {
  78350. if (source._provided && hasOwn(source._provided, provideKey)) {
  78351. result[key] = source._provided[provideKey];
  78352. break
  78353. }
  78354. source = source.$parent;
  78355. }
  78356. if (!source) {
  78357. if ('default' in inject[key]) {
  78358. var provideDefault = inject[key].default;
  78359. result[key] = typeof provideDefault === 'function'
  78360. ? provideDefault.call(vm)
  78361. : provideDefault;
  78362. } else {
  78363. warn(("Injection \"" + key + "\" not found"), vm);
  78364. }
  78365. }
  78366. }
  78367. return result
  78368. }
  78369. }
  78370. /* */
  78371. /**
  78372. * Runtime helper for resolving raw children VNodes into a slot object.
  78373. */
  78374. function resolveSlots (
  78375. children,
  78376. context
  78377. ) {
  78378. if (!children || !children.length) {
  78379. return {}
  78380. }
  78381. var slots = {};
  78382. for (var i = 0, l = children.length; i < l; i++) {
  78383. var child = children[i];
  78384. var data = child.data;
  78385. // remove slot attribute if the node is resolved as a Vue slot node
  78386. if (data && data.attrs && data.attrs.slot) {
  78387. delete data.attrs.slot;
  78388. }
  78389. // named slots should only be respected if the vnode was rendered in the
  78390. // same context.
  78391. if ((child.context === context || child.fnContext === context) &&
  78392. data && data.slot != null
  78393. ) {
  78394. var name = data.slot;
  78395. var slot = (slots[name] || (slots[name] = []));
  78396. if (child.tag === 'template') {
  78397. slot.push.apply(slot, child.children || []);
  78398. } else {
  78399. slot.push(child);
  78400. }
  78401. } else {
  78402. (slots.default || (slots.default = [])).push(child);
  78403. }
  78404. }
  78405. // ignore slots that contains only whitespace
  78406. for (var name$1 in slots) {
  78407. if (slots[name$1].every(isWhitespace)) {
  78408. delete slots[name$1];
  78409. }
  78410. }
  78411. return slots
  78412. }
  78413. function isWhitespace (node) {
  78414. return (node.isComment && !node.asyncFactory) || node.text === ' '
  78415. }
  78416. /* */
  78417. function normalizeScopedSlots (
  78418. slots,
  78419. normalSlots,
  78420. prevSlots
  78421. ) {
  78422. var res;
  78423. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  78424. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  78425. var key = slots && slots.$key;
  78426. if (!slots) {
  78427. res = {};
  78428. } else if (slots._normalized) {
  78429. // fast path 1: child component re-render only, parent did not change
  78430. return slots._normalized
  78431. } else if (
  78432. isStable &&
  78433. prevSlots &&
  78434. prevSlots !== emptyObject &&
  78435. key === prevSlots.$key &&
  78436. !hasNormalSlots &&
  78437. !prevSlots.$hasNormal
  78438. ) {
  78439. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  78440. // only need to normalize once
  78441. return prevSlots
  78442. } else {
  78443. res = {};
  78444. for (var key$1 in slots) {
  78445. if (slots[key$1] && key$1[0] !== '$') {
  78446. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  78447. }
  78448. }
  78449. }
  78450. // expose normal slots on scopedSlots
  78451. for (var key$2 in normalSlots) {
  78452. if (!(key$2 in res)) {
  78453. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  78454. }
  78455. }
  78456. // avoriaz seems to mock a non-extensible $scopedSlots object
  78457. // and when that is passed down this would cause an error
  78458. if (slots && Object.isExtensible(slots)) {
  78459. (slots)._normalized = res;
  78460. }
  78461. def(res, '$stable', isStable);
  78462. def(res, '$key', key);
  78463. def(res, '$hasNormal', hasNormalSlots);
  78464. return res
  78465. }
  78466. function normalizeScopedSlot(normalSlots, key, fn) {
  78467. var normalized = function () {
  78468. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  78469. res = res && typeof res === 'object' && !Array.isArray(res)
  78470. ? [res] // single vnode
  78471. : normalizeChildren(res);
  78472. return res && (
  78473. res.length === 0 ||
  78474. (res.length === 1 && res[0].isComment) // #9658
  78475. ) ? undefined
  78476. : res
  78477. };
  78478. // this is a slot using the new v-slot syntax without scope. although it is
  78479. // compiled as a scoped slot, render fn users would expect it to be present
  78480. // on this.$slots because the usage is semantically a normal slot.
  78481. if (fn.proxy) {
  78482. Object.defineProperty(normalSlots, key, {
  78483. get: normalized,
  78484. enumerable: true,
  78485. configurable: true
  78486. });
  78487. }
  78488. return normalized
  78489. }
  78490. function proxyNormalSlot(slots, key) {
  78491. return function () { return slots[key]; }
  78492. }
  78493. /* */
  78494. /**
  78495. * Runtime helper for rendering v-for lists.
  78496. */
  78497. function renderList (
  78498. val,
  78499. render
  78500. ) {
  78501. var ret, i, l, keys, key;
  78502. if (Array.isArray(val) || typeof val === 'string') {
  78503. ret = new Array(val.length);
  78504. for (i = 0, l = val.length; i < l; i++) {
  78505. ret[i] = render(val[i], i);
  78506. }
  78507. } else if (typeof val === 'number') {
  78508. ret = new Array(val);
  78509. for (i = 0; i < val; i++) {
  78510. ret[i] = render(i + 1, i);
  78511. }
  78512. } else if (isObject(val)) {
  78513. if (hasSymbol && val[Symbol.iterator]) {
  78514. ret = [];
  78515. var iterator = val[Symbol.iterator]();
  78516. var result = iterator.next();
  78517. while (!result.done) {
  78518. ret.push(render(result.value, ret.length));
  78519. result = iterator.next();
  78520. }
  78521. } else {
  78522. keys = Object.keys(val);
  78523. ret = new Array(keys.length);
  78524. for (i = 0, l = keys.length; i < l; i++) {
  78525. key = keys[i];
  78526. ret[i] = render(val[key], key, i);
  78527. }
  78528. }
  78529. }
  78530. if (!isDef(ret)) {
  78531. ret = [];
  78532. }
  78533. (ret)._isVList = true;
  78534. return ret
  78535. }
  78536. /* */
  78537. /**
  78538. * Runtime helper for rendering <slot>
  78539. */
  78540. function renderSlot (
  78541. name,
  78542. fallback,
  78543. props,
  78544. bindObject
  78545. ) {
  78546. var scopedSlotFn = this.$scopedSlots[name];
  78547. var nodes;
  78548. if (scopedSlotFn) { // scoped slot
  78549. props = props || {};
  78550. if (bindObject) {
  78551. if (!isObject(bindObject)) {
  78552. warn(
  78553. 'slot v-bind without argument expects an Object',
  78554. this
  78555. );
  78556. }
  78557. props = extend(extend({}, bindObject), props);
  78558. }
  78559. nodes = scopedSlotFn(props) || fallback;
  78560. } else {
  78561. nodes = this.$slots[name] || fallback;
  78562. }
  78563. var target = props && props.slot;
  78564. if (target) {
  78565. return this.$createElement('template', { slot: target }, nodes)
  78566. } else {
  78567. return nodes
  78568. }
  78569. }
  78570. /* */
  78571. /**
  78572. * Runtime helper for resolving filters
  78573. */
  78574. function resolveFilter (id) {
  78575. return resolveAsset(this.$options, 'filters', id, true) || identity
  78576. }
  78577. /* */
  78578. function isKeyNotMatch (expect, actual) {
  78579. if (Array.isArray(expect)) {
  78580. return expect.indexOf(actual) === -1
  78581. } else {
  78582. return expect !== actual
  78583. }
  78584. }
  78585. /**
  78586. * Runtime helper for checking keyCodes from config.
  78587. * exposed as Vue.prototype._k
  78588. * passing in eventKeyName as last argument separately for backwards compat
  78589. */
  78590. function checkKeyCodes (
  78591. eventKeyCode,
  78592. key,
  78593. builtInKeyCode,
  78594. eventKeyName,
  78595. builtInKeyName
  78596. ) {
  78597. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  78598. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  78599. return isKeyNotMatch(builtInKeyName, eventKeyName)
  78600. } else if (mappedKeyCode) {
  78601. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  78602. } else if (eventKeyName) {
  78603. return hyphenate(eventKeyName) !== key
  78604. }
  78605. }
  78606. /* */
  78607. /**
  78608. * Runtime helper for merging v-bind="object" into a VNode's data.
  78609. */
  78610. function bindObjectProps (
  78611. data,
  78612. tag,
  78613. value,
  78614. asProp,
  78615. isSync
  78616. ) {
  78617. if (value) {
  78618. if (!isObject(value)) {
  78619. warn(
  78620. 'v-bind without argument expects an Object or Array value',
  78621. this
  78622. );
  78623. } else {
  78624. if (Array.isArray(value)) {
  78625. value = toObject(value);
  78626. }
  78627. var hash;
  78628. var loop = function ( key ) {
  78629. if (
  78630. key === 'class' ||
  78631. key === 'style' ||
  78632. isReservedAttribute(key)
  78633. ) {
  78634. hash = data;
  78635. } else {
  78636. var type = data.attrs && data.attrs.type;
  78637. hash = asProp || config.mustUseProp(tag, type, key)
  78638. ? data.domProps || (data.domProps = {})
  78639. : data.attrs || (data.attrs = {});
  78640. }
  78641. var camelizedKey = camelize(key);
  78642. var hyphenatedKey = hyphenate(key);
  78643. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  78644. hash[key] = value[key];
  78645. if (isSync) {
  78646. var on = data.on || (data.on = {});
  78647. on[("update:" + key)] = function ($event) {
  78648. value[key] = $event;
  78649. };
  78650. }
  78651. }
  78652. };
  78653. for (var key in value) loop( key );
  78654. }
  78655. }
  78656. return data
  78657. }
  78658. /* */
  78659. /**
  78660. * Runtime helper for rendering static trees.
  78661. */
  78662. function renderStatic (
  78663. index,
  78664. isInFor
  78665. ) {
  78666. var cached = this._staticTrees || (this._staticTrees = []);
  78667. var tree = cached[index];
  78668. // if has already-rendered static tree and not inside v-for,
  78669. // we can reuse the same tree.
  78670. if (tree && !isInFor) {
  78671. return tree
  78672. }
  78673. // otherwise, render a fresh tree.
  78674. tree = cached[index] = this.$options.staticRenderFns[index].call(
  78675. this._renderProxy,
  78676. null,
  78677. this // for render fns generated for functional component templates
  78678. );
  78679. markStatic(tree, ("__static__" + index), false);
  78680. return tree
  78681. }
  78682. /**
  78683. * Runtime helper for v-once.
  78684. * Effectively it means marking the node as static with a unique key.
  78685. */
  78686. function markOnce (
  78687. tree,
  78688. index,
  78689. key
  78690. ) {
  78691. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  78692. return tree
  78693. }
  78694. function markStatic (
  78695. tree,
  78696. key,
  78697. isOnce
  78698. ) {
  78699. if (Array.isArray(tree)) {
  78700. for (var i = 0; i < tree.length; i++) {
  78701. if (tree[i] && typeof tree[i] !== 'string') {
  78702. markStaticNode(tree[i], (key + "_" + i), isOnce);
  78703. }
  78704. }
  78705. } else {
  78706. markStaticNode(tree, key, isOnce);
  78707. }
  78708. }
  78709. function markStaticNode (node, key, isOnce) {
  78710. node.isStatic = true;
  78711. node.key = key;
  78712. node.isOnce = isOnce;
  78713. }
  78714. /* */
  78715. function bindObjectListeners (data, value) {
  78716. if (value) {
  78717. if (!isPlainObject(value)) {
  78718. warn(
  78719. 'v-on without argument expects an Object value',
  78720. this
  78721. );
  78722. } else {
  78723. var on = data.on = data.on ? extend({}, data.on) : {};
  78724. for (var key in value) {
  78725. var existing = on[key];
  78726. var ours = value[key];
  78727. on[key] = existing ? [].concat(existing, ours) : ours;
  78728. }
  78729. }
  78730. }
  78731. return data
  78732. }
  78733. /* */
  78734. function resolveScopedSlots (
  78735. fns, // see flow/vnode
  78736. res,
  78737. // the following are added in 2.6
  78738. hasDynamicKeys,
  78739. contentHashKey
  78740. ) {
  78741. res = res || { $stable: !hasDynamicKeys };
  78742. for (var i = 0; i < fns.length; i++) {
  78743. var slot = fns[i];
  78744. if (Array.isArray(slot)) {
  78745. resolveScopedSlots(slot, res, hasDynamicKeys);
  78746. } else if (slot) {
  78747. // marker for reverse proxying v-slot without scope on this.$slots
  78748. if (slot.proxy) {
  78749. slot.fn.proxy = true;
  78750. }
  78751. res[slot.key] = slot.fn;
  78752. }
  78753. }
  78754. if (contentHashKey) {
  78755. (res).$key = contentHashKey;
  78756. }
  78757. return res
  78758. }
  78759. /* */
  78760. function bindDynamicKeys (baseObj, values) {
  78761. for (var i = 0; i < values.length; i += 2) {
  78762. var key = values[i];
  78763. if (typeof key === 'string' && key) {
  78764. baseObj[values[i]] = values[i + 1];
  78765. } else if (key !== '' && key !== null) {
  78766. // null is a special value for explicitly removing a binding
  78767. warn(
  78768. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  78769. this
  78770. );
  78771. }
  78772. }
  78773. return baseObj
  78774. }
  78775. // helper to dynamically append modifier runtime markers to event names.
  78776. // ensure only append when value is already string, otherwise it will be cast
  78777. // to string and cause the type check to miss.
  78778. function prependModifier (value, symbol) {
  78779. return typeof value === 'string' ? symbol + value : value
  78780. }
  78781. /* */
  78782. function installRenderHelpers (target) {
  78783. target._o = markOnce;
  78784. target._n = toNumber;
  78785. target._s = toString;
  78786. target._l = renderList;
  78787. target._t = renderSlot;
  78788. target._q = looseEqual;
  78789. target._i = looseIndexOf;
  78790. target._m = renderStatic;
  78791. target._f = resolveFilter;
  78792. target._k = checkKeyCodes;
  78793. target._b = bindObjectProps;
  78794. target._v = createTextVNode;
  78795. target._e = createEmptyVNode;
  78796. target._u = resolveScopedSlots;
  78797. target._g = bindObjectListeners;
  78798. target._d = bindDynamicKeys;
  78799. target._p = prependModifier;
  78800. }
  78801. /* */
  78802. function FunctionalRenderContext (
  78803. data,
  78804. props,
  78805. children,
  78806. parent,
  78807. Ctor
  78808. ) {
  78809. var this$1 = this;
  78810. var options = Ctor.options;
  78811. // ensure the createElement function in functional components
  78812. // gets a unique context - this is necessary for correct named slot check
  78813. var contextVm;
  78814. if (hasOwn(parent, '_uid')) {
  78815. contextVm = Object.create(parent);
  78816. // $flow-disable-line
  78817. contextVm._original = parent;
  78818. } else {
  78819. // the context vm passed in is a functional context as well.
  78820. // in this case we want to make sure we are able to get a hold to the
  78821. // real context instance.
  78822. contextVm = parent;
  78823. // $flow-disable-line
  78824. parent = parent._original;
  78825. }
  78826. var isCompiled = isTrue(options._compiled);
  78827. var needNormalization = !isCompiled;
  78828. this.data = data;
  78829. this.props = props;
  78830. this.children = children;
  78831. this.parent = parent;
  78832. this.listeners = data.on || emptyObject;
  78833. this.injections = resolveInject(options.inject, parent);
  78834. this.slots = function () {
  78835. if (!this$1.$slots) {
  78836. normalizeScopedSlots(
  78837. data.scopedSlots,
  78838. this$1.$slots = resolveSlots(children, parent)
  78839. );
  78840. }
  78841. return this$1.$slots
  78842. };
  78843. Object.defineProperty(this, 'scopedSlots', ({
  78844. enumerable: true,
  78845. get: function get () {
  78846. return normalizeScopedSlots(data.scopedSlots, this.slots())
  78847. }
  78848. }));
  78849. // support for compiled functional template
  78850. if (isCompiled) {
  78851. // exposing $options for renderStatic()
  78852. this.$options = options;
  78853. // pre-resolve slots for renderSlot()
  78854. this.$slots = this.slots();
  78855. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  78856. }
  78857. if (options._scopeId) {
  78858. this._c = function (a, b, c, d) {
  78859. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  78860. if (vnode && !Array.isArray(vnode)) {
  78861. vnode.fnScopeId = options._scopeId;
  78862. vnode.fnContext = parent;
  78863. }
  78864. return vnode
  78865. };
  78866. } else {
  78867. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  78868. }
  78869. }
  78870. installRenderHelpers(FunctionalRenderContext.prototype);
  78871. function createFunctionalComponent (
  78872. Ctor,
  78873. propsData,
  78874. data,
  78875. contextVm,
  78876. children
  78877. ) {
  78878. var options = Ctor.options;
  78879. var props = {};
  78880. var propOptions = options.props;
  78881. if (isDef(propOptions)) {
  78882. for (var key in propOptions) {
  78883. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  78884. }
  78885. } else {
  78886. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  78887. if (isDef(data.props)) { mergeProps(props, data.props); }
  78888. }
  78889. var renderContext = new FunctionalRenderContext(
  78890. data,
  78891. props,
  78892. children,
  78893. contextVm,
  78894. Ctor
  78895. );
  78896. var vnode = options.render.call(null, renderContext._c, renderContext);
  78897. if (vnode instanceof VNode) {
  78898. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  78899. } else if (Array.isArray(vnode)) {
  78900. var vnodes = normalizeChildren(vnode) || [];
  78901. var res = new Array(vnodes.length);
  78902. for (var i = 0; i < vnodes.length; i++) {
  78903. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  78904. }
  78905. return res
  78906. }
  78907. }
  78908. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  78909. // #7817 clone node before setting fnContext, otherwise if the node is reused
  78910. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  78911. // that should not be matched to match.
  78912. var clone = cloneVNode(vnode);
  78913. clone.fnContext = contextVm;
  78914. clone.fnOptions = options;
  78915. {
  78916. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  78917. }
  78918. if (data.slot) {
  78919. (clone.data || (clone.data = {})).slot = data.slot;
  78920. }
  78921. return clone
  78922. }
  78923. function mergeProps (to, from) {
  78924. for (var key in from) {
  78925. to[camelize(key)] = from[key];
  78926. }
  78927. }
  78928. /* */
  78929. /* */
  78930. /* */
  78931. /* */
  78932. // inline hooks to be invoked on component VNodes during patch
  78933. var componentVNodeHooks = {
  78934. init: function init (vnode, hydrating) {
  78935. if (
  78936. vnode.componentInstance &&
  78937. !vnode.componentInstance._isDestroyed &&
  78938. vnode.data.keepAlive
  78939. ) {
  78940. // kept-alive components, treat as a patch
  78941. var mountedNode = vnode; // work around flow
  78942. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  78943. } else {
  78944. var child = vnode.componentInstance = createComponentInstanceForVnode(
  78945. vnode,
  78946. activeInstance
  78947. );
  78948. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  78949. }
  78950. },
  78951. prepatch: function prepatch (oldVnode, vnode) {
  78952. var options = vnode.componentOptions;
  78953. var child = vnode.componentInstance = oldVnode.componentInstance;
  78954. updateChildComponent(
  78955. child,
  78956. options.propsData, // updated props
  78957. options.listeners, // updated listeners
  78958. vnode, // new parent vnode
  78959. options.children // new children
  78960. );
  78961. },
  78962. insert: function insert (vnode) {
  78963. var context = vnode.context;
  78964. var componentInstance = vnode.componentInstance;
  78965. if (!componentInstance._isMounted) {
  78966. componentInstance._isMounted = true;
  78967. callHook(componentInstance, 'mounted');
  78968. }
  78969. if (vnode.data.keepAlive) {
  78970. if (context._isMounted) {
  78971. // vue-router#1212
  78972. // During updates, a kept-alive component's child components may
  78973. // change, so directly walking the tree here may call activated hooks
  78974. // on incorrect children. Instead we push them into a queue which will
  78975. // be processed after the whole patch process ended.
  78976. queueActivatedComponent(componentInstance);
  78977. } else {
  78978. activateChildComponent(componentInstance, true /* direct */);
  78979. }
  78980. }
  78981. },
  78982. destroy: function destroy (vnode) {
  78983. var componentInstance = vnode.componentInstance;
  78984. if (!componentInstance._isDestroyed) {
  78985. if (!vnode.data.keepAlive) {
  78986. componentInstance.$destroy();
  78987. } else {
  78988. deactivateChildComponent(componentInstance, true /* direct */);
  78989. }
  78990. }
  78991. }
  78992. };
  78993. var hooksToMerge = Object.keys(componentVNodeHooks);
  78994. function createComponent (
  78995. Ctor,
  78996. data,
  78997. context,
  78998. children,
  78999. tag
  79000. ) {
  79001. if (isUndef(Ctor)) {
  79002. return
  79003. }
  79004. var baseCtor = context.$options._base;
  79005. // plain options object: turn it into a constructor
  79006. if (isObject(Ctor)) {
  79007. Ctor = baseCtor.extend(Ctor);
  79008. }
  79009. // if at this stage it's not a constructor or an async component factory,
  79010. // reject.
  79011. if (typeof Ctor !== 'function') {
  79012. {
  79013. warn(("Invalid Component definition: " + (String(Ctor))), context);
  79014. }
  79015. return
  79016. }
  79017. // async component
  79018. var asyncFactory;
  79019. if (isUndef(Ctor.cid)) {
  79020. asyncFactory = Ctor;
  79021. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  79022. if (Ctor === undefined) {
  79023. // return a placeholder node for async component, which is rendered
  79024. // as a comment node but preserves all the raw information for the node.
  79025. // the information will be used for async server-rendering and hydration.
  79026. return createAsyncPlaceholder(
  79027. asyncFactory,
  79028. data,
  79029. context,
  79030. children,
  79031. tag
  79032. )
  79033. }
  79034. }
  79035. data = data || {};
  79036. // resolve constructor options in case global mixins are applied after
  79037. // component constructor creation
  79038. resolveConstructorOptions(Ctor);
  79039. // transform component v-model data into props & events
  79040. if (isDef(data.model)) {
  79041. transformModel(Ctor.options, data);
  79042. }
  79043. // extract props
  79044. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  79045. // functional component
  79046. if (isTrue(Ctor.options.functional)) {
  79047. return createFunctionalComponent(Ctor, propsData, data, context, children)
  79048. }
  79049. // extract listeners, since these needs to be treated as
  79050. // child component listeners instead of DOM listeners
  79051. var listeners = data.on;
  79052. // replace with listeners with .native modifier
  79053. // so it gets processed during parent component patch.
  79054. data.on = data.nativeOn;
  79055. if (isTrue(Ctor.options.abstract)) {
  79056. // abstract components do not keep anything
  79057. // other than props & listeners & slot
  79058. // work around flow
  79059. var slot = data.slot;
  79060. data = {};
  79061. if (slot) {
  79062. data.slot = slot;
  79063. }
  79064. }
  79065. // install component management hooks onto the placeholder node
  79066. installComponentHooks(data);
  79067. // return a placeholder vnode
  79068. var name = Ctor.options.name || tag;
  79069. var vnode = new VNode(
  79070. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  79071. data, undefined, undefined, undefined, context,
  79072. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  79073. asyncFactory
  79074. );
  79075. return vnode
  79076. }
  79077. function createComponentInstanceForVnode (
  79078. vnode, // we know it's MountedComponentVNode but flow doesn't
  79079. parent // activeInstance in lifecycle state
  79080. ) {
  79081. var options = {
  79082. _isComponent: true,
  79083. _parentVnode: vnode,
  79084. parent: parent
  79085. };
  79086. // check inline-template render functions
  79087. var inlineTemplate = vnode.data.inlineTemplate;
  79088. if (isDef(inlineTemplate)) {
  79089. options.render = inlineTemplate.render;
  79090. options.staticRenderFns = inlineTemplate.staticRenderFns;
  79091. }
  79092. return new vnode.componentOptions.Ctor(options)
  79093. }
  79094. function installComponentHooks (data) {
  79095. var hooks = data.hook || (data.hook = {});
  79096. for (var i = 0; i < hooksToMerge.length; i++) {
  79097. var key = hooksToMerge[i];
  79098. var existing = hooks[key];
  79099. var toMerge = componentVNodeHooks[key];
  79100. if (existing !== toMerge && !(existing && existing._merged)) {
  79101. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  79102. }
  79103. }
  79104. }
  79105. function mergeHook$1 (f1, f2) {
  79106. var merged = function (a, b) {
  79107. // flow complains about extra args which is why we use any
  79108. f1(a, b);
  79109. f2(a, b);
  79110. };
  79111. merged._merged = true;
  79112. return merged
  79113. }
  79114. // transform component v-model info (value and callback) into
  79115. // prop and event handler respectively.
  79116. function transformModel (options, data) {
  79117. var prop = (options.model && options.model.prop) || 'value';
  79118. var event = (options.model && options.model.event) || 'input'
  79119. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  79120. var on = data.on || (data.on = {});
  79121. var existing = on[event];
  79122. var callback = data.model.callback;
  79123. if (isDef(existing)) {
  79124. if (
  79125. Array.isArray(existing)
  79126. ? existing.indexOf(callback) === -1
  79127. : existing !== callback
  79128. ) {
  79129. on[event] = [callback].concat(existing);
  79130. }
  79131. } else {
  79132. on[event] = callback;
  79133. }
  79134. }
  79135. /* */
  79136. var SIMPLE_NORMALIZE = 1;
  79137. var ALWAYS_NORMALIZE = 2;
  79138. // wrapper function for providing a more flexible interface
  79139. // without getting yelled at by flow
  79140. function createElement (
  79141. context,
  79142. tag,
  79143. data,
  79144. children,
  79145. normalizationType,
  79146. alwaysNormalize
  79147. ) {
  79148. if (Array.isArray(data) || isPrimitive(data)) {
  79149. normalizationType = children;
  79150. children = data;
  79151. data = undefined;
  79152. }
  79153. if (isTrue(alwaysNormalize)) {
  79154. normalizationType = ALWAYS_NORMALIZE;
  79155. }
  79156. return _createElement(context, tag, data, children, normalizationType)
  79157. }
  79158. function _createElement (
  79159. context,
  79160. tag,
  79161. data,
  79162. children,
  79163. normalizationType
  79164. ) {
  79165. if (isDef(data) && isDef((data).__ob__)) {
  79166. warn(
  79167. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  79168. 'Always create fresh vnode data objects in each render!',
  79169. context
  79170. );
  79171. return createEmptyVNode()
  79172. }
  79173. // object syntax in v-bind
  79174. if (isDef(data) && isDef(data.is)) {
  79175. tag = data.is;
  79176. }
  79177. if (!tag) {
  79178. // in case of component :is set to falsy value
  79179. return createEmptyVNode()
  79180. }
  79181. // warn against non-primitive key
  79182. if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  79183. ) {
  79184. {
  79185. warn(
  79186. 'Avoid using non-primitive value as key, ' +
  79187. 'use string/number value instead.',
  79188. context
  79189. );
  79190. }
  79191. }
  79192. // support single function children as default scoped slot
  79193. if (Array.isArray(children) &&
  79194. typeof children[0] === 'function'
  79195. ) {
  79196. data = data || {};
  79197. data.scopedSlots = { default: children[0] };
  79198. children.length = 0;
  79199. }
  79200. if (normalizationType === ALWAYS_NORMALIZE) {
  79201. children = normalizeChildren(children);
  79202. } else if (normalizationType === SIMPLE_NORMALIZE) {
  79203. children = simpleNormalizeChildren(children);
  79204. }
  79205. var vnode, ns;
  79206. if (typeof tag === 'string') {
  79207. var Ctor;
  79208. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  79209. if (config.isReservedTag(tag)) {
  79210. // platform built-in elements
  79211. if (isDef(data) && isDef(data.nativeOn)) {
  79212. warn(
  79213. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  79214. context
  79215. );
  79216. }
  79217. vnode = new VNode(
  79218. config.parsePlatformTagName(tag), data, children,
  79219. undefined, undefined, context
  79220. );
  79221. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  79222. // component
  79223. vnode = createComponent(Ctor, data, context, children, tag);
  79224. } else {
  79225. // unknown or unlisted namespaced elements
  79226. // check at runtime because it may get assigned a namespace when its
  79227. // parent normalizes children
  79228. vnode = new VNode(
  79229. tag, data, children,
  79230. undefined, undefined, context
  79231. );
  79232. }
  79233. } else {
  79234. // direct component options / constructor
  79235. vnode = createComponent(tag, data, context, children);
  79236. }
  79237. if (Array.isArray(vnode)) {
  79238. return vnode
  79239. } else if (isDef(vnode)) {
  79240. if (isDef(ns)) { applyNS(vnode, ns); }
  79241. if (isDef(data)) { registerDeepBindings(data); }
  79242. return vnode
  79243. } else {
  79244. return createEmptyVNode()
  79245. }
  79246. }
  79247. function applyNS (vnode, ns, force) {
  79248. vnode.ns = ns;
  79249. if (vnode.tag === 'foreignObject') {
  79250. // use default namespace inside foreignObject
  79251. ns = undefined;
  79252. force = true;
  79253. }
  79254. if (isDef(vnode.children)) {
  79255. for (var i = 0, l = vnode.children.length; i < l; i++) {
  79256. var child = vnode.children[i];
  79257. if (isDef(child.tag) && (
  79258. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  79259. applyNS(child, ns, force);
  79260. }
  79261. }
  79262. }
  79263. }
  79264. // ref #5318
  79265. // necessary to ensure parent re-render when deep bindings like :style and
  79266. // :class are used on slot nodes
  79267. function registerDeepBindings (data) {
  79268. if (isObject(data.style)) {
  79269. traverse(data.style);
  79270. }
  79271. if (isObject(data.class)) {
  79272. traverse(data.class);
  79273. }
  79274. }
  79275. /* */
  79276. function initRender (vm) {
  79277. vm._vnode = null; // the root of the child tree
  79278. vm._staticTrees = null; // v-once cached trees
  79279. var options = vm.$options;
  79280. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  79281. var renderContext = parentVnode && parentVnode.context;
  79282. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  79283. vm.$scopedSlots = emptyObject;
  79284. // bind the createElement fn to this instance
  79285. // so that we get proper render context inside it.
  79286. // args order: tag, data, children, normalizationType, alwaysNormalize
  79287. // internal version is used by render functions compiled from templates
  79288. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  79289. // normalization is always applied for the public version, used in
  79290. // user-written render functions.
  79291. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  79292. // $attrs & $listeners are exposed for easier HOC creation.
  79293. // they need to be reactive so that HOCs using them are always updated
  79294. var parentData = parentVnode && parentVnode.data;
  79295. /* istanbul ignore else */
  79296. {
  79297. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  79298. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  79299. }, true);
  79300. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  79301. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  79302. }, true);
  79303. }
  79304. }
  79305. var currentRenderingInstance = null;
  79306. function renderMixin (Vue) {
  79307. // install runtime convenience helpers
  79308. installRenderHelpers(Vue.prototype);
  79309. Vue.prototype.$nextTick = function (fn) {
  79310. return nextTick(fn, this)
  79311. };
  79312. Vue.prototype._render = function () {
  79313. var vm = this;
  79314. var ref = vm.$options;
  79315. var render = ref.render;
  79316. var _parentVnode = ref._parentVnode;
  79317. if (_parentVnode) {
  79318. vm.$scopedSlots = normalizeScopedSlots(
  79319. _parentVnode.data.scopedSlots,
  79320. vm.$slots,
  79321. vm.$scopedSlots
  79322. );
  79323. }
  79324. // set parent vnode. this allows render functions to have access
  79325. // to the data on the placeholder node.
  79326. vm.$vnode = _parentVnode;
  79327. // render self
  79328. var vnode;
  79329. try {
  79330. // There's no need to maintain a stack because all render fns are called
  79331. // separately from one another. Nested component's render fns are called
  79332. // when parent component is patched.
  79333. currentRenderingInstance = vm;
  79334. vnode = render.call(vm._renderProxy, vm.$createElement);
  79335. } catch (e) {
  79336. handleError(e, vm, "render");
  79337. // return error render result,
  79338. // or previous vnode to prevent render error causing blank component
  79339. /* istanbul ignore else */
  79340. if (vm.$options.renderError) {
  79341. try {
  79342. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  79343. } catch (e) {
  79344. handleError(e, vm, "renderError");
  79345. vnode = vm._vnode;
  79346. }
  79347. } else {
  79348. vnode = vm._vnode;
  79349. }
  79350. } finally {
  79351. currentRenderingInstance = null;
  79352. }
  79353. // if the returned array contains only a single node, allow it
  79354. if (Array.isArray(vnode) && vnode.length === 1) {
  79355. vnode = vnode[0];
  79356. }
  79357. // return empty vnode in case the render function errored out
  79358. if (!(vnode instanceof VNode)) {
  79359. if (Array.isArray(vnode)) {
  79360. warn(
  79361. 'Multiple root nodes returned from render function. Render function ' +
  79362. 'should return a single root node.',
  79363. vm
  79364. );
  79365. }
  79366. vnode = createEmptyVNode();
  79367. }
  79368. // set parent
  79369. vnode.parent = _parentVnode;
  79370. return vnode
  79371. };
  79372. }
  79373. /* */
  79374. function ensureCtor (comp, base) {
  79375. if (
  79376. comp.__esModule ||
  79377. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  79378. ) {
  79379. comp = comp.default;
  79380. }
  79381. return isObject(comp)
  79382. ? base.extend(comp)
  79383. : comp
  79384. }
  79385. function createAsyncPlaceholder (
  79386. factory,
  79387. data,
  79388. context,
  79389. children,
  79390. tag
  79391. ) {
  79392. var node = createEmptyVNode();
  79393. node.asyncFactory = factory;
  79394. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  79395. return node
  79396. }
  79397. function resolveAsyncComponent (
  79398. factory,
  79399. baseCtor
  79400. ) {
  79401. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  79402. return factory.errorComp
  79403. }
  79404. if (isDef(factory.resolved)) {
  79405. return factory.resolved
  79406. }
  79407. var owner = currentRenderingInstance;
  79408. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  79409. // already pending
  79410. factory.owners.push(owner);
  79411. }
  79412. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  79413. return factory.loadingComp
  79414. }
  79415. if (owner && !isDef(factory.owners)) {
  79416. var owners = factory.owners = [owner];
  79417. var sync = true;
  79418. var timerLoading = null;
  79419. var timerTimeout = null
  79420. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  79421. var forceRender = function (renderCompleted) {
  79422. for (var i = 0, l = owners.length; i < l; i++) {
  79423. (owners[i]).$forceUpdate();
  79424. }
  79425. if (renderCompleted) {
  79426. owners.length = 0;
  79427. if (timerLoading !== null) {
  79428. clearTimeout(timerLoading);
  79429. timerLoading = null;
  79430. }
  79431. if (timerTimeout !== null) {
  79432. clearTimeout(timerTimeout);
  79433. timerTimeout = null;
  79434. }
  79435. }
  79436. };
  79437. var resolve = once(function (res) {
  79438. // cache resolved
  79439. factory.resolved = ensureCtor(res, baseCtor);
  79440. // invoke callbacks only if this is not a synchronous resolve
  79441. // (async resolves are shimmed as synchronous during SSR)
  79442. if (!sync) {
  79443. forceRender(true);
  79444. } else {
  79445. owners.length = 0;
  79446. }
  79447. });
  79448. var reject = once(function (reason) {
  79449. warn(
  79450. "Failed to resolve async component: " + (String(factory)) +
  79451. (reason ? ("\nReason: " + reason) : '')
  79452. );
  79453. if (isDef(factory.errorComp)) {
  79454. factory.error = true;
  79455. forceRender(true);
  79456. }
  79457. });
  79458. var res = factory(resolve, reject);
  79459. if (isObject(res)) {
  79460. if (isPromise(res)) {
  79461. // () => Promise
  79462. if (isUndef(factory.resolved)) {
  79463. res.then(resolve, reject);
  79464. }
  79465. } else if (isPromise(res.component)) {
  79466. res.component.then(resolve, reject);
  79467. if (isDef(res.error)) {
  79468. factory.errorComp = ensureCtor(res.error, baseCtor);
  79469. }
  79470. if (isDef(res.loading)) {
  79471. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  79472. if (res.delay === 0) {
  79473. factory.loading = true;
  79474. } else {
  79475. timerLoading = setTimeout(function () {
  79476. timerLoading = null;
  79477. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  79478. factory.loading = true;
  79479. forceRender(false);
  79480. }
  79481. }, res.delay || 200);
  79482. }
  79483. }
  79484. if (isDef(res.timeout)) {
  79485. timerTimeout = setTimeout(function () {
  79486. timerTimeout = null;
  79487. if (isUndef(factory.resolved)) {
  79488. reject(
  79489. "timeout (" + (res.timeout) + "ms)"
  79490. );
  79491. }
  79492. }, res.timeout);
  79493. }
  79494. }
  79495. }
  79496. sync = false;
  79497. // return in case resolved synchronously
  79498. return factory.loading
  79499. ? factory.loadingComp
  79500. : factory.resolved
  79501. }
  79502. }
  79503. /* */
  79504. function isAsyncPlaceholder (node) {
  79505. return node.isComment && node.asyncFactory
  79506. }
  79507. /* */
  79508. function getFirstComponentChild (children) {
  79509. if (Array.isArray(children)) {
  79510. for (var i = 0; i < children.length; i++) {
  79511. var c = children[i];
  79512. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  79513. return c
  79514. }
  79515. }
  79516. }
  79517. }
  79518. /* */
  79519. /* */
  79520. function initEvents (vm) {
  79521. vm._events = Object.create(null);
  79522. vm._hasHookEvent = false;
  79523. // init parent attached events
  79524. var listeners = vm.$options._parentListeners;
  79525. if (listeners) {
  79526. updateComponentListeners(vm, listeners);
  79527. }
  79528. }
  79529. var target;
  79530. function add (event, fn) {
  79531. target.$on(event, fn);
  79532. }
  79533. function remove$1 (event, fn) {
  79534. target.$off(event, fn);
  79535. }
  79536. function createOnceHandler (event, fn) {
  79537. var _target = target;
  79538. return function onceHandler () {
  79539. var res = fn.apply(null, arguments);
  79540. if (res !== null) {
  79541. _target.$off(event, onceHandler);
  79542. }
  79543. }
  79544. }
  79545. function updateComponentListeners (
  79546. vm,
  79547. listeners,
  79548. oldListeners
  79549. ) {
  79550. target = vm;
  79551. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  79552. target = undefined;
  79553. }
  79554. function eventsMixin (Vue) {
  79555. var hookRE = /^hook:/;
  79556. Vue.prototype.$on = function (event, fn) {
  79557. var vm = this;
  79558. if (Array.isArray(event)) {
  79559. for (var i = 0, l = event.length; i < l; i++) {
  79560. vm.$on(event[i], fn);
  79561. }
  79562. } else {
  79563. (vm._events[event] || (vm._events[event] = [])).push(fn);
  79564. // optimize hook:event cost by using a boolean flag marked at registration
  79565. // instead of a hash lookup
  79566. if (hookRE.test(event)) {
  79567. vm._hasHookEvent = true;
  79568. }
  79569. }
  79570. return vm
  79571. };
  79572. Vue.prototype.$once = function (event, fn) {
  79573. var vm = this;
  79574. function on () {
  79575. vm.$off(event, on);
  79576. fn.apply(vm, arguments);
  79577. }
  79578. on.fn = fn;
  79579. vm.$on(event, on);
  79580. return vm
  79581. };
  79582. Vue.prototype.$off = function (event, fn) {
  79583. var vm = this;
  79584. // all
  79585. if (!arguments.length) {
  79586. vm._events = Object.create(null);
  79587. return vm
  79588. }
  79589. // array of events
  79590. if (Array.isArray(event)) {
  79591. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  79592. vm.$off(event[i$1], fn);
  79593. }
  79594. return vm
  79595. }
  79596. // specific event
  79597. var cbs = vm._events[event];
  79598. if (!cbs) {
  79599. return vm
  79600. }
  79601. if (!fn) {
  79602. vm._events[event] = null;
  79603. return vm
  79604. }
  79605. // specific handler
  79606. var cb;
  79607. var i = cbs.length;
  79608. while (i--) {
  79609. cb = cbs[i];
  79610. if (cb === fn || cb.fn === fn) {
  79611. cbs.splice(i, 1);
  79612. break
  79613. }
  79614. }
  79615. return vm
  79616. };
  79617. Vue.prototype.$emit = function (event) {
  79618. var vm = this;
  79619. {
  79620. var lowerCaseEvent = event.toLowerCase();
  79621. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  79622. tip(
  79623. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  79624. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  79625. "Note that HTML attributes are case-insensitive and you cannot use " +
  79626. "v-on to listen to camelCase events when using in-DOM templates. " +
  79627. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  79628. );
  79629. }
  79630. }
  79631. var cbs = vm._events[event];
  79632. if (cbs) {
  79633. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  79634. var args = toArray(arguments, 1);
  79635. var info = "event handler for \"" + event + "\"";
  79636. for (var i = 0, l = cbs.length; i < l; i++) {
  79637. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  79638. }
  79639. }
  79640. return vm
  79641. };
  79642. }
  79643. /* */
  79644. var activeInstance = null;
  79645. var isUpdatingChildComponent = false;
  79646. function setActiveInstance(vm) {
  79647. var prevActiveInstance = activeInstance;
  79648. activeInstance = vm;
  79649. return function () {
  79650. activeInstance = prevActiveInstance;
  79651. }
  79652. }
  79653. function initLifecycle (vm) {
  79654. var options = vm.$options;
  79655. // locate first non-abstract parent
  79656. var parent = options.parent;
  79657. if (parent && !options.abstract) {
  79658. while (parent.$options.abstract && parent.$parent) {
  79659. parent = parent.$parent;
  79660. }
  79661. parent.$children.push(vm);
  79662. }
  79663. vm.$parent = parent;
  79664. vm.$root = parent ? parent.$root : vm;
  79665. vm.$children = [];
  79666. vm.$refs = {};
  79667. vm._watcher = null;
  79668. vm._inactive = null;
  79669. vm._directInactive = false;
  79670. vm._isMounted = false;
  79671. vm._isDestroyed = false;
  79672. vm._isBeingDestroyed = false;
  79673. }
  79674. function lifecycleMixin (Vue) {
  79675. Vue.prototype._update = function (vnode, hydrating) {
  79676. var vm = this;
  79677. var prevEl = vm.$el;
  79678. var prevVnode = vm._vnode;
  79679. var restoreActiveInstance = setActiveInstance(vm);
  79680. vm._vnode = vnode;
  79681. // Vue.prototype.__patch__ is injected in entry points
  79682. // based on the rendering backend used.
  79683. if (!prevVnode) {
  79684. // initial render
  79685. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  79686. } else {
  79687. // updates
  79688. vm.$el = vm.__patch__(prevVnode, vnode);
  79689. }
  79690. restoreActiveInstance();
  79691. // update __vue__ reference
  79692. if (prevEl) {
  79693. prevEl.__vue__ = null;
  79694. }
  79695. if (vm.$el) {
  79696. vm.$el.__vue__ = vm;
  79697. }
  79698. // if parent is an HOC, update its $el as well
  79699. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  79700. vm.$parent.$el = vm.$el;
  79701. }
  79702. // updated hook is called by the scheduler to ensure that children are
  79703. // updated in a parent's updated hook.
  79704. };
  79705. Vue.prototype.$forceUpdate = function () {
  79706. var vm = this;
  79707. if (vm._watcher) {
  79708. vm._watcher.update();
  79709. }
  79710. };
  79711. Vue.prototype.$destroy = function () {
  79712. var vm = this;
  79713. if (vm._isBeingDestroyed) {
  79714. return
  79715. }
  79716. callHook(vm, 'beforeDestroy');
  79717. vm._isBeingDestroyed = true;
  79718. // remove self from parent
  79719. var parent = vm.$parent;
  79720. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  79721. remove(parent.$children, vm);
  79722. }
  79723. // teardown watchers
  79724. if (vm._watcher) {
  79725. vm._watcher.teardown();
  79726. }
  79727. var i = vm._watchers.length;
  79728. while (i--) {
  79729. vm._watchers[i].teardown();
  79730. }
  79731. // remove reference from data ob
  79732. // frozen object may not have observer.
  79733. if (vm._data.__ob__) {
  79734. vm._data.__ob__.vmCount--;
  79735. }
  79736. // call the last hook...
  79737. vm._isDestroyed = true;
  79738. // invoke destroy hooks on current rendered tree
  79739. vm.__patch__(vm._vnode, null);
  79740. // fire destroyed hook
  79741. callHook(vm, 'destroyed');
  79742. // turn off all instance listeners.
  79743. vm.$off();
  79744. // remove __vue__ reference
  79745. if (vm.$el) {
  79746. vm.$el.__vue__ = null;
  79747. }
  79748. // release circular reference (#6759)
  79749. if (vm.$vnode) {
  79750. vm.$vnode.parent = null;
  79751. }
  79752. };
  79753. }
  79754. function mountComponent (
  79755. vm,
  79756. el,
  79757. hydrating
  79758. ) {
  79759. vm.$el = el;
  79760. if (!vm.$options.render) {
  79761. vm.$options.render = createEmptyVNode;
  79762. {
  79763. /* istanbul ignore if */
  79764. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  79765. vm.$options.el || el) {
  79766. warn(
  79767. 'You are using the runtime-only build of Vue where the template ' +
  79768. 'compiler is not available. Either pre-compile the templates into ' +
  79769. 'render functions, or use the compiler-included build.',
  79770. vm
  79771. );
  79772. } else {
  79773. warn(
  79774. 'Failed to mount component: template or render function not defined.',
  79775. vm
  79776. );
  79777. }
  79778. }
  79779. }
  79780. callHook(vm, 'beforeMount');
  79781. var updateComponent;
  79782. /* istanbul ignore if */
  79783. if (config.performance && mark) {
  79784. updateComponent = function () {
  79785. var name = vm._name;
  79786. var id = vm._uid;
  79787. var startTag = "vue-perf-start:" + id;
  79788. var endTag = "vue-perf-end:" + id;
  79789. mark(startTag);
  79790. var vnode = vm._render();
  79791. mark(endTag);
  79792. measure(("vue " + name + " render"), startTag, endTag);
  79793. mark(startTag);
  79794. vm._update(vnode, hydrating);
  79795. mark(endTag);
  79796. measure(("vue " + name + " patch"), startTag, endTag);
  79797. };
  79798. } else {
  79799. updateComponent = function () {
  79800. vm._update(vm._render(), hydrating);
  79801. };
  79802. }
  79803. // we set this to vm._watcher inside the watcher's constructor
  79804. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  79805. // component's mounted hook), which relies on vm._watcher being already defined
  79806. new Watcher(vm, updateComponent, noop, {
  79807. before: function before () {
  79808. if (vm._isMounted && !vm._isDestroyed) {
  79809. callHook(vm, 'beforeUpdate');
  79810. }
  79811. }
  79812. }, true /* isRenderWatcher */);
  79813. hydrating = false;
  79814. // manually mounted instance, call mounted on self
  79815. // mounted is called for render-created child components in its inserted hook
  79816. if (vm.$vnode == null) {
  79817. vm._isMounted = true;
  79818. callHook(vm, 'mounted');
  79819. }
  79820. return vm
  79821. }
  79822. function updateChildComponent (
  79823. vm,
  79824. propsData,
  79825. listeners,
  79826. parentVnode,
  79827. renderChildren
  79828. ) {
  79829. {
  79830. isUpdatingChildComponent = true;
  79831. }
  79832. // determine whether component has slot children
  79833. // we need to do this before overwriting $options._renderChildren.
  79834. // check if there are dynamic scopedSlots (hand-written or compiled but with
  79835. // dynamic slot names). Static scoped slots compiled from template has the
  79836. // "$stable" marker.
  79837. var newScopedSlots = parentVnode.data.scopedSlots;
  79838. var oldScopedSlots = vm.$scopedSlots;
  79839. var hasDynamicScopedSlot = !!(
  79840. (newScopedSlots && !newScopedSlots.$stable) ||
  79841. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  79842. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  79843. );
  79844. // Any static slot children from the parent may have changed during parent's
  79845. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  79846. // update is necessary to ensure correctness.
  79847. var needsForceUpdate = !!(
  79848. renderChildren || // has new static slots
  79849. vm.$options._renderChildren || // has old static slots
  79850. hasDynamicScopedSlot
  79851. );
  79852. vm.$options._parentVnode = parentVnode;
  79853. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  79854. if (vm._vnode) { // update child tree's parent
  79855. vm._vnode.parent = parentVnode;
  79856. }
  79857. vm.$options._renderChildren = renderChildren;
  79858. // update $attrs and $listeners hash
  79859. // these are also reactive so they may trigger child update if the child
  79860. // used them during render
  79861. vm.$attrs = parentVnode.data.attrs || emptyObject;
  79862. vm.$listeners = listeners || emptyObject;
  79863. // update props
  79864. if (propsData && vm.$options.props) {
  79865. toggleObserving(false);
  79866. var props = vm._props;
  79867. var propKeys = vm.$options._propKeys || [];
  79868. for (var i = 0; i < propKeys.length; i++) {
  79869. var key = propKeys[i];
  79870. var propOptions = vm.$options.props; // wtf flow?
  79871. props[key] = validateProp(key, propOptions, propsData, vm);
  79872. }
  79873. toggleObserving(true);
  79874. // keep a copy of raw propsData
  79875. vm.$options.propsData = propsData;
  79876. }
  79877. // update listeners
  79878. listeners = listeners || emptyObject;
  79879. var oldListeners = vm.$options._parentListeners;
  79880. vm.$options._parentListeners = listeners;
  79881. updateComponentListeners(vm, listeners, oldListeners);
  79882. // resolve slots + force update if has children
  79883. if (needsForceUpdate) {
  79884. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  79885. vm.$forceUpdate();
  79886. }
  79887. {
  79888. isUpdatingChildComponent = false;
  79889. }
  79890. }
  79891. function isInInactiveTree (vm) {
  79892. while (vm && (vm = vm.$parent)) {
  79893. if (vm._inactive) { return true }
  79894. }
  79895. return false
  79896. }
  79897. function activateChildComponent (vm, direct) {
  79898. if (direct) {
  79899. vm._directInactive = false;
  79900. if (isInInactiveTree(vm)) {
  79901. return
  79902. }
  79903. } else if (vm._directInactive) {
  79904. return
  79905. }
  79906. if (vm._inactive || vm._inactive === null) {
  79907. vm._inactive = false;
  79908. for (var i = 0; i < vm.$children.length; i++) {
  79909. activateChildComponent(vm.$children[i]);
  79910. }
  79911. callHook(vm, 'activated');
  79912. }
  79913. }
  79914. function deactivateChildComponent (vm, direct) {
  79915. if (direct) {
  79916. vm._directInactive = true;
  79917. if (isInInactiveTree(vm)) {
  79918. return
  79919. }
  79920. }
  79921. if (!vm._inactive) {
  79922. vm._inactive = true;
  79923. for (var i = 0; i < vm.$children.length; i++) {
  79924. deactivateChildComponent(vm.$children[i]);
  79925. }
  79926. callHook(vm, 'deactivated');
  79927. }
  79928. }
  79929. function callHook (vm, hook) {
  79930. // #7573 disable dep collection when invoking lifecycle hooks
  79931. pushTarget();
  79932. var handlers = vm.$options[hook];
  79933. var info = hook + " hook";
  79934. if (handlers) {
  79935. for (var i = 0, j = handlers.length; i < j; i++) {
  79936. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  79937. }
  79938. }
  79939. if (vm._hasHookEvent) {
  79940. vm.$emit('hook:' + hook);
  79941. }
  79942. popTarget();
  79943. }
  79944. /* */
  79945. var MAX_UPDATE_COUNT = 100;
  79946. var queue = [];
  79947. var activatedChildren = [];
  79948. var has = {};
  79949. var circular = {};
  79950. var waiting = false;
  79951. var flushing = false;
  79952. var index = 0;
  79953. /**
  79954. * Reset the scheduler's state.
  79955. */
  79956. function resetSchedulerState () {
  79957. index = queue.length = activatedChildren.length = 0;
  79958. has = {};
  79959. {
  79960. circular = {};
  79961. }
  79962. waiting = flushing = false;
  79963. }
  79964. // Async edge case #6566 requires saving the timestamp when event listeners are
  79965. // attached. However, calling performance.now() has a perf overhead especially
  79966. // if the page has thousands of event listeners. Instead, we take a timestamp
  79967. // every time the scheduler flushes and use that for all event listeners
  79968. // attached during that flush.
  79969. var currentFlushTimestamp = 0;
  79970. // Async edge case fix requires storing an event listener's attach timestamp.
  79971. var getNow = Date.now;
  79972. // Determine what event timestamp the browser is using. Annoyingly, the
  79973. // timestamp can either be hi-res (relative to page load) or low-res
  79974. // (relative to UNIX epoch), so in order to compare time we have to use the
  79975. // same timestamp type when saving the flush timestamp.
  79976. // All IE versions use low-res event timestamps, and have problematic clock
  79977. // implementations (#9632)
  79978. if (inBrowser && !isIE) {
  79979. var performance = window.performance;
  79980. if (
  79981. performance &&
  79982. typeof performance.now === 'function' &&
  79983. getNow() > document.createEvent('Event').timeStamp
  79984. ) {
  79985. // if the event timestamp, although evaluated AFTER the Date.now(), is
  79986. // smaller than it, it means the event is using a hi-res timestamp,
  79987. // and we need to use the hi-res version for event listener timestamps as
  79988. // well.
  79989. getNow = function () { return performance.now(); };
  79990. }
  79991. }
  79992. /**
  79993. * Flush both queues and run the watchers.
  79994. */
  79995. function flushSchedulerQueue () {
  79996. currentFlushTimestamp = getNow();
  79997. flushing = true;
  79998. var watcher, id;
  79999. // Sort queue before flush.
  80000. // This ensures that:
  80001. // 1. Components are updated from parent to child. (because parent is always
  80002. // created before the child)
  80003. // 2. A component's user watchers are run before its render watcher (because
  80004. // user watchers are created before the render watcher)
  80005. // 3. If a component is destroyed during a parent component's watcher run,
  80006. // its watchers can be skipped.
  80007. queue.sort(function (a, b) { return a.id - b.id; });
  80008. // do not cache length because more watchers might be pushed
  80009. // as we run existing watchers
  80010. for (index = 0; index < queue.length; index++) {
  80011. watcher = queue[index];
  80012. if (watcher.before) {
  80013. watcher.before();
  80014. }
  80015. id = watcher.id;
  80016. has[id] = null;
  80017. watcher.run();
  80018. // in dev build, check and stop circular updates.
  80019. if (has[id] != null) {
  80020. circular[id] = (circular[id] || 0) + 1;
  80021. if (circular[id] > MAX_UPDATE_COUNT) {
  80022. warn(
  80023. 'You may have an infinite update loop ' + (
  80024. watcher.user
  80025. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  80026. : "in a component render function."
  80027. ),
  80028. watcher.vm
  80029. );
  80030. break
  80031. }
  80032. }
  80033. }
  80034. // keep copies of post queues before resetting state
  80035. var activatedQueue = activatedChildren.slice();
  80036. var updatedQueue = queue.slice();
  80037. resetSchedulerState();
  80038. // call component updated and activated hooks
  80039. callActivatedHooks(activatedQueue);
  80040. callUpdatedHooks(updatedQueue);
  80041. // devtool hook
  80042. /* istanbul ignore if */
  80043. if (devtools && config.devtools) {
  80044. devtools.emit('flush');
  80045. }
  80046. }
  80047. function callUpdatedHooks (queue) {
  80048. var i = queue.length;
  80049. while (i--) {
  80050. var watcher = queue[i];
  80051. var vm = watcher.vm;
  80052. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  80053. callHook(vm, 'updated');
  80054. }
  80055. }
  80056. }
  80057. /**
  80058. * Queue a kept-alive component that was activated during patch.
  80059. * The queue will be processed after the entire tree has been patched.
  80060. */
  80061. function queueActivatedComponent (vm) {
  80062. // setting _inactive to false here so that a render function can
  80063. // rely on checking whether it's in an inactive tree (e.g. router-view)
  80064. vm._inactive = false;
  80065. activatedChildren.push(vm);
  80066. }
  80067. function callActivatedHooks (queue) {
  80068. for (var i = 0; i < queue.length; i++) {
  80069. queue[i]._inactive = true;
  80070. activateChildComponent(queue[i], true /* true */);
  80071. }
  80072. }
  80073. /**
  80074. * Push a watcher into the watcher queue.
  80075. * Jobs with duplicate IDs will be skipped unless it's
  80076. * pushed when the queue is being flushed.
  80077. */
  80078. function queueWatcher (watcher) {
  80079. var id = watcher.id;
  80080. if (has[id] == null) {
  80081. has[id] = true;
  80082. if (!flushing) {
  80083. queue.push(watcher);
  80084. } else {
  80085. // if already flushing, splice the watcher based on its id
  80086. // if already past its id, it will be run next immediately.
  80087. var i = queue.length - 1;
  80088. while (i > index && queue[i].id > watcher.id) {
  80089. i--;
  80090. }
  80091. queue.splice(i + 1, 0, watcher);
  80092. }
  80093. // queue the flush
  80094. if (!waiting) {
  80095. waiting = true;
  80096. if (!config.async) {
  80097. flushSchedulerQueue();
  80098. return
  80099. }
  80100. nextTick(flushSchedulerQueue);
  80101. }
  80102. }
  80103. }
  80104. /* */
  80105. var uid$2 = 0;
  80106. /**
  80107. * A watcher parses an expression, collects dependencies,
  80108. * and fires callback when the expression value changes.
  80109. * This is used for both the $watch() api and directives.
  80110. */
  80111. var Watcher = function Watcher (
  80112. vm,
  80113. expOrFn,
  80114. cb,
  80115. options,
  80116. isRenderWatcher
  80117. ) {
  80118. this.vm = vm;
  80119. if (isRenderWatcher) {
  80120. vm._watcher = this;
  80121. }
  80122. vm._watchers.push(this);
  80123. // options
  80124. if (options) {
  80125. this.deep = !!options.deep;
  80126. this.user = !!options.user;
  80127. this.lazy = !!options.lazy;
  80128. this.sync = !!options.sync;
  80129. this.before = options.before;
  80130. } else {
  80131. this.deep = this.user = this.lazy = this.sync = false;
  80132. }
  80133. this.cb = cb;
  80134. this.id = ++uid$2; // uid for batching
  80135. this.active = true;
  80136. this.dirty = this.lazy; // for lazy watchers
  80137. this.deps = [];
  80138. this.newDeps = [];
  80139. this.depIds = new _Set();
  80140. this.newDepIds = new _Set();
  80141. this.expression = expOrFn.toString();
  80142. // parse expression for getter
  80143. if (typeof expOrFn === 'function') {
  80144. this.getter = expOrFn;
  80145. } else {
  80146. this.getter = parsePath(expOrFn);
  80147. if (!this.getter) {
  80148. this.getter = noop;
  80149. warn(
  80150. "Failed watching path: \"" + expOrFn + "\" " +
  80151. 'Watcher only accepts simple dot-delimited paths. ' +
  80152. 'For full control, use a function instead.',
  80153. vm
  80154. );
  80155. }
  80156. }
  80157. this.value = this.lazy
  80158. ? undefined
  80159. : this.get();
  80160. };
  80161. /**
  80162. * Evaluate the getter, and re-collect dependencies.
  80163. */
  80164. Watcher.prototype.get = function get () {
  80165. pushTarget(this);
  80166. var value;
  80167. var vm = this.vm;
  80168. try {
  80169. value = this.getter.call(vm, vm);
  80170. } catch (e) {
  80171. if (this.user) {
  80172. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  80173. } else {
  80174. throw e
  80175. }
  80176. } finally {
  80177. // "touch" every property so they are all tracked as
  80178. // dependencies for deep watching
  80179. if (this.deep) {
  80180. traverse(value);
  80181. }
  80182. popTarget();
  80183. this.cleanupDeps();
  80184. }
  80185. return value
  80186. };
  80187. /**
  80188. * Add a dependency to this directive.
  80189. */
  80190. Watcher.prototype.addDep = function addDep (dep) {
  80191. var id = dep.id;
  80192. if (!this.newDepIds.has(id)) {
  80193. this.newDepIds.add(id);
  80194. this.newDeps.push(dep);
  80195. if (!this.depIds.has(id)) {
  80196. dep.addSub(this);
  80197. }
  80198. }
  80199. };
  80200. /**
  80201. * Clean up for dependency collection.
  80202. */
  80203. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  80204. var i = this.deps.length;
  80205. while (i--) {
  80206. var dep = this.deps[i];
  80207. if (!this.newDepIds.has(dep.id)) {
  80208. dep.removeSub(this);
  80209. }
  80210. }
  80211. var tmp = this.depIds;
  80212. this.depIds = this.newDepIds;
  80213. this.newDepIds = tmp;
  80214. this.newDepIds.clear();
  80215. tmp = this.deps;
  80216. this.deps = this.newDeps;
  80217. this.newDeps = tmp;
  80218. this.newDeps.length = 0;
  80219. };
  80220. /**
  80221. * Subscriber interface.
  80222. * Will be called when a dependency changes.
  80223. */
  80224. Watcher.prototype.update = function update () {
  80225. /* istanbul ignore else */
  80226. if (this.lazy) {
  80227. this.dirty = true;
  80228. } else if (this.sync) {
  80229. this.run();
  80230. } else {
  80231. queueWatcher(this);
  80232. }
  80233. };
  80234. /**
  80235. * Scheduler job interface.
  80236. * Will be called by the scheduler.
  80237. */
  80238. Watcher.prototype.run = function run () {
  80239. if (this.active) {
  80240. var value = this.get();
  80241. if (
  80242. value !== this.value ||
  80243. // Deep watchers and watchers on Object/Arrays should fire even
  80244. // when the value is the same, because the value may
  80245. // have mutated.
  80246. isObject(value) ||
  80247. this.deep
  80248. ) {
  80249. // set new value
  80250. var oldValue = this.value;
  80251. this.value = value;
  80252. if (this.user) {
  80253. try {
  80254. this.cb.call(this.vm, value, oldValue);
  80255. } catch (e) {
  80256. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  80257. }
  80258. } else {
  80259. this.cb.call(this.vm, value, oldValue);
  80260. }
  80261. }
  80262. }
  80263. };
  80264. /**
  80265. * Evaluate the value of the watcher.
  80266. * This only gets called for lazy watchers.
  80267. */
  80268. Watcher.prototype.evaluate = function evaluate () {
  80269. this.value = this.get();
  80270. this.dirty = false;
  80271. };
  80272. /**
  80273. * Depend on all deps collected by this watcher.
  80274. */
  80275. Watcher.prototype.depend = function depend () {
  80276. var i = this.deps.length;
  80277. while (i--) {
  80278. this.deps[i].depend();
  80279. }
  80280. };
  80281. /**
  80282. * Remove self from all dependencies' subscriber list.
  80283. */
  80284. Watcher.prototype.teardown = function teardown () {
  80285. if (this.active) {
  80286. // remove self from vm's watcher list
  80287. // this is a somewhat expensive operation so we skip it
  80288. // if the vm is being destroyed.
  80289. if (!this.vm._isBeingDestroyed) {
  80290. remove(this.vm._watchers, this);
  80291. }
  80292. var i = this.deps.length;
  80293. while (i--) {
  80294. this.deps[i].removeSub(this);
  80295. }
  80296. this.active = false;
  80297. }
  80298. };
  80299. /* */
  80300. var sharedPropertyDefinition = {
  80301. enumerable: true,
  80302. configurable: true,
  80303. get: noop,
  80304. set: noop
  80305. };
  80306. function proxy (target, sourceKey, key) {
  80307. sharedPropertyDefinition.get = function proxyGetter () {
  80308. return this[sourceKey][key]
  80309. };
  80310. sharedPropertyDefinition.set = function proxySetter (val) {
  80311. this[sourceKey][key] = val;
  80312. };
  80313. Object.defineProperty(target, key, sharedPropertyDefinition);
  80314. }
  80315. function initState (vm) {
  80316. vm._watchers = [];
  80317. var opts = vm.$options;
  80318. if (opts.props) { initProps(vm, opts.props); }
  80319. if (opts.methods) { initMethods(vm, opts.methods); }
  80320. if (opts.data) {
  80321. initData(vm);
  80322. } else {
  80323. observe(vm._data = {}, true /* asRootData */);
  80324. }
  80325. if (opts.computed) { initComputed(vm, opts.computed); }
  80326. if (opts.watch && opts.watch !== nativeWatch) {
  80327. initWatch(vm, opts.watch);
  80328. }
  80329. }
  80330. function initProps (vm, propsOptions) {
  80331. var propsData = vm.$options.propsData || {};
  80332. var props = vm._props = {};
  80333. // cache prop keys so that future props updates can iterate using Array
  80334. // instead of dynamic object key enumeration.
  80335. var keys = vm.$options._propKeys = [];
  80336. var isRoot = !vm.$parent;
  80337. // root instance props should be converted
  80338. if (!isRoot) {
  80339. toggleObserving(false);
  80340. }
  80341. var loop = function ( key ) {
  80342. keys.push(key);
  80343. var value = validateProp(key, propsOptions, propsData, vm);
  80344. /* istanbul ignore else */
  80345. {
  80346. var hyphenatedKey = hyphenate(key);
  80347. if (isReservedAttribute(hyphenatedKey) ||
  80348. config.isReservedAttr(hyphenatedKey)) {
  80349. warn(
  80350. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  80351. vm
  80352. );
  80353. }
  80354. defineReactive$$1(props, key, value, function () {
  80355. if (!isRoot && !isUpdatingChildComponent) {
  80356. warn(
  80357. "Avoid mutating a prop directly since the value will be " +
  80358. "overwritten whenever the parent component re-renders. " +
  80359. "Instead, use a data or computed property based on the prop's " +
  80360. "value. Prop being mutated: \"" + key + "\"",
  80361. vm
  80362. );
  80363. }
  80364. });
  80365. }
  80366. // static props are already proxied on the component's prototype
  80367. // during Vue.extend(). We only need to proxy props defined at
  80368. // instantiation here.
  80369. if (!(key in vm)) {
  80370. proxy(vm, "_props", key);
  80371. }
  80372. };
  80373. for (var key in propsOptions) loop( key );
  80374. toggleObserving(true);
  80375. }
  80376. function initData (vm) {
  80377. var data = vm.$options.data;
  80378. data = vm._data = typeof data === 'function'
  80379. ? getData(data, vm)
  80380. : data || {};
  80381. if (!isPlainObject(data)) {
  80382. data = {};
  80383. warn(
  80384. 'data functions should return an object:\n' +
  80385. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  80386. vm
  80387. );
  80388. }
  80389. // proxy data on instance
  80390. var keys = Object.keys(data);
  80391. var props = vm.$options.props;
  80392. var methods = vm.$options.methods;
  80393. var i = keys.length;
  80394. while (i--) {
  80395. var key = keys[i];
  80396. {
  80397. if (methods && hasOwn(methods, key)) {
  80398. warn(
  80399. ("Method \"" + key + "\" has already been defined as a data property."),
  80400. vm
  80401. );
  80402. }
  80403. }
  80404. if (props && hasOwn(props, key)) {
  80405. warn(
  80406. "The data property \"" + key + "\" is already declared as a prop. " +
  80407. "Use prop default value instead.",
  80408. vm
  80409. );
  80410. } else if (!isReserved(key)) {
  80411. proxy(vm, "_data", key);
  80412. }
  80413. }
  80414. // observe data
  80415. observe(data, true /* asRootData */);
  80416. }
  80417. function getData (data, vm) {
  80418. // #7573 disable dep collection when invoking data getters
  80419. pushTarget();
  80420. try {
  80421. return data.call(vm, vm)
  80422. } catch (e) {
  80423. handleError(e, vm, "data()");
  80424. return {}
  80425. } finally {
  80426. popTarget();
  80427. }
  80428. }
  80429. var computedWatcherOptions = { lazy: true };
  80430. function initComputed (vm, computed) {
  80431. // $flow-disable-line
  80432. var watchers = vm._computedWatchers = Object.create(null);
  80433. // computed properties are just getters during SSR
  80434. var isSSR = isServerRendering();
  80435. for (var key in computed) {
  80436. var userDef = computed[key];
  80437. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  80438. if (getter == null) {
  80439. warn(
  80440. ("Getter is missing for computed property \"" + key + "\"."),
  80441. vm
  80442. );
  80443. }
  80444. if (!isSSR) {
  80445. // create internal watcher for the computed property.
  80446. watchers[key] = new Watcher(
  80447. vm,
  80448. getter || noop,
  80449. noop,
  80450. computedWatcherOptions
  80451. );
  80452. }
  80453. // component-defined computed properties are already defined on the
  80454. // component prototype. We only need to define computed properties defined
  80455. // at instantiation here.
  80456. if (!(key in vm)) {
  80457. defineComputed(vm, key, userDef);
  80458. } else {
  80459. if (key in vm.$data) {
  80460. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  80461. } else if (vm.$options.props && key in vm.$options.props) {
  80462. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  80463. }
  80464. }
  80465. }
  80466. }
  80467. function defineComputed (
  80468. target,
  80469. key,
  80470. userDef
  80471. ) {
  80472. var shouldCache = !isServerRendering();
  80473. if (typeof userDef === 'function') {
  80474. sharedPropertyDefinition.get = shouldCache
  80475. ? createComputedGetter(key)
  80476. : createGetterInvoker(userDef);
  80477. sharedPropertyDefinition.set = noop;
  80478. } else {
  80479. sharedPropertyDefinition.get = userDef.get
  80480. ? shouldCache && userDef.cache !== false
  80481. ? createComputedGetter(key)
  80482. : createGetterInvoker(userDef.get)
  80483. : noop;
  80484. sharedPropertyDefinition.set = userDef.set || noop;
  80485. }
  80486. if (sharedPropertyDefinition.set === noop) {
  80487. sharedPropertyDefinition.set = function () {
  80488. warn(
  80489. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  80490. this
  80491. );
  80492. };
  80493. }
  80494. Object.defineProperty(target, key, sharedPropertyDefinition);
  80495. }
  80496. function createComputedGetter (key) {
  80497. return function computedGetter () {
  80498. var watcher = this._computedWatchers && this._computedWatchers[key];
  80499. if (watcher) {
  80500. if (watcher.dirty) {
  80501. watcher.evaluate();
  80502. }
  80503. if (Dep.target) {
  80504. watcher.depend();
  80505. }
  80506. return watcher.value
  80507. }
  80508. }
  80509. }
  80510. function createGetterInvoker(fn) {
  80511. return function computedGetter () {
  80512. return fn.call(this, this)
  80513. }
  80514. }
  80515. function initMethods (vm, methods) {
  80516. var props = vm.$options.props;
  80517. for (var key in methods) {
  80518. {
  80519. if (typeof methods[key] !== 'function') {
  80520. warn(
  80521. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  80522. "Did you reference the function correctly?",
  80523. vm
  80524. );
  80525. }
  80526. if (props && hasOwn(props, key)) {
  80527. warn(
  80528. ("Method \"" + key + "\" has already been defined as a prop."),
  80529. vm
  80530. );
  80531. }
  80532. if ((key in vm) && isReserved(key)) {
  80533. warn(
  80534. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  80535. "Avoid defining component methods that start with _ or $."
  80536. );
  80537. }
  80538. }
  80539. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  80540. }
  80541. }
  80542. function initWatch (vm, watch) {
  80543. for (var key in watch) {
  80544. var handler = watch[key];
  80545. if (Array.isArray(handler)) {
  80546. for (var i = 0; i < handler.length; i++) {
  80547. createWatcher(vm, key, handler[i]);
  80548. }
  80549. } else {
  80550. createWatcher(vm, key, handler);
  80551. }
  80552. }
  80553. }
  80554. function createWatcher (
  80555. vm,
  80556. expOrFn,
  80557. handler,
  80558. options
  80559. ) {
  80560. if (isPlainObject(handler)) {
  80561. options = handler;
  80562. handler = handler.handler;
  80563. }
  80564. if (typeof handler === 'string') {
  80565. handler = vm[handler];
  80566. }
  80567. return vm.$watch(expOrFn, handler, options)
  80568. }
  80569. function stateMixin (Vue) {
  80570. // flow somehow has problems with directly declared definition object
  80571. // when using Object.defineProperty, so we have to procedurally build up
  80572. // the object here.
  80573. var dataDef = {};
  80574. dataDef.get = function () { return this._data };
  80575. var propsDef = {};
  80576. propsDef.get = function () { return this._props };
  80577. {
  80578. dataDef.set = function () {
  80579. warn(
  80580. 'Avoid replacing instance root $data. ' +
  80581. 'Use nested data properties instead.',
  80582. this
  80583. );
  80584. };
  80585. propsDef.set = function () {
  80586. warn("$props is readonly.", this);
  80587. };
  80588. }
  80589. Object.defineProperty(Vue.prototype, '$data', dataDef);
  80590. Object.defineProperty(Vue.prototype, '$props', propsDef);
  80591. Vue.prototype.$set = set;
  80592. Vue.prototype.$delete = del;
  80593. Vue.prototype.$watch = function (
  80594. expOrFn,
  80595. cb,
  80596. options
  80597. ) {
  80598. var vm = this;
  80599. if (isPlainObject(cb)) {
  80600. return createWatcher(vm, expOrFn, cb, options)
  80601. }
  80602. options = options || {};
  80603. options.user = true;
  80604. var watcher = new Watcher(vm, expOrFn, cb, options);
  80605. if (options.immediate) {
  80606. try {
  80607. cb.call(vm, watcher.value);
  80608. } catch (error) {
  80609. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  80610. }
  80611. }
  80612. return function unwatchFn () {
  80613. watcher.teardown();
  80614. }
  80615. };
  80616. }
  80617. /* */
  80618. var uid$3 = 0;
  80619. function initMixin (Vue) {
  80620. Vue.prototype._init = function (options) {
  80621. var vm = this;
  80622. // a uid
  80623. vm._uid = uid$3++;
  80624. var startTag, endTag;
  80625. /* istanbul ignore if */
  80626. if (config.performance && mark) {
  80627. startTag = "vue-perf-start:" + (vm._uid);
  80628. endTag = "vue-perf-end:" + (vm._uid);
  80629. mark(startTag);
  80630. }
  80631. // a flag to avoid this being observed
  80632. vm._isVue = true;
  80633. // merge options
  80634. if (options && options._isComponent) {
  80635. // optimize internal component instantiation
  80636. // since dynamic options merging is pretty slow, and none of the
  80637. // internal component options needs special treatment.
  80638. initInternalComponent(vm, options);
  80639. } else {
  80640. vm.$options = mergeOptions(
  80641. resolveConstructorOptions(vm.constructor),
  80642. options || {},
  80643. vm
  80644. );
  80645. }
  80646. /* istanbul ignore else */
  80647. {
  80648. initProxy(vm);
  80649. }
  80650. // expose real self
  80651. vm._self = vm;
  80652. initLifecycle(vm);
  80653. initEvents(vm);
  80654. initRender(vm);
  80655. callHook(vm, 'beforeCreate');
  80656. initInjections(vm); // resolve injections before data/props
  80657. initState(vm);
  80658. initProvide(vm); // resolve provide after data/props
  80659. callHook(vm, 'created');
  80660. /* istanbul ignore if */
  80661. if (config.performance && mark) {
  80662. vm._name = formatComponentName(vm, false);
  80663. mark(endTag);
  80664. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  80665. }
  80666. if (vm.$options.el) {
  80667. vm.$mount(vm.$options.el);
  80668. }
  80669. };
  80670. }
  80671. function initInternalComponent (vm, options) {
  80672. var opts = vm.$options = Object.create(vm.constructor.options);
  80673. // doing this because it's faster than dynamic enumeration.
  80674. var parentVnode = options._parentVnode;
  80675. opts.parent = options.parent;
  80676. opts._parentVnode = parentVnode;
  80677. var vnodeComponentOptions = parentVnode.componentOptions;
  80678. opts.propsData = vnodeComponentOptions.propsData;
  80679. opts._parentListeners = vnodeComponentOptions.listeners;
  80680. opts._renderChildren = vnodeComponentOptions.children;
  80681. opts._componentTag = vnodeComponentOptions.tag;
  80682. if (options.render) {
  80683. opts.render = options.render;
  80684. opts.staticRenderFns = options.staticRenderFns;
  80685. }
  80686. }
  80687. function resolveConstructorOptions (Ctor) {
  80688. var options = Ctor.options;
  80689. if (Ctor.super) {
  80690. var superOptions = resolveConstructorOptions(Ctor.super);
  80691. var cachedSuperOptions = Ctor.superOptions;
  80692. if (superOptions !== cachedSuperOptions) {
  80693. // super option changed,
  80694. // need to resolve new options.
  80695. Ctor.superOptions = superOptions;
  80696. // check if there are any late-modified/attached options (#4976)
  80697. var modifiedOptions = resolveModifiedOptions(Ctor);
  80698. // update base extend options
  80699. if (modifiedOptions) {
  80700. extend(Ctor.extendOptions, modifiedOptions);
  80701. }
  80702. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  80703. if (options.name) {
  80704. options.components[options.name] = Ctor;
  80705. }
  80706. }
  80707. }
  80708. return options
  80709. }
  80710. function resolveModifiedOptions (Ctor) {
  80711. var modified;
  80712. var latest = Ctor.options;
  80713. var sealed = Ctor.sealedOptions;
  80714. for (var key in latest) {
  80715. if (latest[key] !== sealed[key]) {
  80716. if (!modified) { modified = {}; }
  80717. modified[key] = latest[key];
  80718. }
  80719. }
  80720. return modified
  80721. }
  80722. function Vue (options) {
  80723. if (!(this instanceof Vue)
  80724. ) {
  80725. warn('Vue is a constructor and should be called with the `new` keyword');
  80726. }
  80727. this._init(options);
  80728. }
  80729. initMixin(Vue);
  80730. stateMixin(Vue);
  80731. eventsMixin(Vue);
  80732. lifecycleMixin(Vue);
  80733. renderMixin(Vue);
  80734. /* */
  80735. function initUse (Vue) {
  80736. Vue.use = function (plugin) {
  80737. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  80738. if (installedPlugins.indexOf(plugin) > -1) {
  80739. return this
  80740. }
  80741. // additional parameters
  80742. var args = toArray(arguments, 1);
  80743. args.unshift(this);
  80744. if (typeof plugin.install === 'function') {
  80745. plugin.install.apply(plugin, args);
  80746. } else if (typeof plugin === 'function') {
  80747. plugin.apply(null, args);
  80748. }
  80749. installedPlugins.push(plugin);
  80750. return this
  80751. };
  80752. }
  80753. /* */
  80754. function initMixin$1 (Vue) {
  80755. Vue.mixin = function (mixin) {
  80756. this.options = mergeOptions(this.options, mixin);
  80757. return this
  80758. };
  80759. }
  80760. /* */
  80761. function initExtend (Vue) {
  80762. /**
  80763. * Each instance constructor, including Vue, has a unique
  80764. * cid. This enables us to create wrapped "child
  80765. * constructors" for prototypal inheritance and cache them.
  80766. */
  80767. Vue.cid = 0;
  80768. var cid = 1;
  80769. /**
  80770. * Class inheritance
  80771. */
  80772. Vue.extend = function (extendOptions) {
  80773. extendOptions = extendOptions || {};
  80774. var Super = this;
  80775. var SuperId = Super.cid;
  80776. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  80777. if (cachedCtors[SuperId]) {
  80778. return cachedCtors[SuperId]
  80779. }
  80780. var name = extendOptions.name || Super.options.name;
  80781. if (name) {
  80782. validateComponentName(name);
  80783. }
  80784. var Sub = function VueComponent (options) {
  80785. this._init(options);
  80786. };
  80787. Sub.prototype = Object.create(Super.prototype);
  80788. Sub.prototype.constructor = Sub;
  80789. Sub.cid = cid++;
  80790. Sub.options = mergeOptions(
  80791. Super.options,
  80792. extendOptions
  80793. );
  80794. Sub['super'] = Super;
  80795. // For props and computed properties, we define the proxy getters on
  80796. // the Vue instances at extension time, on the extended prototype. This
  80797. // avoids Object.defineProperty calls for each instance created.
  80798. if (Sub.options.props) {
  80799. initProps$1(Sub);
  80800. }
  80801. if (Sub.options.computed) {
  80802. initComputed$1(Sub);
  80803. }
  80804. // allow further extension/mixin/plugin usage
  80805. Sub.extend = Super.extend;
  80806. Sub.mixin = Super.mixin;
  80807. Sub.use = Super.use;
  80808. // create asset registers, so extended classes
  80809. // can have their private assets too.
  80810. ASSET_TYPES.forEach(function (type) {
  80811. Sub[type] = Super[type];
  80812. });
  80813. // enable recursive self-lookup
  80814. if (name) {
  80815. Sub.options.components[name] = Sub;
  80816. }
  80817. // keep a reference to the super options at extension time.
  80818. // later at instantiation we can check if Super's options have
  80819. // been updated.
  80820. Sub.superOptions = Super.options;
  80821. Sub.extendOptions = extendOptions;
  80822. Sub.sealedOptions = extend({}, Sub.options);
  80823. // cache constructor
  80824. cachedCtors[SuperId] = Sub;
  80825. return Sub
  80826. };
  80827. }
  80828. function initProps$1 (Comp) {
  80829. var props = Comp.options.props;
  80830. for (var key in props) {
  80831. proxy(Comp.prototype, "_props", key);
  80832. }
  80833. }
  80834. function initComputed$1 (Comp) {
  80835. var computed = Comp.options.computed;
  80836. for (var key in computed) {
  80837. defineComputed(Comp.prototype, key, computed[key]);
  80838. }
  80839. }
  80840. /* */
  80841. function initAssetRegisters (Vue) {
  80842. /**
  80843. * Create asset registration methods.
  80844. */
  80845. ASSET_TYPES.forEach(function (type) {
  80846. Vue[type] = function (
  80847. id,
  80848. definition
  80849. ) {
  80850. if (!definition) {
  80851. return this.options[type + 's'][id]
  80852. } else {
  80853. /* istanbul ignore if */
  80854. if (type === 'component') {
  80855. validateComponentName(id);
  80856. }
  80857. if (type === 'component' && isPlainObject(definition)) {
  80858. definition.name = definition.name || id;
  80859. definition = this.options._base.extend(definition);
  80860. }
  80861. if (type === 'directive' && typeof definition === 'function') {
  80862. definition = { bind: definition, update: definition };
  80863. }
  80864. this.options[type + 's'][id] = definition;
  80865. return definition
  80866. }
  80867. };
  80868. });
  80869. }
  80870. /* */
  80871. function getComponentName (opts) {
  80872. return opts && (opts.Ctor.options.name || opts.tag)
  80873. }
  80874. function matches (pattern, name) {
  80875. if (Array.isArray(pattern)) {
  80876. return pattern.indexOf(name) > -1
  80877. } else if (typeof pattern === 'string') {
  80878. return pattern.split(',').indexOf(name) > -1
  80879. } else if (isRegExp(pattern)) {
  80880. return pattern.test(name)
  80881. }
  80882. /* istanbul ignore next */
  80883. return false
  80884. }
  80885. function pruneCache (keepAliveInstance, filter) {
  80886. var cache = keepAliveInstance.cache;
  80887. var keys = keepAliveInstance.keys;
  80888. var _vnode = keepAliveInstance._vnode;
  80889. for (var key in cache) {
  80890. var cachedNode = cache[key];
  80891. if (cachedNode) {
  80892. var name = getComponentName(cachedNode.componentOptions);
  80893. if (name && !filter(name)) {
  80894. pruneCacheEntry(cache, key, keys, _vnode);
  80895. }
  80896. }
  80897. }
  80898. }
  80899. function pruneCacheEntry (
  80900. cache,
  80901. key,
  80902. keys,
  80903. current
  80904. ) {
  80905. var cached$$1 = cache[key];
  80906. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  80907. cached$$1.componentInstance.$destroy();
  80908. }
  80909. cache[key] = null;
  80910. remove(keys, key);
  80911. }
  80912. var patternTypes = [String, RegExp, Array];
  80913. var KeepAlive = {
  80914. name: 'keep-alive',
  80915. abstract: true,
  80916. props: {
  80917. include: patternTypes,
  80918. exclude: patternTypes,
  80919. max: [String, Number]
  80920. },
  80921. created: function created () {
  80922. this.cache = Object.create(null);
  80923. this.keys = [];
  80924. },
  80925. destroyed: function destroyed () {
  80926. for (var key in this.cache) {
  80927. pruneCacheEntry(this.cache, key, this.keys);
  80928. }
  80929. },
  80930. mounted: function mounted () {
  80931. var this$1 = this;
  80932. this.$watch('include', function (val) {
  80933. pruneCache(this$1, function (name) { return matches(val, name); });
  80934. });
  80935. this.$watch('exclude', function (val) {
  80936. pruneCache(this$1, function (name) { return !matches(val, name); });
  80937. });
  80938. },
  80939. render: function render () {
  80940. var slot = this.$slots.default;
  80941. var vnode = getFirstComponentChild(slot);
  80942. var componentOptions = vnode && vnode.componentOptions;
  80943. if (componentOptions) {
  80944. // check pattern
  80945. var name = getComponentName(componentOptions);
  80946. var ref = this;
  80947. var include = ref.include;
  80948. var exclude = ref.exclude;
  80949. if (
  80950. // not included
  80951. (include && (!name || !matches(include, name))) ||
  80952. // excluded
  80953. (exclude && name && matches(exclude, name))
  80954. ) {
  80955. return vnode
  80956. }
  80957. var ref$1 = this;
  80958. var cache = ref$1.cache;
  80959. var keys = ref$1.keys;
  80960. var key = vnode.key == null
  80961. // same constructor may get registered as different local components
  80962. // so cid alone is not enough (#3269)
  80963. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  80964. : vnode.key;
  80965. if (cache[key]) {
  80966. vnode.componentInstance = cache[key].componentInstance;
  80967. // make current key freshest
  80968. remove(keys, key);
  80969. keys.push(key);
  80970. } else {
  80971. cache[key] = vnode;
  80972. keys.push(key);
  80973. // prune oldest entry
  80974. if (this.max && keys.length > parseInt(this.max)) {
  80975. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  80976. }
  80977. }
  80978. vnode.data.keepAlive = true;
  80979. }
  80980. return vnode || (slot && slot[0])
  80981. }
  80982. };
  80983. var builtInComponents = {
  80984. KeepAlive: KeepAlive
  80985. };
  80986. /* */
  80987. function initGlobalAPI (Vue) {
  80988. // config
  80989. var configDef = {};
  80990. configDef.get = function () { return config; };
  80991. {
  80992. configDef.set = function () {
  80993. warn(
  80994. 'Do not replace the Vue.config object, set individual fields instead.'
  80995. );
  80996. };
  80997. }
  80998. Object.defineProperty(Vue, 'config', configDef);
  80999. // exposed util methods.
  81000. // NOTE: these are not considered part of the public API - avoid relying on
  81001. // them unless you are aware of the risk.
  81002. Vue.util = {
  81003. warn: warn,
  81004. extend: extend,
  81005. mergeOptions: mergeOptions,
  81006. defineReactive: defineReactive$$1
  81007. };
  81008. Vue.set = set;
  81009. Vue.delete = del;
  81010. Vue.nextTick = nextTick;
  81011. // 2.6 explicit observable API
  81012. Vue.observable = function (obj) {
  81013. observe(obj);
  81014. return obj
  81015. };
  81016. Vue.options = Object.create(null);
  81017. ASSET_TYPES.forEach(function (type) {
  81018. Vue.options[type + 's'] = Object.create(null);
  81019. });
  81020. // this is used to identify the "base" constructor to extend all plain-object
  81021. // components with in Weex's multi-instance scenarios.
  81022. Vue.options._base = Vue;
  81023. extend(Vue.options.components, builtInComponents);
  81024. initUse(Vue);
  81025. initMixin$1(Vue);
  81026. initExtend(Vue);
  81027. initAssetRegisters(Vue);
  81028. }
  81029. initGlobalAPI(Vue);
  81030. Object.defineProperty(Vue.prototype, '$isServer', {
  81031. get: isServerRendering
  81032. });
  81033. Object.defineProperty(Vue.prototype, '$ssrContext', {
  81034. get: function get () {
  81035. /* istanbul ignore next */
  81036. return this.$vnode && this.$vnode.ssrContext
  81037. }
  81038. });
  81039. // expose FunctionalRenderContext for ssr runtime helper installation
  81040. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  81041. value: FunctionalRenderContext
  81042. });
  81043. Vue.version = '2.6.11';
  81044. /* */
  81045. // these are reserved for web because they are directly compiled away
  81046. // during template compilation
  81047. var isReservedAttr = makeMap('style,class');
  81048. // attributes that should be using props for binding
  81049. var acceptValue = makeMap('input,textarea,option,select,progress');
  81050. var mustUseProp = function (tag, type, attr) {
  81051. return (
  81052. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  81053. (attr === 'selected' && tag === 'option') ||
  81054. (attr === 'checked' && tag === 'input') ||
  81055. (attr === 'muted' && tag === 'video')
  81056. )
  81057. };
  81058. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  81059. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  81060. var convertEnumeratedValue = function (key, value) {
  81061. return isFalsyAttrValue(value) || value === 'false'
  81062. ? 'false'
  81063. // allow arbitrary string value for contenteditable
  81064. : key === 'contenteditable' && isValidContentEditableValue(value)
  81065. ? value
  81066. : 'true'
  81067. };
  81068. var isBooleanAttr = makeMap(
  81069. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  81070. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  81071. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  81072. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  81073. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  81074. 'truespeed,typemustmatch,visible'
  81075. );
  81076. var xlinkNS = 'http://www.w3.org/1999/xlink';
  81077. var isXlink = function (name) {
  81078. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  81079. };
  81080. var getXlinkProp = function (name) {
  81081. return isXlink(name) ? name.slice(6, name.length) : ''
  81082. };
  81083. var isFalsyAttrValue = function (val) {
  81084. return val == null || val === false
  81085. };
  81086. /* */
  81087. function genClassForVnode (vnode) {
  81088. var data = vnode.data;
  81089. var parentNode = vnode;
  81090. var childNode = vnode;
  81091. while (isDef(childNode.componentInstance)) {
  81092. childNode = childNode.componentInstance._vnode;
  81093. if (childNode && childNode.data) {
  81094. data = mergeClassData(childNode.data, data);
  81095. }
  81096. }
  81097. while (isDef(parentNode = parentNode.parent)) {
  81098. if (parentNode && parentNode.data) {
  81099. data = mergeClassData(data, parentNode.data);
  81100. }
  81101. }
  81102. return renderClass(data.staticClass, data.class)
  81103. }
  81104. function mergeClassData (child, parent) {
  81105. return {
  81106. staticClass: concat(child.staticClass, parent.staticClass),
  81107. class: isDef(child.class)
  81108. ? [child.class, parent.class]
  81109. : parent.class
  81110. }
  81111. }
  81112. function renderClass (
  81113. staticClass,
  81114. dynamicClass
  81115. ) {
  81116. if (isDef(staticClass) || isDef(dynamicClass)) {
  81117. return concat(staticClass, stringifyClass(dynamicClass))
  81118. }
  81119. /* istanbul ignore next */
  81120. return ''
  81121. }
  81122. function concat (a, b) {
  81123. return a ? b ? (a + ' ' + b) : a : (b || '')
  81124. }
  81125. function stringifyClass (value) {
  81126. if (Array.isArray(value)) {
  81127. return stringifyArray(value)
  81128. }
  81129. if (isObject(value)) {
  81130. return stringifyObject(value)
  81131. }
  81132. if (typeof value === 'string') {
  81133. return value
  81134. }
  81135. /* istanbul ignore next */
  81136. return ''
  81137. }
  81138. function stringifyArray (value) {
  81139. var res = '';
  81140. var stringified;
  81141. for (var i = 0, l = value.length; i < l; i++) {
  81142. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  81143. if (res) { res += ' '; }
  81144. res += stringified;
  81145. }
  81146. }
  81147. return res
  81148. }
  81149. function stringifyObject (value) {
  81150. var res = '';
  81151. for (var key in value) {
  81152. if (value[key]) {
  81153. if (res) { res += ' '; }
  81154. res += key;
  81155. }
  81156. }
  81157. return res
  81158. }
  81159. /* */
  81160. var namespaceMap = {
  81161. svg: 'http://www.w3.org/2000/svg',
  81162. math: 'http://www.w3.org/1998/Math/MathML'
  81163. };
  81164. var isHTMLTag = makeMap(
  81165. 'html,body,base,head,link,meta,style,title,' +
  81166. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  81167. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  81168. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  81169. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  81170. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  81171. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  81172. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  81173. 'output,progress,select,textarea,' +
  81174. 'details,dialog,menu,menuitem,summary,' +
  81175. 'content,element,shadow,template,blockquote,iframe,tfoot'
  81176. );
  81177. // this map is intentionally selective, only covering SVG elements that may
  81178. // contain child elements.
  81179. var isSVG = makeMap(
  81180. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  81181. 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  81182. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  81183. true
  81184. );
  81185. var isPreTag = function (tag) { return tag === 'pre'; };
  81186. var isReservedTag = function (tag) {
  81187. return isHTMLTag(tag) || isSVG(tag)
  81188. };
  81189. function getTagNamespace (tag) {
  81190. if (isSVG(tag)) {
  81191. return 'svg'
  81192. }
  81193. // basic support for MathML
  81194. // note it doesn't support other MathML elements being component roots
  81195. if (tag === 'math') {
  81196. return 'math'
  81197. }
  81198. }
  81199. var unknownElementCache = Object.create(null);
  81200. function isUnknownElement (tag) {
  81201. /* istanbul ignore if */
  81202. if (!inBrowser) {
  81203. return true
  81204. }
  81205. if (isReservedTag(tag)) {
  81206. return false
  81207. }
  81208. tag = tag.toLowerCase();
  81209. /* istanbul ignore if */
  81210. if (unknownElementCache[tag] != null) {
  81211. return unknownElementCache[tag]
  81212. }
  81213. var el = document.createElement(tag);
  81214. if (tag.indexOf('-') > -1) {
  81215. // http://stackoverflow.com/a/28210364/1070244
  81216. return (unknownElementCache[tag] = (
  81217. el.constructor === window.HTMLUnknownElement ||
  81218. el.constructor === window.HTMLElement
  81219. ))
  81220. } else {
  81221. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  81222. }
  81223. }
  81224. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  81225. /* */
  81226. /**
  81227. * Query an element selector if it's not an element already.
  81228. */
  81229. function query (el) {
  81230. if (typeof el === 'string') {
  81231. var selected = document.querySelector(el);
  81232. if (!selected) {
  81233. warn(
  81234. 'Cannot find element: ' + el
  81235. );
  81236. return document.createElement('div')
  81237. }
  81238. return selected
  81239. } else {
  81240. return el
  81241. }
  81242. }
  81243. /* */
  81244. function createElement$1 (tagName, vnode) {
  81245. var elm = document.createElement(tagName);
  81246. if (tagName !== 'select') {
  81247. return elm
  81248. }
  81249. // false or null will remove the attribute but undefined will not
  81250. if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
  81251. elm.setAttribute('multiple', 'multiple');
  81252. }
  81253. return elm
  81254. }
  81255. function createElementNS (namespace, tagName) {
  81256. return document.createElementNS(namespaceMap[namespace], tagName)
  81257. }
  81258. function createTextNode (text) {
  81259. return document.createTextNode(text)
  81260. }
  81261. function createComment (text) {
  81262. return document.createComment(text)
  81263. }
  81264. function insertBefore (parentNode, newNode, referenceNode) {
  81265. parentNode.insertBefore(newNode, referenceNode);
  81266. }
  81267. function removeChild (node, child) {
  81268. node.removeChild(child);
  81269. }
  81270. function appendChild (node, child) {
  81271. node.appendChild(child);
  81272. }
  81273. function parentNode (node) {
  81274. return node.parentNode
  81275. }
  81276. function nextSibling (node) {
  81277. return node.nextSibling
  81278. }
  81279. function tagName (node) {
  81280. return node.tagName
  81281. }
  81282. function setTextContent (node, text) {
  81283. node.textContent = text;
  81284. }
  81285. function setStyleScope (node, scopeId) {
  81286. node.setAttribute(scopeId, '');
  81287. }
  81288. var nodeOps = /*#__PURE__*/Object.freeze({
  81289. createElement: createElement$1,
  81290. createElementNS: createElementNS,
  81291. createTextNode: createTextNode,
  81292. createComment: createComment,
  81293. insertBefore: insertBefore,
  81294. removeChild: removeChild,
  81295. appendChild: appendChild,
  81296. parentNode: parentNode,
  81297. nextSibling: nextSibling,
  81298. tagName: tagName,
  81299. setTextContent: setTextContent,
  81300. setStyleScope: setStyleScope
  81301. });
  81302. /* */
  81303. var ref = {
  81304. create: function create (_, vnode) {
  81305. registerRef(vnode);
  81306. },
  81307. update: function update (oldVnode, vnode) {
  81308. if (oldVnode.data.ref !== vnode.data.ref) {
  81309. registerRef(oldVnode, true);
  81310. registerRef(vnode);
  81311. }
  81312. },
  81313. destroy: function destroy (vnode) {
  81314. registerRef(vnode, true);
  81315. }
  81316. };
  81317. function registerRef (vnode, isRemoval) {
  81318. var key = vnode.data.ref;
  81319. if (!isDef(key)) { return }
  81320. var vm = vnode.context;
  81321. var ref = vnode.componentInstance || vnode.elm;
  81322. var refs = vm.$refs;
  81323. if (isRemoval) {
  81324. if (Array.isArray(refs[key])) {
  81325. remove(refs[key], ref);
  81326. } else if (refs[key] === ref) {
  81327. refs[key] = undefined;
  81328. }
  81329. } else {
  81330. if (vnode.data.refInFor) {
  81331. if (!Array.isArray(refs[key])) {
  81332. refs[key] = [ref];
  81333. } else if (refs[key].indexOf(ref) < 0) {
  81334. // $flow-disable-line
  81335. refs[key].push(ref);
  81336. }
  81337. } else {
  81338. refs[key] = ref;
  81339. }
  81340. }
  81341. }
  81342. /**
  81343. * Virtual DOM patching algorithm based on Snabbdom by
  81344. * Simon Friis Vindum (@paldepind)
  81345. * Licensed under the MIT License
  81346. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  81347. *
  81348. * modified by Evan You (@yyx990803)
  81349. *
  81350. * Not type-checking this because this file is perf-critical and the cost
  81351. * of making flow understand it is not worth it.
  81352. */
  81353. var emptyNode = new VNode('', {}, []);
  81354. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  81355. function sameVnode (a, b) {
  81356. return (
  81357. a.key === b.key && (
  81358. (
  81359. a.tag === b.tag &&
  81360. a.isComment === b.isComment &&
  81361. isDef(a.data) === isDef(b.data) &&
  81362. sameInputType(a, b)
  81363. ) || (
  81364. isTrue(a.isAsyncPlaceholder) &&
  81365. a.asyncFactory === b.asyncFactory &&
  81366. isUndef(b.asyncFactory.error)
  81367. )
  81368. )
  81369. )
  81370. }
  81371. function sameInputType (a, b) {
  81372. if (a.tag !== 'input') { return true }
  81373. var i;
  81374. var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
  81375. var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
  81376. return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
  81377. }
  81378. function createKeyToOldIdx (children, beginIdx, endIdx) {
  81379. var i, key;
  81380. var map = {};
  81381. for (i = beginIdx; i <= endIdx; ++i) {
  81382. key = children[i].key;
  81383. if (isDef(key)) { map[key] = i; }
  81384. }
  81385. return map
  81386. }
  81387. function createPatchFunction (backend) {
  81388. var i, j;
  81389. var cbs = {};
  81390. var modules = backend.modules;
  81391. var nodeOps = backend.nodeOps;
  81392. for (i = 0; i < hooks.length; ++i) {
  81393. cbs[hooks[i]] = [];
  81394. for (j = 0; j < modules.length; ++j) {
  81395. if (isDef(modules[j][hooks[i]])) {
  81396. cbs[hooks[i]].push(modules[j][hooks[i]]);
  81397. }
  81398. }
  81399. }
  81400. function emptyNodeAt (elm) {
  81401. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  81402. }
  81403. function createRmCb (childElm, listeners) {
  81404. function remove$$1 () {
  81405. if (--remove$$1.listeners === 0) {
  81406. removeNode(childElm);
  81407. }
  81408. }
  81409. remove$$1.listeners = listeners;
  81410. return remove$$1
  81411. }
  81412. function removeNode (el) {
  81413. var parent = nodeOps.parentNode(el);
  81414. // element may have already been removed due to v-html / v-text
  81415. if (isDef(parent)) {
  81416. nodeOps.removeChild(parent, el);
  81417. }
  81418. }
  81419. function isUnknownElement$$1 (vnode, inVPre) {
  81420. return (
  81421. !inVPre &&
  81422. !vnode.ns &&
  81423. !(
  81424. config.ignoredElements.length &&
  81425. config.ignoredElements.some(function (ignore) {
  81426. return isRegExp(ignore)
  81427. ? ignore.test(vnode.tag)
  81428. : ignore === vnode.tag
  81429. })
  81430. ) &&
  81431. config.isUnknownElement(vnode.tag)
  81432. )
  81433. }
  81434. var creatingElmInVPre = 0;
  81435. function createElm (
  81436. vnode,
  81437. insertedVnodeQueue,
  81438. parentElm,
  81439. refElm,
  81440. nested,
  81441. ownerArray,
  81442. index
  81443. ) {
  81444. if (isDef(vnode.elm) && isDef(ownerArray)) {
  81445. // This vnode was used in a previous render!
  81446. // now it's used as a new node, overwriting its elm would cause
  81447. // potential patch errors down the road when it's used as an insertion
  81448. // reference node. Instead, we clone the node on-demand before creating
  81449. // associated DOM element for it.
  81450. vnode = ownerArray[index] = cloneVNode(vnode);
  81451. }
  81452. vnode.isRootInsert = !nested; // for transition enter check
  81453. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  81454. return
  81455. }
  81456. var data = vnode.data;
  81457. var children = vnode.children;
  81458. var tag = vnode.tag;
  81459. if (isDef(tag)) {
  81460. {
  81461. if (data && data.pre) {
  81462. creatingElmInVPre++;
  81463. }
  81464. if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
  81465. warn(
  81466. 'Unknown custom element: <' + tag + '> - did you ' +
  81467. 'register the component correctly? For recursive components, ' +
  81468. 'make sure to provide the "name" option.',
  81469. vnode.context
  81470. );
  81471. }
  81472. }
  81473. vnode.elm = vnode.ns
  81474. ? nodeOps.createElementNS(vnode.ns, tag)
  81475. : nodeOps.createElement(tag, vnode);
  81476. setScope(vnode);
  81477. /* istanbul ignore if */
  81478. {
  81479. createChildren(vnode, children, insertedVnodeQueue);
  81480. if (isDef(data)) {
  81481. invokeCreateHooks(vnode, insertedVnodeQueue);
  81482. }
  81483. insert(parentElm, vnode.elm, refElm);
  81484. }
  81485. if (data && data.pre) {
  81486. creatingElmInVPre--;
  81487. }
  81488. } else if (isTrue(vnode.isComment)) {
  81489. vnode.elm = nodeOps.createComment(vnode.text);
  81490. insert(parentElm, vnode.elm, refElm);
  81491. } else {
  81492. vnode.elm = nodeOps.createTextNode(vnode.text);
  81493. insert(parentElm, vnode.elm, refElm);
  81494. }
  81495. }
  81496. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  81497. var i = vnode.data;
  81498. if (isDef(i)) {
  81499. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  81500. if (isDef(i = i.hook) && isDef(i = i.init)) {
  81501. i(vnode, false /* hydrating */);
  81502. }
  81503. // after calling the init hook, if the vnode is a child component
  81504. // it should've created a child instance and mounted it. the child
  81505. // component also has set the placeholder vnode's elm.
  81506. // in that case we can just return the element and be done.
  81507. if (isDef(vnode.componentInstance)) {
  81508. initComponent(vnode, insertedVnodeQueue);
  81509. insert(parentElm, vnode.elm, refElm);
  81510. if (isTrue(isReactivated)) {
  81511. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  81512. }
  81513. return true
  81514. }
  81515. }
  81516. }
  81517. function initComponent (vnode, insertedVnodeQueue) {
  81518. if (isDef(vnode.data.pendingInsert)) {
  81519. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  81520. vnode.data.pendingInsert = null;
  81521. }
  81522. vnode.elm = vnode.componentInstance.$el;
  81523. if (isPatchable(vnode)) {
  81524. invokeCreateHooks(vnode, insertedVnodeQueue);
  81525. setScope(vnode);
  81526. } else {
  81527. // empty component root.
  81528. // skip all element-related modules except for ref (#3455)
  81529. registerRef(vnode);
  81530. // make sure to invoke the insert hook
  81531. insertedVnodeQueue.push(vnode);
  81532. }
  81533. }
  81534. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  81535. var i;
  81536. // hack for #4339: a reactivated component with inner transition
  81537. // does not trigger because the inner node's created hooks are not called
  81538. // again. It's not ideal to involve module-specific logic in here but
  81539. // there doesn't seem to be a better way to do it.
  81540. var innerNode = vnode;
  81541. while (innerNode.componentInstance) {
  81542. innerNode = innerNode.componentInstance._vnode;
  81543. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  81544. for (i = 0; i < cbs.activate.length; ++i) {
  81545. cbs.activate[i](emptyNode, innerNode);
  81546. }
  81547. insertedVnodeQueue.push(innerNode);
  81548. break
  81549. }
  81550. }
  81551. // unlike a newly created component,
  81552. // a reactivated keep-alive component doesn't insert itself
  81553. insert(parentElm, vnode.elm, refElm);
  81554. }
  81555. function insert (parent, elm, ref$$1) {
  81556. if (isDef(parent)) {
  81557. if (isDef(ref$$1)) {
  81558. if (nodeOps.parentNode(ref$$1) === parent) {
  81559. nodeOps.insertBefore(parent, elm, ref$$1);
  81560. }
  81561. } else {
  81562. nodeOps.appendChild(parent, elm);
  81563. }
  81564. }
  81565. }
  81566. function createChildren (vnode, children, insertedVnodeQueue) {
  81567. if (Array.isArray(children)) {
  81568. {
  81569. checkDuplicateKeys(children);
  81570. }
  81571. for (var i = 0; i < children.length; ++i) {
  81572. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
  81573. }
  81574. } else if (isPrimitive(vnode.text)) {
  81575. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  81576. }
  81577. }
  81578. function isPatchable (vnode) {
  81579. while (vnode.componentInstance) {
  81580. vnode = vnode.componentInstance._vnode;
  81581. }
  81582. return isDef(vnode.tag)
  81583. }
  81584. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  81585. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  81586. cbs.create[i$1](emptyNode, vnode);
  81587. }
  81588. i = vnode.data.hook; // Reuse variable
  81589. if (isDef(i)) {
  81590. if (isDef(i.create)) { i.create(emptyNode, vnode); }
  81591. if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
  81592. }
  81593. }
  81594. // set scope id attribute for scoped CSS.
  81595. // this is implemented as a special case to avoid the overhead
  81596. // of going through the normal attribute patching process.
  81597. function setScope (vnode) {
  81598. var i;
  81599. if (isDef(i = vnode.fnScopeId)) {
  81600. nodeOps.setStyleScope(vnode.elm, i);
  81601. } else {
  81602. var ancestor = vnode;
  81603. while (ancestor) {
  81604. if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
  81605. nodeOps.setStyleScope(vnode.elm, i);
  81606. }
  81607. ancestor = ancestor.parent;
  81608. }
  81609. }
  81610. // for slot content they should also get the scopeId from the host instance.
  81611. if (isDef(i = activeInstance) &&
  81612. i !== vnode.context &&
  81613. i !== vnode.fnContext &&
  81614. isDef(i = i.$options._scopeId)
  81615. ) {
  81616. nodeOps.setStyleScope(vnode.elm, i);
  81617. }
  81618. }
  81619. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  81620. for (; startIdx <= endIdx; ++startIdx) {
  81621. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  81622. }
  81623. }
  81624. function invokeDestroyHook (vnode) {
  81625. var i, j;
  81626. var data = vnode.data;
  81627. if (isDef(data)) {
  81628. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  81629. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  81630. }
  81631. if (isDef(i = vnode.children)) {
  81632. for (j = 0; j < vnode.children.length; ++j) {
  81633. invokeDestroyHook(vnode.children[j]);
  81634. }
  81635. }
  81636. }
  81637. function removeVnodes (vnodes, startIdx, endIdx) {
  81638. for (; startIdx <= endIdx; ++startIdx) {
  81639. var ch = vnodes[startIdx];
  81640. if (isDef(ch)) {
  81641. if (isDef(ch.tag)) {
  81642. removeAndInvokeRemoveHook(ch);
  81643. invokeDestroyHook(ch);
  81644. } else { // Text node
  81645. removeNode(ch.elm);
  81646. }
  81647. }
  81648. }
  81649. }
  81650. function removeAndInvokeRemoveHook (vnode, rm) {
  81651. if (isDef(rm) || isDef(vnode.data)) {
  81652. var i;
  81653. var listeners = cbs.remove.length + 1;
  81654. if (isDef(rm)) {
  81655. // we have a recursively passed down rm callback
  81656. // increase the listeners count
  81657. rm.listeners += listeners;
  81658. } else {
  81659. // directly removing
  81660. rm = createRmCb(vnode.elm, listeners);
  81661. }
  81662. // recursively invoke hooks on child component root node
  81663. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  81664. removeAndInvokeRemoveHook(i, rm);
  81665. }
  81666. for (i = 0; i < cbs.remove.length; ++i) {
  81667. cbs.remove[i](vnode, rm);
  81668. }
  81669. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  81670. i(vnode, rm);
  81671. } else {
  81672. rm();
  81673. }
  81674. } else {
  81675. removeNode(vnode.elm);
  81676. }
  81677. }
  81678. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  81679. var oldStartIdx = 0;
  81680. var newStartIdx = 0;
  81681. var oldEndIdx = oldCh.length - 1;
  81682. var oldStartVnode = oldCh[0];
  81683. var oldEndVnode = oldCh[oldEndIdx];
  81684. var newEndIdx = newCh.length - 1;
  81685. var newStartVnode = newCh[0];
  81686. var newEndVnode = newCh[newEndIdx];
  81687. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  81688. // removeOnly is a special flag used only by <transition-group>
  81689. // to ensure removed elements stay in correct relative positions
  81690. // during leaving transitions
  81691. var canMove = !removeOnly;
  81692. {
  81693. checkDuplicateKeys(newCh);
  81694. }
  81695. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  81696. if (isUndef(oldStartVnode)) {
  81697. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  81698. } else if (isUndef(oldEndVnode)) {
  81699. oldEndVnode = oldCh[--oldEndIdx];
  81700. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  81701. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  81702. oldStartVnode = oldCh[++oldStartIdx];
  81703. newStartVnode = newCh[++newStartIdx];
  81704. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  81705. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  81706. oldEndVnode = oldCh[--oldEndIdx];
  81707. newEndVnode = newCh[--newEndIdx];
  81708. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  81709. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  81710. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  81711. oldStartVnode = oldCh[++oldStartIdx];
  81712. newEndVnode = newCh[--newEndIdx];
  81713. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  81714. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  81715. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  81716. oldEndVnode = oldCh[--oldEndIdx];
  81717. newStartVnode = newCh[++newStartIdx];
  81718. } else {
  81719. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  81720. idxInOld = isDef(newStartVnode.key)
  81721. ? oldKeyToIdx[newStartVnode.key]
  81722. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  81723. if (isUndef(idxInOld)) { // New element
  81724. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  81725. } else {
  81726. vnodeToMove = oldCh[idxInOld];
  81727. if (sameVnode(vnodeToMove, newStartVnode)) {
  81728. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  81729. oldCh[idxInOld] = undefined;
  81730. canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  81731. } else {
  81732. // same key but different element. treat as new element
  81733. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  81734. }
  81735. }
  81736. newStartVnode = newCh[++newStartIdx];
  81737. }
  81738. }
  81739. if (oldStartIdx > oldEndIdx) {
  81740. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  81741. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  81742. } else if (newStartIdx > newEndIdx) {
  81743. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  81744. }
  81745. }
  81746. function checkDuplicateKeys (children) {
  81747. var seenKeys = {};
  81748. for (var i = 0; i < children.length; i++) {
  81749. var vnode = children[i];
  81750. var key = vnode.key;
  81751. if (isDef(key)) {
  81752. if (seenKeys[key]) {
  81753. warn(
  81754. ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
  81755. vnode.context
  81756. );
  81757. } else {
  81758. seenKeys[key] = true;
  81759. }
  81760. }
  81761. }
  81762. }
  81763. function findIdxInOld (node, oldCh, start, end) {
  81764. for (var i = start; i < end; i++) {
  81765. var c = oldCh[i];
  81766. if (isDef(c) && sameVnode(node, c)) { return i }
  81767. }
  81768. }
  81769. function patchVnode (
  81770. oldVnode,
  81771. vnode,
  81772. insertedVnodeQueue,
  81773. ownerArray,
  81774. index,
  81775. removeOnly
  81776. ) {
  81777. if (oldVnode === vnode) {
  81778. return
  81779. }
  81780. if (isDef(vnode.elm) && isDef(ownerArray)) {
  81781. // clone reused vnode
  81782. vnode = ownerArray[index] = cloneVNode(vnode);
  81783. }
  81784. var elm = vnode.elm = oldVnode.elm;
  81785. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  81786. if (isDef(vnode.asyncFactory.resolved)) {
  81787. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  81788. } else {
  81789. vnode.isAsyncPlaceholder = true;
  81790. }
  81791. return
  81792. }
  81793. // reuse element for static trees.
  81794. // note we only do this if the vnode is cloned -
  81795. // if the new node is not cloned it means the render functions have been
  81796. // reset by the hot-reload-api and we need to do a proper re-render.
  81797. if (isTrue(vnode.isStatic) &&
  81798. isTrue(oldVnode.isStatic) &&
  81799. vnode.key === oldVnode.key &&
  81800. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
  81801. ) {
  81802. vnode.componentInstance = oldVnode.componentInstance;
  81803. return
  81804. }
  81805. var i;
  81806. var data = vnode.data;
  81807. if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  81808. i(oldVnode, vnode);
  81809. }
  81810. var oldCh = oldVnode.children;
  81811. var ch = vnode.children;
  81812. if (isDef(data) && isPatchable(vnode)) {
  81813. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  81814. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  81815. }
  81816. if (isUndef(vnode.text)) {
  81817. if (isDef(oldCh) && isDef(ch)) {
  81818. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  81819. } else if (isDef(ch)) {
  81820. {
  81821. checkDuplicateKeys(ch);
  81822. }
  81823. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  81824. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  81825. } else if (isDef(oldCh)) {
  81826. removeVnodes(oldCh, 0, oldCh.length - 1);
  81827. } else if (isDef(oldVnode.text)) {
  81828. nodeOps.setTextContent(elm, '');
  81829. }
  81830. } else if (oldVnode.text !== vnode.text) {
  81831. nodeOps.setTextContent(elm, vnode.text);
  81832. }
  81833. if (isDef(data)) {
  81834. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  81835. }
  81836. }
  81837. function invokeInsertHook (vnode, queue, initial) {
  81838. // delay insert hooks for component root nodes, invoke them after the
  81839. // element is really inserted
  81840. if (isTrue(initial) && isDef(vnode.parent)) {
  81841. vnode.parent.data.pendingInsert = queue;
  81842. } else {
  81843. for (var i = 0; i < queue.length; ++i) {
  81844. queue[i].data.hook.insert(queue[i]);
  81845. }
  81846. }
  81847. }
  81848. var hydrationBailed = false;
  81849. // list of modules that can skip create hook during hydration because they
  81850. // are already rendered on the client or has no need for initialization
  81851. // Note: style is excluded because it relies on initial clone for future
  81852. // deep updates (#7063).
  81853. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  81854. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  81855. function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
  81856. var i;
  81857. var tag = vnode.tag;
  81858. var data = vnode.data;
  81859. var children = vnode.children;
  81860. inVPre = inVPre || (data && data.pre);
  81861. vnode.elm = elm;
  81862. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  81863. vnode.isAsyncPlaceholder = true;
  81864. return true
  81865. }
  81866. // assert node match
  81867. {
  81868. if (!assertNodeMatch(elm, vnode, inVPre)) {
  81869. return false
  81870. }
  81871. }
  81872. if (isDef(data)) {
  81873. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  81874. if (isDef(i = vnode.componentInstance)) {
  81875. // child component. it should have hydrated its own tree.
  81876. initComponent(vnode, insertedVnodeQueue);
  81877. return true
  81878. }
  81879. }
  81880. if (isDef(tag)) {
  81881. if (isDef(children)) {
  81882. // empty element, allow client to pick up and populate children
  81883. if (!elm.hasChildNodes()) {
  81884. createChildren(vnode, children, insertedVnodeQueue);
  81885. } else {
  81886. // v-html and domProps: innerHTML
  81887. if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
  81888. if (i !== elm.innerHTML) {
  81889. /* istanbul ignore if */
  81890. if (typeof console !== 'undefined' &&
  81891. !hydrationBailed
  81892. ) {
  81893. hydrationBailed = true;
  81894. console.warn('Parent: ', elm);
  81895. console.warn('server innerHTML: ', i);
  81896. console.warn('client innerHTML: ', elm.innerHTML);
  81897. }
  81898. return false
  81899. }
  81900. } else {
  81901. // iterate and compare children lists
  81902. var childrenMatch = true;
  81903. var childNode = elm.firstChild;
  81904. for (var i$1 = 0; i$1 < children.length; i$1++) {
  81905. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
  81906. childrenMatch = false;
  81907. break
  81908. }
  81909. childNode = childNode.nextSibling;
  81910. }
  81911. // if childNode is not null, it means the actual childNodes list is
  81912. // longer than the virtual children list.
  81913. if (!childrenMatch || childNode) {
  81914. /* istanbul ignore if */
  81915. if (typeof console !== 'undefined' &&
  81916. !hydrationBailed
  81917. ) {
  81918. hydrationBailed = true;
  81919. console.warn('Parent: ', elm);
  81920. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  81921. }
  81922. return false
  81923. }
  81924. }
  81925. }
  81926. }
  81927. if (isDef(data)) {
  81928. var fullInvoke = false;
  81929. for (var key in data) {
  81930. if (!isRenderedModule(key)) {
  81931. fullInvoke = true;
  81932. invokeCreateHooks(vnode, insertedVnodeQueue);
  81933. break
  81934. }
  81935. }
  81936. if (!fullInvoke && data['class']) {
  81937. // ensure collecting deps for deep class bindings for future updates
  81938. traverse(data['class']);
  81939. }
  81940. }
  81941. } else if (elm.data !== vnode.text) {
  81942. elm.data = vnode.text;
  81943. }
  81944. return true
  81945. }
  81946. function assertNodeMatch (node, vnode, inVPre) {
  81947. if (isDef(vnode.tag)) {
  81948. return vnode.tag.indexOf('vue-component') === 0 || (
  81949. !isUnknownElement$$1(vnode, inVPre) &&
  81950. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  81951. )
  81952. } else {
  81953. return node.nodeType === (vnode.isComment ? 8 : 3)
  81954. }
  81955. }
  81956. return function patch (oldVnode, vnode, hydrating, removeOnly) {
  81957. if (isUndef(vnode)) {
  81958. if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
  81959. return
  81960. }
  81961. var isInitialPatch = false;
  81962. var insertedVnodeQueue = [];
  81963. if (isUndef(oldVnode)) {
  81964. // empty mount (likely as component), create new root element
  81965. isInitialPatch = true;
  81966. createElm(vnode, insertedVnodeQueue);
  81967. } else {
  81968. var isRealElement = isDef(oldVnode.nodeType);
  81969. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  81970. // patch existing root node
  81971. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  81972. } else {
  81973. if (isRealElement) {
  81974. // mounting to a real element
  81975. // check if this is server-rendered content and if we can perform
  81976. // a successful hydration.
  81977. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  81978. oldVnode.removeAttribute(SSR_ATTR);
  81979. hydrating = true;
  81980. }
  81981. if (isTrue(hydrating)) {
  81982. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  81983. invokeInsertHook(vnode, insertedVnodeQueue, true);
  81984. return oldVnode
  81985. } else {
  81986. warn(
  81987. 'The client-side rendered virtual DOM tree is not matching ' +
  81988. 'server-rendered content. This is likely caused by incorrect ' +
  81989. 'HTML markup, for example nesting block-level elements inside ' +
  81990. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  81991. 'full client-side render.'
  81992. );
  81993. }
  81994. }
  81995. // either not server-rendered, or hydration failed.
  81996. // create an empty node and replace it
  81997. oldVnode = emptyNodeAt(oldVnode);
  81998. }
  81999. // replacing existing element
  82000. var oldElm = oldVnode.elm;
  82001. var parentElm = nodeOps.parentNode(oldElm);
  82002. // create new node
  82003. createElm(
  82004. vnode,
  82005. insertedVnodeQueue,
  82006. // extremely rare edge case: do not insert if old element is in a
  82007. // leaving transition. Only happens when combining transition +
  82008. // keep-alive + HOCs. (#4590)
  82009. oldElm._leaveCb ? null : parentElm,
  82010. nodeOps.nextSibling(oldElm)
  82011. );
  82012. // update parent placeholder node element, recursively
  82013. if (isDef(vnode.parent)) {
  82014. var ancestor = vnode.parent;
  82015. var patchable = isPatchable(vnode);
  82016. while (ancestor) {
  82017. for (var i = 0; i < cbs.destroy.length; ++i) {
  82018. cbs.destroy[i](ancestor);
  82019. }
  82020. ancestor.elm = vnode.elm;
  82021. if (patchable) {
  82022. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  82023. cbs.create[i$1](emptyNode, ancestor);
  82024. }
  82025. // #6513
  82026. // invoke insert hooks that may have been merged by create hooks.
  82027. // e.g. for directives that uses the "inserted" hook.
  82028. var insert = ancestor.data.hook.insert;
  82029. if (insert.merged) {
  82030. // start at index 1 to avoid re-invoking component mounted hook
  82031. for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
  82032. insert.fns[i$2]();
  82033. }
  82034. }
  82035. } else {
  82036. registerRef(ancestor);
  82037. }
  82038. ancestor = ancestor.parent;
  82039. }
  82040. }
  82041. // destroy old node
  82042. if (isDef(parentElm)) {
  82043. removeVnodes([oldVnode], 0, 0);
  82044. } else if (isDef(oldVnode.tag)) {
  82045. invokeDestroyHook(oldVnode);
  82046. }
  82047. }
  82048. }
  82049. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  82050. return vnode.elm
  82051. }
  82052. }
  82053. /* */
  82054. var directives = {
  82055. create: updateDirectives,
  82056. update: updateDirectives,
  82057. destroy: function unbindDirectives (vnode) {
  82058. updateDirectives(vnode, emptyNode);
  82059. }
  82060. };
  82061. function updateDirectives (oldVnode, vnode) {
  82062. if (oldVnode.data.directives || vnode.data.directives) {
  82063. _update(oldVnode, vnode);
  82064. }
  82065. }
  82066. function _update (oldVnode, vnode) {
  82067. var isCreate = oldVnode === emptyNode;
  82068. var isDestroy = vnode === emptyNode;
  82069. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  82070. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  82071. var dirsWithInsert = [];
  82072. var dirsWithPostpatch = [];
  82073. var key, oldDir, dir;
  82074. for (key in newDirs) {
  82075. oldDir = oldDirs[key];
  82076. dir = newDirs[key];
  82077. if (!oldDir) {
  82078. // new directive, bind
  82079. callHook$1(dir, 'bind', vnode, oldVnode);
  82080. if (dir.def && dir.def.inserted) {
  82081. dirsWithInsert.push(dir);
  82082. }
  82083. } else {
  82084. // existing directive, update
  82085. dir.oldValue = oldDir.value;
  82086. dir.oldArg = oldDir.arg;
  82087. callHook$1(dir, 'update', vnode, oldVnode);
  82088. if (dir.def && dir.def.componentUpdated) {
  82089. dirsWithPostpatch.push(dir);
  82090. }
  82091. }
  82092. }
  82093. if (dirsWithInsert.length) {
  82094. var callInsert = function () {
  82095. for (var i = 0; i < dirsWithInsert.length; i++) {
  82096. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  82097. }
  82098. };
  82099. if (isCreate) {
  82100. mergeVNodeHook(vnode, 'insert', callInsert);
  82101. } else {
  82102. callInsert();
  82103. }
  82104. }
  82105. if (dirsWithPostpatch.length) {
  82106. mergeVNodeHook(vnode, 'postpatch', function () {
  82107. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  82108. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  82109. }
  82110. });
  82111. }
  82112. if (!isCreate) {
  82113. for (key in oldDirs) {
  82114. if (!newDirs[key]) {
  82115. // no longer present, unbind
  82116. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  82117. }
  82118. }
  82119. }
  82120. }
  82121. var emptyModifiers = Object.create(null);
  82122. function normalizeDirectives$1 (
  82123. dirs,
  82124. vm
  82125. ) {
  82126. var res = Object.create(null);
  82127. if (!dirs) {
  82128. // $flow-disable-line
  82129. return res
  82130. }
  82131. var i, dir;
  82132. for (i = 0; i < dirs.length; i++) {
  82133. dir = dirs[i];
  82134. if (!dir.modifiers) {
  82135. // $flow-disable-line
  82136. dir.modifiers = emptyModifiers;
  82137. }
  82138. res[getRawDirName(dir)] = dir;
  82139. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  82140. }
  82141. // $flow-disable-line
  82142. return res
  82143. }
  82144. function getRawDirName (dir) {
  82145. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  82146. }
  82147. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  82148. var fn = dir.def && dir.def[hook];
  82149. if (fn) {
  82150. try {
  82151. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  82152. } catch (e) {
  82153. handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
  82154. }
  82155. }
  82156. }
  82157. var baseModules = [
  82158. ref,
  82159. directives
  82160. ];
  82161. /* */
  82162. function updateAttrs (oldVnode, vnode) {
  82163. var opts = vnode.componentOptions;
  82164. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  82165. return
  82166. }
  82167. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  82168. return
  82169. }
  82170. var key, cur, old;
  82171. var elm = vnode.elm;
  82172. var oldAttrs = oldVnode.data.attrs || {};
  82173. var attrs = vnode.data.attrs || {};
  82174. // clone observed objects, as the user probably wants to mutate it
  82175. if (isDef(attrs.__ob__)) {
  82176. attrs = vnode.data.attrs = extend({}, attrs);
  82177. }
  82178. for (key in attrs) {
  82179. cur = attrs[key];
  82180. old = oldAttrs[key];
  82181. if (old !== cur) {
  82182. setAttr(elm, key, cur);
  82183. }
  82184. }
  82185. // #4391: in IE9, setting type can reset value for input[type=radio]
  82186. // #6666: IE/Edge forces progress value down to 1 before setting a max
  82187. /* istanbul ignore if */
  82188. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  82189. setAttr(elm, 'value', attrs.value);
  82190. }
  82191. for (key in oldAttrs) {
  82192. if (isUndef(attrs[key])) {
  82193. if (isXlink(key)) {
  82194. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  82195. } else if (!isEnumeratedAttr(key)) {
  82196. elm.removeAttribute(key);
  82197. }
  82198. }
  82199. }
  82200. }
  82201. function setAttr (el, key, value) {
  82202. if (el.tagName.indexOf('-') > -1) {
  82203. baseSetAttr(el, key, value);
  82204. } else if (isBooleanAttr(key)) {
  82205. // set attribute for blank value
  82206. // e.g. <option disabled>Select one</option>
  82207. if (isFalsyAttrValue(value)) {
  82208. el.removeAttribute(key);
  82209. } else {
  82210. // technically allowfullscreen is a boolean attribute for <iframe>,
  82211. // but Flash expects a value of "true" when used on <embed> tag
  82212. value = key === 'allowfullscreen' && el.tagName === 'EMBED'
  82213. ? 'true'
  82214. : key;
  82215. el.setAttribute(key, value);
  82216. }
  82217. } else if (isEnumeratedAttr(key)) {
  82218. el.setAttribute(key, convertEnumeratedValue(key, value));
  82219. } else if (isXlink(key)) {
  82220. if (isFalsyAttrValue(value)) {
  82221. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  82222. } else {
  82223. el.setAttributeNS(xlinkNS, key, value);
  82224. }
  82225. } else {
  82226. baseSetAttr(el, key, value);
  82227. }
  82228. }
  82229. function baseSetAttr (el, key, value) {
  82230. if (isFalsyAttrValue(value)) {
  82231. el.removeAttribute(key);
  82232. } else {
  82233. // #7138: IE10 & 11 fires input event when setting placeholder on
  82234. // <textarea>... block the first input event and remove the blocker
  82235. // immediately.
  82236. /* istanbul ignore if */
  82237. if (
  82238. isIE && !isIE9 &&
  82239. el.tagName === 'TEXTAREA' &&
  82240. key === 'placeholder' && value !== '' && !el.__ieph
  82241. ) {
  82242. var blocker = function (e) {
  82243. e.stopImmediatePropagation();
  82244. el.removeEventListener('input', blocker);
  82245. };
  82246. el.addEventListener('input', blocker);
  82247. // $flow-disable-line
  82248. el.__ieph = true; /* IE placeholder patched */
  82249. }
  82250. el.setAttribute(key, value);
  82251. }
  82252. }
  82253. var attrs = {
  82254. create: updateAttrs,
  82255. update: updateAttrs
  82256. };
  82257. /* */
  82258. function updateClass (oldVnode, vnode) {
  82259. var el = vnode.elm;
  82260. var data = vnode.data;
  82261. var oldData = oldVnode.data;
  82262. if (
  82263. isUndef(data.staticClass) &&
  82264. isUndef(data.class) && (
  82265. isUndef(oldData) || (
  82266. isUndef(oldData.staticClass) &&
  82267. isUndef(oldData.class)
  82268. )
  82269. )
  82270. ) {
  82271. return
  82272. }
  82273. var cls = genClassForVnode(vnode);
  82274. // handle transition classes
  82275. var transitionClass = el._transitionClasses;
  82276. if (isDef(transitionClass)) {
  82277. cls = concat(cls, stringifyClass(transitionClass));
  82278. }
  82279. // set the class
  82280. if (cls !== el._prevClass) {
  82281. el.setAttribute('class', cls);
  82282. el._prevClass = cls;
  82283. }
  82284. }
  82285. var klass = {
  82286. create: updateClass,
  82287. update: updateClass
  82288. };
  82289. /* */
  82290. var validDivisionCharRE = /[\w).+\-_$\]]/;
  82291. function parseFilters (exp) {
  82292. var inSingle = false;
  82293. var inDouble = false;
  82294. var inTemplateString = false;
  82295. var inRegex = false;
  82296. var curly = 0;
  82297. var square = 0;
  82298. var paren = 0;
  82299. var lastFilterIndex = 0;
  82300. var c, prev, i, expression, filters;
  82301. for (i = 0; i < exp.length; i++) {
  82302. prev = c;
  82303. c = exp.charCodeAt(i);
  82304. if (inSingle) {
  82305. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  82306. } else if (inDouble) {
  82307. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  82308. } else if (inTemplateString) {
  82309. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  82310. } else if (inRegex) {
  82311. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  82312. } else if (
  82313. c === 0x7C && // pipe
  82314. exp.charCodeAt(i + 1) !== 0x7C &&
  82315. exp.charCodeAt(i - 1) !== 0x7C &&
  82316. !curly && !square && !paren
  82317. ) {
  82318. if (expression === undefined) {
  82319. // first filter, end of expression
  82320. lastFilterIndex = i + 1;
  82321. expression = exp.slice(0, i).trim();
  82322. } else {
  82323. pushFilter();
  82324. }
  82325. } else {
  82326. switch (c) {
  82327. case 0x22: inDouble = true; break // "
  82328. case 0x27: inSingle = true; break // '
  82329. case 0x60: inTemplateString = true; break // `
  82330. case 0x28: paren++; break // (
  82331. case 0x29: paren--; break // )
  82332. case 0x5B: square++; break // [
  82333. case 0x5D: square--; break // ]
  82334. case 0x7B: curly++; break // {
  82335. case 0x7D: curly--; break // }
  82336. }
  82337. if (c === 0x2f) { // /
  82338. var j = i - 1;
  82339. var p = (void 0);
  82340. // find first non-whitespace prev char
  82341. for (; j >= 0; j--) {
  82342. p = exp.charAt(j);
  82343. if (p !== ' ') { break }
  82344. }
  82345. if (!p || !validDivisionCharRE.test(p)) {
  82346. inRegex = true;
  82347. }
  82348. }
  82349. }
  82350. }
  82351. if (expression === undefined) {
  82352. expression = exp.slice(0, i).trim();
  82353. } else if (lastFilterIndex !== 0) {
  82354. pushFilter();
  82355. }
  82356. function pushFilter () {
  82357. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  82358. lastFilterIndex = i + 1;
  82359. }
  82360. if (filters) {
  82361. for (i = 0; i < filters.length; i++) {
  82362. expression = wrapFilter(expression, filters[i]);
  82363. }
  82364. }
  82365. return expression
  82366. }
  82367. function wrapFilter (exp, filter) {
  82368. var i = filter.indexOf('(');
  82369. if (i < 0) {
  82370. // _f: resolveFilter
  82371. return ("_f(\"" + filter + "\")(" + exp + ")")
  82372. } else {
  82373. var name = filter.slice(0, i);
  82374. var args = filter.slice(i + 1);
  82375. return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
  82376. }
  82377. }
  82378. /* */
  82379. /* eslint-disable no-unused-vars */
  82380. function baseWarn (msg, range) {
  82381. console.error(("[Vue compiler]: " + msg));
  82382. }
  82383. /* eslint-enable no-unused-vars */
  82384. function pluckModuleFunction (
  82385. modules,
  82386. key
  82387. ) {
  82388. return modules
  82389. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  82390. : []
  82391. }
  82392. function addProp (el, name, value, range, dynamic) {
  82393. (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  82394. el.plain = false;
  82395. }
  82396. function addAttr (el, name, value, range, dynamic) {
  82397. var attrs = dynamic
  82398. ? (el.dynamicAttrs || (el.dynamicAttrs = []))
  82399. : (el.attrs || (el.attrs = []));
  82400. attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  82401. el.plain = false;
  82402. }
  82403. // add a raw attr (use this in preTransforms)
  82404. function addRawAttr (el, name, value, range) {
  82405. el.attrsMap[name] = value;
  82406. el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
  82407. }
  82408. function addDirective (
  82409. el,
  82410. name,
  82411. rawName,
  82412. value,
  82413. arg,
  82414. isDynamicArg,
  82415. modifiers,
  82416. range
  82417. ) {
  82418. (el.directives || (el.directives = [])).push(rangeSetItem({
  82419. name: name,
  82420. rawName: rawName,
  82421. value: value,
  82422. arg: arg,
  82423. isDynamicArg: isDynamicArg,
  82424. modifiers: modifiers
  82425. }, range));
  82426. el.plain = false;
  82427. }
  82428. function prependModifierMarker (symbol, name, dynamic) {
  82429. return dynamic
  82430. ? ("_p(" + name + ",\"" + symbol + "\")")
  82431. : symbol + name // mark the event as captured
  82432. }
  82433. function addHandler (
  82434. el,
  82435. name,
  82436. value,
  82437. modifiers,
  82438. important,
  82439. warn,
  82440. range,
  82441. dynamic
  82442. ) {
  82443. modifiers = modifiers || emptyObject;
  82444. // warn prevent and passive modifier
  82445. /* istanbul ignore if */
  82446. if (
  82447. warn &&
  82448. modifiers.prevent && modifiers.passive
  82449. ) {
  82450. warn(
  82451. 'passive and prevent can\'t be used together. ' +
  82452. 'Passive handler can\'t prevent default event.',
  82453. range
  82454. );
  82455. }
  82456. // normalize click.right and click.middle since they don't actually fire
  82457. // this is technically browser-specific, but at least for now browsers are
  82458. // the only target envs that have right/middle clicks.
  82459. if (modifiers.right) {
  82460. if (dynamic) {
  82461. name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
  82462. } else if (name === 'click') {
  82463. name = 'contextmenu';
  82464. delete modifiers.right;
  82465. }
  82466. } else if (modifiers.middle) {
  82467. if (dynamic) {
  82468. name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
  82469. } else if (name === 'click') {
  82470. name = 'mouseup';
  82471. }
  82472. }
  82473. // check capture modifier
  82474. if (modifiers.capture) {
  82475. delete modifiers.capture;
  82476. name = prependModifierMarker('!', name, dynamic);
  82477. }
  82478. if (modifiers.once) {
  82479. delete modifiers.once;
  82480. name = prependModifierMarker('~', name, dynamic);
  82481. }
  82482. /* istanbul ignore if */
  82483. if (modifiers.passive) {
  82484. delete modifiers.passive;
  82485. name = prependModifierMarker('&', name, dynamic);
  82486. }
  82487. var events;
  82488. if (modifiers.native) {
  82489. delete modifiers.native;
  82490. events = el.nativeEvents || (el.nativeEvents = {});
  82491. } else {
  82492. events = el.events || (el.events = {});
  82493. }
  82494. var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
  82495. if (modifiers !== emptyObject) {
  82496. newHandler.modifiers = modifiers;
  82497. }
  82498. var handlers = events[name];
  82499. /* istanbul ignore if */
  82500. if (Array.isArray(handlers)) {
  82501. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  82502. } else if (handlers) {
  82503. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  82504. } else {
  82505. events[name] = newHandler;
  82506. }
  82507. el.plain = false;
  82508. }
  82509. function getRawBindingAttr (
  82510. el,
  82511. name
  82512. ) {
  82513. return el.rawAttrsMap[':' + name] ||
  82514. el.rawAttrsMap['v-bind:' + name] ||
  82515. el.rawAttrsMap[name]
  82516. }
  82517. function getBindingAttr (
  82518. el,
  82519. name,
  82520. getStatic
  82521. ) {
  82522. var dynamicValue =
  82523. getAndRemoveAttr(el, ':' + name) ||
  82524. getAndRemoveAttr(el, 'v-bind:' + name);
  82525. if (dynamicValue != null) {
  82526. return parseFilters(dynamicValue)
  82527. } else if (getStatic !== false) {
  82528. var staticValue = getAndRemoveAttr(el, name);
  82529. if (staticValue != null) {
  82530. return JSON.stringify(staticValue)
  82531. }
  82532. }
  82533. }
  82534. // note: this only removes the attr from the Array (attrsList) so that it
  82535. // doesn't get processed by processAttrs.
  82536. // By default it does NOT remove it from the map (attrsMap) because the map is
  82537. // needed during codegen.
  82538. function getAndRemoveAttr (
  82539. el,
  82540. name,
  82541. removeFromMap
  82542. ) {
  82543. var val;
  82544. if ((val = el.attrsMap[name]) != null) {
  82545. var list = el.attrsList;
  82546. for (var i = 0, l = list.length; i < l; i++) {
  82547. if (list[i].name === name) {
  82548. list.splice(i, 1);
  82549. break
  82550. }
  82551. }
  82552. }
  82553. if (removeFromMap) {
  82554. delete el.attrsMap[name];
  82555. }
  82556. return val
  82557. }
  82558. function getAndRemoveAttrByRegex (
  82559. el,
  82560. name
  82561. ) {
  82562. var list = el.attrsList;
  82563. for (var i = 0, l = list.length; i < l; i++) {
  82564. var attr = list[i];
  82565. if (name.test(attr.name)) {
  82566. list.splice(i, 1);
  82567. return attr
  82568. }
  82569. }
  82570. }
  82571. function rangeSetItem (
  82572. item,
  82573. range
  82574. ) {
  82575. if (range) {
  82576. if (range.start != null) {
  82577. item.start = range.start;
  82578. }
  82579. if (range.end != null) {
  82580. item.end = range.end;
  82581. }
  82582. }
  82583. return item
  82584. }
  82585. /* */
  82586. /**
  82587. * Cross-platform code generation for component v-model
  82588. */
  82589. function genComponentModel (
  82590. el,
  82591. value,
  82592. modifiers
  82593. ) {
  82594. var ref = modifiers || {};
  82595. var number = ref.number;
  82596. var trim = ref.trim;
  82597. var baseValueExpression = '$$v';
  82598. var valueExpression = baseValueExpression;
  82599. if (trim) {
  82600. valueExpression =
  82601. "(typeof " + baseValueExpression + " === 'string'" +
  82602. "? " + baseValueExpression + ".trim()" +
  82603. ": " + baseValueExpression + ")";
  82604. }
  82605. if (number) {
  82606. valueExpression = "_n(" + valueExpression + ")";
  82607. }
  82608. var assignment = genAssignmentCode(value, valueExpression);
  82609. el.model = {
  82610. value: ("(" + value + ")"),
  82611. expression: JSON.stringify(value),
  82612. callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
  82613. };
  82614. }
  82615. /**
  82616. * Cross-platform codegen helper for generating v-model value assignment code.
  82617. */
  82618. function genAssignmentCode (
  82619. value,
  82620. assignment
  82621. ) {
  82622. var res = parseModel(value);
  82623. if (res.key === null) {
  82624. return (value + "=" + assignment)
  82625. } else {
  82626. return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
  82627. }
  82628. }
  82629. /**
  82630. * Parse a v-model expression into a base path and a final key segment.
  82631. * Handles both dot-path and possible square brackets.
  82632. *
  82633. * Possible cases:
  82634. *
  82635. * - test
  82636. * - test[key]
  82637. * - test[test1[key]]
  82638. * - test["a"][key]
  82639. * - xxx.test[a[a].test1[key]]
  82640. * - test.xxx.a["asa"][test1[key]]
  82641. *
  82642. */
  82643. var len, str, chr, index$1, expressionPos, expressionEndPos;
  82644. function parseModel (val) {
  82645. // Fix https://github.com/vuejs/vue/pull/7730
  82646. // allow v-model="obj.val " (trailing whitespace)
  82647. val = val.trim();
  82648. len = val.length;
  82649. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  82650. index$1 = val.lastIndexOf('.');
  82651. if (index$1 > -1) {
  82652. return {
  82653. exp: val.slice(0, index$1),
  82654. key: '"' + val.slice(index$1 + 1) + '"'
  82655. }
  82656. } else {
  82657. return {
  82658. exp: val,
  82659. key: null
  82660. }
  82661. }
  82662. }
  82663. str = val;
  82664. index$1 = expressionPos = expressionEndPos = 0;
  82665. while (!eof()) {
  82666. chr = next();
  82667. /* istanbul ignore if */
  82668. if (isStringStart(chr)) {
  82669. parseString(chr);
  82670. } else if (chr === 0x5B) {
  82671. parseBracket(chr);
  82672. }
  82673. }
  82674. return {
  82675. exp: val.slice(0, expressionPos),
  82676. key: val.slice(expressionPos + 1, expressionEndPos)
  82677. }
  82678. }
  82679. function next () {
  82680. return str.charCodeAt(++index$1)
  82681. }
  82682. function eof () {
  82683. return index$1 >= len
  82684. }
  82685. function isStringStart (chr) {
  82686. return chr === 0x22 || chr === 0x27
  82687. }
  82688. function parseBracket (chr) {
  82689. var inBracket = 1;
  82690. expressionPos = index$1;
  82691. while (!eof()) {
  82692. chr = next();
  82693. if (isStringStart(chr)) {
  82694. parseString(chr);
  82695. continue
  82696. }
  82697. if (chr === 0x5B) { inBracket++; }
  82698. if (chr === 0x5D) { inBracket--; }
  82699. if (inBracket === 0) {
  82700. expressionEndPos = index$1;
  82701. break
  82702. }
  82703. }
  82704. }
  82705. function parseString (chr) {
  82706. var stringQuote = chr;
  82707. while (!eof()) {
  82708. chr = next();
  82709. if (chr === stringQuote) {
  82710. break
  82711. }
  82712. }
  82713. }
  82714. /* */
  82715. var warn$1;
  82716. // in some cases, the event used has to be determined at runtime
  82717. // so we used some reserved tokens during compile.
  82718. var RANGE_TOKEN = '__r';
  82719. var CHECKBOX_RADIO_TOKEN = '__c';
  82720. function model (
  82721. el,
  82722. dir,
  82723. _warn
  82724. ) {
  82725. warn$1 = _warn;
  82726. var value = dir.value;
  82727. var modifiers = dir.modifiers;
  82728. var tag = el.tag;
  82729. var type = el.attrsMap.type;
  82730. {
  82731. // inputs with type="file" are read only and setting the input's
  82732. // value will throw an error.
  82733. if (tag === 'input' && type === 'file') {
  82734. warn$1(
  82735. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  82736. "File inputs are read only. Use a v-on:change listener instead.",
  82737. el.rawAttrsMap['v-model']
  82738. );
  82739. }
  82740. }
  82741. if (el.component) {
  82742. genComponentModel(el, value, modifiers);
  82743. // component v-model doesn't need extra runtime
  82744. return false
  82745. } else if (tag === 'select') {
  82746. genSelect(el, value, modifiers);
  82747. } else if (tag === 'input' && type === 'checkbox') {
  82748. genCheckboxModel(el, value, modifiers);
  82749. } else if (tag === 'input' && type === 'radio') {
  82750. genRadioModel(el, value, modifiers);
  82751. } else if (tag === 'input' || tag === 'textarea') {
  82752. genDefaultModel(el, value, modifiers);
  82753. } else if (!config.isReservedTag(tag)) {
  82754. genComponentModel(el, value, modifiers);
  82755. // component v-model doesn't need extra runtime
  82756. return false
  82757. } else {
  82758. warn$1(
  82759. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  82760. "v-model is not supported on this element type. " +
  82761. 'If you are working with contenteditable, it\'s recommended to ' +
  82762. 'wrap a library dedicated for that purpose inside a custom component.',
  82763. el.rawAttrsMap['v-model']
  82764. );
  82765. }
  82766. // ensure runtime directive metadata
  82767. return true
  82768. }
  82769. function genCheckboxModel (
  82770. el,
  82771. value,
  82772. modifiers
  82773. ) {
  82774. var number = modifiers && modifiers.number;
  82775. var valueBinding = getBindingAttr(el, 'value') || 'null';
  82776. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  82777. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  82778. addProp(el, 'checked',
  82779. "Array.isArray(" + value + ")" +
  82780. "?_i(" + value + "," + valueBinding + ")>-1" + (
  82781. trueValueBinding === 'true'
  82782. ? (":(" + value + ")")
  82783. : (":_q(" + value + "," + trueValueBinding + ")")
  82784. )
  82785. );
  82786. addHandler(el, 'change',
  82787. "var $$a=" + value + "," +
  82788. '$$el=$event.target,' +
  82789. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  82790. 'if(Array.isArray($$a)){' +
  82791. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  82792. '$$i=_i($$a,$$v);' +
  82793. "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
  82794. "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
  82795. "}else{" + (genAssignmentCode(value, '$$c')) + "}",
  82796. null, true
  82797. );
  82798. }
  82799. function genRadioModel (
  82800. el,
  82801. value,
  82802. modifiers
  82803. ) {
  82804. var number = modifiers && modifiers.number;
  82805. var valueBinding = getBindingAttr(el, 'value') || 'null';
  82806. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  82807. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  82808. addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
  82809. }
  82810. function genSelect (
  82811. el,
  82812. value,
  82813. modifiers
  82814. ) {
  82815. var number = modifiers && modifiers.number;
  82816. var selectedVal = "Array.prototype.filter" +
  82817. ".call($event.target.options,function(o){return o.selected})" +
  82818. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  82819. "return " + (number ? '_n(val)' : 'val') + "})";
  82820. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  82821. var code = "var $$selectedVal = " + selectedVal + ";";
  82822. code = code + " " + (genAssignmentCode(value, assignment));
  82823. addHandler(el, 'change', code, null, true);
  82824. }
  82825. function genDefaultModel (
  82826. el,
  82827. value,
  82828. modifiers
  82829. ) {
  82830. var type = el.attrsMap.type;
  82831. // warn if v-bind:value conflicts with v-model
  82832. // except for inputs with v-bind:type
  82833. {
  82834. var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
  82835. var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  82836. if (value$1 && !typeBinding) {
  82837. var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
  82838. warn$1(
  82839. binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
  82840. 'because the latter already expands to a value binding internally',
  82841. el.rawAttrsMap[binding]
  82842. );
  82843. }
  82844. }
  82845. var ref = modifiers || {};
  82846. var lazy = ref.lazy;
  82847. var number = ref.number;
  82848. var trim = ref.trim;
  82849. var needCompositionGuard = !lazy && type !== 'range';
  82850. var event = lazy
  82851. ? 'change'
  82852. : type === 'range'
  82853. ? RANGE_TOKEN
  82854. : 'input';
  82855. var valueExpression = '$event.target.value';
  82856. if (trim) {
  82857. valueExpression = "$event.target.value.trim()";
  82858. }
  82859. if (number) {
  82860. valueExpression = "_n(" + valueExpression + ")";
  82861. }
  82862. var code = genAssignmentCode(value, valueExpression);
  82863. if (needCompositionGuard) {
  82864. code = "if($event.target.composing)return;" + code;
  82865. }
  82866. addProp(el, 'value', ("(" + value + ")"));
  82867. addHandler(el, event, code, null, true);
  82868. if (trim || number) {
  82869. addHandler(el, 'blur', '$forceUpdate()');
  82870. }
  82871. }
  82872. /* */
  82873. // normalize v-model event tokens that can only be determined at runtime.
  82874. // it's important to place the event as the first in the array because
  82875. // the whole point is ensuring the v-model callback gets called before
  82876. // user-attached handlers.
  82877. function normalizeEvents (on) {
  82878. /* istanbul ignore if */
  82879. if (isDef(on[RANGE_TOKEN])) {
  82880. // IE input[type=range] only supports `change` event
  82881. var event = isIE ? 'change' : 'input';
  82882. on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
  82883. delete on[RANGE_TOKEN];
  82884. }
  82885. // This was originally intended to fix #4521 but no longer necessary
  82886. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  82887. /* istanbul ignore if */
  82888. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  82889. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  82890. delete on[CHECKBOX_RADIO_TOKEN];
  82891. }
  82892. }
  82893. var target$1;
  82894. function createOnceHandler$1 (event, handler, capture) {
  82895. var _target = target$1; // save current target element in closure
  82896. return function onceHandler () {
  82897. var res = handler.apply(null, arguments);
  82898. if (res !== null) {
  82899. remove$2(event, onceHandler, capture, _target);
  82900. }
  82901. }
  82902. }
  82903. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  82904. // implementation and does not fire microtasks in between event propagation, so
  82905. // safe to exclude.
  82906. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  82907. function add$1 (
  82908. name,
  82909. handler,
  82910. capture,
  82911. passive
  82912. ) {
  82913. // async edge case #6566: inner click event triggers patch, event handler
  82914. // attached to outer element during patch, and triggered again. This
  82915. // happens because browsers fire microtask ticks between event propagation.
  82916. // the solution is simple: we save the timestamp when a handler is attached,
  82917. // and the handler would only fire if the event passed to it was fired
  82918. // AFTER it was attached.
  82919. if (useMicrotaskFix) {
  82920. var attachedTimestamp = currentFlushTimestamp;
  82921. var original = handler;
  82922. handler = original._wrapper = function (e) {
  82923. if (
  82924. // no bubbling, should always fire.
  82925. // this is just a safety net in case event.timeStamp is unreliable in
  82926. // certain weird environments...
  82927. e.target === e.currentTarget ||
  82928. // event is fired after handler attachment
  82929. e.timeStamp >= attachedTimestamp ||
  82930. // bail for environments that have buggy event.timeStamp implementations
  82931. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  82932. // #9681 QtWebEngine event.timeStamp is negative value
  82933. e.timeStamp <= 0 ||
  82934. // #9448 bail if event is fired in another document in a multi-page
  82935. // electron/nw.js app, since event.timeStamp will be using a different
  82936. // starting reference
  82937. e.target.ownerDocument !== document
  82938. ) {
  82939. return original.apply(this, arguments)
  82940. }
  82941. };
  82942. }
  82943. target$1.addEventListener(
  82944. name,
  82945. handler,
  82946. supportsPassive
  82947. ? { capture: capture, passive: passive }
  82948. : capture
  82949. );
  82950. }
  82951. function remove$2 (
  82952. name,
  82953. handler,
  82954. capture,
  82955. _target
  82956. ) {
  82957. (_target || target$1).removeEventListener(
  82958. name,
  82959. handler._wrapper || handler,
  82960. capture
  82961. );
  82962. }
  82963. function updateDOMListeners (oldVnode, vnode) {
  82964. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  82965. return
  82966. }
  82967. var on = vnode.data.on || {};
  82968. var oldOn = oldVnode.data.on || {};
  82969. target$1 = vnode.elm;
  82970. normalizeEvents(on);
  82971. updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
  82972. target$1 = undefined;
  82973. }
  82974. var events = {
  82975. create: updateDOMListeners,
  82976. update: updateDOMListeners
  82977. };
  82978. /* */
  82979. var svgContainer;
  82980. function updateDOMProps (oldVnode, vnode) {
  82981. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  82982. return
  82983. }
  82984. var key, cur;
  82985. var elm = vnode.elm;
  82986. var oldProps = oldVnode.data.domProps || {};
  82987. var props = vnode.data.domProps || {};
  82988. // clone observed objects, as the user probably wants to mutate it
  82989. if (isDef(props.__ob__)) {
  82990. props = vnode.data.domProps = extend({}, props);
  82991. }
  82992. for (key in oldProps) {
  82993. if (!(key in props)) {
  82994. elm[key] = '';
  82995. }
  82996. }
  82997. for (key in props) {
  82998. cur = props[key];
  82999. // ignore children if the node has textContent or innerHTML,
  83000. // as these will throw away existing DOM nodes and cause removal errors
  83001. // on subsequent patches (#3360)
  83002. if (key === 'textContent' || key === 'innerHTML') {
  83003. if (vnode.children) { vnode.children.length = 0; }
  83004. if (cur === oldProps[key]) { continue }
  83005. // #6601 work around Chrome version <= 55 bug where single textNode
  83006. // replaced by innerHTML/textContent retains its parentNode property
  83007. if (elm.childNodes.length === 1) {
  83008. elm.removeChild(elm.childNodes[0]);
  83009. }
  83010. }
  83011. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  83012. // store value as _value as well since
  83013. // non-string values will be stringified
  83014. elm._value = cur;
  83015. // avoid resetting cursor position when value is the same
  83016. var strCur = isUndef(cur) ? '' : String(cur);
  83017. if (shouldUpdateValue(elm, strCur)) {
  83018. elm.value = strCur;
  83019. }
  83020. } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
  83021. // IE doesn't support innerHTML for SVG elements
  83022. svgContainer = svgContainer || document.createElement('div');
  83023. svgContainer.innerHTML = "<svg>" + cur + "</svg>";
  83024. var svg = svgContainer.firstChild;
  83025. while (elm.firstChild) {
  83026. elm.removeChild(elm.firstChild);
  83027. }
  83028. while (svg.firstChild) {
  83029. elm.appendChild(svg.firstChild);
  83030. }
  83031. } else if (
  83032. // skip the update if old and new VDOM state is the same.
  83033. // `value` is handled separately because the DOM value may be temporarily
  83034. // out of sync with VDOM state due to focus, composition and modifiers.
  83035. // This #4521 by skipping the unnecesarry `checked` update.
  83036. cur !== oldProps[key]
  83037. ) {
  83038. // some property updates can throw
  83039. // e.g. `value` on <progress> w/ non-finite value
  83040. try {
  83041. elm[key] = cur;
  83042. } catch (e) {}
  83043. }
  83044. }
  83045. }
  83046. // check platforms/web/util/attrs.js acceptValue
  83047. function shouldUpdateValue (elm, checkVal) {
  83048. return (!elm.composing && (
  83049. elm.tagName === 'OPTION' ||
  83050. isNotInFocusAndDirty(elm, checkVal) ||
  83051. isDirtyWithModifiers(elm, checkVal)
  83052. ))
  83053. }
  83054. function isNotInFocusAndDirty (elm, checkVal) {
  83055. // return true when textbox (.number and .trim) loses focus and its value is
  83056. // not equal to the updated value
  83057. var notInFocus = true;
  83058. // #6157
  83059. // work around IE bug when accessing document.activeElement in an iframe
  83060. try { notInFocus = document.activeElement !== elm; } catch (e) {}
  83061. return notInFocus && elm.value !== checkVal
  83062. }
  83063. function isDirtyWithModifiers (elm, newVal) {
  83064. var value = elm.value;
  83065. var modifiers = elm._vModifiers; // injected by v-model runtime
  83066. if (isDef(modifiers)) {
  83067. if (modifiers.number) {
  83068. return toNumber(value) !== toNumber(newVal)
  83069. }
  83070. if (modifiers.trim) {
  83071. return value.trim() !== newVal.trim()
  83072. }
  83073. }
  83074. return value !== newVal
  83075. }
  83076. var domProps = {
  83077. create: updateDOMProps,
  83078. update: updateDOMProps
  83079. };
  83080. /* */
  83081. var parseStyleText = cached(function (cssText) {
  83082. var res = {};
  83083. var listDelimiter = /;(?![^(]*\))/g;
  83084. var propertyDelimiter = /:(.+)/;
  83085. cssText.split(listDelimiter).forEach(function (item) {
  83086. if (item) {
  83087. var tmp = item.split(propertyDelimiter);
  83088. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  83089. }
  83090. });
  83091. return res
  83092. });
  83093. // merge static and dynamic style data on the same vnode
  83094. function normalizeStyleData (data) {
  83095. var style = normalizeStyleBinding(data.style);
  83096. // static style is pre-processed into an object during compilation
  83097. // and is always a fresh object, so it's safe to merge into it
  83098. return data.staticStyle
  83099. ? extend(data.staticStyle, style)
  83100. : style
  83101. }
  83102. // normalize possible array / string values into Object
  83103. function normalizeStyleBinding (bindingStyle) {
  83104. if (Array.isArray(bindingStyle)) {
  83105. return toObject(bindingStyle)
  83106. }
  83107. if (typeof bindingStyle === 'string') {
  83108. return parseStyleText(bindingStyle)
  83109. }
  83110. return bindingStyle
  83111. }
  83112. /**
  83113. * parent component style should be after child's
  83114. * so that parent component's style could override it
  83115. */
  83116. function getStyle (vnode, checkChild) {
  83117. var res = {};
  83118. var styleData;
  83119. if (checkChild) {
  83120. var childNode = vnode;
  83121. while (childNode.componentInstance) {
  83122. childNode = childNode.componentInstance._vnode;
  83123. if (
  83124. childNode && childNode.data &&
  83125. (styleData = normalizeStyleData(childNode.data))
  83126. ) {
  83127. extend(res, styleData);
  83128. }
  83129. }
  83130. }
  83131. if ((styleData = normalizeStyleData(vnode.data))) {
  83132. extend(res, styleData);
  83133. }
  83134. var parentNode = vnode;
  83135. while ((parentNode = parentNode.parent)) {
  83136. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  83137. extend(res, styleData);
  83138. }
  83139. }
  83140. return res
  83141. }
  83142. /* */
  83143. var cssVarRE = /^--/;
  83144. var importantRE = /\s*!important$/;
  83145. var setProp = function (el, name, val) {
  83146. /* istanbul ignore if */
  83147. if (cssVarRE.test(name)) {
  83148. el.style.setProperty(name, val);
  83149. } else if (importantRE.test(val)) {
  83150. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  83151. } else {
  83152. var normalizedName = normalize(name);
  83153. if (Array.isArray(val)) {
  83154. // Support values array created by autoprefixer, e.g.
  83155. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  83156. // Set them one by one, and the browser will only set those it can recognize
  83157. for (var i = 0, len = val.length; i < len; i++) {
  83158. el.style[normalizedName] = val[i];
  83159. }
  83160. } else {
  83161. el.style[normalizedName] = val;
  83162. }
  83163. }
  83164. };
  83165. var vendorNames = ['Webkit', 'Moz', 'ms'];
  83166. var emptyStyle;
  83167. var normalize = cached(function (prop) {
  83168. emptyStyle = emptyStyle || document.createElement('div').style;
  83169. prop = camelize(prop);
  83170. if (prop !== 'filter' && (prop in emptyStyle)) {
  83171. return prop
  83172. }
  83173. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  83174. for (var i = 0; i < vendorNames.length; i++) {
  83175. var name = vendorNames[i] + capName;
  83176. if (name in emptyStyle) {
  83177. return name
  83178. }
  83179. }
  83180. });
  83181. function updateStyle (oldVnode, vnode) {
  83182. var data = vnode.data;
  83183. var oldData = oldVnode.data;
  83184. if (isUndef(data.staticStyle) && isUndef(data.style) &&
  83185. isUndef(oldData.staticStyle) && isUndef(oldData.style)
  83186. ) {
  83187. return
  83188. }
  83189. var cur, name;
  83190. var el = vnode.elm;
  83191. var oldStaticStyle = oldData.staticStyle;
  83192. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  83193. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  83194. var oldStyle = oldStaticStyle || oldStyleBinding;
  83195. var style = normalizeStyleBinding(vnode.data.style) || {};
  83196. // store normalized style under a different key for next diff
  83197. // make sure to clone it if it's reactive, since the user likely wants
  83198. // to mutate it.
  83199. vnode.data.normalizedStyle = isDef(style.__ob__)
  83200. ? extend({}, style)
  83201. : style;
  83202. var newStyle = getStyle(vnode, true);
  83203. for (name in oldStyle) {
  83204. if (isUndef(newStyle[name])) {
  83205. setProp(el, name, '');
  83206. }
  83207. }
  83208. for (name in newStyle) {
  83209. cur = newStyle[name];
  83210. if (cur !== oldStyle[name]) {
  83211. // ie9 setting to null has no effect, must use empty string
  83212. setProp(el, name, cur == null ? '' : cur);
  83213. }
  83214. }
  83215. }
  83216. var style = {
  83217. create: updateStyle,
  83218. update: updateStyle
  83219. };
  83220. /* */
  83221. var whitespaceRE = /\s+/;
  83222. /**
  83223. * Add class with compatibility for SVG since classList is not supported on
  83224. * SVG elements in IE
  83225. */
  83226. function addClass (el, cls) {
  83227. /* istanbul ignore if */
  83228. if (!cls || !(cls = cls.trim())) {
  83229. return
  83230. }
  83231. /* istanbul ignore else */
  83232. if (el.classList) {
  83233. if (cls.indexOf(' ') > -1) {
  83234. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  83235. } else {
  83236. el.classList.add(cls);
  83237. }
  83238. } else {
  83239. var cur = " " + (el.getAttribute('class') || '') + " ";
  83240. if (cur.indexOf(' ' + cls + ' ') < 0) {
  83241. el.setAttribute('class', (cur + cls).trim());
  83242. }
  83243. }
  83244. }
  83245. /**
  83246. * Remove class with compatibility for SVG since classList is not supported on
  83247. * SVG elements in IE
  83248. */
  83249. function removeClass (el, cls) {
  83250. /* istanbul ignore if */
  83251. if (!cls || !(cls = cls.trim())) {
  83252. return
  83253. }
  83254. /* istanbul ignore else */
  83255. if (el.classList) {
  83256. if (cls.indexOf(' ') > -1) {
  83257. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  83258. } else {
  83259. el.classList.remove(cls);
  83260. }
  83261. if (!el.classList.length) {
  83262. el.removeAttribute('class');
  83263. }
  83264. } else {
  83265. var cur = " " + (el.getAttribute('class') || '') + " ";
  83266. var tar = ' ' + cls + ' ';
  83267. while (cur.indexOf(tar) >= 0) {
  83268. cur = cur.replace(tar, ' ');
  83269. }
  83270. cur = cur.trim();
  83271. if (cur) {
  83272. el.setAttribute('class', cur);
  83273. } else {
  83274. el.removeAttribute('class');
  83275. }
  83276. }
  83277. }
  83278. /* */
  83279. function resolveTransition (def$$1) {
  83280. if (!def$$1) {
  83281. return
  83282. }
  83283. /* istanbul ignore else */
  83284. if (typeof def$$1 === 'object') {
  83285. var res = {};
  83286. if (def$$1.css !== false) {
  83287. extend(res, autoCssTransition(def$$1.name || 'v'));
  83288. }
  83289. extend(res, def$$1);
  83290. return res
  83291. } else if (typeof def$$1 === 'string') {
  83292. return autoCssTransition(def$$1)
  83293. }
  83294. }
  83295. var autoCssTransition = cached(function (name) {
  83296. return {
  83297. enterClass: (name + "-enter"),
  83298. enterToClass: (name + "-enter-to"),
  83299. enterActiveClass: (name + "-enter-active"),
  83300. leaveClass: (name + "-leave"),
  83301. leaveToClass: (name + "-leave-to"),
  83302. leaveActiveClass: (name + "-leave-active")
  83303. }
  83304. });
  83305. var hasTransition = inBrowser && !isIE9;
  83306. var TRANSITION = 'transition';
  83307. var ANIMATION = 'animation';
  83308. // Transition property/event sniffing
  83309. var transitionProp = 'transition';
  83310. var transitionEndEvent = 'transitionend';
  83311. var animationProp = 'animation';
  83312. var animationEndEvent = 'animationend';
  83313. if (hasTransition) {
  83314. /* istanbul ignore if */
  83315. if (window.ontransitionend === undefined &&
  83316. window.onwebkittransitionend !== undefined
  83317. ) {
  83318. transitionProp = 'WebkitTransition';
  83319. transitionEndEvent = 'webkitTransitionEnd';
  83320. }
  83321. if (window.onanimationend === undefined &&
  83322. window.onwebkitanimationend !== undefined
  83323. ) {
  83324. animationProp = 'WebkitAnimation';
  83325. animationEndEvent = 'webkitAnimationEnd';
  83326. }
  83327. }
  83328. // binding to window is necessary to make hot reload work in IE in strict mode
  83329. var raf = inBrowser
  83330. ? window.requestAnimationFrame
  83331. ? window.requestAnimationFrame.bind(window)
  83332. : setTimeout
  83333. : /* istanbul ignore next */ function (fn) { return fn(); };
  83334. function nextFrame (fn) {
  83335. raf(function () {
  83336. raf(fn);
  83337. });
  83338. }
  83339. function addTransitionClass (el, cls) {
  83340. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  83341. if (transitionClasses.indexOf(cls) < 0) {
  83342. transitionClasses.push(cls);
  83343. addClass(el, cls);
  83344. }
  83345. }
  83346. function removeTransitionClass (el, cls) {
  83347. if (el._transitionClasses) {
  83348. remove(el._transitionClasses, cls);
  83349. }
  83350. removeClass(el, cls);
  83351. }
  83352. function whenTransitionEnds (
  83353. el,
  83354. expectedType,
  83355. cb
  83356. ) {
  83357. var ref = getTransitionInfo(el, expectedType);
  83358. var type = ref.type;
  83359. var timeout = ref.timeout;
  83360. var propCount = ref.propCount;
  83361. if (!type) { return cb() }
  83362. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  83363. var ended = 0;
  83364. var end = function () {
  83365. el.removeEventListener(event, onEnd);
  83366. cb();
  83367. };
  83368. var onEnd = function (e) {
  83369. if (e.target === el) {
  83370. if (++ended >= propCount) {
  83371. end();
  83372. }
  83373. }
  83374. };
  83375. setTimeout(function () {
  83376. if (ended < propCount) {
  83377. end();
  83378. }
  83379. }, timeout + 1);
  83380. el.addEventListener(event, onEnd);
  83381. }
  83382. var transformRE = /\b(transform|all)(,|$)/;
  83383. function getTransitionInfo (el, expectedType) {
  83384. var styles = window.getComputedStyle(el);
  83385. // JSDOM may return undefined for transition properties
  83386. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  83387. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  83388. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  83389. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  83390. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  83391. var animationTimeout = getTimeout(animationDelays, animationDurations);
  83392. var type;
  83393. var timeout = 0;
  83394. var propCount = 0;
  83395. /* istanbul ignore if */
  83396. if (expectedType === TRANSITION) {
  83397. if (transitionTimeout > 0) {
  83398. type = TRANSITION;
  83399. timeout = transitionTimeout;
  83400. propCount = transitionDurations.length;
  83401. }
  83402. } else if (expectedType === ANIMATION) {
  83403. if (animationTimeout > 0) {
  83404. type = ANIMATION;
  83405. timeout = animationTimeout;
  83406. propCount = animationDurations.length;
  83407. }
  83408. } else {
  83409. timeout = Math.max(transitionTimeout, animationTimeout);
  83410. type = timeout > 0
  83411. ? transitionTimeout > animationTimeout
  83412. ? TRANSITION
  83413. : ANIMATION
  83414. : null;
  83415. propCount = type
  83416. ? type === TRANSITION
  83417. ? transitionDurations.length
  83418. : animationDurations.length
  83419. : 0;
  83420. }
  83421. var hasTransform =
  83422. type === TRANSITION &&
  83423. transformRE.test(styles[transitionProp + 'Property']);
  83424. return {
  83425. type: type,
  83426. timeout: timeout,
  83427. propCount: propCount,
  83428. hasTransform: hasTransform
  83429. }
  83430. }
  83431. function getTimeout (delays, durations) {
  83432. /* istanbul ignore next */
  83433. while (delays.length < durations.length) {
  83434. delays = delays.concat(delays);
  83435. }
  83436. return Math.max.apply(null, durations.map(function (d, i) {
  83437. return toMs(d) + toMs(delays[i])
  83438. }))
  83439. }
  83440. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  83441. // in a locale-dependent way, using a comma instead of a dot.
  83442. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  83443. // as a floor function) causing unexpected behaviors
  83444. function toMs (s) {
  83445. return Number(s.slice(0, -1).replace(',', '.')) * 1000
  83446. }
  83447. /* */
  83448. function enter (vnode, toggleDisplay) {
  83449. var el = vnode.elm;
  83450. // call leave callback now
  83451. if (isDef(el._leaveCb)) {
  83452. el._leaveCb.cancelled = true;
  83453. el._leaveCb();
  83454. }
  83455. var data = resolveTransition(vnode.data.transition);
  83456. if (isUndef(data)) {
  83457. return
  83458. }
  83459. /* istanbul ignore if */
  83460. if (isDef(el._enterCb) || el.nodeType !== 1) {
  83461. return
  83462. }
  83463. var css = data.css;
  83464. var type = data.type;
  83465. var enterClass = data.enterClass;
  83466. var enterToClass = data.enterToClass;
  83467. var enterActiveClass = data.enterActiveClass;
  83468. var appearClass = data.appearClass;
  83469. var appearToClass = data.appearToClass;
  83470. var appearActiveClass = data.appearActiveClass;
  83471. var beforeEnter = data.beforeEnter;
  83472. var enter = data.enter;
  83473. var afterEnter = data.afterEnter;
  83474. var enterCancelled = data.enterCancelled;
  83475. var beforeAppear = data.beforeAppear;
  83476. var appear = data.appear;
  83477. var afterAppear = data.afterAppear;
  83478. var appearCancelled = data.appearCancelled;
  83479. var duration = data.duration;
  83480. // activeInstance will always be the <transition> component managing this
  83481. // transition. One edge case to check is when the <transition> is placed
  83482. // as the root node of a child component. In that case we need to check
  83483. // <transition>'s parent for appear check.
  83484. var context = activeInstance;
  83485. var transitionNode = activeInstance.$vnode;
  83486. while (transitionNode && transitionNode.parent) {
  83487. context = transitionNode.context;
  83488. transitionNode = transitionNode.parent;
  83489. }
  83490. var isAppear = !context._isMounted || !vnode.isRootInsert;
  83491. if (isAppear && !appear && appear !== '') {
  83492. return
  83493. }
  83494. var startClass = isAppear && appearClass
  83495. ? appearClass
  83496. : enterClass;
  83497. var activeClass = isAppear && appearActiveClass
  83498. ? appearActiveClass
  83499. : enterActiveClass;
  83500. var toClass = isAppear && appearToClass
  83501. ? appearToClass
  83502. : enterToClass;
  83503. var beforeEnterHook = isAppear
  83504. ? (beforeAppear || beforeEnter)
  83505. : beforeEnter;
  83506. var enterHook = isAppear
  83507. ? (typeof appear === 'function' ? appear : enter)
  83508. : enter;
  83509. var afterEnterHook = isAppear
  83510. ? (afterAppear || afterEnter)
  83511. : afterEnter;
  83512. var enterCancelledHook = isAppear
  83513. ? (appearCancelled || enterCancelled)
  83514. : enterCancelled;
  83515. var explicitEnterDuration = toNumber(
  83516. isObject(duration)
  83517. ? duration.enter
  83518. : duration
  83519. );
  83520. if (explicitEnterDuration != null) {
  83521. checkDuration(explicitEnterDuration, 'enter', vnode);
  83522. }
  83523. var expectsCSS = css !== false && !isIE9;
  83524. var userWantsControl = getHookArgumentsLength(enterHook);
  83525. var cb = el._enterCb = once(function () {
  83526. if (expectsCSS) {
  83527. removeTransitionClass(el, toClass);
  83528. removeTransitionClass(el, activeClass);
  83529. }
  83530. if (cb.cancelled) {
  83531. if (expectsCSS) {
  83532. removeTransitionClass(el, startClass);
  83533. }
  83534. enterCancelledHook && enterCancelledHook(el);
  83535. } else {
  83536. afterEnterHook && afterEnterHook(el);
  83537. }
  83538. el._enterCb = null;
  83539. });
  83540. if (!vnode.data.show) {
  83541. // remove pending leave element on enter by injecting an insert hook
  83542. mergeVNodeHook(vnode, 'insert', function () {
  83543. var parent = el.parentNode;
  83544. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  83545. if (pendingNode &&
  83546. pendingNode.tag === vnode.tag &&
  83547. pendingNode.elm._leaveCb
  83548. ) {
  83549. pendingNode.elm._leaveCb();
  83550. }
  83551. enterHook && enterHook(el, cb);
  83552. });
  83553. }
  83554. // start enter transition
  83555. beforeEnterHook && beforeEnterHook(el);
  83556. if (expectsCSS) {
  83557. addTransitionClass(el, startClass);
  83558. addTransitionClass(el, activeClass);
  83559. nextFrame(function () {
  83560. removeTransitionClass(el, startClass);
  83561. if (!cb.cancelled) {
  83562. addTransitionClass(el, toClass);
  83563. if (!userWantsControl) {
  83564. if (isValidDuration(explicitEnterDuration)) {
  83565. setTimeout(cb, explicitEnterDuration);
  83566. } else {
  83567. whenTransitionEnds(el, type, cb);
  83568. }
  83569. }
  83570. }
  83571. });
  83572. }
  83573. if (vnode.data.show) {
  83574. toggleDisplay && toggleDisplay();
  83575. enterHook && enterHook(el, cb);
  83576. }
  83577. if (!expectsCSS && !userWantsControl) {
  83578. cb();
  83579. }
  83580. }
  83581. function leave (vnode, rm) {
  83582. var el = vnode.elm;
  83583. // call enter callback now
  83584. if (isDef(el._enterCb)) {
  83585. el._enterCb.cancelled = true;
  83586. el._enterCb();
  83587. }
  83588. var data = resolveTransition(vnode.data.transition);
  83589. if (isUndef(data) || el.nodeType !== 1) {
  83590. return rm()
  83591. }
  83592. /* istanbul ignore if */
  83593. if (isDef(el._leaveCb)) {
  83594. return
  83595. }
  83596. var css = data.css;
  83597. var type = data.type;
  83598. var leaveClass = data.leaveClass;
  83599. var leaveToClass = data.leaveToClass;
  83600. var leaveActiveClass = data.leaveActiveClass;
  83601. var beforeLeave = data.beforeLeave;
  83602. var leave = data.leave;
  83603. var afterLeave = data.afterLeave;
  83604. var leaveCancelled = data.leaveCancelled;
  83605. var delayLeave = data.delayLeave;
  83606. var duration = data.duration;
  83607. var expectsCSS = css !== false && !isIE9;
  83608. var userWantsControl = getHookArgumentsLength(leave);
  83609. var explicitLeaveDuration = toNumber(
  83610. isObject(duration)
  83611. ? duration.leave
  83612. : duration
  83613. );
  83614. if (isDef(explicitLeaveDuration)) {
  83615. checkDuration(explicitLeaveDuration, 'leave', vnode);
  83616. }
  83617. var cb = el._leaveCb = once(function () {
  83618. if (el.parentNode && el.parentNode._pending) {
  83619. el.parentNode._pending[vnode.key] = null;
  83620. }
  83621. if (expectsCSS) {
  83622. removeTransitionClass(el, leaveToClass);
  83623. removeTransitionClass(el, leaveActiveClass);
  83624. }
  83625. if (cb.cancelled) {
  83626. if (expectsCSS) {
  83627. removeTransitionClass(el, leaveClass);
  83628. }
  83629. leaveCancelled && leaveCancelled(el);
  83630. } else {
  83631. rm();
  83632. afterLeave && afterLeave(el);
  83633. }
  83634. el._leaveCb = null;
  83635. });
  83636. if (delayLeave) {
  83637. delayLeave(performLeave);
  83638. } else {
  83639. performLeave();
  83640. }
  83641. function performLeave () {
  83642. // the delayed leave may have already been cancelled
  83643. if (cb.cancelled) {
  83644. return
  83645. }
  83646. // record leaving element
  83647. if (!vnode.data.show && el.parentNode) {
  83648. (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
  83649. }
  83650. beforeLeave && beforeLeave(el);
  83651. if (expectsCSS) {
  83652. addTransitionClass(el, leaveClass);
  83653. addTransitionClass(el, leaveActiveClass);
  83654. nextFrame(function () {
  83655. removeTransitionClass(el, leaveClass);
  83656. if (!cb.cancelled) {
  83657. addTransitionClass(el, leaveToClass);
  83658. if (!userWantsControl) {
  83659. if (isValidDuration(explicitLeaveDuration)) {
  83660. setTimeout(cb, explicitLeaveDuration);
  83661. } else {
  83662. whenTransitionEnds(el, type, cb);
  83663. }
  83664. }
  83665. }
  83666. });
  83667. }
  83668. leave && leave(el, cb);
  83669. if (!expectsCSS && !userWantsControl) {
  83670. cb();
  83671. }
  83672. }
  83673. }
  83674. // only used in dev mode
  83675. function checkDuration (val, name, vnode) {
  83676. if (typeof val !== 'number') {
  83677. warn(
  83678. "<transition> explicit " + name + " duration is not a valid number - " +
  83679. "got " + (JSON.stringify(val)) + ".",
  83680. vnode.context
  83681. );
  83682. } else if (isNaN(val)) {
  83683. warn(
  83684. "<transition> explicit " + name + " duration is NaN - " +
  83685. 'the duration expression might be incorrect.',
  83686. vnode.context
  83687. );
  83688. }
  83689. }
  83690. function isValidDuration (val) {
  83691. return typeof val === 'number' && !isNaN(val)
  83692. }
  83693. /**
  83694. * Normalize a transition hook's argument length. The hook may be:
  83695. * - a merged hook (invoker) with the original in .fns
  83696. * - a wrapped component method (check ._length)
  83697. * - a plain function (.length)
  83698. */
  83699. function getHookArgumentsLength (fn) {
  83700. if (isUndef(fn)) {
  83701. return false
  83702. }
  83703. var invokerFns = fn.fns;
  83704. if (isDef(invokerFns)) {
  83705. // invoker
  83706. return getHookArgumentsLength(
  83707. Array.isArray(invokerFns)
  83708. ? invokerFns[0]
  83709. : invokerFns
  83710. )
  83711. } else {
  83712. return (fn._length || fn.length) > 1
  83713. }
  83714. }
  83715. function _enter (_, vnode) {
  83716. if (vnode.data.show !== true) {
  83717. enter(vnode);
  83718. }
  83719. }
  83720. var transition = inBrowser ? {
  83721. create: _enter,
  83722. activate: _enter,
  83723. remove: function remove$$1 (vnode, rm) {
  83724. /* istanbul ignore else */
  83725. if (vnode.data.show !== true) {
  83726. leave(vnode, rm);
  83727. } else {
  83728. rm();
  83729. }
  83730. }
  83731. } : {};
  83732. var platformModules = [
  83733. attrs,
  83734. klass,
  83735. events,
  83736. domProps,
  83737. style,
  83738. transition
  83739. ];
  83740. /* */
  83741. // the directive module should be applied last, after all
  83742. // built-in modules have been applied.
  83743. var modules = platformModules.concat(baseModules);
  83744. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  83745. /**
  83746. * Not type checking this file because flow doesn't like attaching
  83747. * properties to Elements.
  83748. */
  83749. /* istanbul ignore if */
  83750. if (isIE9) {
  83751. // http://www.matts411.com/post/internet-explorer-9-oninput/
  83752. document.addEventListener('selectionchange', function () {
  83753. var el = document.activeElement;
  83754. if (el && el.vmodel) {
  83755. trigger(el, 'input');
  83756. }
  83757. });
  83758. }
  83759. var directive = {
  83760. inserted: function inserted (el, binding, vnode, oldVnode) {
  83761. if (vnode.tag === 'select') {
  83762. // #6903
  83763. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  83764. mergeVNodeHook(vnode, 'postpatch', function () {
  83765. directive.componentUpdated(el, binding, vnode);
  83766. });
  83767. } else {
  83768. setSelected(el, binding, vnode.context);
  83769. }
  83770. el._vOptions = [].map.call(el.options, getValue);
  83771. } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  83772. el._vModifiers = binding.modifiers;
  83773. if (!binding.modifiers.lazy) {
  83774. el.addEventListener('compositionstart', onCompositionStart);
  83775. el.addEventListener('compositionend', onCompositionEnd);
  83776. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  83777. // switching focus before confirming composition choice
  83778. // this also fixes the issue where some browsers e.g. iOS Chrome
  83779. // fires "change" instead of "input" on autocomplete.
  83780. el.addEventListener('change', onCompositionEnd);
  83781. /* istanbul ignore if */
  83782. if (isIE9) {
  83783. el.vmodel = true;
  83784. }
  83785. }
  83786. }
  83787. },
  83788. componentUpdated: function componentUpdated (el, binding, vnode) {
  83789. if (vnode.tag === 'select') {
  83790. setSelected(el, binding, vnode.context);
  83791. // in case the options rendered by v-for have changed,
  83792. // it's possible that the value is out-of-sync with the rendered options.
  83793. // detect such cases and filter out values that no longer has a matching
  83794. // option in the DOM.
  83795. var prevOptions = el._vOptions;
  83796. var curOptions = el._vOptions = [].map.call(el.options, getValue);
  83797. if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
  83798. // trigger change event if
  83799. // no matching option found for at least one value
  83800. var needReset = el.multiple
  83801. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
  83802. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
  83803. if (needReset) {
  83804. trigger(el, 'change');
  83805. }
  83806. }
  83807. }
  83808. }
  83809. };
  83810. function setSelected (el, binding, vm) {
  83811. actuallySetSelected(el, binding, vm);
  83812. /* istanbul ignore if */
  83813. if (isIE || isEdge) {
  83814. setTimeout(function () {
  83815. actuallySetSelected(el, binding, vm);
  83816. }, 0);
  83817. }
  83818. }
  83819. function actuallySetSelected (el, binding, vm) {
  83820. var value = binding.value;
  83821. var isMultiple = el.multiple;
  83822. if (isMultiple && !Array.isArray(value)) {
  83823. warn(
  83824. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  83825. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  83826. vm
  83827. );
  83828. return
  83829. }
  83830. var selected, option;
  83831. for (var i = 0, l = el.options.length; i < l; i++) {
  83832. option = el.options[i];
  83833. if (isMultiple) {
  83834. selected = looseIndexOf(value, getValue(option)) > -1;
  83835. if (option.selected !== selected) {
  83836. option.selected = selected;
  83837. }
  83838. } else {
  83839. if (looseEqual(getValue(option), value)) {
  83840. if (el.selectedIndex !== i) {
  83841. el.selectedIndex = i;
  83842. }
  83843. return
  83844. }
  83845. }
  83846. }
  83847. if (!isMultiple) {
  83848. el.selectedIndex = -1;
  83849. }
  83850. }
  83851. function hasNoMatchingOption (value, options) {
  83852. return options.every(function (o) { return !looseEqual(o, value); })
  83853. }
  83854. function getValue (option) {
  83855. return '_value' in option
  83856. ? option._value
  83857. : option.value
  83858. }
  83859. function onCompositionStart (e) {
  83860. e.target.composing = true;
  83861. }
  83862. function onCompositionEnd (e) {
  83863. // prevent triggering an input event for no reason
  83864. if (!e.target.composing) { return }
  83865. e.target.composing = false;
  83866. trigger(e.target, 'input');
  83867. }
  83868. function trigger (el, type) {
  83869. var e = document.createEvent('HTMLEvents');
  83870. e.initEvent(type, true, true);
  83871. el.dispatchEvent(e);
  83872. }
  83873. /* */
  83874. // recursively search for possible transition defined inside the component root
  83875. function locateNode (vnode) {
  83876. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  83877. ? locateNode(vnode.componentInstance._vnode)
  83878. : vnode
  83879. }
  83880. var show = {
  83881. bind: function bind (el, ref, vnode) {
  83882. var value = ref.value;
  83883. vnode = locateNode(vnode);
  83884. var transition$$1 = vnode.data && vnode.data.transition;
  83885. var originalDisplay = el.__vOriginalDisplay =
  83886. el.style.display === 'none' ? '' : el.style.display;
  83887. if (value && transition$$1) {
  83888. vnode.data.show = true;
  83889. enter(vnode, function () {
  83890. el.style.display = originalDisplay;
  83891. });
  83892. } else {
  83893. el.style.display = value ? originalDisplay : 'none';
  83894. }
  83895. },
  83896. update: function update (el, ref, vnode) {
  83897. var value = ref.value;
  83898. var oldValue = ref.oldValue;
  83899. /* istanbul ignore if */
  83900. if (!value === !oldValue) { return }
  83901. vnode = locateNode(vnode);
  83902. var transition$$1 = vnode.data && vnode.data.transition;
  83903. if (transition$$1) {
  83904. vnode.data.show = true;
  83905. if (value) {
  83906. enter(vnode, function () {
  83907. el.style.display = el.__vOriginalDisplay;
  83908. });
  83909. } else {
  83910. leave(vnode, function () {
  83911. el.style.display = 'none';
  83912. });
  83913. }
  83914. } else {
  83915. el.style.display = value ? el.__vOriginalDisplay : 'none';
  83916. }
  83917. },
  83918. unbind: function unbind (
  83919. el,
  83920. binding,
  83921. vnode,
  83922. oldVnode,
  83923. isDestroy
  83924. ) {
  83925. if (!isDestroy) {
  83926. el.style.display = el.__vOriginalDisplay;
  83927. }
  83928. }
  83929. };
  83930. var platformDirectives = {
  83931. model: directive,
  83932. show: show
  83933. };
  83934. /* */
  83935. var transitionProps = {
  83936. name: String,
  83937. appear: Boolean,
  83938. css: Boolean,
  83939. mode: String,
  83940. type: String,
  83941. enterClass: String,
  83942. leaveClass: String,
  83943. enterToClass: String,
  83944. leaveToClass: String,
  83945. enterActiveClass: String,
  83946. leaveActiveClass: String,
  83947. appearClass: String,
  83948. appearActiveClass: String,
  83949. appearToClass: String,
  83950. duration: [Number, String, Object]
  83951. };
  83952. // in case the child is also an abstract component, e.g. <keep-alive>
  83953. // we want to recursively retrieve the real component to be rendered
  83954. function getRealChild (vnode) {
  83955. var compOptions = vnode && vnode.componentOptions;
  83956. if (compOptions && compOptions.Ctor.options.abstract) {
  83957. return getRealChild(getFirstComponentChild(compOptions.children))
  83958. } else {
  83959. return vnode
  83960. }
  83961. }
  83962. function extractTransitionData (comp) {
  83963. var data = {};
  83964. var options = comp.$options;
  83965. // props
  83966. for (var key in options.propsData) {
  83967. data[key] = comp[key];
  83968. }
  83969. // events.
  83970. // extract listeners and pass them directly to the transition methods
  83971. var listeners = options._parentListeners;
  83972. for (var key$1 in listeners) {
  83973. data[camelize(key$1)] = listeners[key$1];
  83974. }
  83975. return data
  83976. }
  83977. function placeholder (h, rawChild) {
  83978. if (/\d-keep-alive$/.test(rawChild.tag)) {
  83979. return h('keep-alive', {
  83980. props: rawChild.componentOptions.propsData
  83981. })
  83982. }
  83983. }
  83984. function hasParentTransition (vnode) {
  83985. while ((vnode = vnode.parent)) {
  83986. if (vnode.data.transition) {
  83987. return true
  83988. }
  83989. }
  83990. }
  83991. function isSameChild (child, oldChild) {
  83992. return oldChild.key === child.key && oldChild.tag === child.tag
  83993. }
  83994. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  83995. var isVShowDirective = function (d) { return d.name === 'show'; };
  83996. var Transition = {
  83997. name: 'transition',
  83998. props: transitionProps,
  83999. abstract: true,
  84000. render: function render (h) {
  84001. var this$1 = this;
  84002. var children = this.$slots.default;
  84003. if (!children) {
  84004. return
  84005. }
  84006. // filter out text nodes (possible whitespaces)
  84007. children = children.filter(isNotTextNode);
  84008. /* istanbul ignore if */
  84009. if (!children.length) {
  84010. return
  84011. }
  84012. // warn multiple elements
  84013. if (children.length > 1) {
  84014. warn(
  84015. '<transition> can only be used on a single element. Use ' +
  84016. '<transition-group> for lists.',
  84017. this.$parent
  84018. );
  84019. }
  84020. var mode = this.mode;
  84021. // warn invalid mode
  84022. if (mode && mode !== 'in-out' && mode !== 'out-in'
  84023. ) {
  84024. warn(
  84025. 'invalid <transition> mode: ' + mode,
  84026. this.$parent
  84027. );
  84028. }
  84029. var rawChild = children[0];
  84030. // if this is a component root node and the component's
  84031. // parent container node also has transition, skip.
  84032. if (hasParentTransition(this.$vnode)) {
  84033. return rawChild
  84034. }
  84035. // apply transition data to child
  84036. // use getRealChild() to ignore abstract components e.g. keep-alive
  84037. var child = getRealChild(rawChild);
  84038. /* istanbul ignore if */
  84039. if (!child) {
  84040. return rawChild
  84041. }
  84042. if (this._leaving) {
  84043. return placeholder(h, rawChild)
  84044. }
  84045. // ensure a key that is unique to the vnode type and to this transition
  84046. // component instance. This key will be used to remove pending leaving nodes
  84047. // during entering.
  84048. var id = "__transition-" + (this._uid) + "-";
  84049. child.key = child.key == null
  84050. ? child.isComment
  84051. ? id + 'comment'
  84052. : id + child.tag
  84053. : isPrimitive(child.key)
  84054. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  84055. : child.key;
  84056. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  84057. var oldRawChild = this._vnode;
  84058. var oldChild = getRealChild(oldRawChild);
  84059. // mark v-show
  84060. // so that the transition module can hand over the control to the directive
  84061. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  84062. child.data.show = true;
  84063. }
  84064. if (
  84065. oldChild &&
  84066. oldChild.data &&
  84067. !isSameChild(child, oldChild) &&
  84068. !isAsyncPlaceholder(oldChild) &&
  84069. // #6687 component root is a comment node
  84070. !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
  84071. ) {
  84072. // replace old child transition data with fresh one
  84073. // important for dynamic transitions!
  84074. var oldData = oldChild.data.transition = extend({}, data);
  84075. // handle transition mode
  84076. if (mode === 'out-in') {
  84077. // return placeholder node and queue update when leave finishes
  84078. this._leaving = true;
  84079. mergeVNodeHook(oldData, 'afterLeave', function () {
  84080. this$1._leaving = false;
  84081. this$1.$forceUpdate();
  84082. });
  84083. return placeholder(h, rawChild)
  84084. } else if (mode === 'in-out') {
  84085. if (isAsyncPlaceholder(child)) {
  84086. return oldRawChild
  84087. }
  84088. var delayedLeave;
  84089. var performLeave = function () { delayedLeave(); };
  84090. mergeVNodeHook(data, 'afterEnter', performLeave);
  84091. mergeVNodeHook(data, 'enterCancelled', performLeave);
  84092. mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
  84093. }
  84094. }
  84095. return rawChild
  84096. }
  84097. };
  84098. /* */
  84099. var props = extend({
  84100. tag: String,
  84101. moveClass: String
  84102. }, transitionProps);
  84103. delete props.mode;
  84104. var TransitionGroup = {
  84105. props: props,
  84106. beforeMount: function beforeMount () {
  84107. var this$1 = this;
  84108. var update = this._update;
  84109. this._update = function (vnode, hydrating) {
  84110. var restoreActiveInstance = setActiveInstance(this$1);
  84111. // force removing pass
  84112. this$1.__patch__(
  84113. this$1._vnode,
  84114. this$1.kept,
  84115. false, // hydrating
  84116. true // removeOnly (!important, avoids unnecessary moves)
  84117. );
  84118. this$1._vnode = this$1.kept;
  84119. restoreActiveInstance();
  84120. update.call(this$1, vnode, hydrating);
  84121. };
  84122. },
  84123. render: function render (h) {
  84124. var tag = this.tag || this.$vnode.data.tag || 'span';
  84125. var map = Object.create(null);
  84126. var prevChildren = this.prevChildren = this.children;
  84127. var rawChildren = this.$slots.default || [];
  84128. var children = this.children = [];
  84129. var transitionData = extractTransitionData(this);
  84130. for (var i = 0; i < rawChildren.length; i++) {
  84131. var c = rawChildren[i];
  84132. if (c.tag) {
  84133. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  84134. children.push(c);
  84135. map[c.key] = c
  84136. ;(c.data || (c.data = {})).transition = transitionData;
  84137. } else {
  84138. var opts = c.componentOptions;
  84139. var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
  84140. warn(("<transition-group> children must be keyed: <" + name + ">"));
  84141. }
  84142. }
  84143. }
  84144. if (prevChildren) {
  84145. var kept = [];
  84146. var removed = [];
  84147. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  84148. var c$1 = prevChildren[i$1];
  84149. c$1.data.transition = transitionData;
  84150. c$1.data.pos = c$1.elm.getBoundingClientRect();
  84151. if (map[c$1.key]) {
  84152. kept.push(c$1);
  84153. } else {
  84154. removed.push(c$1);
  84155. }
  84156. }
  84157. this.kept = h(tag, null, kept);
  84158. this.removed = removed;
  84159. }
  84160. return h(tag, null, children)
  84161. },
  84162. updated: function updated () {
  84163. var children = this.prevChildren;
  84164. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  84165. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  84166. return
  84167. }
  84168. // we divide the work into three loops to avoid mixing DOM reads and writes
  84169. // in each iteration - which helps prevent layout thrashing.
  84170. children.forEach(callPendingCbs);
  84171. children.forEach(recordPosition);
  84172. children.forEach(applyTranslation);
  84173. // force reflow to put everything in position
  84174. // assign to this to avoid being removed in tree-shaking
  84175. // $flow-disable-line
  84176. this._reflow = document.body.offsetHeight;
  84177. children.forEach(function (c) {
  84178. if (c.data.moved) {
  84179. var el = c.elm;
  84180. var s = el.style;
  84181. addTransitionClass(el, moveClass);
  84182. s.transform = s.WebkitTransform = s.transitionDuration = '';
  84183. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  84184. if (e && e.target !== el) {
  84185. return
  84186. }
  84187. if (!e || /transform$/.test(e.propertyName)) {
  84188. el.removeEventListener(transitionEndEvent, cb);
  84189. el._moveCb = null;
  84190. removeTransitionClass(el, moveClass);
  84191. }
  84192. });
  84193. }
  84194. });
  84195. },
  84196. methods: {
  84197. hasMove: function hasMove (el, moveClass) {
  84198. /* istanbul ignore if */
  84199. if (!hasTransition) {
  84200. return false
  84201. }
  84202. /* istanbul ignore if */
  84203. if (this._hasMove) {
  84204. return this._hasMove
  84205. }
  84206. // Detect whether an element with the move class applied has
  84207. // CSS transitions. Since the element may be inside an entering
  84208. // transition at this very moment, we make a clone of it and remove
  84209. // all other transition classes applied to ensure only the move class
  84210. // is applied.
  84211. var clone = el.cloneNode();
  84212. if (el._transitionClasses) {
  84213. el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
  84214. }
  84215. addClass(clone, moveClass);
  84216. clone.style.display = 'none';
  84217. this.$el.appendChild(clone);
  84218. var info = getTransitionInfo(clone);
  84219. this.$el.removeChild(clone);
  84220. return (this._hasMove = info.hasTransform)
  84221. }
  84222. }
  84223. };
  84224. function callPendingCbs (c) {
  84225. /* istanbul ignore if */
  84226. if (c.elm._moveCb) {
  84227. c.elm._moveCb();
  84228. }
  84229. /* istanbul ignore if */
  84230. if (c.elm._enterCb) {
  84231. c.elm._enterCb();
  84232. }
  84233. }
  84234. function recordPosition (c) {
  84235. c.data.newPos = c.elm.getBoundingClientRect();
  84236. }
  84237. function applyTranslation (c) {
  84238. var oldPos = c.data.pos;
  84239. var newPos = c.data.newPos;
  84240. var dx = oldPos.left - newPos.left;
  84241. var dy = oldPos.top - newPos.top;
  84242. if (dx || dy) {
  84243. c.data.moved = true;
  84244. var s = c.elm.style;
  84245. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  84246. s.transitionDuration = '0s';
  84247. }
  84248. }
  84249. var platformComponents = {
  84250. Transition: Transition,
  84251. TransitionGroup: TransitionGroup
  84252. };
  84253. /* */
  84254. // install platform specific utils
  84255. Vue.config.mustUseProp = mustUseProp;
  84256. Vue.config.isReservedTag = isReservedTag;
  84257. Vue.config.isReservedAttr = isReservedAttr;
  84258. Vue.config.getTagNamespace = getTagNamespace;
  84259. Vue.config.isUnknownElement = isUnknownElement;
  84260. // install platform runtime directives & components
  84261. extend(Vue.options.directives, platformDirectives);
  84262. extend(Vue.options.components, platformComponents);
  84263. // install platform patch function
  84264. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  84265. // public mount method
  84266. Vue.prototype.$mount = function (
  84267. el,
  84268. hydrating
  84269. ) {
  84270. el = el && inBrowser ? query(el) : undefined;
  84271. return mountComponent(this, el, hydrating)
  84272. };
  84273. // devtools global hook
  84274. /* istanbul ignore next */
  84275. if (inBrowser) {
  84276. setTimeout(function () {
  84277. if (config.devtools) {
  84278. if (devtools) {
  84279. devtools.emit('init', Vue);
  84280. } else {
  84281. console[console.info ? 'info' : 'log'](
  84282. 'Download the Vue Devtools extension for a better development experience:\n' +
  84283. 'https://github.com/vuejs/vue-devtools'
  84284. );
  84285. }
  84286. }
  84287. if (config.productionTip !== false &&
  84288. typeof console !== 'undefined'
  84289. ) {
  84290. console[console.info ? 'info' : 'log'](
  84291. "You are running Vue in development mode.\n" +
  84292. "Make sure to turn on production mode when deploying for production.\n" +
  84293. "See more tips at https://vuejs.org/guide/deployment.html"
  84294. );
  84295. }
  84296. }, 0);
  84297. }
  84298. /* */
  84299. var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
  84300. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  84301. var buildRegex = cached(function (delimiters) {
  84302. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  84303. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  84304. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  84305. });
  84306. function parseText (
  84307. text,
  84308. delimiters
  84309. ) {
  84310. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  84311. if (!tagRE.test(text)) {
  84312. return
  84313. }
  84314. var tokens = [];
  84315. var rawTokens = [];
  84316. var lastIndex = tagRE.lastIndex = 0;
  84317. var match, index, tokenValue;
  84318. while ((match = tagRE.exec(text))) {
  84319. index = match.index;
  84320. // push text token
  84321. if (index > lastIndex) {
  84322. rawTokens.push(tokenValue = text.slice(lastIndex, index));
  84323. tokens.push(JSON.stringify(tokenValue));
  84324. }
  84325. // tag token
  84326. var exp = parseFilters(match[1].trim());
  84327. tokens.push(("_s(" + exp + ")"));
  84328. rawTokens.push({ '@binding': exp });
  84329. lastIndex = index + match[0].length;
  84330. }
  84331. if (lastIndex < text.length) {
  84332. rawTokens.push(tokenValue = text.slice(lastIndex));
  84333. tokens.push(JSON.stringify(tokenValue));
  84334. }
  84335. return {
  84336. expression: tokens.join('+'),
  84337. tokens: rawTokens
  84338. }
  84339. }
  84340. /* */
  84341. function transformNode (el, options) {
  84342. var warn = options.warn || baseWarn;
  84343. var staticClass = getAndRemoveAttr(el, 'class');
  84344. if (staticClass) {
  84345. var res = parseText(staticClass, options.delimiters);
  84346. if (res) {
  84347. warn(
  84348. "class=\"" + staticClass + "\": " +
  84349. 'Interpolation inside attributes has been removed. ' +
  84350. 'Use v-bind or the colon shorthand instead. For example, ' +
  84351. 'instead of <div class="{{ val }}">, use <div :class="val">.',
  84352. el.rawAttrsMap['class']
  84353. );
  84354. }
  84355. }
  84356. if (staticClass) {
  84357. el.staticClass = JSON.stringify(staticClass);
  84358. }
  84359. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  84360. if (classBinding) {
  84361. el.classBinding = classBinding;
  84362. }
  84363. }
  84364. function genData (el) {
  84365. var data = '';
  84366. if (el.staticClass) {
  84367. data += "staticClass:" + (el.staticClass) + ",";
  84368. }
  84369. if (el.classBinding) {
  84370. data += "class:" + (el.classBinding) + ",";
  84371. }
  84372. return data
  84373. }
  84374. var klass$1 = {
  84375. staticKeys: ['staticClass'],
  84376. transformNode: transformNode,
  84377. genData: genData
  84378. };
  84379. /* */
  84380. function transformNode$1 (el, options) {
  84381. var warn = options.warn || baseWarn;
  84382. var staticStyle = getAndRemoveAttr(el, 'style');
  84383. if (staticStyle) {
  84384. /* istanbul ignore if */
  84385. {
  84386. var res = parseText(staticStyle, options.delimiters);
  84387. if (res) {
  84388. warn(
  84389. "style=\"" + staticStyle + "\": " +
  84390. 'Interpolation inside attributes has been removed. ' +
  84391. 'Use v-bind or the colon shorthand instead. For example, ' +
  84392. 'instead of <div style="{{ val }}">, use <div :style="val">.',
  84393. el.rawAttrsMap['style']
  84394. );
  84395. }
  84396. }
  84397. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  84398. }
  84399. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  84400. if (styleBinding) {
  84401. el.styleBinding = styleBinding;
  84402. }
  84403. }
  84404. function genData$1 (el) {
  84405. var data = '';
  84406. if (el.staticStyle) {
  84407. data += "staticStyle:" + (el.staticStyle) + ",";
  84408. }
  84409. if (el.styleBinding) {
  84410. data += "style:(" + (el.styleBinding) + "),";
  84411. }
  84412. return data
  84413. }
  84414. var style$1 = {
  84415. staticKeys: ['staticStyle'],
  84416. transformNode: transformNode$1,
  84417. genData: genData$1
  84418. };
  84419. /* */
  84420. var decoder;
  84421. var he = {
  84422. decode: function decode (html) {
  84423. decoder = decoder || document.createElement('div');
  84424. decoder.innerHTML = html;
  84425. return decoder.textContent
  84426. }
  84427. };
  84428. /* */
  84429. var isUnaryTag = makeMap(
  84430. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  84431. 'link,meta,param,source,track,wbr'
  84432. );
  84433. // Elements that you can, intentionally, leave open
  84434. // (and which close themselves)
  84435. var canBeLeftOpenTag = makeMap(
  84436. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
  84437. );
  84438. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  84439. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  84440. var isNonPhrasingTag = makeMap(
  84441. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  84442. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  84443. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  84444. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  84445. 'title,tr,track'
  84446. );
  84447. /**
  84448. * Not type-checking this file because it's mostly vendor code.
  84449. */
  84450. // Regular Expressions for parsing tags and attributes
  84451. var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  84452. var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  84453. var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
  84454. var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
  84455. var startTagOpen = new RegExp(("^<" + qnameCapture));
  84456. var startTagClose = /^\s*(\/?)>/;
  84457. var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
  84458. var doctype = /^<!DOCTYPE [^>]+>/i;
  84459. // #7298: escape - to avoid being passed as HTML comment when inlined in page
  84460. var comment = /^<!\--/;
  84461. var conditionalComment = /^<!\[/;
  84462. // Special Elements (can contain anything)
  84463. var isPlainTextElement = makeMap('script,style,textarea', true);
  84464. var reCache = {};
  84465. var decodingMap = {
  84466. '&lt;': '<',
  84467. '&gt;': '>',
  84468. '&quot;': '"',
  84469. '&amp;': '&',
  84470. '&#10;': '\n',
  84471. '&#9;': '\t',
  84472. '&#39;': "'"
  84473. };
  84474. var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
  84475. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
  84476. // #5992
  84477. var isIgnoreNewlineTag = makeMap('pre,textarea', true);
  84478. var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
  84479. function decodeAttr (value, shouldDecodeNewlines) {
  84480. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  84481. return value.replace(re, function (match) { return decodingMap[match]; })
  84482. }
  84483. function parseHTML (html, options) {
  84484. var stack = [];
  84485. var expectHTML = options.expectHTML;
  84486. var isUnaryTag$$1 = options.isUnaryTag || no;
  84487. var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
  84488. var index = 0;
  84489. var last, lastTag;
  84490. while (html) {
  84491. last = html;
  84492. // Make sure we're not in a plaintext content element like script/style
  84493. if (!lastTag || !isPlainTextElement(lastTag)) {
  84494. var textEnd = html.indexOf('<');
  84495. if (textEnd === 0) {
  84496. // Comment:
  84497. if (comment.test(html)) {
  84498. var commentEnd = html.indexOf('-->');
  84499. if (commentEnd >= 0) {
  84500. if (options.shouldKeepComment) {
  84501. options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
  84502. }
  84503. advance(commentEnd + 3);
  84504. continue
  84505. }
  84506. }
  84507. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  84508. if (conditionalComment.test(html)) {
  84509. var conditionalEnd = html.indexOf(']>');
  84510. if (conditionalEnd >= 0) {
  84511. advance(conditionalEnd + 2);
  84512. continue
  84513. }
  84514. }
  84515. // Doctype:
  84516. var doctypeMatch = html.match(doctype);
  84517. if (doctypeMatch) {
  84518. advance(doctypeMatch[0].length);
  84519. continue
  84520. }
  84521. // End tag:
  84522. var endTagMatch = html.match(endTag);
  84523. if (endTagMatch) {
  84524. var curIndex = index;
  84525. advance(endTagMatch[0].length);
  84526. parseEndTag(endTagMatch[1], curIndex, index);
  84527. continue
  84528. }
  84529. // Start tag:
  84530. var startTagMatch = parseStartTag();
  84531. if (startTagMatch) {
  84532. handleStartTag(startTagMatch);
  84533. if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
  84534. advance(1);
  84535. }
  84536. continue
  84537. }
  84538. }
  84539. var text = (void 0), rest = (void 0), next = (void 0);
  84540. if (textEnd >= 0) {
  84541. rest = html.slice(textEnd);
  84542. while (
  84543. !endTag.test(rest) &&
  84544. !startTagOpen.test(rest) &&
  84545. !comment.test(rest) &&
  84546. !conditionalComment.test(rest)
  84547. ) {
  84548. // < in plain text, be forgiving and treat it as text
  84549. next = rest.indexOf('<', 1);
  84550. if (next < 0) { break }
  84551. textEnd += next;
  84552. rest = html.slice(textEnd);
  84553. }
  84554. text = html.substring(0, textEnd);
  84555. }
  84556. if (textEnd < 0) {
  84557. text = html;
  84558. }
  84559. if (text) {
  84560. advance(text.length);
  84561. }
  84562. if (options.chars && text) {
  84563. options.chars(text, index - text.length, index);
  84564. }
  84565. } else {
  84566. var endTagLength = 0;
  84567. var stackedTag = lastTag.toLowerCase();
  84568. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  84569. var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
  84570. endTagLength = endTag.length;
  84571. if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
  84572. text = text
  84573. .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
  84574. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  84575. }
  84576. if (shouldIgnoreFirstNewline(stackedTag, text)) {
  84577. text = text.slice(1);
  84578. }
  84579. if (options.chars) {
  84580. options.chars(text);
  84581. }
  84582. return ''
  84583. });
  84584. index += html.length - rest$1.length;
  84585. html = rest$1;
  84586. parseEndTag(stackedTag, index - endTagLength, index);
  84587. }
  84588. if (html === last) {
  84589. options.chars && options.chars(html);
  84590. if (!stack.length && options.warn) {
  84591. options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
  84592. }
  84593. break
  84594. }
  84595. }
  84596. // Clean up any remaining tags
  84597. parseEndTag();
  84598. function advance (n) {
  84599. index += n;
  84600. html = html.substring(n);
  84601. }
  84602. function parseStartTag () {
  84603. var start = html.match(startTagOpen);
  84604. if (start) {
  84605. var match = {
  84606. tagName: start[1],
  84607. attrs: [],
  84608. start: index
  84609. };
  84610. advance(start[0].length);
  84611. var end, attr;
  84612. while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
  84613. attr.start = index;
  84614. advance(attr[0].length);
  84615. attr.end = index;
  84616. match.attrs.push(attr);
  84617. }
  84618. if (end) {
  84619. match.unarySlash = end[1];
  84620. advance(end[0].length);
  84621. match.end = index;
  84622. return match
  84623. }
  84624. }
  84625. }
  84626. function handleStartTag (match) {
  84627. var tagName = match.tagName;
  84628. var unarySlash = match.unarySlash;
  84629. if (expectHTML) {
  84630. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  84631. parseEndTag(lastTag);
  84632. }
  84633. if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
  84634. parseEndTag(tagName);
  84635. }
  84636. }
  84637. var unary = isUnaryTag$$1(tagName) || !!unarySlash;
  84638. var l = match.attrs.length;
  84639. var attrs = new Array(l);
  84640. for (var i = 0; i < l; i++) {
  84641. var args = match.attrs[i];
  84642. var value = args[3] || args[4] || args[5] || '';
  84643. var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
  84644. ? options.shouldDecodeNewlinesForHref
  84645. : options.shouldDecodeNewlines;
  84646. attrs[i] = {
  84647. name: args[1],
  84648. value: decodeAttr(value, shouldDecodeNewlines)
  84649. };
  84650. if (options.outputSourceRange) {
  84651. attrs[i].start = args.start + args[0].match(/^\s*/).length;
  84652. attrs[i].end = args.end;
  84653. }
  84654. }
  84655. if (!unary) {
  84656. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
  84657. lastTag = tagName;
  84658. }
  84659. if (options.start) {
  84660. options.start(tagName, attrs, unary, match.start, match.end);
  84661. }
  84662. }
  84663. function parseEndTag (tagName, start, end) {
  84664. var pos, lowerCasedTagName;
  84665. if (start == null) { start = index; }
  84666. if (end == null) { end = index; }
  84667. // Find the closest opened tag of the same type
  84668. if (tagName) {
  84669. lowerCasedTagName = tagName.toLowerCase();
  84670. for (pos = stack.length - 1; pos >= 0; pos--) {
  84671. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  84672. break
  84673. }
  84674. }
  84675. } else {
  84676. // If no tag name is provided, clean shop
  84677. pos = 0;
  84678. }
  84679. if (pos >= 0) {
  84680. // Close all the open elements, up the stack
  84681. for (var i = stack.length - 1; i >= pos; i--) {
  84682. if (i > pos || !tagName &&
  84683. options.warn
  84684. ) {
  84685. options.warn(
  84686. ("tag <" + (stack[i].tag) + "> has no matching end tag."),
  84687. { start: stack[i].start, end: stack[i].end }
  84688. );
  84689. }
  84690. if (options.end) {
  84691. options.end(stack[i].tag, start, end);
  84692. }
  84693. }
  84694. // Remove the open elements from the stack
  84695. stack.length = pos;
  84696. lastTag = pos && stack[pos - 1].tag;
  84697. } else if (lowerCasedTagName === 'br') {
  84698. if (options.start) {
  84699. options.start(tagName, [], true, start, end);
  84700. }
  84701. } else if (lowerCasedTagName === 'p') {
  84702. if (options.start) {
  84703. options.start(tagName, [], false, start, end);
  84704. }
  84705. if (options.end) {
  84706. options.end(tagName, start, end);
  84707. }
  84708. }
  84709. }
  84710. }
  84711. /* */
  84712. var onRE = /^@|^v-on:/;
  84713. var dirRE = /^v-|^@|^:|^#/;
  84714. var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  84715. var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  84716. var stripParensRE = /^\(|\)$/g;
  84717. var dynamicArgRE = /^\[.*\]$/;
  84718. var argRE = /:(.*)$/;
  84719. var bindRE = /^:|^\.|^v-bind:/;
  84720. var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
  84721. var slotRE = /^v-slot(:|$)|^#/;
  84722. var lineBreakRE = /[\r\n]/;
  84723. var whitespaceRE$1 = /\s+/g;
  84724. var invalidAttributeRE = /[\s"'<>\/=]/;
  84725. var decodeHTMLCached = cached(he.decode);
  84726. var emptySlotScopeToken = "_empty_";
  84727. // configurable state
  84728. var warn$2;
  84729. var delimiters;
  84730. var transforms;
  84731. var preTransforms;
  84732. var postTransforms;
  84733. var platformIsPreTag;
  84734. var platformMustUseProp;
  84735. var platformGetTagNamespace;
  84736. var maybeComponent;
  84737. function createASTElement (
  84738. tag,
  84739. attrs,
  84740. parent
  84741. ) {
  84742. return {
  84743. type: 1,
  84744. tag: tag,
  84745. attrsList: attrs,
  84746. attrsMap: makeAttrsMap(attrs),
  84747. rawAttrsMap: {},
  84748. parent: parent,
  84749. children: []
  84750. }
  84751. }
  84752. /**
  84753. * Convert HTML string to AST.
  84754. */
  84755. function parse (
  84756. template,
  84757. options
  84758. ) {
  84759. warn$2 = options.warn || baseWarn;
  84760. platformIsPreTag = options.isPreTag || no;
  84761. platformMustUseProp = options.mustUseProp || no;
  84762. platformGetTagNamespace = options.getTagNamespace || no;
  84763. var isReservedTag = options.isReservedTag || no;
  84764. maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  84765. transforms = pluckModuleFunction(options.modules, 'transformNode');
  84766. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  84767. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  84768. delimiters = options.delimiters;
  84769. var stack = [];
  84770. var preserveWhitespace = options.preserveWhitespace !== false;
  84771. var whitespaceOption = options.whitespace;
  84772. var root;
  84773. var currentParent;
  84774. var inVPre = false;
  84775. var inPre = false;
  84776. var warned = false;
  84777. function warnOnce (msg, range) {
  84778. if (!warned) {
  84779. warned = true;
  84780. warn$2(msg, range);
  84781. }
  84782. }
  84783. function closeElement (element) {
  84784. trimEndingWhitespace(element);
  84785. if (!inVPre && !element.processed) {
  84786. element = processElement(element, options);
  84787. }
  84788. // tree management
  84789. if (!stack.length && element !== root) {
  84790. // allow root elements with v-if, v-else-if and v-else
  84791. if (root.if && (element.elseif || element.else)) {
  84792. {
  84793. checkRootConstraints(element);
  84794. }
  84795. addIfCondition(root, {
  84796. exp: element.elseif,
  84797. block: element
  84798. });
  84799. } else {
  84800. warnOnce(
  84801. "Component template should contain exactly one root element. " +
  84802. "If you are using v-if on multiple elements, " +
  84803. "use v-else-if to chain them instead.",
  84804. { start: element.start }
  84805. );
  84806. }
  84807. }
  84808. if (currentParent && !element.forbidden) {
  84809. if (element.elseif || element.else) {
  84810. processIfConditions(element, currentParent);
  84811. } else {
  84812. if (element.slotScope) {
  84813. // scoped slot
  84814. // keep it in the children list so that v-else(-if) conditions can
  84815. // find it as the prev node.
  84816. var name = element.slotTarget || '"default"'
  84817. ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  84818. }
  84819. currentParent.children.push(element);
  84820. element.parent = currentParent;
  84821. }
  84822. }
  84823. // final children cleanup
  84824. // filter out scoped slots
  84825. element.children = element.children.filter(function (c) { return !(c).slotScope; });
  84826. // remove trailing whitespace node again
  84827. trimEndingWhitespace(element);
  84828. // check pre state
  84829. if (element.pre) {
  84830. inVPre = false;
  84831. }
  84832. if (platformIsPreTag(element.tag)) {
  84833. inPre = false;
  84834. }
  84835. // apply post-transforms
  84836. for (var i = 0; i < postTransforms.length; i++) {
  84837. postTransforms[i](element, options);
  84838. }
  84839. }
  84840. function trimEndingWhitespace (el) {
  84841. // remove trailing whitespace node
  84842. if (!inPre) {
  84843. var lastNode;
  84844. while (
  84845. (lastNode = el.children[el.children.length - 1]) &&
  84846. lastNode.type === 3 &&
  84847. lastNode.text === ' '
  84848. ) {
  84849. el.children.pop();
  84850. }
  84851. }
  84852. }
  84853. function checkRootConstraints (el) {
  84854. if (el.tag === 'slot' || el.tag === 'template') {
  84855. warnOnce(
  84856. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  84857. 'contain multiple nodes.',
  84858. { start: el.start }
  84859. );
  84860. }
  84861. if (el.attrsMap.hasOwnProperty('v-for')) {
  84862. warnOnce(
  84863. 'Cannot use v-for on stateful component root element because ' +
  84864. 'it renders multiple elements.',
  84865. el.rawAttrsMap['v-for']
  84866. );
  84867. }
  84868. }
  84869. parseHTML(template, {
  84870. warn: warn$2,
  84871. expectHTML: options.expectHTML,
  84872. isUnaryTag: options.isUnaryTag,
  84873. canBeLeftOpenTag: options.canBeLeftOpenTag,
  84874. shouldDecodeNewlines: options.shouldDecodeNewlines,
  84875. shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
  84876. shouldKeepComment: options.comments,
  84877. outputSourceRange: options.outputSourceRange,
  84878. start: function start (tag, attrs, unary, start$1, end) {
  84879. // check namespace.
  84880. // inherit parent ns if there is one
  84881. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  84882. // handle IE svg bug
  84883. /* istanbul ignore if */
  84884. if (isIE && ns === 'svg') {
  84885. attrs = guardIESVGBug(attrs);
  84886. }
  84887. var element = createASTElement(tag, attrs, currentParent);
  84888. if (ns) {
  84889. element.ns = ns;
  84890. }
  84891. {
  84892. if (options.outputSourceRange) {
  84893. element.start = start$1;
  84894. element.end = end;
  84895. element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
  84896. cumulated[attr.name] = attr;
  84897. return cumulated
  84898. }, {});
  84899. }
  84900. attrs.forEach(function (attr) {
  84901. if (invalidAttributeRE.test(attr.name)) {
  84902. warn$2(
  84903. "Invalid dynamic argument expression: attribute names cannot contain " +
  84904. "spaces, quotes, <, >, / or =.",
  84905. {
  84906. start: attr.start + attr.name.indexOf("["),
  84907. end: attr.start + attr.name.length
  84908. }
  84909. );
  84910. }
  84911. });
  84912. }
  84913. if (isForbiddenTag(element) && !isServerRendering()) {
  84914. element.forbidden = true;
  84915. warn$2(
  84916. 'Templates should only be responsible for mapping the state to the ' +
  84917. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  84918. "<" + tag + ">" + ', as they will not be parsed.',
  84919. { start: element.start }
  84920. );
  84921. }
  84922. // apply pre-transforms
  84923. for (var i = 0; i < preTransforms.length; i++) {
  84924. element = preTransforms[i](element, options) || element;
  84925. }
  84926. if (!inVPre) {
  84927. processPre(element);
  84928. if (element.pre) {
  84929. inVPre = true;
  84930. }
  84931. }
  84932. if (platformIsPreTag(element.tag)) {
  84933. inPre = true;
  84934. }
  84935. if (inVPre) {
  84936. processRawAttrs(element);
  84937. } else if (!element.processed) {
  84938. // structural directives
  84939. processFor(element);
  84940. processIf(element);
  84941. processOnce(element);
  84942. }
  84943. if (!root) {
  84944. root = element;
  84945. {
  84946. checkRootConstraints(root);
  84947. }
  84948. }
  84949. if (!unary) {
  84950. currentParent = element;
  84951. stack.push(element);
  84952. } else {
  84953. closeElement(element);
  84954. }
  84955. },
  84956. end: function end (tag, start, end$1) {
  84957. var element = stack[stack.length - 1];
  84958. // pop stack
  84959. stack.length -= 1;
  84960. currentParent = stack[stack.length - 1];
  84961. if (options.outputSourceRange) {
  84962. element.end = end$1;
  84963. }
  84964. closeElement(element);
  84965. },
  84966. chars: function chars (text, start, end) {
  84967. if (!currentParent) {
  84968. {
  84969. if (text === template) {
  84970. warnOnce(
  84971. 'Component template requires a root element, rather than just text.',
  84972. { start: start }
  84973. );
  84974. } else if ((text = text.trim())) {
  84975. warnOnce(
  84976. ("text \"" + text + "\" outside root element will be ignored."),
  84977. { start: start }
  84978. );
  84979. }
  84980. }
  84981. return
  84982. }
  84983. // IE textarea placeholder bug
  84984. /* istanbul ignore if */
  84985. if (isIE &&
  84986. currentParent.tag === 'textarea' &&
  84987. currentParent.attrsMap.placeholder === text
  84988. ) {
  84989. return
  84990. }
  84991. var children = currentParent.children;
  84992. if (inPre || text.trim()) {
  84993. text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
  84994. } else if (!children.length) {
  84995. // remove the whitespace-only node right after an opening tag
  84996. text = '';
  84997. } else if (whitespaceOption) {
  84998. if (whitespaceOption === 'condense') {
  84999. // in condense mode, remove the whitespace node if it contains
  85000. // line break, otherwise condense to a single space
  85001. text = lineBreakRE.test(text) ? '' : ' ';
  85002. } else {
  85003. text = ' ';
  85004. }
  85005. } else {
  85006. text = preserveWhitespace ? ' ' : '';
  85007. }
  85008. if (text) {
  85009. if (!inPre && whitespaceOption === 'condense') {
  85010. // condense consecutive whitespaces into single space
  85011. text = text.replace(whitespaceRE$1, ' ');
  85012. }
  85013. var res;
  85014. var child;
  85015. if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
  85016. child = {
  85017. type: 2,
  85018. expression: res.expression,
  85019. tokens: res.tokens,
  85020. text: text
  85021. };
  85022. } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
  85023. child = {
  85024. type: 3,
  85025. text: text
  85026. };
  85027. }
  85028. if (child) {
  85029. if (options.outputSourceRange) {
  85030. child.start = start;
  85031. child.end = end;
  85032. }
  85033. children.push(child);
  85034. }
  85035. }
  85036. },
  85037. comment: function comment (text, start, end) {
  85038. // adding anyting as a sibling to the root node is forbidden
  85039. // comments should still be allowed, but ignored
  85040. if (currentParent) {
  85041. var child = {
  85042. type: 3,
  85043. text: text,
  85044. isComment: true
  85045. };
  85046. if (options.outputSourceRange) {
  85047. child.start = start;
  85048. child.end = end;
  85049. }
  85050. currentParent.children.push(child);
  85051. }
  85052. }
  85053. });
  85054. return root
  85055. }
  85056. function processPre (el) {
  85057. if (getAndRemoveAttr(el, 'v-pre') != null) {
  85058. el.pre = true;
  85059. }
  85060. }
  85061. function processRawAttrs (el) {
  85062. var list = el.attrsList;
  85063. var len = list.length;
  85064. if (len) {
  85065. var attrs = el.attrs = new Array(len);
  85066. for (var i = 0; i < len; i++) {
  85067. attrs[i] = {
  85068. name: list[i].name,
  85069. value: JSON.stringify(list[i].value)
  85070. };
  85071. if (list[i].start != null) {
  85072. attrs[i].start = list[i].start;
  85073. attrs[i].end = list[i].end;
  85074. }
  85075. }
  85076. } else if (!el.pre) {
  85077. // non root node in pre blocks with no attributes
  85078. el.plain = true;
  85079. }
  85080. }
  85081. function processElement (
  85082. element,
  85083. options
  85084. ) {
  85085. processKey(element);
  85086. // determine whether this is a plain element after
  85087. // removing structural attributes
  85088. element.plain = (
  85089. !element.key &&
  85090. !element.scopedSlots &&
  85091. !element.attrsList.length
  85092. );
  85093. processRef(element);
  85094. processSlotContent(element);
  85095. processSlotOutlet(element);
  85096. processComponent(element);
  85097. for (var i = 0; i < transforms.length; i++) {
  85098. element = transforms[i](element, options) || element;
  85099. }
  85100. processAttrs(element);
  85101. return element
  85102. }
  85103. function processKey (el) {
  85104. var exp = getBindingAttr(el, 'key');
  85105. if (exp) {
  85106. {
  85107. if (el.tag === 'template') {
  85108. warn$2(
  85109. "<template> cannot be keyed. Place the key on real elements instead.",
  85110. getRawBindingAttr(el, 'key')
  85111. );
  85112. }
  85113. if (el.for) {
  85114. var iterator = el.iterator2 || el.iterator1;
  85115. var parent = el.parent;
  85116. if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
  85117. warn$2(
  85118. "Do not use v-for index as key on <transition-group> children, " +
  85119. "this is the same as not using keys.",
  85120. getRawBindingAttr(el, 'key'),
  85121. true /* tip */
  85122. );
  85123. }
  85124. }
  85125. }
  85126. el.key = exp;
  85127. }
  85128. }
  85129. function processRef (el) {
  85130. var ref = getBindingAttr(el, 'ref');
  85131. if (ref) {
  85132. el.ref = ref;
  85133. el.refInFor = checkInFor(el);
  85134. }
  85135. }
  85136. function processFor (el) {
  85137. var exp;
  85138. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  85139. var res = parseFor(exp);
  85140. if (res) {
  85141. extend(el, res);
  85142. } else {
  85143. warn$2(
  85144. ("Invalid v-for expression: " + exp),
  85145. el.rawAttrsMap['v-for']
  85146. );
  85147. }
  85148. }
  85149. }
  85150. function parseFor (exp) {
  85151. var inMatch = exp.match(forAliasRE);
  85152. if (!inMatch) { return }
  85153. var res = {};
  85154. res.for = inMatch[2].trim();
  85155. var alias = inMatch[1].trim().replace(stripParensRE, '');
  85156. var iteratorMatch = alias.match(forIteratorRE);
  85157. if (iteratorMatch) {
  85158. res.alias = alias.replace(forIteratorRE, '').trim();
  85159. res.iterator1 = iteratorMatch[1].trim();
  85160. if (iteratorMatch[2]) {
  85161. res.iterator2 = iteratorMatch[2].trim();
  85162. }
  85163. } else {
  85164. res.alias = alias;
  85165. }
  85166. return res
  85167. }
  85168. function processIf (el) {
  85169. var exp = getAndRemoveAttr(el, 'v-if');
  85170. if (exp) {
  85171. el.if = exp;
  85172. addIfCondition(el, {
  85173. exp: exp,
  85174. block: el
  85175. });
  85176. } else {
  85177. if (getAndRemoveAttr(el, 'v-else') != null) {
  85178. el.else = true;
  85179. }
  85180. var elseif = getAndRemoveAttr(el, 'v-else-if');
  85181. if (elseif) {
  85182. el.elseif = elseif;
  85183. }
  85184. }
  85185. }
  85186. function processIfConditions (el, parent) {
  85187. var prev = findPrevElement(parent.children);
  85188. if (prev && prev.if) {
  85189. addIfCondition(prev, {
  85190. exp: el.elseif,
  85191. block: el
  85192. });
  85193. } else {
  85194. warn$2(
  85195. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  85196. "used on element <" + (el.tag) + "> without corresponding v-if.",
  85197. el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
  85198. );
  85199. }
  85200. }
  85201. function findPrevElement (children) {
  85202. var i = children.length;
  85203. while (i--) {
  85204. if (children[i].type === 1) {
  85205. return children[i]
  85206. } else {
  85207. if (children[i].text !== ' ') {
  85208. warn$2(
  85209. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  85210. "will be ignored.",
  85211. children[i]
  85212. );
  85213. }
  85214. children.pop();
  85215. }
  85216. }
  85217. }
  85218. function addIfCondition (el, condition) {
  85219. if (!el.ifConditions) {
  85220. el.ifConditions = [];
  85221. }
  85222. el.ifConditions.push(condition);
  85223. }
  85224. function processOnce (el) {
  85225. var once$$1 = getAndRemoveAttr(el, 'v-once');
  85226. if (once$$1 != null) {
  85227. el.once = true;
  85228. }
  85229. }
  85230. // handle content being passed to a component as slot,
  85231. // e.g. <template slot="xxx">, <div slot-scope="xxx">
  85232. function processSlotContent (el) {
  85233. var slotScope;
  85234. if (el.tag === 'template') {
  85235. slotScope = getAndRemoveAttr(el, 'scope');
  85236. /* istanbul ignore if */
  85237. if (slotScope) {
  85238. warn$2(
  85239. "the \"scope\" attribute for scoped slots have been deprecated and " +
  85240. "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
  85241. "can also be used on plain elements in addition to <template> to " +
  85242. "denote scoped slots.",
  85243. el.rawAttrsMap['scope'],
  85244. true
  85245. );
  85246. }
  85247. el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
  85248. } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
  85249. /* istanbul ignore if */
  85250. if (el.attrsMap['v-for']) {
  85251. warn$2(
  85252. "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
  85253. "(v-for takes higher priority). Use a wrapper <template> for the " +
  85254. "scoped slot to make it clearer.",
  85255. el.rawAttrsMap['slot-scope'],
  85256. true
  85257. );
  85258. }
  85259. el.slotScope = slotScope;
  85260. }
  85261. // slot="xxx"
  85262. var slotTarget = getBindingAttr(el, 'slot');
  85263. if (slotTarget) {
  85264. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  85265. el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
  85266. // preserve slot as an attribute for native shadow DOM compat
  85267. // only for non-scoped slots.
  85268. if (el.tag !== 'template' && !el.slotScope) {
  85269. addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
  85270. }
  85271. }
  85272. // 2.6 v-slot syntax
  85273. {
  85274. if (el.tag === 'template') {
  85275. // v-slot on <template>
  85276. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  85277. if (slotBinding) {
  85278. {
  85279. if (el.slotTarget || el.slotScope) {
  85280. warn$2(
  85281. "Unexpected mixed usage of different slot syntaxes.",
  85282. el
  85283. );
  85284. }
  85285. if (el.parent && !maybeComponent(el.parent)) {
  85286. warn$2(
  85287. "<template v-slot> can only appear at the root level inside " +
  85288. "the receiving component",
  85289. el
  85290. );
  85291. }
  85292. }
  85293. var ref = getSlotName(slotBinding);
  85294. var name = ref.name;
  85295. var dynamic = ref.dynamic;
  85296. el.slotTarget = name;
  85297. el.slotTargetDynamic = dynamic;
  85298. el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
  85299. }
  85300. } else {
  85301. // v-slot on component, denotes default slot
  85302. var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
  85303. if (slotBinding$1) {
  85304. {
  85305. if (!maybeComponent(el)) {
  85306. warn$2(
  85307. "v-slot can only be used on components or <template>.",
  85308. slotBinding$1
  85309. );
  85310. }
  85311. if (el.slotScope || el.slotTarget) {
  85312. warn$2(
  85313. "Unexpected mixed usage of different slot syntaxes.",
  85314. el
  85315. );
  85316. }
  85317. if (el.scopedSlots) {
  85318. warn$2(
  85319. "To avoid scope ambiguity, the default slot should also use " +
  85320. "<template> syntax when there are other named slots.",
  85321. slotBinding$1
  85322. );
  85323. }
  85324. }
  85325. // add the component's children to its default slot
  85326. var slots = el.scopedSlots || (el.scopedSlots = {});
  85327. var ref$1 = getSlotName(slotBinding$1);
  85328. var name$1 = ref$1.name;
  85329. var dynamic$1 = ref$1.dynamic;
  85330. var slotContainer = slots[name$1] = createASTElement('template', [], el);
  85331. slotContainer.slotTarget = name$1;
  85332. slotContainer.slotTargetDynamic = dynamic$1;
  85333. slotContainer.children = el.children.filter(function (c) {
  85334. if (!c.slotScope) {
  85335. c.parent = slotContainer;
  85336. return true
  85337. }
  85338. });
  85339. slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
  85340. // remove children as they are returned from scopedSlots now
  85341. el.children = [];
  85342. // mark el non-plain so data gets generated
  85343. el.plain = false;
  85344. }
  85345. }
  85346. }
  85347. }
  85348. function getSlotName (binding) {
  85349. var name = binding.name.replace(slotRE, '');
  85350. if (!name) {
  85351. if (binding.name[0] !== '#') {
  85352. name = 'default';
  85353. } else {
  85354. warn$2(
  85355. "v-slot shorthand syntax requires a slot name.",
  85356. binding
  85357. );
  85358. }
  85359. }
  85360. return dynamicArgRE.test(name)
  85361. // dynamic [name]
  85362. ? { name: name.slice(1, -1), dynamic: true }
  85363. // static name
  85364. : { name: ("\"" + name + "\""), dynamic: false }
  85365. }
  85366. // handle <slot/> outlets
  85367. function processSlotOutlet (el) {
  85368. if (el.tag === 'slot') {
  85369. el.slotName = getBindingAttr(el, 'name');
  85370. if (el.key) {
  85371. warn$2(
  85372. "`key` does not work on <slot> because slots are abstract outlets " +
  85373. "and can possibly expand into multiple elements. " +
  85374. "Use the key on a wrapping element instead.",
  85375. getRawBindingAttr(el, 'key')
  85376. );
  85377. }
  85378. }
  85379. }
  85380. function processComponent (el) {
  85381. var binding;
  85382. if ((binding = getBindingAttr(el, 'is'))) {
  85383. el.component = binding;
  85384. }
  85385. if (getAndRemoveAttr(el, 'inline-template') != null) {
  85386. el.inlineTemplate = true;
  85387. }
  85388. }
  85389. function processAttrs (el) {
  85390. var list = el.attrsList;
  85391. var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
  85392. for (i = 0, l = list.length; i < l; i++) {
  85393. name = rawName = list[i].name;
  85394. value = list[i].value;
  85395. if (dirRE.test(name)) {
  85396. // mark element as dynamic
  85397. el.hasBindings = true;
  85398. // modifiers
  85399. modifiers = parseModifiers(name.replace(dirRE, ''));
  85400. // support .foo shorthand syntax for the .prop modifier
  85401. if (modifiers) {
  85402. name = name.replace(modifierRE, '');
  85403. }
  85404. if (bindRE.test(name)) { // v-bind
  85405. name = name.replace(bindRE, '');
  85406. value = parseFilters(value);
  85407. isDynamic = dynamicArgRE.test(name);
  85408. if (isDynamic) {
  85409. name = name.slice(1, -1);
  85410. }
  85411. if (
  85412. value.trim().length === 0
  85413. ) {
  85414. warn$2(
  85415. ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
  85416. );
  85417. }
  85418. if (modifiers) {
  85419. if (modifiers.prop && !isDynamic) {
  85420. name = camelize(name);
  85421. if (name === 'innerHtml') { name = 'innerHTML'; }
  85422. }
  85423. if (modifiers.camel && !isDynamic) {
  85424. name = camelize(name);
  85425. }
  85426. if (modifiers.sync) {
  85427. syncGen = genAssignmentCode(value, "$event");
  85428. if (!isDynamic) {
  85429. addHandler(
  85430. el,
  85431. ("update:" + (camelize(name))),
  85432. syncGen,
  85433. null,
  85434. false,
  85435. warn$2,
  85436. list[i]
  85437. );
  85438. if (hyphenate(name) !== camelize(name)) {
  85439. addHandler(
  85440. el,
  85441. ("update:" + (hyphenate(name))),
  85442. syncGen,
  85443. null,
  85444. false,
  85445. warn$2,
  85446. list[i]
  85447. );
  85448. }
  85449. } else {
  85450. // handler w/ dynamic event name
  85451. addHandler(
  85452. el,
  85453. ("\"update:\"+(" + name + ")"),
  85454. syncGen,
  85455. null,
  85456. false,
  85457. warn$2,
  85458. list[i],
  85459. true // dynamic
  85460. );
  85461. }
  85462. }
  85463. }
  85464. if ((modifiers && modifiers.prop) || (
  85465. !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
  85466. )) {
  85467. addProp(el, name, value, list[i], isDynamic);
  85468. } else {
  85469. addAttr(el, name, value, list[i], isDynamic);
  85470. }
  85471. } else if (onRE.test(name)) { // v-on
  85472. name = name.replace(onRE, '');
  85473. isDynamic = dynamicArgRE.test(name);
  85474. if (isDynamic) {
  85475. name = name.slice(1, -1);
  85476. }
  85477. addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
  85478. } else { // normal directives
  85479. name = name.replace(dirRE, '');
  85480. // parse arg
  85481. var argMatch = name.match(argRE);
  85482. var arg = argMatch && argMatch[1];
  85483. isDynamic = false;
  85484. if (arg) {
  85485. name = name.slice(0, -(arg.length + 1));
  85486. if (dynamicArgRE.test(arg)) {
  85487. arg = arg.slice(1, -1);
  85488. isDynamic = true;
  85489. }
  85490. }
  85491. addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
  85492. if (name === 'model') {
  85493. checkForAliasModel(el, value);
  85494. }
  85495. }
  85496. } else {
  85497. // literal attribute
  85498. {
  85499. var res = parseText(value, delimiters);
  85500. if (res) {
  85501. warn$2(
  85502. name + "=\"" + value + "\": " +
  85503. 'Interpolation inside attributes has been removed. ' +
  85504. 'Use v-bind or the colon shorthand instead. For example, ' +
  85505. 'instead of <div id="{{ val }}">, use <div :id="val">.',
  85506. list[i]
  85507. );
  85508. }
  85509. }
  85510. addAttr(el, name, JSON.stringify(value), list[i]);
  85511. // #6887 firefox doesn't update muted state if set via attribute
  85512. // even immediately after element creation
  85513. if (!el.component &&
  85514. name === 'muted' &&
  85515. platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  85516. addProp(el, name, 'true', list[i]);
  85517. }
  85518. }
  85519. }
  85520. }
  85521. function checkInFor (el) {
  85522. var parent = el;
  85523. while (parent) {
  85524. if (parent.for !== undefined) {
  85525. return true
  85526. }
  85527. parent = parent.parent;
  85528. }
  85529. return false
  85530. }
  85531. function parseModifiers (name) {
  85532. var match = name.match(modifierRE);
  85533. if (match) {
  85534. var ret = {};
  85535. match.forEach(function (m) { ret[m.slice(1)] = true; });
  85536. return ret
  85537. }
  85538. }
  85539. function makeAttrsMap (attrs) {
  85540. var map = {};
  85541. for (var i = 0, l = attrs.length; i < l; i++) {
  85542. if (
  85543. map[attrs[i].name] && !isIE && !isEdge
  85544. ) {
  85545. warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
  85546. }
  85547. map[attrs[i].name] = attrs[i].value;
  85548. }
  85549. return map
  85550. }
  85551. // for script (e.g. type="x/template") or style, do not decode content
  85552. function isTextTag (el) {
  85553. return el.tag === 'script' || el.tag === 'style'
  85554. }
  85555. function isForbiddenTag (el) {
  85556. return (
  85557. el.tag === 'style' ||
  85558. (el.tag === 'script' && (
  85559. !el.attrsMap.type ||
  85560. el.attrsMap.type === 'text/javascript'
  85561. ))
  85562. )
  85563. }
  85564. var ieNSBug = /^xmlns:NS\d+/;
  85565. var ieNSPrefix = /^NS\d+:/;
  85566. /* istanbul ignore next */
  85567. function guardIESVGBug (attrs) {
  85568. var res = [];
  85569. for (var i = 0; i < attrs.length; i++) {
  85570. var attr = attrs[i];
  85571. if (!ieNSBug.test(attr.name)) {
  85572. attr.name = attr.name.replace(ieNSPrefix, '');
  85573. res.push(attr);
  85574. }
  85575. }
  85576. return res
  85577. }
  85578. function checkForAliasModel (el, value) {
  85579. var _el = el;
  85580. while (_el) {
  85581. if (_el.for && _el.alias === value) {
  85582. warn$2(
  85583. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  85584. "You are binding v-model directly to a v-for iteration alias. " +
  85585. "This will not be able to modify the v-for source array because " +
  85586. "writing to the alias is like modifying a function local variable. " +
  85587. "Consider using an array of objects and use v-model on an object property instead.",
  85588. el.rawAttrsMap['v-model']
  85589. );
  85590. }
  85591. _el = _el.parent;
  85592. }
  85593. }
  85594. /* */
  85595. function preTransformNode (el, options) {
  85596. if (el.tag === 'input') {
  85597. var map = el.attrsMap;
  85598. if (!map['v-model']) {
  85599. return
  85600. }
  85601. var typeBinding;
  85602. if (map[':type'] || map['v-bind:type']) {
  85603. typeBinding = getBindingAttr(el, 'type');
  85604. }
  85605. if (!map.type && !typeBinding && map['v-bind']) {
  85606. typeBinding = "(" + (map['v-bind']) + ").type";
  85607. }
  85608. if (typeBinding) {
  85609. var ifCondition = getAndRemoveAttr(el, 'v-if', true);
  85610. var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
  85611. var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
  85612. var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
  85613. // 1. checkbox
  85614. var branch0 = cloneASTElement(el);
  85615. // process for on the main node
  85616. processFor(branch0);
  85617. addRawAttr(branch0, 'type', 'checkbox');
  85618. processElement(branch0, options);
  85619. branch0.processed = true; // prevent it from double-processed
  85620. branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
  85621. addIfCondition(branch0, {
  85622. exp: branch0.if,
  85623. block: branch0
  85624. });
  85625. // 2. add radio else-if condition
  85626. var branch1 = cloneASTElement(el);
  85627. getAndRemoveAttr(branch1, 'v-for', true);
  85628. addRawAttr(branch1, 'type', 'radio');
  85629. processElement(branch1, options);
  85630. addIfCondition(branch0, {
  85631. exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
  85632. block: branch1
  85633. });
  85634. // 3. other
  85635. var branch2 = cloneASTElement(el);
  85636. getAndRemoveAttr(branch2, 'v-for', true);
  85637. addRawAttr(branch2, ':type', typeBinding);
  85638. processElement(branch2, options);
  85639. addIfCondition(branch0, {
  85640. exp: ifCondition,
  85641. block: branch2
  85642. });
  85643. if (hasElse) {
  85644. branch0.else = true;
  85645. } else if (elseIfCondition) {
  85646. branch0.elseif = elseIfCondition;
  85647. }
  85648. return branch0
  85649. }
  85650. }
  85651. }
  85652. function cloneASTElement (el) {
  85653. return createASTElement(el.tag, el.attrsList.slice(), el.parent)
  85654. }
  85655. var model$1 = {
  85656. preTransformNode: preTransformNode
  85657. };
  85658. var modules$1 = [
  85659. klass$1,
  85660. style$1,
  85661. model$1
  85662. ];
  85663. /* */
  85664. function text (el, dir) {
  85665. if (dir.value) {
  85666. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
  85667. }
  85668. }
  85669. /* */
  85670. function html (el, dir) {
  85671. if (dir.value) {
  85672. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
  85673. }
  85674. }
  85675. var directives$1 = {
  85676. model: model,
  85677. text: text,
  85678. html: html
  85679. };
  85680. /* */
  85681. var baseOptions = {
  85682. expectHTML: true,
  85683. modules: modules$1,
  85684. directives: directives$1,
  85685. isPreTag: isPreTag,
  85686. isUnaryTag: isUnaryTag,
  85687. mustUseProp: mustUseProp,
  85688. canBeLeftOpenTag: canBeLeftOpenTag,
  85689. isReservedTag: isReservedTag,
  85690. getTagNamespace: getTagNamespace,
  85691. staticKeys: genStaticKeys(modules$1)
  85692. };
  85693. /* */
  85694. var isStaticKey;
  85695. var isPlatformReservedTag;
  85696. var genStaticKeysCached = cached(genStaticKeys$1);
  85697. /**
  85698. * Goal of the optimizer: walk the generated template AST tree
  85699. * and detect sub-trees that are purely static, i.e. parts of
  85700. * the DOM that never needs to change.
  85701. *
  85702. * Once we detect these sub-trees, we can:
  85703. *
  85704. * 1. Hoist them into constants, so that we no longer need to
  85705. * create fresh nodes for them on each re-render;
  85706. * 2. Completely skip them in the patching process.
  85707. */
  85708. function optimize (root, options) {
  85709. if (!root) { return }
  85710. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  85711. isPlatformReservedTag = options.isReservedTag || no;
  85712. // first pass: mark all non-static nodes.
  85713. markStatic$1(root);
  85714. // second pass: mark static roots.
  85715. markStaticRoots(root, false);
  85716. }
  85717. function genStaticKeys$1 (keys) {
  85718. return makeMap(
  85719. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
  85720. (keys ? ',' + keys : '')
  85721. )
  85722. }
  85723. function markStatic$1 (node) {
  85724. node.static = isStatic(node);
  85725. if (node.type === 1) {
  85726. // do not make component slot content static. this avoids
  85727. // 1. components not able to mutate slot nodes
  85728. // 2. static slot content fails for hot-reloading
  85729. if (
  85730. !isPlatformReservedTag(node.tag) &&
  85731. node.tag !== 'slot' &&
  85732. node.attrsMap['inline-template'] == null
  85733. ) {
  85734. return
  85735. }
  85736. for (var i = 0, l = node.children.length; i < l; i++) {
  85737. var child = node.children[i];
  85738. markStatic$1(child);
  85739. if (!child.static) {
  85740. node.static = false;
  85741. }
  85742. }
  85743. if (node.ifConditions) {
  85744. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  85745. var block = node.ifConditions[i$1].block;
  85746. markStatic$1(block);
  85747. if (!block.static) {
  85748. node.static = false;
  85749. }
  85750. }
  85751. }
  85752. }
  85753. }
  85754. function markStaticRoots (node, isInFor) {
  85755. if (node.type === 1) {
  85756. if (node.static || node.once) {
  85757. node.staticInFor = isInFor;
  85758. }
  85759. // For a node to qualify as a static root, it should have children that
  85760. // are not just static text. Otherwise the cost of hoisting out will
  85761. // outweigh the benefits and it's better off to just always render it fresh.
  85762. if (node.static && node.children.length && !(
  85763. node.children.length === 1 &&
  85764. node.children[0].type === 3
  85765. )) {
  85766. node.staticRoot = true;
  85767. return
  85768. } else {
  85769. node.staticRoot = false;
  85770. }
  85771. if (node.children) {
  85772. for (var i = 0, l = node.children.length; i < l; i++) {
  85773. markStaticRoots(node.children[i], isInFor || !!node.for);
  85774. }
  85775. }
  85776. if (node.ifConditions) {
  85777. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  85778. markStaticRoots(node.ifConditions[i$1].block, isInFor);
  85779. }
  85780. }
  85781. }
  85782. }
  85783. function isStatic (node) {
  85784. if (node.type === 2) { // expression
  85785. return false
  85786. }
  85787. if (node.type === 3) { // text
  85788. return true
  85789. }
  85790. return !!(node.pre || (
  85791. !node.hasBindings && // no dynamic bindings
  85792. !node.if && !node.for && // not v-if or v-for or v-else
  85793. !isBuiltInTag(node.tag) && // not a built-in
  85794. isPlatformReservedTag(node.tag) && // not a component
  85795. !isDirectChildOfTemplateFor(node) &&
  85796. Object.keys(node).every(isStaticKey)
  85797. ))
  85798. }
  85799. function isDirectChildOfTemplateFor (node) {
  85800. while (node.parent) {
  85801. node = node.parent;
  85802. if (node.tag !== 'template') {
  85803. return false
  85804. }
  85805. if (node.for) {
  85806. return true
  85807. }
  85808. }
  85809. return false
  85810. }
  85811. /* */
  85812. var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
  85813. var fnInvokeRE = /\([^)]*?\);*$/;
  85814. var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  85815. // KeyboardEvent.keyCode aliases
  85816. var keyCodes = {
  85817. esc: 27,
  85818. tab: 9,
  85819. enter: 13,
  85820. space: 32,
  85821. up: 38,
  85822. left: 37,
  85823. right: 39,
  85824. down: 40,
  85825. 'delete': [8, 46]
  85826. };
  85827. // KeyboardEvent.key aliases
  85828. var keyNames = {
  85829. // #7880: IE11 and Edge use `Esc` for Escape key name.
  85830. esc: ['Esc', 'Escape'],
  85831. tab: 'Tab',
  85832. enter: 'Enter',
  85833. // #9112: IE11 uses `Spacebar` for Space key name.
  85834. space: [' ', 'Spacebar'],
  85835. // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
  85836. up: ['Up', 'ArrowUp'],
  85837. left: ['Left', 'ArrowLeft'],
  85838. right: ['Right', 'ArrowRight'],
  85839. down: ['Down', 'ArrowDown'],
  85840. // #9112: IE11 uses `Del` for Delete key name.
  85841. 'delete': ['Backspace', 'Delete', 'Del']
  85842. };
  85843. // #4868: modifiers that prevent the execution of the listener
  85844. // need to explicitly return null so that we can determine whether to remove
  85845. // the listener for .once
  85846. var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
  85847. var modifierCode = {
  85848. stop: '$event.stopPropagation();',
  85849. prevent: '$event.preventDefault();',
  85850. self: genGuard("$event.target !== $event.currentTarget"),
  85851. ctrl: genGuard("!$event.ctrlKey"),
  85852. shift: genGuard("!$event.shiftKey"),
  85853. alt: genGuard("!$event.altKey"),
  85854. meta: genGuard("!$event.metaKey"),
  85855. left: genGuard("'button' in $event && $event.button !== 0"),
  85856. middle: genGuard("'button' in $event && $event.button !== 1"),
  85857. right: genGuard("'button' in $event && $event.button !== 2")
  85858. };
  85859. function genHandlers (
  85860. events,
  85861. isNative
  85862. ) {
  85863. var prefix = isNative ? 'nativeOn:' : 'on:';
  85864. var staticHandlers = "";
  85865. var dynamicHandlers = "";
  85866. for (var name in events) {
  85867. var handlerCode = genHandler(events[name]);
  85868. if (events[name] && events[name].dynamic) {
  85869. dynamicHandlers += name + "," + handlerCode + ",";
  85870. } else {
  85871. staticHandlers += "\"" + name + "\":" + handlerCode + ",";
  85872. }
  85873. }
  85874. staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
  85875. if (dynamicHandlers) {
  85876. return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
  85877. } else {
  85878. return prefix + staticHandlers
  85879. }
  85880. }
  85881. function genHandler (handler) {
  85882. if (!handler) {
  85883. return 'function(){}'
  85884. }
  85885. if (Array.isArray(handler)) {
  85886. return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
  85887. }
  85888. var isMethodPath = simplePathRE.test(handler.value);
  85889. var isFunctionExpression = fnExpRE.test(handler.value);
  85890. var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
  85891. if (!handler.modifiers) {
  85892. if (isMethodPath || isFunctionExpression) {
  85893. return handler.value
  85894. }
  85895. return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
  85896. } else {
  85897. var code = '';
  85898. var genModifierCode = '';
  85899. var keys = [];
  85900. for (var key in handler.modifiers) {
  85901. if (modifierCode[key]) {
  85902. genModifierCode += modifierCode[key];
  85903. // left/right
  85904. if (keyCodes[key]) {
  85905. keys.push(key);
  85906. }
  85907. } else if (key === 'exact') {
  85908. var modifiers = (handler.modifiers);
  85909. genModifierCode += genGuard(
  85910. ['ctrl', 'shift', 'alt', 'meta']
  85911. .filter(function (keyModifier) { return !modifiers[keyModifier]; })
  85912. .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
  85913. .join('||')
  85914. );
  85915. } else {
  85916. keys.push(key);
  85917. }
  85918. }
  85919. if (keys.length) {
  85920. code += genKeyFilter(keys);
  85921. }
  85922. // Make sure modifiers like prevent and stop get executed after key filtering
  85923. if (genModifierCode) {
  85924. code += genModifierCode;
  85925. }
  85926. var handlerCode = isMethodPath
  85927. ? ("return " + (handler.value) + "($event)")
  85928. : isFunctionExpression
  85929. ? ("return (" + (handler.value) + ")($event)")
  85930. : isFunctionInvocation
  85931. ? ("return " + (handler.value))
  85932. : handler.value;
  85933. return ("function($event){" + code + handlerCode + "}")
  85934. }
  85935. }
  85936. function genKeyFilter (keys) {
  85937. return (
  85938. // make sure the key filters only apply to KeyboardEvents
  85939. // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
  85940. // key events that do not have keyCode property...
  85941. "if(!$event.type.indexOf('key')&&" +
  85942. (keys.map(genFilterCode).join('&&')) + ")return null;"
  85943. )
  85944. }
  85945. function genFilterCode (key) {
  85946. var keyVal = parseInt(key, 10);
  85947. if (keyVal) {
  85948. return ("$event.keyCode!==" + keyVal)
  85949. }
  85950. var keyCode = keyCodes[key];
  85951. var keyName = keyNames[key];
  85952. return (
  85953. "_k($event.keyCode," +
  85954. (JSON.stringify(key)) + "," +
  85955. (JSON.stringify(keyCode)) + "," +
  85956. "$event.key," +
  85957. "" + (JSON.stringify(keyName)) +
  85958. ")"
  85959. )
  85960. }
  85961. /* */
  85962. function on (el, dir) {
  85963. if (dir.modifiers) {
  85964. warn("v-on without argument does not support modifiers.");
  85965. }
  85966. el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
  85967. }
  85968. /* */
  85969. function bind$1 (el, dir) {
  85970. el.wrapData = function (code) {
  85971. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
  85972. };
  85973. }
  85974. /* */
  85975. var baseDirectives = {
  85976. on: on,
  85977. bind: bind$1,
  85978. cloak: noop
  85979. };
  85980. /* */
  85981. var CodegenState = function CodegenState (options) {
  85982. this.options = options;
  85983. this.warn = options.warn || baseWarn;
  85984. this.transforms = pluckModuleFunction(options.modules, 'transformCode');
  85985. this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
  85986. this.directives = extend(extend({}, baseDirectives), options.directives);
  85987. var isReservedTag = options.isReservedTag || no;
  85988. this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  85989. this.onceId = 0;
  85990. this.staticRenderFns = [];
  85991. this.pre = false;
  85992. };
  85993. function generate (
  85994. ast,
  85995. options
  85996. ) {
  85997. var state = new CodegenState(options);
  85998. var code = ast ? genElement(ast, state) : '_c("div")';
  85999. return {
  86000. render: ("with(this){return " + code + "}"),
  86001. staticRenderFns: state.staticRenderFns
  86002. }
  86003. }
  86004. function genElement (el, state) {
  86005. if (el.parent) {
  86006. el.pre = el.pre || el.parent.pre;
  86007. }
  86008. if (el.staticRoot && !el.staticProcessed) {
  86009. return genStatic(el, state)
  86010. } else if (el.once && !el.onceProcessed) {
  86011. return genOnce(el, state)
  86012. } else if (el.for && !el.forProcessed) {
  86013. return genFor(el, state)
  86014. } else if (el.if && !el.ifProcessed) {
  86015. return genIf(el, state)
  86016. } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
  86017. return genChildren(el, state) || 'void 0'
  86018. } else if (el.tag === 'slot') {
  86019. return genSlot(el, state)
  86020. } else {
  86021. // component or element
  86022. var code;
  86023. if (el.component) {
  86024. code = genComponent(el.component, el, state);
  86025. } else {
  86026. var data;
  86027. if (!el.plain || (el.pre && state.maybeComponent(el))) {
  86028. data = genData$2(el, state);
  86029. }
  86030. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  86031. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  86032. }
  86033. // module transforms
  86034. for (var i = 0; i < state.transforms.length; i++) {
  86035. code = state.transforms[i](el, code);
  86036. }
  86037. return code
  86038. }
  86039. }
  86040. // hoist static sub-trees out
  86041. function genStatic (el, state) {
  86042. el.staticProcessed = true;
  86043. // Some elements (templates) need to behave differently inside of a v-pre
  86044. // node. All pre nodes are static roots, so we can use this as a location to
  86045. // wrap a state change and reset it upon exiting the pre node.
  86046. var originalPreState = state.pre;
  86047. if (el.pre) {
  86048. state.pre = el.pre;
  86049. }
  86050. state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
  86051. state.pre = originalPreState;
  86052. return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  86053. }
  86054. // v-once
  86055. function genOnce (el, state) {
  86056. el.onceProcessed = true;
  86057. if (el.if && !el.ifProcessed) {
  86058. return genIf(el, state)
  86059. } else if (el.staticInFor) {
  86060. var key = '';
  86061. var parent = el.parent;
  86062. while (parent) {
  86063. if (parent.for) {
  86064. key = parent.key;
  86065. break
  86066. }
  86067. parent = parent.parent;
  86068. }
  86069. if (!key) {
  86070. state.warn(
  86071. "v-once can only be used inside v-for that is keyed. ",
  86072. el.rawAttrsMap['v-once']
  86073. );
  86074. return genElement(el, state)
  86075. }
  86076. return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
  86077. } else {
  86078. return genStatic(el, state)
  86079. }
  86080. }
  86081. function genIf (
  86082. el,
  86083. state,
  86084. altGen,
  86085. altEmpty
  86086. ) {
  86087. el.ifProcessed = true; // avoid recursion
  86088. return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
  86089. }
  86090. function genIfConditions (
  86091. conditions,
  86092. state,
  86093. altGen,
  86094. altEmpty
  86095. ) {
  86096. if (!conditions.length) {
  86097. return altEmpty || '_e()'
  86098. }
  86099. var condition = conditions.shift();
  86100. if (condition.exp) {
  86101. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
  86102. } else {
  86103. return ("" + (genTernaryExp(condition.block)))
  86104. }
  86105. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  86106. function genTernaryExp (el) {
  86107. return altGen
  86108. ? altGen(el, state)
  86109. : el.once
  86110. ? genOnce(el, state)
  86111. : genElement(el, state)
  86112. }
  86113. }
  86114. function genFor (
  86115. el,
  86116. state,
  86117. altGen,
  86118. altHelper
  86119. ) {
  86120. var exp = el.for;
  86121. var alias = el.alias;
  86122. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  86123. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  86124. if (state.maybeComponent(el) &&
  86125. el.tag !== 'slot' &&
  86126. el.tag !== 'template' &&
  86127. !el.key
  86128. ) {
  86129. state.warn(
  86130. "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
  86131. "v-for should have explicit keys. " +
  86132. "See https://vuejs.org/guide/list.html#key for more info.",
  86133. el.rawAttrsMap['v-for'],
  86134. true /* tip */
  86135. );
  86136. }
  86137. el.forProcessed = true; // avoid recursion
  86138. return (altHelper || '_l') + "((" + exp + ")," +
  86139. "function(" + alias + iterator1 + iterator2 + "){" +
  86140. "return " + ((altGen || genElement)(el, state)) +
  86141. '})'
  86142. }
  86143. function genData$2 (el, state) {
  86144. var data = '{';
  86145. // directives first.
  86146. // directives may mutate the el's other properties before they are generated.
  86147. var dirs = genDirectives(el, state);
  86148. if (dirs) { data += dirs + ','; }
  86149. // key
  86150. if (el.key) {
  86151. data += "key:" + (el.key) + ",";
  86152. }
  86153. // ref
  86154. if (el.ref) {
  86155. data += "ref:" + (el.ref) + ",";
  86156. }
  86157. if (el.refInFor) {
  86158. data += "refInFor:true,";
  86159. }
  86160. // pre
  86161. if (el.pre) {
  86162. data += "pre:true,";
  86163. }
  86164. // record original tag name for components using "is" attribute
  86165. if (el.component) {
  86166. data += "tag:\"" + (el.tag) + "\",";
  86167. }
  86168. // module data generation functions
  86169. for (var i = 0; i < state.dataGenFns.length; i++) {
  86170. data += state.dataGenFns[i](el);
  86171. }
  86172. // attributes
  86173. if (el.attrs) {
  86174. data += "attrs:" + (genProps(el.attrs)) + ",";
  86175. }
  86176. // DOM props
  86177. if (el.props) {
  86178. data += "domProps:" + (genProps(el.props)) + ",";
  86179. }
  86180. // event handlers
  86181. if (el.events) {
  86182. data += (genHandlers(el.events, false)) + ",";
  86183. }
  86184. if (el.nativeEvents) {
  86185. data += (genHandlers(el.nativeEvents, true)) + ",";
  86186. }
  86187. // slot target
  86188. // only for non-scoped slots
  86189. if (el.slotTarget && !el.slotScope) {
  86190. data += "slot:" + (el.slotTarget) + ",";
  86191. }
  86192. // scoped slots
  86193. if (el.scopedSlots) {
  86194. data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
  86195. }
  86196. // component v-model
  86197. if (el.model) {
  86198. data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
  86199. }
  86200. // inline-template
  86201. if (el.inlineTemplate) {
  86202. var inlineTemplate = genInlineTemplate(el, state);
  86203. if (inlineTemplate) {
  86204. data += inlineTemplate + ",";
  86205. }
  86206. }
  86207. data = data.replace(/,$/, '') + '}';
  86208. // v-bind dynamic argument wrap
  86209. // v-bind with dynamic arguments must be applied using the same v-bind object
  86210. // merge helper so that class/style/mustUseProp attrs are handled correctly.
  86211. if (el.dynamicAttrs) {
  86212. data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
  86213. }
  86214. // v-bind data wrap
  86215. if (el.wrapData) {
  86216. data = el.wrapData(data);
  86217. }
  86218. // v-on data wrap
  86219. if (el.wrapListeners) {
  86220. data = el.wrapListeners(data);
  86221. }
  86222. return data
  86223. }
  86224. function genDirectives (el, state) {
  86225. var dirs = el.directives;
  86226. if (!dirs) { return }
  86227. var res = 'directives:[';
  86228. var hasRuntime = false;
  86229. var i, l, dir, needRuntime;
  86230. for (i = 0, l = dirs.length; i < l; i++) {
  86231. dir = dirs[i];
  86232. needRuntime = true;
  86233. var gen = state.directives[dir.name];
  86234. if (gen) {
  86235. // compile-time directive that manipulates AST.
  86236. // returns true if it also needs a runtime counterpart.
  86237. needRuntime = !!gen(el, dir, state.warn);
  86238. }
  86239. if (needRuntime) {
  86240. hasRuntime = true;
  86241. res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
  86242. }
  86243. }
  86244. if (hasRuntime) {
  86245. return res.slice(0, -1) + ']'
  86246. }
  86247. }
  86248. function genInlineTemplate (el, state) {
  86249. var ast = el.children[0];
  86250. if (el.children.length !== 1 || ast.type !== 1) {
  86251. state.warn(
  86252. 'Inline-template components must have exactly one child element.',
  86253. { start: el.start }
  86254. );
  86255. }
  86256. if (ast && ast.type === 1) {
  86257. var inlineRenderFns = generate(ast, state.options);
  86258. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  86259. }
  86260. }
  86261. function genScopedSlots (
  86262. el,
  86263. slots,
  86264. state
  86265. ) {
  86266. // by default scoped slots are considered "stable", this allows child
  86267. // components with only scoped slots to skip forced updates from parent.
  86268. // but in some cases we have to bail-out of this optimization
  86269. // for example if the slot contains dynamic names, has v-if or v-for on them...
  86270. var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
  86271. var slot = slots[key];
  86272. return (
  86273. slot.slotTargetDynamic ||
  86274. slot.if ||
  86275. slot.for ||
  86276. containsSlotChild(slot) // is passing down slot from parent which may be dynamic
  86277. )
  86278. });
  86279. // #9534: if a component with scoped slots is inside a conditional branch,
  86280. // it's possible for the same component to be reused but with different
  86281. // compiled slot content. To avoid that, we generate a unique key based on
  86282. // the generated code of all the slot contents.
  86283. var needsKey = !!el.if;
  86284. // OR when it is inside another scoped slot or v-for (the reactivity may be
  86285. // disconnected due to the intermediate scope variable)
  86286. // #9438, #9506
  86287. // TODO: this can be further optimized by properly analyzing in-scope bindings
  86288. // and skip force updating ones that do not actually use scope variables.
  86289. if (!needsForceUpdate) {
  86290. var parent = el.parent;
  86291. while (parent) {
  86292. if (
  86293. (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
  86294. parent.for
  86295. ) {
  86296. needsForceUpdate = true;
  86297. break
  86298. }
  86299. if (parent.if) {
  86300. needsKey = true;
  86301. }
  86302. parent = parent.parent;
  86303. }
  86304. }
  86305. var generatedSlots = Object.keys(slots)
  86306. .map(function (key) { return genScopedSlot(slots[key], state); })
  86307. .join(',');
  86308. return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
  86309. }
  86310. function hash(str) {
  86311. var hash = 5381;
  86312. var i = str.length;
  86313. while(i) {
  86314. hash = (hash * 33) ^ str.charCodeAt(--i);
  86315. }
  86316. return hash >>> 0
  86317. }
  86318. function containsSlotChild (el) {
  86319. if (el.type === 1) {
  86320. if (el.tag === 'slot') {
  86321. return true
  86322. }
  86323. return el.children.some(containsSlotChild)
  86324. }
  86325. return false
  86326. }
  86327. function genScopedSlot (
  86328. el,
  86329. state
  86330. ) {
  86331. var isLegacySyntax = el.attrsMap['slot-scope'];
  86332. if (el.if && !el.ifProcessed && !isLegacySyntax) {
  86333. return genIf(el, state, genScopedSlot, "null")
  86334. }
  86335. if (el.for && !el.forProcessed) {
  86336. return genFor(el, state, genScopedSlot)
  86337. }
  86338. var slotScope = el.slotScope === emptySlotScopeToken
  86339. ? ""
  86340. : String(el.slotScope);
  86341. var fn = "function(" + slotScope + "){" +
  86342. "return " + (el.tag === 'template'
  86343. ? el.if && isLegacySyntax
  86344. ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
  86345. : genChildren(el, state) || 'undefined'
  86346. : genElement(el, state)) + "}";
  86347. // reverse proxy v-slot without scope on this.$slots
  86348. var reverseProxy = slotScope ? "" : ",proxy:true";
  86349. return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
  86350. }
  86351. function genChildren (
  86352. el,
  86353. state,
  86354. checkSkip,
  86355. altGenElement,
  86356. altGenNode
  86357. ) {
  86358. var children = el.children;
  86359. if (children.length) {
  86360. var el$1 = children[0];
  86361. // optimize single v-for
  86362. if (children.length === 1 &&
  86363. el$1.for &&
  86364. el$1.tag !== 'template' &&
  86365. el$1.tag !== 'slot'
  86366. ) {
  86367. var normalizationType = checkSkip
  86368. ? state.maybeComponent(el$1) ? ",1" : ",0"
  86369. : "";
  86370. return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
  86371. }
  86372. var normalizationType$1 = checkSkip
  86373. ? getNormalizationType(children, state.maybeComponent)
  86374. : 0;
  86375. var gen = altGenNode || genNode;
  86376. return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
  86377. }
  86378. }
  86379. // determine the normalization needed for the children array.
  86380. // 0: no normalization needed
  86381. // 1: simple normalization needed (possible 1-level deep nested array)
  86382. // 2: full normalization needed
  86383. function getNormalizationType (
  86384. children,
  86385. maybeComponent
  86386. ) {
  86387. var res = 0;
  86388. for (var i = 0; i < children.length; i++) {
  86389. var el = children[i];
  86390. if (el.type !== 1) {
  86391. continue
  86392. }
  86393. if (needsNormalization(el) ||
  86394. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  86395. res = 2;
  86396. break
  86397. }
  86398. if (maybeComponent(el) ||
  86399. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  86400. res = 1;
  86401. }
  86402. }
  86403. return res
  86404. }
  86405. function needsNormalization (el) {
  86406. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  86407. }
  86408. function genNode (node, state) {
  86409. if (node.type === 1) {
  86410. return genElement(node, state)
  86411. } else if (node.type === 3 && node.isComment) {
  86412. return genComment(node)
  86413. } else {
  86414. return genText(node)
  86415. }
  86416. }
  86417. function genText (text) {
  86418. return ("_v(" + (text.type === 2
  86419. ? text.expression // no need for () because already wrapped in _s()
  86420. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  86421. }
  86422. function genComment (comment) {
  86423. return ("_e(" + (JSON.stringify(comment.text)) + ")")
  86424. }
  86425. function genSlot (el, state) {
  86426. var slotName = el.slotName || '"default"';
  86427. var children = genChildren(el, state);
  86428. var res = "_t(" + slotName + (children ? ("," + children) : '');
  86429. var attrs = el.attrs || el.dynamicAttrs
  86430. ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
  86431. // slot props are camelized
  86432. name: camelize(attr.name),
  86433. value: attr.value,
  86434. dynamic: attr.dynamic
  86435. }); }))
  86436. : null;
  86437. var bind$$1 = el.attrsMap['v-bind'];
  86438. if ((attrs || bind$$1) && !children) {
  86439. res += ",null";
  86440. }
  86441. if (attrs) {
  86442. res += "," + attrs;
  86443. }
  86444. if (bind$$1) {
  86445. res += (attrs ? '' : ',null') + "," + bind$$1;
  86446. }
  86447. return res + ')'
  86448. }
  86449. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  86450. function genComponent (
  86451. componentName,
  86452. el,
  86453. state
  86454. ) {
  86455. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  86456. return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
  86457. }
  86458. function genProps (props) {
  86459. var staticProps = "";
  86460. var dynamicProps = "";
  86461. for (var i = 0; i < props.length; i++) {
  86462. var prop = props[i];
  86463. var value = transformSpecialNewlines(prop.value);
  86464. if (prop.dynamic) {
  86465. dynamicProps += (prop.name) + "," + value + ",";
  86466. } else {
  86467. staticProps += "\"" + (prop.name) + "\":" + value + ",";
  86468. }
  86469. }
  86470. staticProps = "{" + (staticProps.slice(0, -1)) + "}";
  86471. if (dynamicProps) {
  86472. return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
  86473. } else {
  86474. return staticProps
  86475. }
  86476. }
  86477. // #3895, #4268
  86478. function transformSpecialNewlines (text) {
  86479. return text
  86480. .replace(/\u2028/g, '\\u2028')
  86481. .replace(/\u2029/g, '\\u2029')
  86482. }
  86483. /* */
  86484. // these keywords should not appear inside expressions, but operators like
  86485. // typeof, instanceof and in are allowed
  86486. var prohibitedKeywordRE = new RegExp('\\b' + (
  86487. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  86488. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  86489. 'extends,finally,continue,debugger,function,arguments'
  86490. ).split(',').join('\\b|\\b') + '\\b');
  86491. // these unary operators should not be used as property/method names
  86492. var unaryOperatorsRE = new RegExp('\\b' + (
  86493. 'delete,typeof,void'
  86494. ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
  86495. // strip strings in expressions
  86496. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  86497. // detect problematic expressions in a template
  86498. function detectErrors (ast, warn) {
  86499. if (ast) {
  86500. checkNode(ast, warn);
  86501. }
  86502. }
  86503. function checkNode (node, warn) {
  86504. if (node.type === 1) {
  86505. for (var name in node.attrsMap) {
  86506. if (dirRE.test(name)) {
  86507. var value = node.attrsMap[name];
  86508. if (value) {
  86509. var range = node.rawAttrsMap[name];
  86510. if (name === 'v-for') {
  86511. checkFor(node, ("v-for=\"" + value + "\""), warn, range);
  86512. } else if (name === 'v-slot' || name[0] === '#') {
  86513. checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
  86514. } else if (onRE.test(name)) {
  86515. checkEvent(value, (name + "=\"" + value + "\""), warn, range);
  86516. } else {
  86517. checkExpression(value, (name + "=\"" + value + "\""), warn, range);
  86518. }
  86519. }
  86520. }
  86521. }
  86522. if (node.children) {
  86523. for (var i = 0; i < node.children.length; i++) {
  86524. checkNode(node.children[i], warn);
  86525. }
  86526. }
  86527. } else if (node.type === 2) {
  86528. checkExpression(node.expression, node.text, warn, node);
  86529. }
  86530. }
  86531. function checkEvent (exp, text, warn, range) {
  86532. var stripped = exp.replace(stripStringRE, '');
  86533. var keywordMatch = stripped.match(unaryOperatorsRE);
  86534. if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
  86535. warn(
  86536. "avoid using JavaScript unary operator as property name: " +
  86537. "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
  86538. range
  86539. );
  86540. }
  86541. checkExpression(exp, text, warn, range);
  86542. }
  86543. function checkFor (node, text, warn, range) {
  86544. checkExpression(node.for || '', text, warn, range);
  86545. checkIdentifier(node.alias, 'v-for alias', text, warn, range);
  86546. checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
  86547. checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
  86548. }
  86549. function checkIdentifier (
  86550. ident,
  86551. type,
  86552. text,
  86553. warn,
  86554. range
  86555. ) {
  86556. if (typeof ident === 'string') {
  86557. try {
  86558. new Function(("var " + ident + "=_"));
  86559. } catch (e) {
  86560. warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
  86561. }
  86562. }
  86563. }
  86564. function checkExpression (exp, text, warn, range) {
  86565. try {
  86566. new Function(("return " + exp));
  86567. } catch (e) {
  86568. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  86569. if (keywordMatch) {
  86570. warn(
  86571. "avoid using JavaScript keyword as property name: " +
  86572. "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
  86573. range
  86574. );
  86575. } else {
  86576. warn(
  86577. "invalid expression: " + (e.message) + " in\n\n" +
  86578. " " + exp + "\n\n" +
  86579. " Raw expression: " + (text.trim()) + "\n",
  86580. range
  86581. );
  86582. }
  86583. }
  86584. }
  86585. function checkFunctionParameterExpression (exp, text, warn, range) {
  86586. try {
  86587. new Function(exp, '');
  86588. } catch (e) {
  86589. warn(
  86590. "invalid function parameter expression: " + (e.message) + " in\n\n" +
  86591. " " + exp + "\n\n" +
  86592. " Raw expression: " + (text.trim()) + "\n",
  86593. range
  86594. );
  86595. }
  86596. }
  86597. /* */
  86598. var range = 2;
  86599. function generateCodeFrame (
  86600. source,
  86601. start,
  86602. end
  86603. ) {
  86604. if ( start === void 0 ) start = 0;
  86605. if ( end === void 0 ) end = source.length;
  86606. var lines = source.split(/\r?\n/);
  86607. var count = 0;
  86608. var res = [];
  86609. for (var i = 0; i < lines.length; i++) {
  86610. count += lines[i].length + 1;
  86611. if (count >= start) {
  86612. for (var j = i - range; j <= i + range || end > count; j++) {
  86613. if (j < 0 || j >= lines.length) { continue }
  86614. res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
  86615. var lineLength = lines[j].length;
  86616. if (j === i) {
  86617. // push underline
  86618. var pad = start - (count - lineLength) + 1;
  86619. var length = end > count ? lineLength - pad : end - start;
  86620. res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
  86621. } else if (j > i) {
  86622. if (end > count) {
  86623. var length$1 = Math.min(end - count, lineLength);
  86624. res.push(" | " + repeat$1("^", length$1));
  86625. }
  86626. count += lineLength + 1;
  86627. }
  86628. }
  86629. break
  86630. }
  86631. }
  86632. return res.join('\n')
  86633. }
  86634. function repeat$1 (str, n) {
  86635. var result = '';
  86636. if (n > 0) {
  86637. while (true) { // eslint-disable-line
  86638. if (n & 1) { result += str; }
  86639. n >>>= 1;
  86640. if (n <= 0) { break }
  86641. str += str;
  86642. }
  86643. }
  86644. return result
  86645. }
  86646. /* */
  86647. function createFunction (code, errors) {
  86648. try {
  86649. return new Function(code)
  86650. } catch (err) {
  86651. errors.push({ err: err, code: code });
  86652. return noop
  86653. }
  86654. }
  86655. function createCompileToFunctionFn (compile) {
  86656. var cache = Object.create(null);
  86657. return function compileToFunctions (
  86658. template,
  86659. options,
  86660. vm
  86661. ) {
  86662. options = extend({}, options);
  86663. var warn$$1 = options.warn || warn;
  86664. delete options.warn;
  86665. /* istanbul ignore if */
  86666. {
  86667. // detect possible CSP restriction
  86668. try {
  86669. new Function('return 1');
  86670. } catch (e) {
  86671. if (e.toString().match(/unsafe-eval|CSP/)) {
  86672. warn$$1(
  86673. 'It seems you are using the standalone build of Vue.js in an ' +
  86674. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  86675. 'The template compiler cannot work in this environment. Consider ' +
  86676. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  86677. 'templates into render functions.'
  86678. );
  86679. }
  86680. }
  86681. }
  86682. // check cache
  86683. var key = options.delimiters
  86684. ? String(options.delimiters) + template
  86685. : template;
  86686. if (cache[key]) {
  86687. return cache[key]
  86688. }
  86689. // compile
  86690. var compiled = compile(template, options);
  86691. // check compilation errors/tips
  86692. {
  86693. if (compiled.errors && compiled.errors.length) {
  86694. if (options.outputSourceRange) {
  86695. compiled.errors.forEach(function (e) {
  86696. warn$$1(
  86697. "Error compiling template:\n\n" + (e.msg) + "\n\n" +
  86698. generateCodeFrame(template, e.start, e.end),
  86699. vm
  86700. );
  86701. });
  86702. } else {
  86703. warn$$1(
  86704. "Error compiling template:\n\n" + template + "\n\n" +
  86705. compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
  86706. vm
  86707. );
  86708. }
  86709. }
  86710. if (compiled.tips && compiled.tips.length) {
  86711. if (options.outputSourceRange) {
  86712. compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
  86713. } else {
  86714. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  86715. }
  86716. }
  86717. }
  86718. // turn code into functions
  86719. var res = {};
  86720. var fnGenErrors = [];
  86721. res.render = createFunction(compiled.render, fnGenErrors);
  86722. res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
  86723. return createFunction(code, fnGenErrors)
  86724. });
  86725. // check function generation errors.
  86726. // this should only happen if there is a bug in the compiler itself.
  86727. // mostly for codegen development use
  86728. /* istanbul ignore if */
  86729. {
  86730. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  86731. warn$$1(
  86732. "Failed to generate render function:\n\n" +
  86733. fnGenErrors.map(function (ref) {
  86734. var err = ref.err;
  86735. var code = ref.code;
  86736. return ((err.toString()) + " in\n\n" + code + "\n");
  86737. }).join('\n'),
  86738. vm
  86739. );
  86740. }
  86741. }
  86742. return (cache[key] = res)
  86743. }
  86744. }
  86745. /* */
  86746. function createCompilerCreator (baseCompile) {
  86747. return function createCompiler (baseOptions) {
  86748. function compile (
  86749. template,
  86750. options
  86751. ) {
  86752. var finalOptions = Object.create(baseOptions);
  86753. var errors = [];
  86754. var tips = [];
  86755. var warn = function (msg, range, tip) {
  86756. (tip ? tips : errors).push(msg);
  86757. };
  86758. if (options) {
  86759. if (options.outputSourceRange) {
  86760. // $flow-disable-line
  86761. var leadingSpaceLength = template.match(/^\s*/)[0].length;
  86762. warn = function (msg, range, tip) {
  86763. var data = { msg: msg };
  86764. if (range) {
  86765. if (range.start != null) {
  86766. data.start = range.start + leadingSpaceLength;
  86767. }
  86768. if (range.end != null) {
  86769. data.end = range.end + leadingSpaceLength;
  86770. }
  86771. }
  86772. (tip ? tips : errors).push(data);
  86773. };
  86774. }
  86775. // merge custom modules
  86776. if (options.modules) {
  86777. finalOptions.modules =
  86778. (baseOptions.modules || []).concat(options.modules);
  86779. }
  86780. // merge custom directives
  86781. if (options.directives) {
  86782. finalOptions.directives = extend(
  86783. Object.create(baseOptions.directives || null),
  86784. options.directives
  86785. );
  86786. }
  86787. // copy other options
  86788. for (var key in options) {
  86789. if (key !== 'modules' && key !== 'directives') {
  86790. finalOptions[key] = options[key];
  86791. }
  86792. }
  86793. }
  86794. finalOptions.warn = warn;
  86795. var compiled = baseCompile(template.trim(), finalOptions);
  86796. {
  86797. detectErrors(compiled.ast, warn);
  86798. }
  86799. compiled.errors = errors;
  86800. compiled.tips = tips;
  86801. return compiled
  86802. }
  86803. return {
  86804. compile: compile,
  86805. compileToFunctions: createCompileToFunctionFn(compile)
  86806. }
  86807. }
  86808. }
  86809. /* */
  86810. // `createCompilerCreator` allows creating compilers that use alternative
  86811. // parser/optimizer/codegen, e.g the SSR optimizing compiler.
  86812. // Here we just export a default compiler using the default parts.
  86813. var createCompiler = createCompilerCreator(function baseCompile (
  86814. template,
  86815. options
  86816. ) {
  86817. var ast = parse(template.trim(), options);
  86818. if (options.optimize !== false) {
  86819. optimize(ast, options);
  86820. }
  86821. var code = generate(ast, options);
  86822. return {
  86823. ast: ast,
  86824. render: code.render,
  86825. staticRenderFns: code.staticRenderFns
  86826. }
  86827. });
  86828. /* */
  86829. var ref$1 = createCompiler(baseOptions);
  86830. var compile = ref$1.compile;
  86831. var compileToFunctions = ref$1.compileToFunctions;
  86832. /* */
  86833. // check whether current browser encodes a char inside attribute values
  86834. var div;
  86835. function getShouldDecode (href) {
  86836. div = div || document.createElement('div');
  86837. div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
  86838. return div.innerHTML.indexOf('&#10;') > 0
  86839. }
  86840. // #3663: IE encodes newlines inside attribute values while other browsers don't
  86841. var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
  86842. // #6828: chrome encodes content in a[href]
  86843. var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
  86844. /* */
  86845. var idToTemplate = cached(function (id) {
  86846. var el = query(id);
  86847. return el && el.innerHTML
  86848. });
  86849. var mount = Vue.prototype.$mount;
  86850. Vue.prototype.$mount = function (
  86851. el,
  86852. hydrating
  86853. ) {
  86854. el = el && query(el);
  86855. /* istanbul ignore if */
  86856. if (el === document.body || el === document.documentElement) {
  86857. warn(
  86858. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  86859. );
  86860. return this
  86861. }
  86862. var options = this.$options;
  86863. // resolve template/el and convert to render function
  86864. if (!options.render) {
  86865. var template = options.template;
  86866. if (template) {
  86867. if (typeof template === 'string') {
  86868. if (template.charAt(0) === '#') {
  86869. template = idToTemplate(template);
  86870. /* istanbul ignore if */
  86871. if (!template) {
  86872. warn(
  86873. ("Template element not found or is empty: " + (options.template)),
  86874. this
  86875. );
  86876. }
  86877. }
  86878. } else if (template.nodeType) {
  86879. template = template.innerHTML;
  86880. } else {
  86881. {
  86882. warn('invalid template option:' + template, this);
  86883. }
  86884. return this
  86885. }
  86886. } else if (el) {
  86887. template = getOuterHTML(el);
  86888. }
  86889. if (template) {
  86890. /* istanbul ignore if */
  86891. if (config.performance && mark) {
  86892. mark('compile');
  86893. }
  86894. var ref = compileToFunctions(template, {
  86895. outputSourceRange: "development" !== 'production',
  86896. shouldDecodeNewlines: shouldDecodeNewlines,
  86897. shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
  86898. delimiters: options.delimiters,
  86899. comments: options.comments
  86900. }, this);
  86901. var render = ref.render;
  86902. var staticRenderFns = ref.staticRenderFns;
  86903. options.render = render;
  86904. options.staticRenderFns = staticRenderFns;
  86905. /* istanbul ignore if */
  86906. if (config.performance && mark) {
  86907. mark('compile end');
  86908. measure(("vue " + (this._name) + " compile"), 'compile', 'compile end');
  86909. }
  86910. }
  86911. }
  86912. return mount.call(this, el, hydrating)
  86913. };
  86914. /**
  86915. * Get outerHTML of elements, taking care
  86916. * of SVG elements in IE as well.
  86917. */
  86918. function getOuterHTML (el) {
  86919. if (el.outerHTML) {
  86920. return el.outerHTML
  86921. } else {
  86922. var container = document.createElement('div');
  86923. container.appendChild(el.cloneNode(true));
  86924. return container.innerHTML
  86925. }
  86926. }
  86927. Vue.compile = compileToFunctions;
  86928. module.exports = Vue;
  86929. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").setImmediate))
  86930. /***/ }),
  86931. /***/ "./node_modules/vue/dist/vue.common.js":
  86932. /*!*********************************************!*\
  86933. !*** ./node_modules/vue/dist/vue.common.js ***!
  86934. \*********************************************/
  86935. /*! no static exports found */
  86936. /*! all exports used */
  86937. /***/ (function(module, exports, __webpack_require__) {
  86938. if (false) {} else {
  86939. module.exports = __webpack_require__(/*! ./vue.common.dev.js */ "./node_modules/vue/dist/vue.common.dev.js")
  86940. }
  86941. /***/ }),
  86942. /***/ "./node_modules/vuetify/dist/vuetify.js":
  86943. /*!**********************************************!*\
  86944. !*** ./node_modules/vuetify/dist/vuetify.js ***!
  86945. \**********************************************/
  86946. /*! no static exports found */
  86947. /*! exports used: default */
  86948. /***/ (function(module, exports, __webpack_require__) {
  86949. (function webpackUniversalModuleDefinition(root, factory) {
  86950. if(true)
  86951. module.exports = factory(__webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js"));
  86952. else {}
  86953. })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_vue__) {
  86954. return /******/ (function(modules) { // webpackBootstrap
  86955. /******/ // The module cache
  86956. /******/ var installedModules = {};
  86957. /******/
  86958. /******/ // The require function
  86959. /******/ function __webpack_require__(moduleId) {
  86960. /******/
  86961. /******/ // Check if module is in cache
  86962. /******/ if(installedModules[moduleId]) {
  86963. /******/ return installedModules[moduleId].exports;
  86964. /******/ }
  86965. /******/ // Create a new module (and put it into the cache)
  86966. /******/ var module = installedModules[moduleId] = {
  86967. /******/ i: moduleId,
  86968. /******/ l: false,
  86969. /******/ exports: {}
  86970. /******/ };
  86971. /******/
  86972. /******/ // Execute the module function
  86973. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  86974. /******/
  86975. /******/ // Flag the module as loaded
  86976. /******/ module.l = true;
  86977. /******/
  86978. /******/ // Return the exports of the module
  86979. /******/ return module.exports;
  86980. /******/ }
  86981. /******/
  86982. /******/
  86983. /******/ // expose the modules object (__webpack_modules__)
  86984. /******/ __webpack_require__.m = modules;
  86985. /******/
  86986. /******/ // expose the module cache
  86987. /******/ __webpack_require__.c = installedModules;
  86988. /******/
  86989. /******/ // define getter function for harmony exports
  86990. /******/ __webpack_require__.d = function(exports, name, getter) {
  86991. /******/ if(!__webpack_require__.o(exports, name)) {
  86992. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  86993. /******/ }
  86994. /******/ };
  86995. /******/
  86996. /******/ // define __esModule on exports
  86997. /******/ __webpack_require__.r = function(exports) {
  86998. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  86999. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  87000. /******/ }
  87001. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  87002. /******/ };
  87003. /******/
  87004. /******/ // create a fake namespace object
  87005. /******/ // mode & 1: value is a module id, require it
  87006. /******/ // mode & 2: merge all properties of value into the ns
  87007. /******/ // mode & 4: return value when already ns object
  87008. /******/ // mode & 8|1: behave like require
  87009. /******/ __webpack_require__.t = function(value, mode) {
  87010. /******/ if(mode & 1) value = __webpack_require__(value);
  87011. /******/ if(mode & 8) return value;
  87012. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  87013. /******/ var ns = Object.create(null);
  87014. /******/ __webpack_require__.r(ns);
  87015. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  87016. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  87017. /******/ return ns;
  87018. /******/ };
  87019. /******/
  87020. /******/ // getDefaultExport function for compatibility with non-harmony modules
  87021. /******/ __webpack_require__.n = function(module) {
  87022. /******/ var getter = module && module.__esModule ?
  87023. /******/ function getDefault() { return module['default']; } :
  87024. /******/ function getModuleExports() { return module; };
  87025. /******/ __webpack_require__.d(getter, 'a', getter);
  87026. /******/ return getter;
  87027. /******/ };
  87028. /******/
  87029. /******/ // Object.prototype.hasOwnProperty.call
  87030. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  87031. /******/
  87032. /******/ // __webpack_public_path__
  87033. /******/ __webpack_require__.p = "/dist/";
  87034. /******/
  87035. /******/
  87036. /******/ // Load entry module and return exports
  87037. /******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
  87038. /******/ })
  87039. /************************************************************************/
  87040. /******/ ({
  87041. /***/ "./src/components/VAlert/VAlert.sass":
  87042. /*!*******************************************!*\
  87043. !*** ./src/components/VAlert/VAlert.sass ***!
  87044. \*******************************************/
  87045. /*! no static exports found */
  87046. /***/ (function(module, exports, __webpack_require__) {
  87047. // extracted by mini-css-extract-plugin
  87048. /***/ }),
  87049. /***/ "./src/components/VAlert/VAlert.ts":
  87050. /*!*****************************************!*\
  87051. !*** ./src/components/VAlert/VAlert.ts ***!
  87052. \*****************************************/
  87053. /*! exports provided: default */
  87054. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87055. "use strict";
  87056. __webpack_require__.r(__webpack_exports__);
  87057. /* harmony import */ var _VAlert_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAlert.sass */ "./src/components/VAlert/VAlert.sass");
  87058. /* harmony import */ var _VAlert_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VAlert_sass__WEBPACK_IMPORTED_MODULE_0__);
  87059. /* harmony import */ var _VSheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSheet */ "./src/components/VSheet/index.ts");
  87060. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  87061. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  87062. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  87063. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  87064. /* harmony import */ var _mixins_transitionable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/transitionable */ "./src/mixins/transitionable/index.ts");
  87065. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  87066. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  87067. var __assign = undefined && undefined.__assign || function () {
  87068. __assign = Object.assign || function (t) {
  87069. for (var s, i = 1, n = arguments.length; i < n; i++) {
  87070. s = arguments[i];
  87071. for (var p in s) {
  87072. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  87073. }
  87074. }
  87075. return t;
  87076. };
  87077. return __assign.apply(this, arguments);
  87078. }; // Styles
  87079. // Extensions
  87080. // Components
  87081. // Mixins
  87082. // Utilities
  87083. /* @vue/component */
  87084. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_7__["default"])(_VSheet__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_transitionable__WEBPACK_IMPORTED_MODULE_6__["default"]).extend({
  87085. name: 'v-alert',
  87086. props: {
  87087. border: {
  87088. type: String,
  87089. validator: function validator(val) {
  87090. return ['top', 'right', 'bottom', 'left'].includes(val);
  87091. }
  87092. },
  87093. closeLabel: {
  87094. type: String,
  87095. default: '$vuetify.close'
  87096. },
  87097. coloredBorder: Boolean,
  87098. dense: Boolean,
  87099. dismissible: Boolean,
  87100. icon: {
  87101. default: '',
  87102. type: [Boolean, String],
  87103. validator: function validator(val) {
  87104. return typeof val === 'string' || val === false;
  87105. }
  87106. },
  87107. outlined: Boolean,
  87108. prominent: Boolean,
  87109. text: Boolean,
  87110. type: {
  87111. type: String,
  87112. validator: function validator(val) {
  87113. return ['info', 'error', 'success', 'warning'].includes(val);
  87114. }
  87115. },
  87116. value: {
  87117. type: Boolean,
  87118. default: true
  87119. }
  87120. },
  87121. computed: {
  87122. __cachedBorder: function __cachedBorder() {
  87123. var _a;
  87124. if (!this.border) return null;
  87125. var data = {
  87126. staticClass: 'v-alert__border',
  87127. class: (_a = {}, _a["v-alert__border--" + this.border] = true, _a)
  87128. };
  87129. if (this.coloredBorder) {
  87130. data = this.setBackgroundColor(this.computedColor, data);
  87131. data.class['v-alert__border--has-color'] = true;
  87132. }
  87133. return this.$createElement('div', data);
  87134. },
  87135. __cachedDismissible: function __cachedDismissible() {
  87136. var _this = this;
  87137. if (!this.dismissible) return null;
  87138. var color = this.iconColor;
  87139. return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_2__["default"], {
  87140. staticClass: 'v-alert__dismissible',
  87141. props: {
  87142. color: color,
  87143. icon: true,
  87144. small: true
  87145. },
  87146. attrs: {
  87147. 'aria-label': this.$vuetify.lang.t(this.closeLabel)
  87148. },
  87149. on: {
  87150. click: function click() {
  87151. return _this.isActive = false;
  87152. }
  87153. }
  87154. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_3__["default"], {
  87155. props: {
  87156. color: color
  87157. }
  87158. }, '$cancel')]);
  87159. },
  87160. __cachedIcon: function __cachedIcon() {
  87161. if (!this.computedIcon) return null;
  87162. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_3__["default"], {
  87163. staticClass: 'v-alert__icon',
  87164. props: {
  87165. color: this.iconColor
  87166. }
  87167. }, this.computedIcon);
  87168. },
  87169. classes: function classes() {
  87170. var classes = __assign({}, _VSheet__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  87171. 'v-alert--border': Boolean(this.border),
  87172. 'v-alert--dense': this.dense,
  87173. 'v-alert--outlined': this.outlined,
  87174. 'v-alert--prominent': this.prominent,
  87175. 'v-alert--text': this.text
  87176. });
  87177. if (this.border) {
  87178. classes["v-alert--border-" + this.border] = true;
  87179. }
  87180. return classes;
  87181. },
  87182. computedColor: function computedColor() {
  87183. return this.color || this.type;
  87184. },
  87185. computedIcon: function computedIcon() {
  87186. if (this.icon === false) return false;
  87187. if (typeof this.icon === 'string' && this.icon) return this.icon;
  87188. if (!['error', 'info', 'success', 'warning'].includes(this.type)) return false;
  87189. return "$" + this.type;
  87190. },
  87191. hasColoredIcon: function hasColoredIcon() {
  87192. return this.hasText || Boolean(this.border) && this.coloredBorder;
  87193. },
  87194. hasText: function hasText() {
  87195. return this.text || this.outlined;
  87196. },
  87197. iconColor: function iconColor() {
  87198. return this.hasColoredIcon ? this.computedColor : undefined;
  87199. },
  87200. isDark: function isDark() {
  87201. if (this.type && !this.coloredBorder && !this.outlined) return true;
  87202. return _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__["default"].options.computed.isDark.call(this);
  87203. }
  87204. },
  87205. created: function created() {
  87206. /* istanbul ignore next */
  87207. if (this.$attrs.hasOwnProperty('outline')) {
  87208. Object(_util_console__WEBPACK_IMPORTED_MODULE_8__["breaking"])('outline', 'outlined', this);
  87209. }
  87210. },
  87211. methods: {
  87212. genWrapper: function genWrapper() {
  87213. var children = [this.$slots.prepend || this.__cachedIcon, this.genContent(), this.__cachedBorder, this.$slots.append, this.$scopedSlots.close ? this.$scopedSlots.close({
  87214. toggle: this.toggle
  87215. }) : this.__cachedDismissible];
  87216. var data = {
  87217. staticClass: 'v-alert__wrapper'
  87218. };
  87219. return this.$createElement('div', data, children);
  87220. },
  87221. genContent: function genContent() {
  87222. return this.$createElement('div', {
  87223. staticClass: 'v-alert__content'
  87224. }, this.$slots.default);
  87225. },
  87226. genAlert: function genAlert() {
  87227. var data = {
  87228. staticClass: 'v-alert',
  87229. attrs: {
  87230. role: 'alert'
  87231. },
  87232. class: this.classes,
  87233. style: this.styles,
  87234. directives: [{
  87235. name: 'show',
  87236. value: this.isActive
  87237. }]
  87238. };
  87239. if (!this.coloredBorder) {
  87240. var setColor = this.hasText ? this.setTextColor : this.setBackgroundColor;
  87241. data = setColor(this.computedColor, data);
  87242. }
  87243. return this.$createElement('div', data, [this.genWrapper()]);
  87244. },
  87245. /** @public */
  87246. toggle: function toggle() {
  87247. this.isActive = !this.isActive;
  87248. }
  87249. },
  87250. render: function render(h) {
  87251. var render = this.genAlert();
  87252. if (!this.transition) return render;
  87253. return h('transition', {
  87254. props: {
  87255. name: this.transition,
  87256. origin: this.origin,
  87257. mode: this.mode
  87258. }
  87259. }, [render]);
  87260. }
  87261. }));
  87262. /***/ }),
  87263. /***/ "./src/components/VAlert/index.ts":
  87264. /*!****************************************!*\
  87265. !*** ./src/components/VAlert/index.ts ***!
  87266. \****************************************/
  87267. /*! exports provided: VAlert, default */
  87268. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87269. "use strict";
  87270. __webpack_require__.r(__webpack_exports__);
  87271. /* harmony import */ var _VAlert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAlert */ "./src/components/VAlert/VAlert.ts");
  87272. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAlert", function() { return _VAlert__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  87273. /* harmony default export */ __webpack_exports__["default"] = (_VAlert__WEBPACK_IMPORTED_MODULE_0__["default"]);
  87274. /***/ }),
  87275. /***/ "./src/components/VApp/VApp.sass":
  87276. /*!***************************************!*\
  87277. !*** ./src/components/VApp/VApp.sass ***!
  87278. \***************************************/
  87279. /*! no static exports found */
  87280. /***/ (function(module, exports, __webpack_require__) {
  87281. // extracted by mini-css-extract-plugin
  87282. /***/ }),
  87283. /***/ "./src/components/VApp/VApp.ts":
  87284. /*!*************************************!*\
  87285. !*** ./src/components/VApp/VApp.ts ***!
  87286. \*************************************/
  87287. /*! exports provided: default */
  87288. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87289. "use strict";
  87290. __webpack_require__.r(__webpack_exports__);
  87291. /* harmony import */ var _VApp_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VApp.sass */ "./src/components/VApp/VApp.sass");
  87292. /* harmony import */ var _VApp_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VApp_sass__WEBPACK_IMPORTED_MODULE_0__);
  87293. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  87294. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  87295. var __assign = undefined && undefined.__assign || function () {
  87296. __assign = Object.assign || function (t) {
  87297. for (var s, i = 1, n = arguments.length; i < n; i++) {
  87298. s = arguments[i];
  87299. for (var p in s) {
  87300. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  87301. }
  87302. }
  87303. return t;
  87304. };
  87305. return __assign.apply(this, arguments);
  87306. }; // Styles
  87307. // Mixins
  87308. // Utilities
  87309. /* @vue/component */
  87310. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
  87311. name: 'v-app',
  87312. props: {
  87313. dark: {
  87314. type: Boolean,
  87315. default: undefined
  87316. },
  87317. id: {
  87318. type: String,
  87319. default: 'app'
  87320. },
  87321. light: {
  87322. type: Boolean,
  87323. default: undefined
  87324. }
  87325. },
  87326. computed: {
  87327. isDark: function isDark() {
  87328. return this.$vuetify.theme.dark;
  87329. }
  87330. },
  87331. beforeCreate: function beforeCreate() {
  87332. if (!this.$vuetify || this.$vuetify === this.$root) {
  87333. throw new Error('Vuetify is not properly initialized, see https://vuetifyjs.com/getting-started/quick-start#bootstrapping-the-vuetify-object');
  87334. }
  87335. },
  87336. render: function render(h) {
  87337. var wrapper = h('div', {
  87338. staticClass: 'v-application--wrap'
  87339. }, this.$slots.default);
  87340. return h('div', {
  87341. staticClass: 'v-application',
  87342. class: __assign({
  87343. 'v-application--is-rtl': this.$vuetify.rtl,
  87344. 'v-application--is-ltr': !this.$vuetify.rtl
  87345. }, this.themeClasses),
  87346. attrs: {
  87347. 'data-app': true
  87348. },
  87349. domProps: {
  87350. id: this.id
  87351. }
  87352. }, [wrapper]);
  87353. }
  87354. }));
  87355. /***/ }),
  87356. /***/ "./src/components/VApp/index.ts":
  87357. /*!**************************************!*\
  87358. !*** ./src/components/VApp/index.ts ***!
  87359. \**************************************/
  87360. /*! exports provided: VApp, default */
  87361. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87362. "use strict";
  87363. __webpack_require__.r(__webpack_exports__);
  87364. /* harmony import */ var _VApp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VApp */ "./src/components/VApp/VApp.ts");
  87365. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VApp", function() { return _VApp__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  87366. /* harmony default export */ __webpack_exports__["default"] = (_VApp__WEBPACK_IMPORTED_MODULE_0__["default"]);
  87367. /***/ }),
  87368. /***/ "./src/components/VAppBar/VAppBar.sass":
  87369. /*!*********************************************!*\
  87370. !*** ./src/components/VAppBar/VAppBar.sass ***!
  87371. \*********************************************/
  87372. /*! no static exports found */
  87373. /***/ (function(module, exports, __webpack_require__) {
  87374. // extracted by mini-css-extract-plugin
  87375. /***/ }),
  87376. /***/ "./src/components/VAppBar/VAppBar.ts":
  87377. /*!*******************************************!*\
  87378. !*** ./src/components/VAppBar/VAppBar.ts ***!
  87379. \*******************************************/
  87380. /*! exports provided: default */
  87381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87382. "use strict";
  87383. __webpack_require__.r(__webpack_exports__);
  87384. /* harmony import */ var _VAppBar_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAppBar.sass */ "./src/components/VAppBar/VAppBar.sass");
  87385. /* harmony import */ var _VAppBar_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VAppBar_sass__WEBPACK_IMPORTED_MODULE_0__);
  87386. /* harmony import */ var _VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VToolbar/VToolbar */ "./src/components/VToolbar/VToolbar.ts");
  87387. /* harmony import */ var _directives_scroll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../directives/scroll */ "./src/directives/scroll/index.ts");
  87388. /* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable/index.ts");
  87389. /* harmony import */ var _mixins_scrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/scrollable */ "./src/mixins/scrollable/index.ts");
  87390. /* harmony import */ var _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/ssr-bootable */ "./src/mixins/ssr-bootable/index.ts");
  87391. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  87392. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  87393. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  87394. var __assign = undefined && undefined.__assign || function () {
  87395. __assign = Object.assign || function (t) {
  87396. for (var s, i = 1, n = arguments.length; i < n; i++) {
  87397. s = arguments[i];
  87398. for (var p in s) {
  87399. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  87400. }
  87401. }
  87402. return t;
  87403. };
  87404. return __assign.apply(this, arguments);
  87405. }; // Styles
  87406. // Extensions
  87407. // Directives
  87408. // Mixins
  87409. // Utilities
  87410. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_8__["default"])(_VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_scrollable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_3__["default"])('top', ['clippedLeft', 'clippedRight', 'computedHeight', 'invertedScroll', 'isExtended', 'isProminent', 'value']));
  87411. /* @vue/component */
  87412. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  87413. name: 'v-app-bar',
  87414. directives: {
  87415. Scroll: _directives_scroll__WEBPACK_IMPORTED_MODULE_2__["default"]
  87416. },
  87417. props: {
  87418. clippedLeft: Boolean,
  87419. clippedRight: Boolean,
  87420. collapseOnScroll: Boolean,
  87421. elevateOnScroll: Boolean,
  87422. fadeImgOnScroll: Boolean,
  87423. hideOnScroll: Boolean,
  87424. invertedScroll: Boolean,
  87425. scrollOffScreen: Boolean,
  87426. shrinkOnScroll: Boolean,
  87427. value: {
  87428. type: Boolean,
  87429. default: true
  87430. }
  87431. },
  87432. data: function data() {
  87433. return {
  87434. isActive: this.value
  87435. };
  87436. },
  87437. computed: {
  87438. applicationProperty: function applicationProperty() {
  87439. return !this.bottom ? 'top' : 'bottom';
  87440. },
  87441. canScroll: function canScroll() {
  87442. return _mixins_scrollable__WEBPACK_IMPORTED_MODULE_4__["default"].options.computed.canScroll.call(this) && (this.invertedScroll || this.elevateOnScroll || this.hideOnScroll || this.collapseOnScroll || this.isBooted || // If falsey, user has provided an
  87443. // explicit value which should
  87444. // overwrite anything we do
  87445. !this.value);
  87446. },
  87447. classes: function classes() {
  87448. return __assign({}, _VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  87449. 'v-toolbar--collapse': this.collapse || this.collapseOnScroll,
  87450. 'v-app-bar': true,
  87451. 'v-app-bar--clipped': this.clippedLeft || this.clippedRight,
  87452. 'v-app-bar--fade-img-on-scroll': this.fadeImgOnScroll,
  87453. 'v-app-bar--elevate-on-scroll': this.elevateOnScroll,
  87454. 'v-app-bar--fixed': !this.absolute && (this.app || this.fixed),
  87455. 'v-app-bar--hide-shadow': this.hideShadow,
  87456. 'v-app-bar--is-scrolled': this.currentScroll > 0,
  87457. 'v-app-bar--shrink-on-scroll': this.shrinkOnScroll
  87458. });
  87459. },
  87460. computedContentHeight: function computedContentHeight() {
  87461. if (!this.shrinkOnScroll) return _VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.computedContentHeight.call(this);
  87462. var height = this.computedOriginalHeight;
  87463. var min = this.dense ? 48 : 56;
  87464. var max = height;
  87465. var difference = max - min;
  87466. var iteration = difference / this.computedScrollThreshold;
  87467. var offset = this.currentScroll * iteration;
  87468. return Math.max(min, max - offset);
  87469. },
  87470. computedFontSize: function computedFontSize() {
  87471. if (!this.isProminent) return undefined;
  87472. var max = this.dense ? 96 : 128;
  87473. var difference = max - this.computedContentHeight;
  87474. var increment = 0.00347; // 1.5rem to a minimum of 1.25rem
  87475. return Number((1.50 - difference * increment).toFixed(2));
  87476. },
  87477. computedLeft: function computedLeft() {
  87478. if (!this.app || this.clippedLeft) return 0;
  87479. return this.$vuetify.application.left;
  87480. },
  87481. computedMarginTop: function computedMarginTop() {
  87482. if (!this.app) return 0;
  87483. return this.$vuetify.application.bar;
  87484. },
  87485. computedOpacity: function computedOpacity() {
  87486. if (!this.fadeImgOnScroll) return undefined;
  87487. var opacity = Math.max((this.computedScrollThreshold - this.currentScroll) / this.computedScrollThreshold, 0);
  87488. return Number(parseFloat(opacity).toFixed(2));
  87489. },
  87490. computedOriginalHeight: function computedOriginalHeight() {
  87491. var height = _VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.computedContentHeight.call(this);
  87492. if (this.isExtended) height += parseInt(this.extensionHeight);
  87493. return height;
  87494. },
  87495. computedRight: function computedRight() {
  87496. if (!this.app || this.clippedRight) return 0;
  87497. return this.$vuetify.application.right;
  87498. },
  87499. computedScrollThreshold: function computedScrollThreshold() {
  87500. if (this.scrollThreshold) return Number(this.scrollThreshold);
  87501. return this.computedOriginalHeight - (this.dense ? 48 : 56);
  87502. },
  87503. computedTransform: function computedTransform() {
  87504. if (!this.canScroll || this.elevateOnScroll && this.currentScroll === 0 && this.isActive) return 0;
  87505. if (this.isActive) return 0;
  87506. var scrollOffScreen = this.scrollOffScreen ? this.computedHeight : this.computedContentHeight;
  87507. return this.bottom ? scrollOffScreen : -scrollOffScreen;
  87508. },
  87509. hideShadow: function hideShadow() {
  87510. if (this.elevateOnScroll && this.isExtended) {
  87511. return this.currentScroll < this.computedScrollThreshold;
  87512. }
  87513. if (this.elevateOnScroll) {
  87514. return this.currentScroll === 0 || this.computedTransform < 0;
  87515. }
  87516. return (!this.isExtended || this.scrollOffScreen) && this.computedTransform !== 0;
  87517. },
  87518. isCollapsed: function isCollapsed() {
  87519. if (!this.collapseOnScroll) {
  87520. return _VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.isCollapsed.call(this);
  87521. }
  87522. return this.currentScroll > 0;
  87523. },
  87524. isProminent: function isProminent() {
  87525. return _VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.isProminent.call(this) || this.shrinkOnScroll;
  87526. },
  87527. styles: function styles() {
  87528. return __assign({}, _VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.styles.call(this), {
  87529. fontSize: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["convertToUnit"])(this.computedFontSize, 'rem'),
  87530. marginTop: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["convertToUnit"])(this.computedMarginTop),
  87531. transform: "translateY(" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["convertToUnit"])(this.computedTransform) + ")",
  87532. left: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["convertToUnit"])(this.computedLeft),
  87533. right: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["convertToUnit"])(this.computedRight)
  87534. });
  87535. }
  87536. },
  87537. watch: {
  87538. canScroll: 'onScroll',
  87539. computedTransform: function computedTransform() {
  87540. // Normally we do not want the v-app-bar
  87541. // to update the application top value
  87542. // to avoid screen jump. However, in
  87543. // this situation, we must so that
  87544. // the clipped drawer can update
  87545. // its top value when scrolled
  87546. if (!this.canScroll || !this.clippedLeft && !this.clippedRight) return;
  87547. this.callUpdate();
  87548. },
  87549. invertedScroll: function invertedScroll(val) {
  87550. this.isActive = !val || this.currentScroll !== 0;
  87551. }
  87552. },
  87553. created: function created() {
  87554. if (this.invertedScroll) this.isActive = false;
  87555. },
  87556. methods: {
  87557. genBackground: function genBackground() {
  87558. var render = _VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genBackground.call(this);
  87559. render.data = this._b(render.data || {}, render.tag, {
  87560. style: {
  87561. opacity: this.computedOpacity
  87562. }
  87563. });
  87564. return render;
  87565. },
  87566. updateApplication: function updateApplication() {
  87567. return this.invertedScroll ? 0 : this.computedHeight + this.computedTransform;
  87568. },
  87569. thresholdMet: function thresholdMet() {
  87570. if (this.invertedScroll) {
  87571. this.isActive = this.currentScroll > this.computedScrollThreshold;
  87572. return;
  87573. }
  87574. if (this.hideOnScroll) {
  87575. this.isActive = this.isScrollingUp || this.currentScroll < this.computedScrollThreshold;
  87576. }
  87577. if (this.currentThreshold < this.computedScrollThreshold) return;
  87578. this.savedScroll = this.currentScroll;
  87579. }
  87580. },
  87581. render: function render(h) {
  87582. var render = _VToolbar_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].options.render.call(this, h);
  87583. render.data = render.data || {};
  87584. if (this.canScroll) {
  87585. render.data.directives = render.data.directives || [];
  87586. render.data.directives.push({
  87587. arg: this.scrollTarget,
  87588. name: 'scroll',
  87589. value: this.onScroll
  87590. });
  87591. }
  87592. return render;
  87593. }
  87594. }));
  87595. /***/ }),
  87596. /***/ "./src/components/VAppBar/VAppBarNavIcon.ts":
  87597. /*!**************************************************!*\
  87598. !*** ./src/components/VAppBar/VAppBarNavIcon.ts ***!
  87599. \**************************************************/
  87600. /*! exports provided: default */
  87601. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87602. "use strict";
  87603. __webpack_require__.r(__webpack_exports__);
  87604. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  87605. /* harmony import */ var _VBtn_VBtn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VBtn/VBtn */ "./src/components/VBtn/VBtn.ts");
  87606. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "vue");
  87607. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);
  87608. var __assign = undefined && undefined.__assign || function () {
  87609. __assign = Object.assign || function (t) {
  87610. for (var s, i = 1, n = arguments.length; i < n; i++) {
  87611. s = arguments[i];
  87612. for (var p in s) {
  87613. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  87614. }
  87615. }
  87616. return t;
  87617. };
  87618. return __assign.apply(this, arguments);
  87619. }; // Components
  87620. // Types
  87621. /* @vue/component */
  87622. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_2___default.a.extend({
  87623. name: 'v-app-bar-nav-icon',
  87624. functional: true,
  87625. render: function render(h, _a) {
  87626. var slots = _a.slots,
  87627. listeners = _a.listeners,
  87628. props = _a.props,
  87629. data = _a.data;
  87630. var d = Object.assign(data, {
  87631. staticClass: ("v-app-bar__nav-icon " + (data.staticClass || '')).trim(),
  87632. props: __assign({}, props, {
  87633. icon: true
  87634. }),
  87635. on: listeners
  87636. });
  87637. var defaultSlot = slots().default;
  87638. return h(_VBtn_VBtn__WEBPACK_IMPORTED_MODULE_1__["default"], d, defaultSlot || [h(_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"], '$menu')]);
  87639. }
  87640. }));
  87641. /***/ }),
  87642. /***/ "./src/components/VAppBar/index.ts":
  87643. /*!*****************************************!*\
  87644. !*** ./src/components/VAppBar/index.ts ***!
  87645. \*****************************************/
  87646. /*! exports provided: VAppBar, VAppBarNavIcon, default */
  87647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87648. "use strict";
  87649. __webpack_require__.r(__webpack_exports__);
  87650. /* harmony import */ var _VAppBar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAppBar */ "./src/components/VAppBar/VAppBar.ts");
  87651. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAppBar", function() { return _VAppBar__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  87652. /* harmony import */ var _VAppBarNavIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VAppBarNavIcon */ "./src/components/VAppBar/VAppBarNavIcon.ts");
  87653. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAppBarNavIcon", function() { return _VAppBarNavIcon__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  87654. /* harmony default export */ __webpack_exports__["default"] = ({
  87655. $_vuetify_subcomponents: {
  87656. VAppBar: _VAppBar__WEBPACK_IMPORTED_MODULE_0__["default"],
  87657. VAppBarNavIcon: _VAppBarNavIcon__WEBPACK_IMPORTED_MODULE_1__["default"]
  87658. }
  87659. });
  87660. /***/ }),
  87661. /***/ "./src/components/VAutocomplete/VAutocomplete.sass":
  87662. /*!*********************************************************!*\
  87663. !*** ./src/components/VAutocomplete/VAutocomplete.sass ***!
  87664. \*********************************************************/
  87665. /*! no static exports found */
  87666. /***/ (function(module, exports, __webpack_require__) {
  87667. // extracted by mini-css-extract-plugin
  87668. /***/ }),
  87669. /***/ "./src/components/VAutocomplete/VAutocomplete.ts":
  87670. /*!*******************************************************!*\
  87671. !*** ./src/components/VAutocomplete/VAutocomplete.ts ***!
  87672. \*******************************************************/
  87673. /*! exports provided: default */
  87674. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87675. "use strict";
  87676. __webpack_require__.r(__webpack_exports__);
  87677. /* harmony import */ var _VAutocomplete_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAutocomplete.sass */ "./src/components/VAutocomplete/VAutocomplete.sass");
  87678. /* harmony import */ var _VAutocomplete_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VAutocomplete_sass__WEBPACK_IMPORTED_MODULE_0__);
  87679. /* harmony import */ var _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSelect/VSelect */ "./src/components/VSelect/VSelect.ts");
  87680. /* harmony import */ var _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VTextField/VTextField */ "./src/components/VTextField/VTextField.ts");
  87681. /* harmony import */ var _util_mergeData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mergeData */ "./src/util/mergeData.ts");
  87682. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  87683. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  87684. var __assign = undefined && undefined.__assign || function () {
  87685. __assign = Object.assign || function (t) {
  87686. for (var s, i = 1, n = arguments.length; i < n; i++) {
  87687. s = arguments[i];
  87688. for (var p in s) {
  87689. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  87690. }
  87691. }
  87692. return t;
  87693. };
  87694. return __assign.apply(this, arguments);
  87695. }; // Styles
  87696. // Extensions
  87697. // Utilities
  87698. var defaultMenuProps = __assign({}, _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["defaultMenuProps"], {
  87699. offsetY: true,
  87700. offsetOverflow: true,
  87701. transition: false
  87702. });
  87703. /* @vue/component */
  87704. /* harmony default export */ __webpack_exports__["default"] = (_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  87705. name: 'v-autocomplete',
  87706. props: {
  87707. allowOverflow: {
  87708. type: Boolean,
  87709. default: true
  87710. },
  87711. autoSelectFirst: {
  87712. type: Boolean,
  87713. default: false
  87714. },
  87715. filter: {
  87716. type: Function,
  87717. default: function _default(item, queryText, itemText) {
  87718. return itemText.toLocaleLowerCase().indexOf(queryText.toLocaleLowerCase()) > -1;
  87719. }
  87720. },
  87721. hideNoData: Boolean,
  87722. menuProps: {
  87723. type: _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.props.menuProps.type,
  87724. default: function _default() {
  87725. return defaultMenuProps;
  87726. }
  87727. },
  87728. noFilter: Boolean,
  87729. searchInput: {
  87730. type: String,
  87731. default: undefined
  87732. }
  87733. },
  87734. data: function data() {
  87735. return {
  87736. lazySearch: this.searchInput
  87737. };
  87738. },
  87739. computed: {
  87740. classes: function classes() {
  87741. return __assign({}, _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  87742. 'v-autocomplete': true,
  87743. 'v-autocomplete--is-selecting-index': this.selectedIndex > -1
  87744. });
  87745. },
  87746. computedItems: function computedItems() {
  87747. return this.filteredItems;
  87748. },
  87749. selectedValues: function selectedValues() {
  87750. var _this = this;
  87751. return this.selectedItems.map(function (item) {
  87752. return _this.getValue(item);
  87753. });
  87754. },
  87755. hasDisplayedItems: function hasDisplayedItems() {
  87756. var _this = this;
  87757. return this.hideSelected ? this.filteredItems.some(function (item) {
  87758. return !_this.hasItem(item);
  87759. }) : this.filteredItems.length > 0;
  87760. },
  87761. currentRange: function currentRange() {
  87762. if (this.selectedItem == null) return 0;
  87763. return String(this.getText(this.selectedItem)).length;
  87764. },
  87765. filteredItems: function filteredItems() {
  87766. var _this = this;
  87767. if (!this.isSearching || this.noFilter || this.internalSearch == null) return this.allItems;
  87768. return this.allItems.filter(function (item) {
  87769. var text = _this.getText(item); // Remove items without text to match
  87770. if (text == null || _typeof(text) === 'object') return false;
  87771. return _this.filter(item, String(_this.internalSearch), String(text));
  87772. });
  87773. },
  87774. internalSearch: {
  87775. get: function get() {
  87776. return this.lazySearch;
  87777. },
  87778. set: function set(val) {
  87779. this.lazySearch = val;
  87780. this.$emit('update:search-input', val);
  87781. }
  87782. },
  87783. isAnyValueAllowed: function isAnyValueAllowed() {
  87784. return false;
  87785. },
  87786. isDirty: function isDirty() {
  87787. return this.searchIsDirty || this.selectedItems.length > 0;
  87788. },
  87789. isSearching: function isSearching() {
  87790. return this.multiple && this.searchIsDirty || this.searchIsDirty && this.internalSearch !== this.getText(this.selectedItem);
  87791. },
  87792. menuCanShow: function menuCanShow() {
  87793. if (!this.isFocused) return false;
  87794. return this.hasDisplayedItems || !this.hideNoData;
  87795. },
  87796. $_menuProps: function $_menuProps() {
  87797. var props = _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.$_menuProps.call(this);
  87798. props.contentClass = ("v-autocomplete__content " + (props.contentClass || '')).trim();
  87799. return __assign({}, defaultMenuProps, props);
  87800. },
  87801. searchIsDirty: function searchIsDirty() {
  87802. return this.internalSearch != null && this.internalSearch !== '';
  87803. },
  87804. selectedItem: function selectedItem() {
  87805. var _this = this;
  87806. if (this.multiple) return null;
  87807. return this.selectedItems.find(function (i) {
  87808. return _this.valueComparator(_this.getValue(i), _this.getValue(_this.internalValue));
  87809. });
  87810. },
  87811. listData: function listData() {
  87812. var data = _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.listData.call(this);
  87813. data.props = __assign({}, data.props, {
  87814. items: this.virtualizedItems,
  87815. noFilter: this.noFilter || !this.isSearching || !this.filteredItems.length,
  87816. searchInput: this.internalSearch
  87817. });
  87818. return data;
  87819. }
  87820. },
  87821. watch: {
  87822. filteredItems: 'onFilteredItemsChanged',
  87823. internalValue: 'setSearch',
  87824. isFocused: function isFocused(val) {
  87825. if (val) {
  87826. document.addEventListener('copy', this.onCopy);
  87827. this.$refs.input && this.$refs.input.select();
  87828. } else {
  87829. document.removeEventListener('copy', this.onCopy);
  87830. this.updateSelf();
  87831. }
  87832. },
  87833. isMenuActive: function isMenuActive(val) {
  87834. if (val || !this.hasSlot) return;
  87835. this.lazySearch = undefined;
  87836. },
  87837. items: function items(val, oldVal) {
  87838. // If we are focused, the menu
  87839. // is not active, hide no data is enabled,
  87840. // and items change
  87841. // User is probably async loading
  87842. // items, try to activate the menu
  87843. if (!(oldVal && oldVal.length) && this.hideNoData && this.isFocused && !this.isMenuActive && val.length) this.activateMenu();
  87844. },
  87845. searchInput: function searchInput(val) {
  87846. this.lazySearch = val;
  87847. },
  87848. internalSearch: 'onInternalSearchChanged',
  87849. itemText: 'updateSelf'
  87850. },
  87851. created: function created() {
  87852. this.setSearch();
  87853. },
  87854. methods: {
  87855. onFilteredItemsChanged: function onFilteredItemsChanged(val, oldVal) {
  87856. var _this = this; // TODO: How is the watcher triggered
  87857. // for duplicate items? no idea
  87858. if (val === oldVal) return;
  87859. this.setMenuIndex(-1);
  87860. this.$nextTick(function () {
  87861. if (!_this.internalSearch || val.length !== 1 && !_this.autoSelectFirst) return;
  87862. _this.$refs.menu.getTiles();
  87863. _this.setMenuIndex(0);
  87864. });
  87865. },
  87866. onInternalSearchChanged: function onInternalSearchChanged() {
  87867. this.updateMenuDimensions();
  87868. },
  87869. updateMenuDimensions: function updateMenuDimensions() {
  87870. // Type from menuable is not making it through
  87871. this.isMenuActive && this.$refs.menu && this.$refs.menu.updateDimensions();
  87872. },
  87873. changeSelectedIndex: function changeSelectedIndex(keyCode) {
  87874. // Do not allow changing of selectedIndex
  87875. // when search is dirty
  87876. if (this.searchIsDirty) return;
  87877. if (this.multiple && keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].left) {
  87878. if (this.selectedIndex === -1) {
  87879. this.selectedIndex = this.selectedItems.length - 1;
  87880. } else {
  87881. this.selectedIndex--;
  87882. }
  87883. } else if (this.multiple && keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].right) {
  87884. if (this.selectedIndex >= this.selectedItems.length - 1) {
  87885. this.selectedIndex = -1;
  87886. } else {
  87887. this.selectedIndex++;
  87888. }
  87889. } else if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].backspace || keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].delete) {
  87890. this.deleteCurrentItem();
  87891. }
  87892. },
  87893. deleteCurrentItem: function deleteCurrentItem() {
  87894. if (this.readonly) return;
  87895. var index = this.selectedItems.length - 1;
  87896. if (this.selectedIndex === -1 && index !== 0) {
  87897. this.selectedIndex = index;
  87898. return;
  87899. }
  87900. var currentItem = this.selectedItems[this.selectedIndex];
  87901. if (this.getDisabled(currentItem)) return;
  87902. var newIndex = this.selectedIndex === index ? this.selectedIndex - 1 : this.selectedItems[this.selectedIndex + 1] ? this.selectedIndex : -1;
  87903. if (newIndex === -1) {
  87904. this.setValue(this.multiple ? [] : undefined);
  87905. } else {
  87906. this.selectItem(currentItem);
  87907. }
  87908. this.selectedIndex = newIndex;
  87909. },
  87910. clearableCallback: function clearableCallback() {
  87911. this.internalSearch = undefined;
  87912. _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.clearableCallback.call(this);
  87913. },
  87914. genInput: function genInput() {
  87915. var input = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genInput.call(this);
  87916. input.data = Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_3__["default"])(input.data, {
  87917. attrs: {
  87918. 'aria-activedescendant': Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(this.$refs.menu, 'activeTile.id'),
  87919. autocomplete: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(input.data, 'attrs.autocomplete', 'off')
  87920. },
  87921. domProps: {
  87922. value: this.internalSearch
  87923. }
  87924. });
  87925. return input;
  87926. },
  87927. genInputSlot: function genInputSlot() {
  87928. var slot = _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genInputSlot.call(this);
  87929. slot.data.attrs.role = 'combobox';
  87930. return slot;
  87931. },
  87932. genSelections: function genSelections() {
  87933. return this.hasSlot || this.multiple ? _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genSelections.call(this) : [];
  87934. },
  87935. onClick: function onClick(e) {
  87936. if (this.isDisabled) return;
  87937. this.selectedIndex > -1 ? this.selectedIndex = -1 : this.onFocus();
  87938. if (!this.isAppendInner(e.target)) this.activateMenu();
  87939. },
  87940. onInput: function onInput(e) {
  87941. if (this.selectedIndex > -1 || !e.target) return;
  87942. var target = e.target;
  87943. var value = target.value; // If typing and menu is not currently active
  87944. if (target.value) this.activateMenu();
  87945. this.internalSearch = value;
  87946. this.badInput = target.validity && target.validity.badInput;
  87947. },
  87948. onKeyDown: function onKeyDown(e) {
  87949. var keyCode = e.keyCode;
  87950. _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.onKeyDown.call(this, e); // The ordering is important here
  87951. // allows new value to be updated
  87952. // and then moves the index to the
  87953. // proper location
  87954. this.changeSelectedIndex(keyCode);
  87955. },
  87956. onSpaceDown: function onSpaceDown(e) {},
  87957. onTabDown: function onTabDown(e) {
  87958. _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.onTabDown.call(this, e);
  87959. this.updateSelf();
  87960. },
  87961. onUpDown: function onUpDown(e) {
  87962. // Prevent screen from scrolling
  87963. e.preventDefault(); // For autocomplete / combobox, cycling
  87964. // interfers with native up/down behavior
  87965. // instead activate the menu
  87966. this.activateMenu();
  87967. },
  87968. selectItem: function selectItem(item) {
  87969. _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.selectItem.call(this, item);
  87970. this.setSearch();
  87971. },
  87972. setSelectedItems: function setSelectedItems() {
  87973. _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.setSelectedItems.call(this); // #4273 Don't replace if searching
  87974. // #4403 Don't replace if focused
  87975. if (!this.isFocused) this.setSearch();
  87976. },
  87977. setSearch: function setSearch() {
  87978. var _this = this; // Wait for nextTick so selectedItem
  87979. // has had time to update
  87980. this.$nextTick(function () {
  87981. if (!_this.multiple || !_this.internalSearch || !_this.isMenuActive) {
  87982. _this.internalSearch = !_this.selectedItems.length || _this.multiple || _this.hasSlot ? null : _this.getText(_this.selectedItem);
  87983. }
  87984. });
  87985. },
  87986. updateSelf: function updateSelf() {
  87987. if (!this.searchIsDirty && !this.internalValue) return;
  87988. if (!this.valueComparator(this.internalSearch, this.getValue(this.internalValue))) {
  87989. this.setSearch();
  87990. }
  87991. },
  87992. hasItem: function hasItem(item) {
  87993. return this.selectedValues.indexOf(this.getValue(item)) > -1;
  87994. },
  87995. onCopy: function onCopy(event) {
  87996. if (this.selectedIndex === -1) return;
  87997. var currentItem = this.selectedItems[this.selectedIndex];
  87998. var currentItemText = this.getText(currentItem);
  87999. event.clipboardData.setData('text/plain', currentItemText);
  88000. event.clipboardData.setData('text/vnd.vuetify.autocomplete.item+plain', currentItemText);
  88001. event.preventDefault();
  88002. }
  88003. }
  88004. }));
  88005. /***/ }),
  88006. /***/ "./src/components/VAutocomplete/index.ts":
  88007. /*!***********************************************!*\
  88008. !*** ./src/components/VAutocomplete/index.ts ***!
  88009. \***********************************************/
  88010. /*! exports provided: VAutocomplete, default */
  88011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88012. "use strict";
  88013. __webpack_require__.r(__webpack_exports__);
  88014. /* harmony import */ var _VAutocomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAutocomplete */ "./src/components/VAutocomplete/VAutocomplete.ts");
  88015. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAutocomplete", function() { return _VAutocomplete__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  88016. /* harmony default export */ __webpack_exports__["default"] = (_VAutocomplete__WEBPACK_IMPORTED_MODULE_0__["default"]);
  88017. /***/ }),
  88018. /***/ "./src/components/VAvatar/VAvatar.sass":
  88019. /*!*********************************************!*\
  88020. !*** ./src/components/VAvatar/VAvatar.sass ***!
  88021. \*********************************************/
  88022. /*! no static exports found */
  88023. /***/ (function(module, exports, __webpack_require__) {
  88024. // extracted by mini-css-extract-plugin
  88025. /***/ }),
  88026. /***/ "./src/components/VAvatar/VAvatar.ts":
  88027. /*!*******************************************!*\
  88028. !*** ./src/components/VAvatar/VAvatar.ts ***!
  88029. \*******************************************/
  88030. /*! exports provided: default */
  88031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88032. "use strict";
  88033. __webpack_require__.r(__webpack_exports__);
  88034. /* harmony import */ var _VAvatar_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAvatar.sass */ "./src/components/VAvatar/VAvatar.sass");
  88035. /* harmony import */ var _VAvatar_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VAvatar_sass__WEBPACK_IMPORTED_MODULE_0__);
  88036. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  88037. /* harmony import */ var _mixins_measurable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/measurable */ "./src/mixins/measurable/index.ts");
  88038. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  88039. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  88040. var __assign = undefined && undefined.__assign || function () {
  88041. __assign = Object.assign || function (t) {
  88042. for (var s, i = 1, n = arguments.length; i < n; i++) {
  88043. s = arguments[i];
  88044. for (var p in s) {
  88045. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  88046. }
  88047. }
  88048. return t;
  88049. };
  88050. return __assign.apply(this, arguments);
  88051. };
  88052. // Mixins
  88053. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_measurable__WEBPACK_IMPORTED_MODULE_2__["default"]
  88054. /* @vue/component */
  88055. ).extend({
  88056. name: 'v-avatar',
  88057. props: {
  88058. left: Boolean,
  88059. right: Boolean,
  88060. size: {
  88061. type: [Number, String],
  88062. default: 48
  88063. },
  88064. tile: Boolean
  88065. },
  88066. computed: {
  88067. classes: function classes() {
  88068. return {
  88069. 'v-avatar--left': this.left,
  88070. 'v-avatar--right': this.right,
  88071. 'v-avatar--tile': this.tile
  88072. };
  88073. },
  88074. styles: function styles() {
  88075. return __assign({
  88076. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.size),
  88077. minWidth: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.size),
  88078. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.size)
  88079. }, this.measurableStyles);
  88080. }
  88081. },
  88082. render: function render(h) {
  88083. var data = {
  88084. staticClass: 'v-avatar',
  88085. class: this.classes,
  88086. style: this.styles,
  88087. on: this.$listeners
  88088. };
  88089. return h('div', this.setBackgroundColor(this.color, data), this.$slots.default);
  88090. }
  88091. }));
  88092. /***/ }),
  88093. /***/ "./src/components/VAvatar/index.ts":
  88094. /*!*****************************************!*\
  88095. !*** ./src/components/VAvatar/index.ts ***!
  88096. \*****************************************/
  88097. /*! exports provided: VAvatar, default */
  88098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88099. "use strict";
  88100. __webpack_require__.r(__webpack_exports__);
  88101. /* harmony import */ var _VAvatar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAvatar */ "./src/components/VAvatar/VAvatar.ts");
  88102. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAvatar", function() { return _VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  88103. /* harmony default export */ __webpack_exports__["default"] = (_VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"]);
  88104. /***/ }),
  88105. /***/ "./src/components/VBadge/VBadge.sass":
  88106. /*!*******************************************!*\
  88107. !*** ./src/components/VBadge/VBadge.sass ***!
  88108. \*******************************************/
  88109. /*! no static exports found */
  88110. /***/ (function(module, exports, __webpack_require__) {
  88111. // extracted by mini-css-extract-plugin
  88112. /***/ }),
  88113. /***/ "./src/components/VBadge/VBadge.ts":
  88114. /*!*****************************************!*\
  88115. !*** ./src/components/VBadge/VBadge.ts ***!
  88116. \*****************************************/
  88117. /*! exports provided: default */
  88118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88119. "use strict";
  88120. __webpack_require__.r(__webpack_exports__);
  88121. /* harmony import */ var _VBadge_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBadge.sass */ "./src/components/VBadge/VBadge.sass");
  88122. /* harmony import */ var _VBadge_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VBadge_sass__WEBPACK_IMPORTED_MODULE_0__);
  88123. /* harmony import */ var _VIcon_VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon/VIcon */ "./src/components/VIcon/VIcon.ts");
  88124. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  88125. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  88126. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  88127. /* harmony import */ var _mixins_transitionable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/transitionable */ "./src/mixins/transitionable/index.ts");
  88128. /* harmony import */ var _mixins_positionable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/positionable */ "./src/mixins/positionable/index.ts");
  88129. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  88130. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  88131. var __assign = undefined && undefined.__assign || function () {
  88132. __assign = Object.assign || function (t) {
  88133. for (var s, i = 1, n = arguments.length; i < n; i++) {
  88134. s = arguments[i];
  88135. for (var p in s) {
  88136. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  88137. }
  88138. }
  88139. return t;
  88140. };
  88141. return __assign.apply(this, arguments);
  88142. };
  88143. var __rest = undefined && undefined.__rest || function (s, e) {
  88144. var t = {};
  88145. for (var p in s) {
  88146. if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  88147. }
  88148. if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  88149. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  88150. }
  88151. return t;
  88152. }; // Styles
  88153. // Components
  88154. // Mixins
  88155. // Utilities
  88156. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_7__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_mixins_positionable__WEBPACK_IMPORTED_MODULE_6__["factory"])(['left', 'bottom']), _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_transitionable__WEBPACK_IMPORTED_MODULE_5__["default"]).extend({
  88157. name: 'v-badge',
  88158. props: {
  88159. avatar: Boolean,
  88160. bordered: Boolean,
  88161. color: {
  88162. type: String,
  88163. default: 'primary'
  88164. },
  88165. content: {
  88166. required: false
  88167. },
  88168. dot: Boolean,
  88169. label: {
  88170. type: String,
  88171. default: '$vuetify.badge'
  88172. },
  88173. icon: String,
  88174. inline: Boolean,
  88175. offsetX: [Number, String],
  88176. offsetY: [Number, String],
  88177. overlap: Boolean,
  88178. tile: Boolean,
  88179. transition: {
  88180. type: String,
  88181. default: 'scale-rotate-transition'
  88182. },
  88183. value: {
  88184. default: true
  88185. }
  88186. },
  88187. computed: {
  88188. classes: function classes() {
  88189. return __assign({
  88190. 'v-badge--avatar': this.avatar,
  88191. 'v-badge--bordered': this.bordered,
  88192. 'v-badge--bottom': this.bottom,
  88193. 'v-badge--dot': this.dot,
  88194. 'v-badge--icon': this.icon != null,
  88195. 'v-badge--inline': this.inline,
  88196. 'v-badge--left': this.left,
  88197. 'v-badge--overlap': this.overlap,
  88198. 'v-badge--tile': this.tile
  88199. }, this.themeClasses);
  88200. },
  88201. computedBottom: function computedBottom() {
  88202. return this.bottom ? 'auto' : this.computedYOffset;
  88203. },
  88204. computedLeft: function computedLeft() {
  88205. if (this.isRtl) {
  88206. return this.left ? this.computedXOffset : 'auto';
  88207. }
  88208. return this.left ? 'auto' : this.computedXOffset;
  88209. },
  88210. computedRight: function computedRight() {
  88211. if (this.isRtl) {
  88212. return this.left ? 'auto' : this.computedXOffset;
  88213. }
  88214. return !this.left ? 'auto' : this.computedXOffset;
  88215. },
  88216. computedTop: function computedTop() {
  88217. return this.bottom ? this.computedYOffset : 'auto';
  88218. },
  88219. computedXOffset: function computedXOffset() {
  88220. return this.calcPosition(this.offsetX);
  88221. },
  88222. computedYOffset: function computedYOffset() {
  88223. return this.calcPosition(this.offsetY);
  88224. },
  88225. isRtl: function isRtl() {
  88226. return this.$vuetify.rtl;
  88227. },
  88228. // Default fallback if offsetX
  88229. // or offsetY are undefined.
  88230. offset: function offset() {
  88231. if (this.overlap) return this.dot ? 8 : 12;
  88232. return this.dot ? 2 : 4;
  88233. },
  88234. styles: function styles() {
  88235. if (this.inline) return {};
  88236. return {
  88237. bottom: this.computedBottom,
  88238. left: this.computedLeft,
  88239. right: this.computedRight,
  88240. top: this.computedTop
  88241. };
  88242. }
  88243. },
  88244. methods: {
  88245. calcPosition: function calcPosition(offset) {
  88246. return "calc(100% - " + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(offset || this.offset) + ")";
  88247. },
  88248. genBadge: function genBadge() {
  88249. var lang = this.$vuetify.lang;
  88250. var label = this.$attrs['aria-label'] || lang.t(this.label);
  88251. var data = this.setBackgroundColor(this.color, {
  88252. staticClass: 'v-badge__badge',
  88253. style: this.styles,
  88254. attrs: {
  88255. 'aria-atomic': this.$attrs['aria-atomic'] || 'true',
  88256. 'aria-label': label,
  88257. 'aria-live': this.$attrs['aria-live'] || 'polite',
  88258. title: this.$attrs.title,
  88259. role: this.$attrs.role || 'status'
  88260. },
  88261. directives: [{
  88262. name: 'show',
  88263. value: this.isActive
  88264. }]
  88265. });
  88266. var badge = this.$createElement('span', data, [this.genBadgeContent()]);
  88267. if (!this.transition) return badge;
  88268. return this.$createElement('transition', {
  88269. props: {
  88270. name: this.transition,
  88271. origin: this.origin,
  88272. mode: this.mode
  88273. }
  88274. }, [badge]);
  88275. },
  88276. genBadgeContent: function genBadgeContent() {
  88277. // Dot prop shows no content
  88278. if (this.dot) return undefined;
  88279. var slot = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["getSlot"])(this, 'badge');
  88280. if (slot) return slot;
  88281. if (this.content) return String(this.content);
  88282. if (this.icon) return this.$createElement(_VIcon_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], this.icon);
  88283. return undefined;
  88284. },
  88285. genBadgeWrapper: function genBadgeWrapper() {
  88286. return this.$createElement('span', {
  88287. staticClass: 'v-badge__wrapper'
  88288. }, [this.genBadge()]);
  88289. }
  88290. },
  88291. render: function render(h) {
  88292. var badge = [this.genBadgeWrapper()];
  88293. var children = [Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["getSlot"])(this)];
  88294. var _a = this.$attrs,
  88295. _x = _a["aria-atomic"],
  88296. _y = _a["aria-label"],
  88297. _z = _a["aria-live"],
  88298. role = _a.role,
  88299. title = _a.title,
  88300. attrs = __rest(_a, ['aria-atomic', 'aria-label', 'aria-live', "role", "title"]);
  88301. if (this.inline && this.left) children.unshift(badge);else children.push(badge);
  88302. return h('span', {
  88303. staticClass: 'v-badge',
  88304. attrs: attrs,
  88305. class: this.classes
  88306. }, children);
  88307. }
  88308. }));
  88309. /***/ }),
  88310. /***/ "./src/components/VBadge/index.ts":
  88311. /*!****************************************!*\
  88312. !*** ./src/components/VBadge/index.ts ***!
  88313. \****************************************/
  88314. /*! exports provided: VBadge, default */
  88315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88316. "use strict";
  88317. __webpack_require__.r(__webpack_exports__);
  88318. /* harmony import */ var _VBadge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBadge */ "./src/components/VBadge/VBadge.ts");
  88319. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBadge", function() { return _VBadge__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  88320. /* harmony default export */ __webpack_exports__["default"] = (_VBadge__WEBPACK_IMPORTED_MODULE_0__["default"]);
  88321. /***/ }),
  88322. /***/ "./src/components/VBanner/VBanner.sass":
  88323. /*!*********************************************!*\
  88324. !*** ./src/components/VBanner/VBanner.sass ***!
  88325. \*********************************************/
  88326. /*! no static exports found */
  88327. /***/ (function(module, exports, __webpack_require__) {
  88328. // extracted by mini-css-extract-plugin
  88329. /***/ }),
  88330. /***/ "./src/components/VBanner/VBanner.ts":
  88331. /*!*******************************************!*\
  88332. !*** ./src/components/VBanner/VBanner.ts ***!
  88333. \*******************************************/
  88334. /*! exports provided: default */
  88335. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88336. "use strict";
  88337. __webpack_require__.r(__webpack_exports__);
  88338. /* harmony import */ var _VBanner_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBanner.sass */ "./src/components/VBanner/VBanner.sass");
  88339. /* harmony import */ var _VBanner_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VBanner_sass__WEBPACK_IMPORTED_MODULE_0__);
  88340. /* harmony import */ var _VSheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSheet */ "./src/components/VSheet/index.ts");
  88341. /* harmony import */ var _VAvatar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VAvatar */ "./src/components/VAvatar/index.ts");
  88342. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  88343. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  88344. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  88345. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  88346. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  88347. var __assign = undefined && undefined.__assign || function () {
  88348. __assign = Object.assign || function (t) {
  88349. for (var s, i = 1, n = arguments.length; i < n; i++) {
  88350. s = arguments[i];
  88351. for (var p in s) {
  88352. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  88353. }
  88354. }
  88355. return t;
  88356. };
  88357. return __assign.apply(this, arguments);
  88358. }; // Styles
  88359. // Extensions
  88360. // Components
  88361. // Mixins
  88362. // Utilities
  88363. /* @vue/component */
  88364. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_6__["default"])(_VSheet__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_5__["default"]).extend({
  88365. name: 'v-banner',
  88366. inheritAttrs: false,
  88367. props: {
  88368. app: Boolean,
  88369. icon: String,
  88370. iconColor: String,
  88371. mobileBreakPoint: {
  88372. type: [Number, String],
  88373. default: 960
  88374. },
  88375. singleLine: Boolean,
  88376. sticky: Boolean,
  88377. tile: {
  88378. type: Boolean,
  88379. default: true
  88380. },
  88381. value: {
  88382. type: Boolean,
  88383. default: true
  88384. }
  88385. },
  88386. computed: {
  88387. classes: function classes() {
  88388. return __assign({}, _VSheet__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  88389. 'v-banner--has-icon': this.hasIcon,
  88390. 'v-banner--is-mobile': this.isMobile,
  88391. 'v-banner--single-line': this.singleLine,
  88392. 'v-banner--sticky': this.isSticky
  88393. });
  88394. },
  88395. hasIcon: function hasIcon() {
  88396. return Boolean(this.icon || this.$slots.icon);
  88397. },
  88398. isMobile: function isMobile() {
  88399. return this.$vuetify.breakpoint.width < Number(this.mobileBreakPoint);
  88400. },
  88401. isSticky: function isSticky() {
  88402. return this.sticky || this.app;
  88403. },
  88404. styles: function styles() {
  88405. var styles = __assign({}, _VSheet__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.styles.call(this));
  88406. if (this.isSticky) {
  88407. var top = !this.app ? 0 : this.$vuetify.application.bar + this.$vuetify.application.top;
  88408. styles.top = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["convertToUnit"])(top);
  88409. styles.position = 'sticky';
  88410. styles.zIndex = 1;
  88411. }
  88412. return styles;
  88413. }
  88414. },
  88415. methods: {
  88416. /** @public */
  88417. toggle: function toggle() {
  88418. this.isActive = !this.isActive;
  88419. },
  88420. iconClick: function iconClick(e) {
  88421. this.$emit('click:icon', e);
  88422. },
  88423. genIcon: function genIcon() {
  88424. if (!this.hasIcon) return undefined;
  88425. var content;
  88426. if (this.icon) {
  88427. content = this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_3__["default"], {
  88428. props: {
  88429. color: this.iconColor,
  88430. size: 28
  88431. }
  88432. }, [this.icon]);
  88433. } else {
  88434. content = this.$slots.icon;
  88435. }
  88436. return this.$createElement(_VAvatar__WEBPACK_IMPORTED_MODULE_2__["default"], {
  88437. staticClass: 'v-banner__icon',
  88438. props: {
  88439. color: this.color,
  88440. size: 40
  88441. },
  88442. on: {
  88443. click: this.iconClick
  88444. }
  88445. }, [content]);
  88446. },
  88447. genText: function genText() {
  88448. return this.$createElement('div', {
  88449. staticClass: 'v-banner__text'
  88450. }, this.$slots.default);
  88451. },
  88452. genActions: function genActions() {
  88453. var _this = this;
  88454. var children = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["getSlot"])(this, 'actions', {
  88455. dismiss: function dismiss() {
  88456. return _this.isActive = false;
  88457. }
  88458. });
  88459. if (!children) return undefined;
  88460. return this.$createElement('div', {
  88461. staticClass: 'v-banner__actions'
  88462. }, children);
  88463. },
  88464. genContent: function genContent() {
  88465. return this.$createElement('div', {
  88466. staticClass: 'v-banner__content'
  88467. }, [this.genIcon(), this.genText()]);
  88468. },
  88469. genWrapper: function genWrapper() {
  88470. return this.$createElement('div', {
  88471. staticClass: 'v-banner__wrapper'
  88472. }, [this.genContent(), this.genActions()]);
  88473. }
  88474. },
  88475. render: function render(h) {
  88476. return h(_transitions__WEBPACK_IMPORTED_MODULE_4__["VExpandTransition"], [h('div', this.setBackgroundColor(this.color, {
  88477. staticClass: 'v-banner',
  88478. attrs: this.attrs$,
  88479. class: this.classes,
  88480. style: this.styles,
  88481. directives: [{
  88482. name: 'show',
  88483. value: this.isActive
  88484. }]
  88485. }), [this.genWrapper()])]);
  88486. }
  88487. }));
  88488. /***/ }),
  88489. /***/ "./src/components/VBanner/index.ts":
  88490. /*!*****************************************!*\
  88491. !*** ./src/components/VBanner/index.ts ***!
  88492. \*****************************************/
  88493. /*! exports provided: VBanner, default */
  88494. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88495. "use strict";
  88496. __webpack_require__.r(__webpack_exports__);
  88497. /* harmony import */ var _VBanner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBanner */ "./src/components/VBanner/VBanner.ts");
  88498. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBanner", function() { return _VBanner__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  88499. /* harmony default export */ __webpack_exports__["default"] = (_VBanner__WEBPACK_IMPORTED_MODULE_0__["default"]);
  88500. /***/ }),
  88501. /***/ "./src/components/VBottomNavigation/VBottomNavigation.sass":
  88502. /*!*****************************************************************!*\
  88503. !*** ./src/components/VBottomNavigation/VBottomNavigation.sass ***!
  88504. \*****************************************************************/
  88505. /*! no static exports found */
  88506. /***/ (function(module, exports, __webpack_require__) {
  88507. // extracted by mini-css-extract-plugin
  88508. /***/ }),
  88509. /***/ "./src/components/VBottomNavigation/VBottomNavigation.ts":
  88510. /*!***************************************************************!*\
  88511. !*** ./src/components/VBottomNavigation/VBottomNavigation.ts ***!
  88512. \***************************************************************/
  88513. /*! exports provided: default */
  88514. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88515. "use strict";
  88516. __webpack_require__.r(__webpack_exports__);
  88517. /* harmony import */ var _VBottomNavigation_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBottomNavigation.sass */ "./src/components/VBottomNavigation/VBottomNavigation.sass");
  88518. /* harmony import */ var _VBottomNavigation_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VBottomNavigation_sass__WEBPACK_IMPORTED_MODULE_0__);
  88519. /* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable/index.ts");
  88520. /* harmony import */ var _mixins_button_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/button-group */ "./src/mixins/button-group/index.ts");
  88521. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  88522. /* harmony import */ var _mixins_measurable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/measurable */ "./src/mixins/measurable/index.ts");
  88523. /* harmony import */ var _mixins_proxyable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/proxyable */ "./src/mixins/proxyable/index.ts");
  88524. /* harmony import */ var _mixins_scrollable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/scrollable */ "./src/mixins/scrollable/index.ts");
  88525. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  88526. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  88527. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  88528. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  88529. var __assign = undefined && undefined.__assign || function () {
  88530. __assign = Object.assign || function (t) {
  88531. for (var s, i = 1, n = arguments.length; i < n; i++) {
  88532. s = arguments[i];
  88533. for (var p in s) {
  88534. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  88535. }
  88536. }
  88537. return t;
  88538. };
  88539. return __assign.apply(this, arguments);
  88540. }; // Styles
  88541. // Mixins
  88542. // Utilities
  88543. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_9__["default"])(Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__["default"])('bottom', ['height', 'inputValue']), _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_measurable__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_mixins_toggleable__WEBPACK_IMPORTED_MODULE_8__["factory"])('inputValue'), _mixins_proxyable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_scrollable__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_7__["default"]
  88544. /* @vue/component */
  88545. ).extend({
  88546. name: 'v-bottom-navigation',
  88547. props: {
  88548. activeClass: {
  88549. type: String,
  88550. default: 'v-btn--active'
  88551. },
  88552. backgroundColor: String,
  88553. grow: Boolean,
  88554. height: {
  88555. type: [Number, String],
  88556. default: 56
  88557. },
  88558. hideOnScroll: Boolean,
  88559. horizontal: Boolean,
  88560. inputValue: {
  88561. type: Boolean,
  88562. default: true
  88563. },
  88564. mandatory: Boolean,
  88565. shift: Boolean
  88566. },
  88567. data: function data() {
  88568. return {
  88569. isActive: this.inputValue
  88570. };
  88571. },
  88572. computed: {
  88573. canScroll: function canScroll() {
  88574. return _mixins_scrollable__WEBPACK_IMPORTED_MODULE_6__["default"].options.computed.canScroll.call(this) && (this.hideOnScroll || !this.inputValue);
  88575. },
  88576. classes: function classes() {
  88577. return {
  88578. 'v-bottom-navigation--absolute': this.absolute,
  88579. 'v-bottom-navigation--grow': this.grow,
  88580. 'v-bottom-navigation--fixed': !this.absolute && (this.app || this.fixed),
  88581. 'v-bottom-navigation--horizontal': this.horizontal,
  88582. 'v-bottom-navigation--shift': this.shift
  88583. };
  88584. },
  88585. styles: function styles() {
  88586. return __assign({}, this.measurableStyles, {
  88587. transform: this.isActive ? 'none' : 'translateY(100%)'
  88588. });
  88589. }
  88590. },
  88591. created: function created() {
  88592. /* istanbul ignore next */
  88593. if (this.$attrs.hasOwnProperty('active')) {
  88594. Object(_util_console__WEBPACK_IMPORTED_MODULE_10__["breaking"])('active.sync', 'value or v-model', this);
  88595. }
  88596. },
  88597. methods: {
  88598. thresholdMet: function thresholdMet() {
  88599. this.isActive = !this.isScrollingUp;
  88600. this.$emit('update:input-value', this.isActive);
  88601. },
  88602. updateApplication: function updateApplication() {
  88603. return this.$el ? this.$el.clientHeight : 0;
  88604. },
  88605. updateValue: function updateValue(val) {
  88606. this.$emit('change', val);
  88607. }
  88608. },
  88609. render: function render(h) {
  88610. var data = this.setBackgroundColor(this.backgroundColor, {
  88611. staticClass: 'v-bottom-navigation',
  88612. class: this.classes,
  88613. style: this.styles,
  88614. props: {
  88615. activeClass: this.activeClass,
  88616. mandatory: Boolean(this.mandatory || this.value !== undefined),
  88617. value: this.internalValue
  88618. },
  88619. on: {
  88620. change: this.updateValue
  88621. }
  88622. });
  88623. if (this.canScroll) {
  88624. data.directives = data.directives || [];
  88625. data.directives.push({
  88626. arg: this.scrollTarget,
  88627. name: 'scroll',
  88628. value: this.onScroll
  88629. });
  88630. }
  88631. return h(_mixins_button_group__WEBPACK_IMPORTED_MODULE_2__["default"], this.setTextColor(this.color, data), this.$slots.default);
  88632. }
  88633. }));
  88634. /***/ }),
  88635. /***/ "./src/components/VBottomNavigation/index.ts":
  88636. /*!***************************************************!*\
  88637. !*** ./src/components/VBottomNavigation/index.ts ***!
  88638. \***************************************************/
  88639. /*! exports provided: VBottomNavigation, default */
  88640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88641. "use strict";
  88642. __webpack_require__.r(__webpack_exports__);
  88643. /* harmony import */ var _VBottomNavigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBottomNavigation */ "./src/components/VBottomNavigation/VBottomNavigation.ts");
  88644. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBottomNavigation", function() { return _VBottomNavigation__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  88645. /* harmony default export */ __webpack_exports__["default"] = (_VBottomNavigation__WEBPACK_IMPORTED_MODULE_0__["default"]);
  88646. /***/ }),
  88647. /***/ "./src/components/VBottomSheet/VBottomSheet.sass":
  88648. /*!*******************************************************!*\
  88649. !*** ./src/components/VBottomSheet/VBottomSheet.sass ***!
  88650. \*******************************************************/
  88651. /*! no static exports found */
  88652. /***/ (function(module, exports, __webpack_require__) {
  88653. // extracted by mini-css-extract-plugin
  88654. /***/ }),
  88655. /***/ "./src/components/VBottomSheet/VBottomSheet.ts":
  88656. /*!*****************************************************!*\
  88657. !*** ./src/components/VBottomSheet/VBottomSheet.ts ***!
  88658. \*****************************************************/
  88659. /*! exports provided: default */
  88660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88661. "use strict";
  88662. __webpack_require__.r(__webpack_exports__);
  88663. /* harmony import */ var _VBottomSheet_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBottomSheet.sass */ "./src/components/VBottomSheet/VBottomSheet.sass");
  88664. /* harmony import */ var _VBottomSheet_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VBottomSheet_sass__WEBPACK_IMPORTED_MODULE_0__);
  88665. /* harmony import */ var _VDialog_VDialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VDialog/VDialog */ "./src/components/VDialog/VDialog.ts");
  88666. var __assign = undefined && undefined.__assign || function () {
  88667. __assign = Object.assign || function (t) {
  88668. for (var s, i = 1, n = arguments.length; i < n; i++) {
  88669. s = arguments[i];
  88670. for (var p in s) {
  88671. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  88672. }
  88673. }
  88674. return t;
  88675. };
  88676. return __assign.apply(this, arguments);
  88677. };
  88678. // Extensions
  88679. /* @vue/component */
  88680. /* harmony default export */ __webpack_exports__["default"] = (_VDialog_VDialog__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  88681. name: 'v-bottom-sheet',
  88682. props: {
  88683. inset: Boolean,
  88684. maxWidth: {
  88685. type: [String, Number],
  88686. default: 'auto'
  88687. },
  88688. transition: {
  88689. type: String,
  88690. default: 'bottom-sheet-transition'
  88691. }
  88692. },
  88693. computed: {
  88694. classes: function classes() {
  88695. return __assign({}, _VDialog_VDialog__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  88696. 'v-bottom-sheet': true,
  88697. 'v-bottom-sheet--inset': this.inset
  88698. });
  88699. }
  88700. }
  88701. }));
  88702. /***/ }),
  88703. /***/ "./src/components/VBottomSheet/index.ts":
  88704. /*!**********************************************!*\
  88705. !*** ./src/components/VBottomSheet/index.ts ***!
  88706. \**********************************************/
  88707. /*! exports provided: VBottomSheet, default */
  88708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88709. "use strict";
  88710. __webpack_require__.r(__webpack_exports__);
  88711. /* harmony import */ var _VBottomSheet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBottomSheet */ "./src/components/VBottomSheet/VBottomSheet.ts");
  88712. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBottomSheet", function() { return _VBottomSheet__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  88713. /* harmony default export */ __webpack_exports__["default"] = (_VBottomSheet__WEBPACK_IMPORTED_MODULE_0__["default"]);
  88714. /***/ }),
  88715. /***/ "./src/components/VBreadcrumbs/VBreadcrumbs.sass":
  88716. /*!*******************************************************!*\
  88717. !*** ./src/components/VBreadcrumbs/VBreadcrumbs.sass ***!
  88718. \*******************************************************/
  88719. /*! no static exports found */
  88720. /***/ (function(module, exports, __webpack_require__) {
  88721. // extracted by mini-css-extract-plugin
  88722. /***/ }),
  88723. /***/ "./src/components/VBreadcrumbs/VBreadcrumbs.ts":
  88724. /*!*****************************************************!*\
  88725. !*** ./src/components/VBreadcrumbs/VBreadcrumbs.ts ***!
  88726. \*****************************************************/
  88727. /*! exports provided: default */
  88728. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88729. "use strict";
  88730. __webpack_require__.r(__webpack_exports__);
  88731. /* harmony import */ var _VBreadcrumbs_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBreadcrumbs.sass */ "./src/components/VBreadcrumbs/VBreadcrumbs.sass");
  88732. /* harmony import */ var _VBreadcrumbs_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VBreadcrumbs_sass__WEBPACK_IMPORTED_MODULE_0__);
  88733. /* harmony import */ var _VBreadcrumbsItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VBreadcrumbsItem */ "./src/components/VBreadcrumbs/VBreadcrumbsItem.ts");
  88734. /* harmony import */ var _VBreadcrumbsDivider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VBreadcrumbsDivider */ "./src/components/VBreadcrumbs/VBreadcrumbsDivider.ts");
  88735. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  88736. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  88737. var __assign = undefined && undefined.__assign || function () {
  88738. __assign = Object.assign || function (t) {
  88739. for (var s, i = 1, n = arguments.length; i < n; i++) {
  88740. s = arguments[i];
  88741. for (var p in s) {
  88742. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  88743. }
  88744. }
  88745. return t;
  88746. };
  88747. return __assign.apply(this, arguments);
  88748. }; // Styles
  88749. // Components
  88750. // Mixins
  88751. // Utils
  88752. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]
  88753. /* @vue/component */
  88754. ).extend({
  88755. name: 'v-breadcrumbs',
  88756. props: {
  88757. divider: {
  88758. type: String,
  88759. default: '/'
  88760. },
  88761. items: {
  88762. type: Array,
  88763. default: function _default() {
  88764. return [];
  88765. }
  88766. },
  88767. large: Boolean
  88768. },
  88769. computed: {
  88770. classes: function classes() {
  88771. return __assign({
  88772. 'v-breadcrumbs--large': this.large
  88773. }, this.themeClasses);
  88774. }
  88775. },
  88776. methods: {
  88777. genDivider: function genDivider() {
  88778. return this.$createElement(_VBreadcrumbsDivider__WEBPACK_IMPORTED_MODULE_2__["default"], this.$slots.divider ? this.$slots.divider : this.divider);
  88779. },
  88780. genItems: function genItems() {
  88781. var items = [];
  88782. var hasSlot = !!this.$scopedSlots.item;
  88783. var keys = [];
  88784. for (var i = 0; i < this.items.length; i++) {
  88785. var item = this.items[i];
  88786. keys.push(item.text);
  88787. if (hasSlot) items.push(this.$scopedSlots.item({
  88788. item: item
  88789. }));else items.push(this.$createElement(_VBreadcrumbsItem__WEBPACK_IMPORTED_MODULE_1__["default"], {
  88790. key: keys.join('.'),
  88791. props: item
  88792. }, [item.text]));
  88793. if (i < this.items.length - 1) items.push(this.genDivider());
  88794. }
  88795. return items;
  88796. }
  88797. },
  88798. render: function render(h) {
  88799. var children = this.$slots.default || this.genItems();
  88800. return h('ul', {
  88801. staticClass: 'v-breadcrumbs',
  88802. class: this.classes
  88803. }, children);
  88804. }
  88805. }));
  88806. /***/ }),
  88807. /***/ "./src/components/VBreadcrumbs/VBreadcrumbsDivider.ts":
  88808. /*!************************************************************!*\
  88809. !*** ./src/components/VBreadcrumbs/VBreadcrumbsDivider.ts ***!
  88810. \************************************************************/
  88811. /*! exports provided: default */
  88812. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88813. "use strict";
  88814. __webpack_require__.r(__webpack_exports__);
  88815. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  88816. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-breadcrumbs__divider', 'li'));
  88817. /***/ }),
  88818. /***/ "./src/components/VBreadcrumbs/VBreadcrumbsItem.ts":
  88819. /*!*********************************************************!*\
  88820. !*** ./src/components/VBreadcrumbs/VBreadcrumbsItem.ts ***!
  88821. \*********************************************************/
  88822. /*! exports provided: default */
  88823. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88824. "use strict";
  88825. __webpack_require__.r(__webpack_exports__);
  88826. /* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable/index.ts");
  88827. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  88828. var __assign = undefined && undefined.__assign || function () {
  88829. __assign = Object.assign || function (t) {
  88830. for (var s, i = 1, n = arguments.length; i < n; i++) {
  88831. s = arguments[i];
  88832. for (var p in s) {
  88833. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  88834. }
  88835. }
  88836. return t;
  88837. };
  88838. return __assign.apply(this, arguments);
  88839. };
  88840. /* @vue/component */
  88841. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(_mixins_routable__WEBPACK_IMPORTED_MODULE_0__["default"]).extend({
  88842. name: 'v-breadcrumbs-item',
  88843. props: {
  88844. // In a breadcrumb, the currently
  88845. // active item should be dimmed
  88846. activeClass: {
  88847. type: String,
  88848. default: 'v-breadcrumbs__item--disabled'
  88849. },
  88850. ripple: {
  88851. type: [Boolean, Object],
  88852. default: false
  88853. }
  88854. },
  88855. computed: {
  88856. classes: function classes() {
  88857. var _a;
  88858. return _a = {
  88859. 'v-breadcrumbs__item': true
  88860. }, _a[this.activeClass] = this.disabled, _a;
  88861. }
  88862. },
  88863. render: function render(h) {
  88864. var _a = this.generateRouteLink(),
  88865. tag = _a.tag,
  88866. data = _a.data;
  88867. return h('li', [h(tag, __assign({}, data, {
  88868. attrs: __assign({}, data.attrs, {
  88869. 'aria-current': this.isActive && this.isLink ? 'page' : undefined
  88870. })
  88871. }), this.$slots.default)]);
  88872. }
  88873. }));
  88874. /***/ }),
  88875. /***/ "./src/components/VBreadcrumbs/index.ts":
  88876. /*!**********************************************!*\
  88877. !*** ./src/components/VBreadcrumbs/index.ts ***!
  88878. \**********************************************/
  88879. /*! exports provided: VBreadcrumbs, VBreadcrumbsItem, VBreadcrumbsDivider, default */
  88880. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88881. "use strict";
  88882. __webpack_require__.r(__webpack_exports__);
  88883. /* harmony import */ var _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBreadcrumbs */ "./src/components/VBreadcrumbs/VBreadcrumbs.ts");
  88884. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBreadcrumbs", function() { return _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  88885. /* harmony import */ var _VBreadcrumbsItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VBreadcrumbsItem */ "./src/components/VBreadcrumbs/VBreadcrumbsItem.ts");
  88886. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBreadcrumbsItem", function() { return _VBreadcrumbsItem__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  88887. /* harmony import */ var _VBreadcrumbsDivider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VBreadcrumbsDivider */ "./src/components/VBreadcrumbs/VBreadcrumbsDivider.ts");
  88888. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBreadcrumbsDivider", function() { return _VBreadcrumbsDivider__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  88889. /* harmony default export */ __webpack_exports__["default"] = ({
  88890. $_vuetify_subcomponents: {
  88891. VBreadcrumbs: _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_0__["default"],
  88892. VBreadcrumbsItem: _VBreadcrumbsItem__WEBPACK_IMPORTED_MODULE_1__["default"],
  88893. VBreadcrumbsDivider: _VBreadcrumbsDivider__WEBPACK_IMPORTED_MODULE_2__["default"]
  88894. }
  88895. });
  88896. /***/ }),
  88897. /***/ "./src/components/VBtn/VBtn.sass":
  88898. /*!***************************************!*\
  88899. !*** ./src/components/VBtn/VBtn.sass ***!
  88900. \***************************************/
  88901. /*! no static exports found */
  88902. /***/ (function(module, exports, __webpack_require__) {
  88903. // extracted by mini-css-extract-plugin
  88904. /***/ }),
  88905. /***/ "./src/components/VBtn/VBtn.ts":
  88906. /*!*************************************!*\
  88907. !*** ./src/components/VBtn/VBtn.ts ***!
  88908. \*************************************/
  88909. /*! exports provided: default */
  88910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88911. "use strict";
  88912. __webpack_require__.r(__webpack_exports__);
  88913. /* harmony import */ var _VBtn_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBtn.sass */ "./src/components/VBtn/VBtn.sass");
  88914. /* harmony import */ var _VBtn_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VBtn_sass__WEBPACK_IMPORTED_MODULE_0__);
  88915. /* harmony import */ var _VSheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSheet */ "./src/components/VSheet/index.ts");
  88916. /* harmony import */ var _VProgressCircular__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VProgressCircular */ "./src/components/VProgressCircular/index.ts");
  88917. /* harmony import */ var _mixins_groupable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/groupable */ "./src/mixins/groupable/index.ts");
  88918. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  88919. /* harmony import */ var _mixins_positionable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/positionable */ "./src/mixins/positionable/index.ts");
  88920. /* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable/index.ts");
  88921. /* harmony import */ var _mixins_sizeable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/sizeable */ "./src/mixins/sizeable/index.ts");
  88922. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  88923. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  88924. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  88925. var __assign = undefined && undefined.__assign || function () {
  88926. __assign = Object.assign || function (t) {
  88927. for (var s, i = 1, n = arguments.length; i < n; i++) {
  88928. s = arguments[i];
  88929. for (var p in s) {
  88930. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  88931. }
  88932. }
  88933. return t;
  88934. };
  88935. return __assign.apply(this, arguments);
  88936. };
  88937. var __read = undefined && undefined.__read || function (o, n) {
  88938. var m = typeof Symbol === "function" && o[Symbol.iterator];
  88939. if (!m) return o;
  88940. var i = m.call(o),
  88941. r,
  88942. ar = [],
  88943. e;
  88944. try {
  88945. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  88946. ar.push(r.value);
  88947. }
  88948. } catch (error) {
  88949. e = {
  88950. error: error
  88951. };
  88952. } finally {
  88953. try {
  88954. if (r && !r.done && (m = i["return"])) m.call(i);
  88955. } finally {
  88956. if (e) throw e.error;
  88957. }
  88958. }
  88959. return ar;
  88960. }; // Styles
  88961. // Extensions
  88962. // Components
  88963. // Mixins
  88964. // Utilities
  88965. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_8__["default"])(_VSheet__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_routable__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_positionable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_sizeable__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_mixins_groupable__WEBPACK_IMPORTED_MODULE_3__["factory"])('btnToggle'), Object(_mixins_toggleable__WEBPACK_IMPORTED_MODULE_4__["factory"])('inputValue')
  88966. /* @vue/component */
  88967. );
  88968. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  88969. name: 'v-btn',
  88970. props: {
  88971. activeClass: {
  88972. type: String,
  88973. default: function _default() {
  88974. if (!this.btnToggle) return '';
  88975. return this.btnToggle.activeClass;
  88976. }
  88977. },
  88978. block: Boolean,
  88979. depressed: Boolean,
  88980. fab: Boolean,
  88981. icon: Boolean,
  88982. loading: Boolean,
  88983. outlined: Boolean,
  88984. retainFocusOnClick: Boolean,
  88985. rounded: Boolean,
  88986. tag: {
  88987. type: String,
  88988. default: 'button'
  88989. },
  88990. text: Boolean,
  88991. type: {
  88992. type: String,
  88993. default: 'button'
  88994. },
  88995. value: null
  88996. },
  88997. data: function data() {
  88998. return {
  88999. proxyClass: 'v-btn--active'
  89000. };
  89001. },
  89002. computed: {
  89003. classes: function classes() {
  89004. return __assign({
  89005. 'v-btn': true
  89006. }, _mixins_routable__WEBPACK_IMPORTED_MODULE_6__["default"].options.computed.classes.call(this), {
  89007. 'v-btn--absolute': this.absolute,
  89008. 'v-btn--block': this.block,
  89009. 'v-btn--bottom': this.bottom,
  89010. 'v-btn--contained': this.contained,
  89011. 'v-btn--depressed': this.depressed || this.outlined,
  89012. 'v-btn--disabled': this.disabled,
  89013. 'v-btn--fab': this.fab,
  89014. 'v-btn--fixed': this.fixed,
  89015. 'v-btn--flat': this.isFlat,
  89016. 'v-btn--icon': this.icon,
  89017. 'v-btn--left': this.left,
  89018. 'v-btn--loading': this.loading,
  89019. 'v-btn--outlined': this.outlined,
  89020. 'v-btn--right': this.right,
  89021. 'v-btn--round': this.isRound,
  89022. 'v-btn--rounded': this.rounded,
  89023. 'v-btn--router': this.to,
  89024. 'v-btn--text': this.text,
  89025. 'v-btn--tile': this.tile,
  89026. 'v-btn--top': this.top
  89027. }, this.themeClasses, this.groupClasses, this.elevationClasses, this.sizeableClasses);
  89028. },
  89029. contained: function contained() {
  89030. return Boolean(!this.isFlat && !this.depressed && // Contained class only adds elevation
  89031. // is not needed if user provides value
  89032. !this.elevation);
  89033. },
  89034. computedRipple: function computedRipple() {
  89035. var defaultRipple = this.icon || this.fab ? {
  89036. circle: true
  89037. } : true;
  89038. if (this.disabled) return false;else return this.ripple != null ? this.ripple : defaultRipple;
  89039. },
  89040. isFlat: function isFlat() {
  89041. return Boolean(this.icon || this.text || this.outlined);
  89042. },
  89043. isRound: function isRound() {
  89044. return Boolean(this.icon || this.fab);
  89045. },
  89046. styles: function styles() {
  89047. return __assign({}, this.measurableStyles);
  89048. }
  89049. },
  89050. created: function created() {
  89051. var _this = this;
  89052. var breakingProps = [['flat', 'text'], ['outline', 'outlined'], ['round', 'rounded']];
  89053. /* istanbul ignore next */
  89054. breakingProps.forEach(function (_a) {
  89055. var _b = __read(_a, 2),
  89056. original = _b[0],
  89057. replacement = _b[1];
  89058. if (_this.$attrs.hasOwnProperty(original)) Object(_util_console__WEBPACK_IMPORTED_MODULE_9__["breaking"])(original, replacement, _this);
  89059. });
  89060. },
  89061. methods: {
  89062. click: function click(e) {
  89063. !this.retainFocusOnClick && !this.fab && e.detail && this.$el.blur();
  89064. this.$emit('click', e);
  89065. this.btnToggle && this.toggle();
  89066. },
  89067. genContent: function genContent() {
  89068. return this.$createElement('span', {
  89069. staticClass: 'v-btn__content'
  89070. }, this.$slots.default);
  89071. },
  89072. genLoader: function genLoader() {
  89073. return this.$createElement('span', {
  89074. class: 'v-btn__loader'
  89075. }, this.$slots.loader || [this.$createElement(_VProgressCircular__WEBPACK_IMPORTED_MODULE_2__["default"], {
  89076. props: {
  89077. indeterminate: true,
  89078. size: 23,
  89079. width: 2
  89080. }
  89081. })]);
  89082. }
  89083. },
  89084. render: function render(h) {
  89085. var children = [this.genContent(), this.loading && this.genLoader()];
  89086. var setColor = !this.isFlat ? this.setBackgroundColor : this.setTextColor;
  89087. var _a = this.generateRouteLink(),
  89088. tag = _a.tag,
  89089. data = _a.data;
  89090. if (tag === 'button') {
  89091. data.attrs.type = this.type;
  89092. data.attrs.disabled = this.disabled;
  89093. }
  89094. data.attrs.value = ['string', 'number'].includes(_typeof(this.value)) ? this.value : JSON.stringify(this.value);
  89095. return h(tag, this.disabled ? data : setColor(this.color, data), children);
  89096. }
  89097. }));
  89098. /***/ }),
  89099. /***/ "./src/components/VBtn/index.ts":
  89100. /*!**************************************!*\
  89101. !*** ./src/components/VBtn/index.ts ***!
  89102. \**************************************/
  89103. /*! exports provided: VBtn, default */
  89104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89105. "use strict";
  89106. __webpack_require__.r(__webpack_exports__);
  89107. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBtn */ "./src/components/VBtn/VBtn.ts");
  89108. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBtn", function() { return _VBtn__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  89109. /* harmony default export */ __webpack_exports__["default"] = (_VBtn__WEBPACK_IMPORTED_MODULE_0__["default"]);
  89110. /***/ }),
  89111. /***/ "./src/components/VBtnToggle/VBtnToggle.sass":
  89112. /*!***************************************************!*\
  89113. !*** ./src/components/VBtnToggle/VBtnToggle.sass ***!
  89114. \***************************************************/
  89115. /*! no static exports found */
  89116. /***/ (function(module, exports, __webpack_require__) {
  89117. // extracted by mini-css-extract-plugin
  89118. /***/ }),
  89119. /***/ "./src/components/VBtnToggle/VBtnToggle.ts":
  89120. /*!*************************************************!*\
  89121. !*** ./src/components/VBtnToggle/VBtnToggle.ts ***!
  89122. \*************************************************/
  89123. /*! exports provided: default */
  89124. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89125. "use strict";
  89126. __webpack_require__.r(__webpack_exports__);
  89127. /* harmony import */ var _VBtnToggle_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBtnToggle.sass */ "./src/components/VBtnToggle/VBtnToggle.sass");
  89128. /* harmony import */ var _VBtnToggle_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VBtnToggle_sass__WEBPACK_IMPORTED_MODULE_0__);
  89129. /* harmony import */ var _mixins_button_group__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/button-group */ "./src/mixins/button-group/index.ts");
  89130. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  89131. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  89132. var __assign = undefined && undefined.__assign || function () {
  89133. __assign = Object.assign || function (t) {
  89134. for (var s, i = 1, n = arguments.length; i < n; i++) {
  89135. s = arguments[i];
  89136. for (var p in s) {
  89137. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  89138. }
  89139. }
  89140. return t;
  89141. };
  89142. return __assign.apply(this, arguments);
  89143. }; // Styles
  89144. // Mixins
  89145. // Utilities
  89146. /* @vue/component */
  89147. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_button_group__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"]).extend({
  89148. name: 'v-btn-toggle',
  89149. props: {
  89150. backgroundColor: String,
  89151. borderless: Boolean,
  89152. dense: Boolean,
  89153. group: Boolean,
  89154. rounded: Boolean,
  89155. shaped: Boolean,
  89156. tile: Boolean
  89157. },
  89158. computed: {
  89159. classes: function classes() {
  89160. return __assign({}, _mixins_button_group__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  89161. 'v-btn-toggle': true,
  89162. 'v-btn-toggle--borderless': this.borderless,
  89163. 'v-btn-toggle--dense': this.dense,
  89164. 'v-btn-toggle--group': this.group,
  89165. 'v-btn-toggle--rounded': this.rounded,
  89166. 'v-btn-toggle--shaped': this.shaped,
  89167. 'v-btn-toggle--tile': this.tile
  89168. }, this.themeClasses);
  89169. }
  89170. },
  89171. methods: {
  89172. genData: function genData() {
  89173. var data = this.setTextColor(this.color, __assign({}, _mixins_button_group__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genData.call(this)));
  89174. if (this.group) return data;
  89175. return this.setBackgroundColor(this.backgroundColor, data);
  89176. }
  89177. }
  89178. }));
  89179. /***/ }),
  89180. /***/ "./src/components/VBtnToggle/index.ts":
  89181. /*!********************************************!*\
  89182. !*** ./src/components/VBtnToggle/index.ts ***!
  89183. \********************************************/
  89184. /*! exports provided: VBtnToggle, default */
  89185. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89186. "use strict";
  89187. __webpack_require__.r(__webpack_exports__);
  89188. /* harmony import */ var _VBtnToggle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBtnToggle */ "./src/components/VBtnToggle/VBtnToggle.ts");
  89189. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBtnToggle", function() { return _VBtnToggle__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  89190. /* harmony default export */ __webpack_exports__["default"] = (_VBtnToggle__WEBPACK_IMPORTED_MODULE_0__["default"]);
  89191. /***/ }),
  89192. /***/ "./src/components/VCalendar/VCalendar.ts":
  89193. /*!***********************************************!*\
  89194. !*** ./src/components/VCalendar/VCalendar.ts ***!
  89195. \***********************************************/
  89196. /*! exports provided: default */
  89197. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89198. "use strict";
  89199. __webpack_require__.r(__webpack_exports__);
  89200. /* harmony import */ var _mixins_calendar_with_events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mixins/calendar-with-events */ "./src/components/VCalendar/mixins/calendar-with-events.ts");
  89201. /* harmony import */ var _util_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/props */ "./src/components/VCalendar/util/props.ts");
  89202. /* harmony import */ var _util_timestamp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  89203. /* harmony import */ var _VCalendarMonthly__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VCalendarMonthly */ "./src/components/VCalendar/VCalendarMonthly.ts");
  89204. /* harmony import */ var _VCalendarDaily__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VCalendarDaily */ "./src/components/VCalendar/VCalendarDaily.ts");
  89205. /* harmony import */ var _VCalendarWeekly__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VCalendarWeekly */ "./src/components/VCalendar/VCalendarWeekly.ts");
  89206. // Styles
  89207. // import '../../stylus/components/_calendar-daily.styl'
  89208. var __assign = undefined && undefined.__assign || function () {
  89209. __assign = Object.assign || function (t) {
  89210. for (var s, i = 1, n = arguments.length; i < n; i++) {
  89211. s = arguments[i];
  89212. for (var p in s) {
  89213. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  89214. }
  89215. }
  89216. return t;
  89217. };
  89218. return __assign.apply(this, arguments);
  89219. }; // Mixins
  89220. // Util
  89221. // Calendars
  89222. /* @vue/component */
  89223. /* harmony default export */ __webpack_exports__["default"] = (_mixins_calendar_with_events__WEBPACK_IMPORTED_MODULE_0__["default"].extend({
  89224. name: 'v-calendar',
  89225. props: __assign({}, _util_props__WEBPACK_IMPORTED_MODULE_1__["default"].calendar, _util_props__WEBPACK_IMPORTED_MODULE_1__["default"].weeks, _util_props__WEBPACK_IMPORTED_MODULE_1__["default"].intervals),
  89226. data: function data() {
  89227. return {
  89228. lastStart: null,
  89229. lastEnd: null
  89230. };
  89231. },
  89232. computed: {
  89233. parsedValue: function parsedValue() {
  89234. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["validateTimestamp"])(this.value) ? Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["parseTimestamp"])(this.value, true) : this.parsedStart || this.times.today;
  89235. },
  89236. renderProps: function renderProps() {
  89237. var around = this.parsedValue;
  89238. var component = null;
  89239. var maxDays = this.maxDays;
  89240. var weekdays = this.parsedWeekdays;
  89241. var start = around;
  89242. var end = around;
  89243. switch (this.type) {
  89244. case 'month':
  89245. component = _VCalendarMonthly__WEBPACK_IMPORTED_MODULE_3__["default"];
  89246. start = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["getStartOfMonth"])(around);
  89247. end = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["getEndOfMonth"])(around);
  89248. break;
  89249. case 'week':
  89250. component = _VCalendarDaily__WEBPACK_IMPORTED_MODULE_4__["default"];
  89251. start = this.getStartOfWeek(around);
  89252. end = this.getEndOfWeek(around);
  89253. maxDays = 7;
  89254. break;
  89255. case 'day':
  89256. component = _VCalendarDaily__WEBPACK_IMPORTED_MODULE_4__["default"];
  89257. maxDays = 1;
  89258. weekdays = [start.weekday];
  89259. break;
  89260. case '4day':
  89261. component = _VCalendarDaily__WEBPACK_IMPORTED_MODULE_4__["default"];
  89262. end = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["relativeDays"])(Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["copyTimestamp"])(end), _util_timestamp__WEBPACK_IMPORTED_MODULE_2__["nextDay"], 4);
  89263. Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["updateFormatted"])(end);
  89264. maxDays = 4;
  89265. weekdays = [start.weekday, (start.weekday + 1) % 7, (start.weekday + 2) % 7, (start.weekday + 3) % 7];
  89266. break;
  89267. case 'custom-weekly':
  89268. component = _VCalendarWeekly__WEBPACK_IMPORTED_MODULE_5__["default"];
  89269. start = this.parsedStart || around;
  89270. end = this.parsedEnd;
  89271. break;
  89272. case 'custom-daily':
  89273. component = _VCalendarDaily__WEBPACK_IMPORTED_MODULE_4__["default"];
  89274. start = this.parsedStart || around;
  89275. end = this.parsedEnd;
  89276. break;
  89277. default:
  89278. throw new Error(this.type + ' is not a valid Calendar type');
  89279. }
  89280. return {
  89281. component: component,
  89282. start: start,
  89283. end: end,
  89284. maxDays: maxDays,
  89285. weekdays: weekdays
  89286. };
  89287. },
  89288. eventWeekdays: function eventWeekdays() {
  89289. return this.renderProps.weekdays;
  89290. }
  89291. },
  89292. watch: {
  89293. renderProps: 'checkChange'
  89294. },
  89295. mounted: function mounted() {
  89296. this.updateEventVisibility();
  89297. this.checkChange();
  89298. },
  89299. updated: function updated() {
  89300. window.requestAnimationFrame(this.updateEventVisibility);
  89301. },
  89302. methods: {
  89303. checkChange: function checkChange() {
  89304. var _a = this,
  89305. lastStart = _a.lastStart,
  89306. lastEnd = _a.lastEnd;
  89307. var _b = this.renderProps,
  89308. start = _b.start,
  89309. end = _b.end;
  89310. if (!lastStart || !lastEnd || start.date !== lastStart.date || end.date !== lastEnd.date) {
  89311. this.lastStart = start;
  89312. this.lastEnd = end;
  89313. this.$emit('change', {
  89314. start: start,
  89315. end: end
  89316. });
  89317. }
  89318. },
  89319. move: function move(amount) {
  89320. if (amount === void 0) {
  89321. amount = 1;
  89322. }
  89323. var moved = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["copyTimestamp"])(this.parsedValue);
  89324. var forward = amount > 0;
  89325. var mover = forward ? _util_timestamp__WEBPACK_IMPORTED_MODULE_2__["nextDay"] : _util_timestamp__WEBPACK_IMPORTED_MODULE_2__["prevDay"];
  89326. var limit = forward ? _util_timestamp__WEBPACK_IMPORTED_MODULE_2__["DAYS_IN_MONTH_MAX"] : _util_timestamp__WEBPACK_IMPORTED_MODULE_2__["DAY_MIN"];
  89327. var times = forward ? amount : -amount;
  89328. while (--times >= 0) {
  89329. switch (this.type) {
  89330. case 'month':
  89331. moved.day = limit;
  89332. mover(moved);
  89333. break;
  89334. case 'week':
  89335. Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["relativeDays"])(moved, mover, _util_timestamp__WEBPACK_IMPORTED_MODULE_2__["DAYS_IN_WEEK"]);
  89336. break;
  89337. case 'day':
  89338. Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["relativeDays"])(moved, mover, 1);
  89339. break;
  89340. case '4day':
  89341. Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["relativeDays"])(moved, mover, 4);
  89342. break;
  89343. }
  89344. }
  89345. Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["updateWeekday"])(moved);
  89346. Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["updateFormatted"])(moved);
  89347. Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["updateRelative"])(moved, this.times.now);
  89348. this.$emit('input', moved.date);
  89349. this.$emit('moved', moved);
  89350. },
  89351. next: function next(amount) {
  89352. if (amount === void 0) {
  89353. amount = 1;
  89354. }
  89355. this.move(amount);
  89356. },
  89357. prev: function prev(amount) {
  89358. if (amount === void 0) {
  89359. amount = 1;
  89360. }
  89361. this.move(-amount);
  89362. },
  89363. timeToY: function timeToY(time, clamp) {
  89364. if (clamp === void 0) {
  89365. clamp = true;
  89366. }
  89367. var c = this.$children[0];
  89368. if (c && c.timeToY) {
  89369. return c.timeToY(time, clamp);
  89370. } else {
  89371. return false;
  89372. }
  89373. },
  89374. minutesToPixels: function minutesToPixels(minutes) {
  89375. var c = this.$children[0];
  89376. if (c && c.minutesToPixels) {
  89377. return c.minutesToPixels(minutes);
  89378. } else {
  89379. return -1;
  89380. }
  89381. },
  89382. scrollToTime: function scrollToTime(time) {
  89383. var c = this.$children[0];
  89384. if (c && c.scrollToTime) {
  89385. return c.scrollToTime(time);
  89386. } else {
  89387. return false;
  89388. }
  89389. }
  89390. },
  89391. render: function render(h) {
  89392. var _this = this;
  89393. var _a = this.renderProps,
  89394. start = _a.start,
  89395. end = _a.end,
  89396. maxDays = _a.maxDays,
  89397. component = _a.component,
  89398. weekdays = _a.weekdays;
  89399. return h(component, {
  89400. staticClass: 'v-calendar',
  89401. class: {
  89402. 'v-calendar-events': !this.noEvents
  89403. },
  89404. props: __assign({}, this.$props, {
  89405. start: start.date,
  89406. end: end.date,
  89407. maxDays: maxDays,
  89408. weekdays: weekdays
  89409. }),
  89410. directives: [{
  89411. modifiers: {
  89412. quiet: true
  89413. },
  89414. name: 'resize',
  89415. value: this.updateEventVisibility
  89416. }],
  89417. on: __assign({}, this.$listeners, {
  89418. 'click:date': function clickDate(day) {
  89419. if (_this.$listeners['input']) {
  89420. _this.$emit('input', day.date);
  89421. }
  89422. if (_this.$listeners['click:date']) {
  89423. _this.$emit('click:date', day);
  89424. }
  89425. }
  89426. }),
  89427. scopedSlots: this.getScopedSlots()
  89428. });
  89429. }
  89430. }));
  89431. /***/ }),
  89432. /***/ "./src/components/VCalendar/VCalendarDaily.sass":
  89433. /*!******************************************************!*\
  89434. !*** ./src/components/VCalendar/VCalendarDaily.sass ***!
  89435. \******************************************************/
  89436. /*! no static exports found */
  89437. /***/ (function(module, exports, __webpack_require__) {
  89438. // extracted by mini-css-extract-plugin
  89439. /***/ }),
  89440. /***/ "./src/components/VCalendar/VCalendarDaily.ts":
  89441. /*!****************************************************!*\
  89442. !*** ./src/components/VCalendar/VCalendarDaily.ts ***!
  89443. \****************************************************/
  89444. /*! exports provided: default */
  89445. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89446. "use strict";
  89447. __webpack_require__.r(__webpack_exports__);
  89448. /* harmony import */ var _VCalendarDaily_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCalendarDaily.sass */ "./src/components/VCalendar/VCalendarDaily.sass");
  89449. /* harmony import */ var _VCalendarDaily_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VCalendarDaily_sass__WEBPACK_IMPORTED_MODULE_0__);
  89450. /* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize/index.ts");
  89451. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  89452. /* harmony import */ var _mixins_calendar_with_intervals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mixins/calendar-with-intervals */ "./src/components/VCalendar/mixins/calendar-with-intervals.ts");
  89453. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  89454. var __assign = undefined && undefined.__assign || function () {
  89455. __assign = Object.assign || function (t) {
  89456. for (var s, i = 1, n = arguments.length; i < n; i++) {
  89457. s = arguments[i];
  89458. for (var p in s) {
  89459. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  89460. }
  89461. }
  89462. return t;
  89463. };
  89464. return __assign.apply(this, arguments);
  89465. };
  89466. var __read = undefined && undefined.__read || function (o, n) {
  89467. var m = typeof Symbol === "function" && o[Symbol.iterator];
  89468. if (!m) return o;
  89469. var i = m.call(o),
  89470. r,
  89471. ar = [],
  89472. e;
  89473. try {
  89474. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  89475. ar.push(r.value);
  89476. }
  89477. } catch (error) {
  89478. e = {
  89479. error: error
  89480. };
  89481. } finally {
  89482. try {
  89483. if (r && !r.done && (m = i["return"])) m.call(i);
  89484. } finally {
  89485. if (e) throw e.error;
  89486. }
  89487. }
  89488. return ar;
  89489. };
  89490. var __spread = undefined && undefined.__spread || function () {
  89491. for (var ar = [], i = 0; i < arguments.length; i++) {
  89492. ar = ar.concat(__read(arguments[i]));
  89493. }
  89494. return ar;
  89495. }; // Styles
  89496. // Directives
  89497. // Components
  89498. // Mixins
  89499. // Util
  89500. /* @vue/component */
  89501. /* harmony default export */ __webpack_exports__["default"] = (_mixins_calendar_with_intervals__WEBPACK_IMPORTED_MODULE_3__["default"].extend({
  89502. name: 'v-calendar-daily',
  89503. directives: {
  89504. Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_1__["default"]
  89505. },
  89506. data: function data() {
  89507. return {
  89508. scrollPush: 0
  89509. };
  89510. },
  89511. computed: {
  89512. classes: function classes() {
  89513. return __assign({
  89514. 'v-calendar-daily': true
  89515. }, this.themeClasses);
  89516. }
  89517. },
  89518. mounted: function mounted() {
  89519. this.init();
  89520. },
  89521. methods: {
  89522. init: function init() {
  89523. this.$nextTick(this.onResize);
  89524. },
  89525. onResize: function onResize() {
  89526. this.scrollPush = this.getScrollPush();
  89527. },
  89528. getScrollPush: function getScrollPush() {
  89529. var area = this.$refs.scrollArea;
  89530. var pane = this.$refs.pane;
  89531. return area && pane ? area.offsetWidth - pane.offsetWidth : 0;
  89532. },
  89533. genHead: function genHead() {
  89534. return this.$createElement('div', {
  89535. staticClass: 'v-calendar-daily__head',
  89536. style: {
  89537. marginRight: this.scrollPush + 'px'
  89538. }
  89539. }, __spread([this.genHeadIntervals()], this.genHeadDays()));
  89540. },
  89541. genHeadIntervals: function genHeadIntervals() {
  89542. var width = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.intervalWidth);
  89543. return this.$createElement('div', {
  89544. staticClass: 'v-calendar-daily__intervals-head',
  89545. style: {
  89546. width: width
  89547. }
  89548. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getSlot"])(this, 'interval-header'));
  89549. },
  89550. genHeadDays: function genHeadDays() {
  89551. return this.days.map(this.genHeadDay);
  89552. },
  89553. genHeadDay: function genHeadDay(day, index) {
  89554. var _this = this;
  89555. var header = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getSlot"])(this, 'day-header', function () {
  89556. return __assign({
  89557. week: _this.days
  89558. }, day, {
  89559. index: index
  89560. });
  89561. });
  89562. return this.$createElement('div', {
  89563. key: day.date,
  89564. staticClass: 'v-calendar-daily_head-day',
  89565. class: this.getRelativeClasses(day),
  89566. on: this.getDefaultMouseEventHandlers(':day', function (_e) {
  89567. return _this.getSlotScope(day);
  89568. })
  89569. }, __spread([this.genHeadWeekday(day), this.genHeadDayLabel(day)], header || []));
  89570. },
  89571. genHeadWeekday: function genHeadWeekday(day) {
  89572. var color = day.present ? this.color : undefined;
  89573. return this.$createElement('div', this.setTextColor(color, {
  89574. staticClass: 'v-calendar-daily_head-weekday'
  89575. }), this.weekdayFormatter(day, this.shortWeekdays));
  89576. },
  89577. genHeadDayLabel: function genHeadDayLabel(day) {
  89578. return this.$createElement('div', {
  89579. staticClass: 'v-calendar-daily_head-day-label'
  89580. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getSlot"])(this, 'day-label-header', day) || [this.genHeadDayButton(day)]);
  89581. },
  89582. genHeadDayButton: function genHeadDayButton(day) {
  89583. var color = day.present ? this.color : 'transparent';
  89584. return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_2__["default"], {
  89585. props: {
  89586. color: color,
  89587. fab: true,
  89588. depressed: true
  89589. },
  89590. on: this.getMouseEventHandlers({
  89591. 'click:date': {
  89592. event: 'click',
  89593. stop: true
  89594. },
  89595. 'contextmenu:date': {
  89596. event: 'contextmenu',
  89597. stop: true,
  89598. prevent: true,
  89599. result: false
  89600. }
  89601. }, function (_e) {
  89602. return day;
  89603. })
  89604. }, this.dayFormatter(day, false));
  89605. },
  89606. genBody: function genBody() {
  89607. return this.$createElement('div', {
  89608. staticClass: 'v-calendar-daily__body'
  89609. }, [this.genScrollArea()]);
  89610. },
  89611. genScrollArea: function genScrollArea() {
  89612. return this.$createElement('div', {
  89613. ref: 'scrollArea',
  89614. staticClass: 'v-calendar-daily__scroll-area'
  89615. }, [this.genPane()]);
  89616. },
  89617. genPane: function genPane() {
  89618. return this.$createElement('div', {
  89619. ref: 'pane',
  89620. staticClass: 'v-calendar-daily__pane',
  89621. style: {
  89622. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.bodyHeight)
  89623. }
  89624. }, [this.genDayContainer()]);
  89625. },
  89626. genDayContainer: function genDayContainer() {
  89627. return this.$createElement('div', {
  89628. staticClass: 'v-calendar-daily__day-container'
  89629. }, __spread([this.genBodyIntervals()], this.genDays()));
  89630. },
  89631. genDays: function genDays() {
  89632. return this.days.map(this.genDay);
  89633. },
  89634. genDay: function genDay(day, index) {
  89635. var _this = this;
  89636. return this.$createElement('div', {
  89637. key: day.date,
  89638. staticClass: 'v-calendar-daily__day',
  89639. class: this.getRelativeClasses(day),
  89640. on: this.getDefaultMouseEventHandlers(':time', function (e) {
  89641. return _this.getSlotScope(_this.getTimestampAtEvent(e, day));
  89642. })
  89643. }, __spread(this.genDayIntervals(index), Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getSlot"])(this, 'day-body', function () {
  89644. return _this.getSlotScope(day);
  89645. }) || []));
  89646. },
  89647. genDayIntervals: function genDayIntervals(index) {
  89648. return this.intervals[index].map(this.genDayInterval);
  89649. },
  89650. genDayInterval: function genDayInterval(interval) {
  89651. var _this = this;
  89652. var height = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.intervalHeight);
  89653. var styler = this.intervalStyle || this.intervalStyleDefault;
  89654. var data = {
  89655. key: interval.time,
  89656. staticClass: 'v-calendar-daily__day-interval',
  89657. style: __assign({
  89658. height: height
  89659. }, styler(interval))
  89660. };
  89661. var children = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getSlot"])(this, 'interval', function () {
  89662. return _this.getSlotScope(interval);
  89663. });
  89664. return this.$createElement('div', data, children);
  89665. },
  89666. genBodyIntervals: function genBodyIntervals() {
  89667. var _this = this;
  89668. var width = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.intervalWidth);
  89669. var data = {
  89670. staticClass: 'v-calendar-daily__intervals-body',
  89671. style: {
  89672. width: width
  89673. },
  89674. on: this.getDefaultMouseEventHandlers(':interval', function (e) {
  89675. return _this.getTimestampAtEvent(e, _this.parsedStart);
  89676. })
  89677. };
  89678. return this.$createElement('div', data, this.genIntervalLabels());
  89679. },
  89680. genIntervalLabels: function genIntervalLabels() {
  89681. if (!this.intervals.length) return null;
  89682. return this.intervals[0].map(this.genIntervalLabel);
  89683. },
  89684. genIntervalLabel: function genIntervalLabel(interval) {
  89685. var height = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.intervalHeight);
  89686. var short = this.shortIntervals;
  89687. var shower = this.showIntervalLabel || this.showIntervalLabelDefault;
  89688. var show = shower(interval);
  89689. var label = show ? this.intervalFormatter(interval, short) : undefined;
  89690. return this.$createElement('div', {
  89691. key: interval.time,
  89692. staticClass: 'v-calendar-daily__interval',
  89693. style: {
  89694. height: height
  89695. }
  89696. }, [this.$createElement('div', {
  89697. staticClass: 'v-calendar-daily__interval-text'
  89698. }, label)]);
  89699. }
  89700. },
  89701. render: function render(h) {
  89702. return h('div', {
  89703. class: this.classes,
  89704. nativeOn: {
  89705. dragstart: function dragstart(e) {
  89706. e.preventDefault();
  89707. }
  89708. },
  89709. directives: [{
  89710. modifiers: {
  89711. quiet: true
  89712. },
  89713. name: 'resize',
  89714. value: this.onResize
  89715. }]
  89716. }, [!this.hideHeader ? this.genHead() : '', this.genBody()]);
  89717. }
  89718. }));
  89719. /***/ }),
  89720. /***/ "./src/components/VCalendar/VCalendarMonthly.ts":
  89721. /*!******************************************************!*\
  89722. !*** ./src/components/VCalendar/VCalendarMonthly.ts ***!
  89723. \******************************************************/
  89724. /*! exports provided: default */
  89725. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89726. "use strict";
  89727. __webpack_require__.r(__webpack_exports__);
  89728. /* harmony import */ var _VCalendarWeekly_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCalendarWeekly.sass */ "./src/components/VCalendar/VCalendarWeekly.sass");
  89729. /* harmony import */ var _VCalendarWeekly_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VCalendarWeekly_sass__WEBPACK_IMPORTED_MODULE_0__);
  89730. /* harmony import */ var _VCalendarWeekly__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VCalendarWeekly */ "./src/components/VCalendar/VCalendarWeekly.ts");
  89731. /* harmony import */ var _util_timestamp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  89732. // Styles
  89733. // Mixins
  89734. // Util
  89735. /* @vue/component */
  89736. /* harmony default export */ __webpack_exports__["default"] = (_VCalendarWeekly__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  89737. name: 'v-calendar-monthly',
  89738. computed: {
  89739. staticClass: function staticClass() {
  89740. return 'v-calendar-monthly v-calendar-weekly';
  89741. },
  89742. parsedStart: function parsedStart() {
  89743. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["getStartOfMonth"])(Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["parseTimestamp"])(this.start, true));
  89744. },
  89745. parsedEnd: function parsedEnd() {
  89746. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["getEndOfMonth"])(Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["parseTimestamp"])(this.end, true));
  89747. }
  89748. }
  89749. }));
  89750. /***/ }),
  89751. /***/ "./src/components/VCalendar/VCalendarWeekly.sass":
  89752. /*!*******************************************************!*\
  89753. !*** ./src/components/VCalendar/VCalendarWeekly.sass ***!
  89754. \*******************************************************/
  89755. /*! no static exports found */
  89756. /***/ (function(module, exports, __webpack_require__) {
  89757. // extracted by mini-css-extract-plugin
  89758. /***/ }),
  89759. /***/ "./src/components/VCalendar/VCalendarWeekly.ts":
  89760. /*!*****************************************************!*\
  89761. !*** ./src/components/VCalendar/VCalendarWeekly.ts ***!
  89762. \*****************************************************/
  89763. /*! exports provided: default */
  89764. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89765. "use strict";
  89766. __webpack_require__.r(__webpack_exports__);
  89767. /* harmony import */ var _VCalendarWeekly_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCalendarWeekly.sass */ "./src/components/VCalendar/VCalendarWeekly.sass");
  89768. /* harmony import */ var _VCalendarWeekly_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VCalendarWeekly_sass__WEBPACK_IMPORTED_MODULE_0__);
  89769. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  89770. /* harmony import */ var _mixins_calendar_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mixins/calendar-base */ "./src/components/VCalendar/mixins/calendar-base.ts");
  89771. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  89772. /* harmony import */ var _util_props__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/props */ "./src/components/VCalendar/util/props.ts");
  89773. /* harmony import */ var _util_timestamp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  89774. var __assign = undefined && undefined.__assign || function () {
  89775. __assign = Object.assign || function (t) {
  89776. for (var s, i = 1, n = arguments.length; i < n; i++) {
  89777. s = arguments[i];
  89778. for (var p in s) {
  89779. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  89780. }
  89781. }
  89782. return t;
  89783. };
  89784. return __assign.apply(this, arguments);
  89785. };
  89786. var __read = undefined && undefined.__read || function (o, n) {
  89787. var m = typeof Symbol === "function" && o[Symbol.iterator];
  89788. if (!m) return o;
  89789. var i = m.call(o),
  89790. r,
  89791. ar = [],
  89792. e;
  89793. try {
  89794. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  89795. ar.push(r.value);
  89796. }
  89797. } catch (error) {
  89798. e = {
  89799. error: error
  89800. };
  89801. } finally {
  89802. try {
  89803. if (r && !r.done && (m = i["return"])) m.call(i);
  89804. } finally {
  89805. if (e) throw e.error;
  89806. }
  89807. }
  89808. return ar;
  89809. };
  89810. var __spread = undefined && undefined.__spread || function () {
  89811. for (var ar = [], i = 0; i < arguments.length; i++) {
  89812. ar = ar.concat(__read(arguments[i]));
  89813. }
  89814. return ar;
  89815. }; // Styles
  89816. // Components
  89817. // Mixins
  89818. // Util
  89819. /* @vue/component */
  89820. /* harmony default export */ __webpack_exports__["default"] = (_mixins_calendar_base__WEBPACK_IMPORTED_MODULE_2__["default"].extend({
  89821. name: 'v-calendar-weekly',
  89822. props: _util_props__WEBPACK_IMPORTED_MODULE_4__["default"].weeks,
  89823. computed: {
  89824. staticClass: function staticClass() {
  89825. return 'v-calendar-weekly';
  89826. },
  89827. classes: function classes() {
  89828. return this.themeClasses;
  89829. },
  89830. parsedMinWeeks: function parsedMinWeeks() {
  89831. return parseInt(this.minWeeks);
  89832. },
  89833. days: function days() {
  89834. var minDays = this.parsedMinWeeks * this.parsedWeekdays.length;
  89835. var start = this.getStartOfWeek(this.parsedStart);
  89836. var end = this.getEndOfWeek(this.parsedEnd);
  89837. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_5__["createDayList"])(start, end, this.times.today, this.weekdaySkips, Number.MAX_SAFE_INTEGER, minDays);
  89838. },
  89839. todayWeek: function todayWeek() {
  89840. var today = this.times.today;
  89841. var start = this.getStartOfWeek(today);
  89842. var end = this.getEndOfWeek(today);
  89843. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_5__["createDayList"])(start, end, today, this.weekdaySkips, this.parsedWeekdays.length, this.parsedWeekdays.length);
  89844. },
  89845. monthFormatter: function monthFormatter() {
  89846. if (this.monthFormat) {
  89847. return this.monthFormat;
  89848. }
  89849. var longOptions = {
  89850. timeZone: 'UTC',
  89851. month: 'long'
  89852. };
  89853. var shortOptions = {
  89854. timeZone: 'UTC',
  89855. month: 'short'
  89856. };
  89857. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_5__["createNativeLocaleFormatter"])(this.currentLocale, function (_tms, short) {
  89858. return short ? shortOptions : longOptions;
  89859. });
  89860. }
  89861. },
  89862. methods: {
  89863. isOutside: function isOutside(day) {
  89864. var dayIdentifier = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_5__["getDayIdentifier"])(day);
  89865. return dayIdentifier < Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_5__["getDayIdentifier"])(this.parsedStart) || dayIdentifier > Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_5__["getDayIdentifier"])(this.parsedEnd);
  89866. },
  89867. genHead: function genHead() {
  89868. return this.$createElement('div', {
  89869. staticClass: 'v-calendar-weekly__head'
  89870. }, this.genHeadDays());
  89871. },
  89872. genHeadDays: function genHeadDays() {
  89873. return this.todayWeek.map(this.genHeadDay);
  89874. },
  89875. genHeadDay: function genHeadDay(day, index) {
  89876. var outside = this.isOutside(this.days[index]);
  89877. var color = day.present ? this.color : undefined;
  89878. return this.$createElement('div', this.setTextColor(color, {
  89879. key: day.date,
  89880. staticClass: 'v-calendar-weekly__head-weekday',
  89881. class: this.getRelativeClasses(day, outside)
  89882. }), this.weekdayFormatter(day, this.shortWeekdays));
  89883. },
  89884. genWeeks: function genWeeks() {
  89885. var days = this.days;
  89886. var weekDays = this.parsedWeekdays.length;
  89887. var weeks = [];
  89888. for (var i = 0; i < days.length; i += weekDays) {
  89889. weeks.push(this.genWeek(days.slice(i, i + weekDays)));
  89890. }
  89891. return weeks;
  89892. },
  89893. genWeek: function genWeek(week) {
  89894. var _this = this;
  89895. return this.$createElement('div', {
  89896. key: week[0].date,
  89897. staticClass: 'v-calendar-weekly__week'
  89898. }, week.map(function (day, index) {
  89899. return _this.genDay(day, index, week);
  89900. }));
  89901. },
  89902. genDay: function genDay(day, index, week) {
  89903. var outside = this.isOutside(day);
  89904. return this.$createElement('div', {
  89905. key: day.date,
  89906. staticClass: 'v-calendar-weekly__day',
  89907. class: this.getRelativeClasses(day, outside),
  89908. on: this.getDefaultMouseEventHandlers(':day', function (_e) {
  89909. return day;
  89910. })
  89911. }, __spread([this.genDayLabel(day)], Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this, 'day', function () {
  89912. return __assign({
  89913. outside: outside,
  89914. index: index,
  89915. week: week
  89916. }, day);
  89917. }) || []));
  89918. },
  89919. genDayLabel: function genDayLabel(day) {
  89920. return this.$createElement('div', {
  89921. staticClass: 'v-calendar-weekly__day-label'
  89922. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this, 'day-label', day) || [this.genDayLabelButton(day)]);
  89923. },
  89924. genDayLabelButton: function genDayLabelButton(day) {
  89925. var color = day.present ? this.color : 'transparent';
  89926. var hasMonth = day.day === 1 && this.showMonthOnFirst;
  89927. return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_1__["default"], {
  89928. props: {
  89929. color: color,
  89930. fab: true,
  89931. depressed: true,
  89932. small: true
  89933. },
  89934. on: this.getMouseEventHandlers({
  89935. 'click:date': {
  89936. event: 'click',
  89937. stop: true
  89938. },
  89939. 'contextmenu:date': {
  89940. event: 'contextmenu',
  89941. stop: true,
  89942. prevent: true,
  89943. result: false
  89944. }
  89945. }, function (_e) {
  89946. return day;
  89947. })
  89948. }, hasMonth ? this.monthFormatter(day, this.shortMonths) + ' ' + this.dayFormatter(day, false) : this.dayFormatter(day, false));
  89949. },
  89950. genDayMonth: function genDayMonth(day) {
  89951. var color = day.present ? this.color : undefined;
  89952. return this.$createElement('div', this.setTextColor(color, {
  89953. staticClass: 'v-calendar-weekly__day-month'
  89954. }), Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this, 'day-month', day) || this.monthFormatter(day, this.shortMonths));
  89955. }
  89956. },
  89957. render: function render(h) {
  89958. return h('div', {
  89959. staticClass: this.staticClass,
  89960. class: this.classes,
  89961. nativeOn: {
  89962. dragstart: function dragstart(e) {
  89963. e.preventDefault();
  89964. }
  89965. }
  89966. }, __spread([!this.hideHeader ? this.genHead() : ''], this.genWeeks()));
  89967. }
  89968. }));
  89969. /***/ }),
  89970. /***/ "./src/components/VCalendar/index.ts":
  89971. /*!*******************************************!*\
  89972. !*** ./src/components/VCalendar/index.ts ***!
  89973. \*******************************************/
  89974. /*! exports provided: VCalendar, VCalendarDaily, VCalendarWeekly, VCalendarMonthly, default */
  89975. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89976. "use strict";
  89977. __webpack_require__.r(__webpack_exports__);
  89978. /* harmony import */ var _VCalendar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCalendar */ "./src/components/VCalendar/VCalendar.ts");
  89979. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCalendar", function() { return _VCalendar__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  89980. /* harmony import */ var _VCalendarDaily__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VCalendarDaily */ "./src/components/VCalendar/VCalendarDaily.ts");
  89981. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCalendarDaily", function() { return _VCalendarDaily__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  89982. /* harmony import */ var _VCalendarWeekly__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VCalendarWeekly */ "./src/components/VCalendar/VCalendarWeekly.ts");
  89983. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCalendarWeekly", function() { return _VCalendarWeekly__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  89984. /* harmony import */ var _VCalendarMonthly__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VCalendarMonthly */ "./src/components/VCalendar/VCalendarMonthly.ts");
  89985. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCalendarMonthly", function() { return _VCalendarMonthly__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  89986. /* harmony default export */ __webpack_exports__["default"] = ({
  89987. $_vuetify_subcomponents: {
  89988. VCalendar: _VCalendar__WEBPACK_IMPORTED_MODULE_0__["default"],
  89989. VCalendarDaily: _VCalendarDaily__WEBPACK_IMPORTED_MODULE_1__["default"],
  89990. VCalendarWeekly: _VCalendarWeekly__WEBPACK_IMPORTED_MODULE_2__["default"],
  89991. VCalendarMonthly: _VCalendarMonthly__WEBPACK_IMPORTED_MODULE_3__["default"]
  89992. }
  89993. });
  89994. /***/ }),
  89995. /***/ "./src/components/VCalendar/mixins/calendar-base.ts":
  89996. /*!**********************************************************!*\
  89997. !*** ./src/components/VCalendar/mixins/calendar-base.ts ***!
  89998. \**********************************************************/
  89999. /*! exports provided: default */
  90000. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90001. "use strict";
  90002. __webpack_require__.r(__webpack_exports__);
  90003. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/mixins */ "./src/util/mixins.ts");
  90004. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  90005. /* harmony import */ var _mixins_localable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../mixins/localable */ "./src/mixins/localable/index.ts");
  90006. /* harmony import */ var _mouse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mouse */ "./src/components/VCalendar/mixins/mouse.ts");
  90007. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  90008. /* harmony import */ var _times__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./times */ "./src/components/VCalendar/mixins/times.ts");
  90009. /* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../directives/resize */ "./src/directives/resize/index.ts");
  90010. /* harmony import */ var _util_props__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/props */ "./src/components/VCalendar/util/props.ts");
  90011. /* harmony import */ var _util_timestamp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  90012. // Mixins
  90013. // Directives
  90014. // Util
  90015. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_0__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_localable__WEBPACK_IMPORTED_MODULE_2__["default"], _mouse__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__["default"], _times__WEBPACK_IMPORTED_MODULE_5__["default"]
  90016. /* @vue/component */
  90017. ).extend({
  90018. name: 'calendar-base',
  90019. directives: {
  90020. Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_6__["default"]
  90021. },
  90022. props: _util_props__WEBPACK_IMPORTED_MODULE_7__["default"].base,
  90023. computed: {
  90024. parsedWeekdays: function parsedWeekdays() {
  90025. return Array.isArray(this.weekdays) ? this.weekdays : (this.weekdays || '').split(',').map(function (x) {
  90026. return parseInt(x, 10);
  90027. });
  90028. },
  90029. weekdaySkips: function weekdaySkips() {
  90030. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["getWeekdaySkips"])(this.parsedWeekdays);
  90031. },
  90032. weekdaySkipsReverse: function weekdaySkipsReverse() {
  90033. var reversed = this.weekdaySkips.slice();
  90034. reversed.reverse();
  90035. return reversed;
  90036. },
  90037. parsedStart: function parsedStart() {
  90038. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["parseTimestamp"])(this.start, true);
  90039. },
  90040. parsedEnd: function parsedEnd() {
  90041. var start = this.parsedStart;
  90042. var end = this.end ? Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["parseTimestamp"])(this.end) || start : start;
  90043. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["getTimestampIdentifier"])(end) < Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["getTimestampIdentifier"])(start) ? start : end;
  90044. },
  90045. days: function days() {
  90046. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["createDayList"])(this.parsedStart, this.parsedEnd, this.times.today, this.weekdaySkips);
  90047. },
  90048. dayFormatter: function dayFormatter() {
  90049. if (this.dayFormat) {
  90050. return this.dayFormat;
  90051. }
  90052. var options = {
  90053. timeZone: 'UTC',
  90054. day: 'numeric'
  90055. };
  90056. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["createNativeLocaleFormatter"])(this.currentLocale, function (_tms, _short) {
  90057. return options;
  90058. });
  90059. },
  90060. weekdayFormatter: function weekdayFormatter() {
  90061. if (this.weekdayFormat) {
  90062. return this.weekdayFormat;
  90063. }
  90064. var longOptions = {
  90065. timeZone: 'UTC',
  90066. weekday: 'long'
  90067. };
  90068. var shortOptions = {
  90069. timeZone: 'UTC',
  90070. weekday: 'short'
  90071. };
  90072. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["createNativeLocaleFormatter"])(this.currentLocale, function (_tms, short) {
  90073. return short ? shortOptions : longOptions;
  90074. });
  90075. }
  90076. },
  90077. methods: {
  90078. getRelativeClasses: function getRelativeClasses(timestamp, outside) {
  90079. if (outside === void 0) {
  90080. outside = false;
  90081. }
  90082. return {
  90083. 'v-present': timestamp.present,
  90084. 'v-past': timestamp.past,
  90085. 'v-future': timestamp.future,
  90086. 'v-outside': outside
  90087. };
  90088. },
  90089. getStartOfWeek: function getStartOfWeek(timestamp) {
  90090. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["getStartOfWeek"])(timestamp, this.parsedWeekdays, this.times.today);
  90091. },
  90092. getEndOfWeek: function getEndOfWeek(timestamp) {
  90093. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["getEndOfWeek"])(timestamp, this.parsedWeekdays, this.times.today);
  90094. },
  90095. getFormatter: function getFormatter(options) {
  90096. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_8__["createNativeLocaleFormatter"])(this.locale, function (_tms, _short) {
  90097. return options;
  90098. });
  90099. }
  90100. }
  90101. }));
  90102. /***/ }),
  90103. /***/ "./src/components/VCalendar/mixins/calendar-with-events.sass":
  90104. /*!*******************************************************************!*\
  90105. !*** ./src/components/VCalendar/mixins/calendar-with-events.sass ***!
  90106. \*******************************************************************/
  90107. /*! no static exports found */
  90108. /***/ (function(module, exports, __webpack_require__) {
  90109. // extracted by mini-css-extract-plugin
  90110. /***/ }),
  90111. /***/ "./src/components/VCalendar/mixins/calendar-with-events.ts":
  90112. /*!*****************************************************************!*\
  90113. !*** ./src/components/VCalendar/mixins/calendar-with-events.ts ***!
  90114. \*****************************************************************/
  90115. /*! exports provided: default */
  90116. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90117. "use strict";
  90118. __webpack_require__.r(__webpack_exports__);
  90119. /* harmony import */ var _calendar_with_events_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./calendar-with-events.sass */ "./src/components/VCalendar/mixins/calendar-with-events.sass");
  90120. /* harmony import */ var _calendar_with_events_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_calendar_with_events_sass__WEBPACK_IMPORTED_MODULE_0__);
  90121. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../directives/ripple */ "./src/directives/ripple/index.ts");
  90122. /* harmony import */ var _calendar_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./calendar-base */ "./src/components/VCalendar/mixins/calendar-base.ts");
  90123. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../util/helpers */ "./src/util/helpers.ts");
  90124. /* harmony import */ var _util_props__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/props */ "./src/components/VCalendar/util/props.ts");
  90125. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes */ "./src/components/VCalendar/modes/index.ts");
  90126. /* harmony import */ var _util_timestamp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  90127. /* harmony import */ var _util_events__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/events */ "./src/components/VCalendar/util/events.ts");
  90128. var __assign = undefined && undefined.__assign || function () {
  90129. __assign = Object.assign || function (t) {
  90130. for (var s, i = 1, n = arguments.length; i < n; i++) {
  90131. s = arguments[i];
  90132. for (var p in s) {
  90133. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  90134. }
  90135. }
  90136. return t;
  90137. };
  90138. return __assign.apply(this, arguments);
  90139. }; // Styles
  90140. // Directives
  90141. // Mixins
  90142. // Helpers
  90143. // Util
  90144. var WIDTH_FULL = 100;
  90145. var WIDTH_START = 95;
  90146. var MINUTES_IN_DAY = 1440;
  90147. /* @vue/component */
  90148. /* harmony default export */ __webpack_exports__["default"] = (_calendar_base__WEBPACK_IMPORTED_MODULE_2__["default"].extend({
  90149. name: 'calendar-with-events',
  90150. directives: {
  90151. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_1__["default"]
  90152. },
  90153. props: _util_props__WEBPACK_IMPORTED_MODULE_4__["default"].events,
  90154. computed: {
  90155. noEvents: function noEvents() {
  90156. return this.events.length === 0;
  90157. },
  90158. parsedEvents: function parsedEvents() {
  90159. var _this = this;
  90160. return this.events.map(function (input, index) {
  90161. return Object(_util_events__WEBPACK_IMPORTED_MODULE_7__["parseEvent"])(input, index, _this.eventStart, _this.eventEnd);
  90162. });
  90163. },
  90164. parsedEventOverlapThreshold: function parsedEventOverlapThreshold() {
  90165. return parseInt(this.eventOverlapThreshold);
  90166. },
  90167. eventColorFunction: function eventColorFunction() {
  90168. var _this = this;
  90169. return typeof this.eventColor === 'function' ? this.eventColor : function () {
  90170. return _this.eventColor;
  90171. };
  90172. },
  90173. eventTextColorFunction: function eventTextColorFunction() {
  90174. var _this = this;
  90175. return typeof this.eventTextColor === 'function' ? this.eventTextColor : function () {
  90176. return _this.eventTextColor;
  90177. };
  90178. },
  90179. eventNameFunction: function eventNameFunction() {
  90180. var _this = this;
  90181. return typeof this.eventName === 'function' ? this.eventName : function (event, timedEvent) {
  90182. var name = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["escapeHTML"])(event.input[_this.eventName]);
  90183. if (event.start.hasTime) {
  90184. if (timedEvent) {
  90185. var showStart = event.start.hour < 12 && event.end.hour >= 12;
  90186. var start = _this.formatTime(event.start, showStart);
  90187. var end = _this.formatTime(event.end, true);
  90188. var singline = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_6__["diffMinutes"])(event.start, event.end) <= _this.parsedEventOverlapThreshold;
  90189. var separator = singline ? ', ' : '<br>';
  90190. return "<strong>" + name + "</strong>" + separator + start + " - " + end;
  90191. } else {
  90192. var time = _this.formatTime(event.start, true);
  90193. return "<strong>" + time + "</strong> " + name;
  90194. }
  90195. }
  90196. return name;
  90197. };
  90198. },
  90199. eventModeFunction: function eventModeFunction() {
  90200. return typeof this.eventOverlapMode === 'function' ? this.eventOverlapMode : _modes__WEBPACK_IMPORTED_MODULE_5__["CalendarEventOverlapModes"][this.eventOverlapMode];
  90201. },
  90202. eventWeekdays: function eventWeekdays() {
  90203. return this.parsedWeekdays;
  90204. }
  90205. },
  90206. methods: {
  90207. formatTime: function formatTime(withTime, ampm) {
  90208. var formatter = this.getFormatter({
  90209. timeZone: 'UTC',
  90210. hour: 'numeric',
  90211. minute: withTime.minute > 0 ? 'numeric' : undefined
  90212. });
  90213. return formatter(withTime, true);
  90214. },
  90215. updateEventVisibility: function updateEventVisibility() {
  90216. if (this.noEvents || !this.eventMore) {
  90217. return;
  90218. }
  90219. var eventHeight = this.eventHeight;
  90220. var eventsMap = this.getEventsMap();
  90221. for (var date in eventsMap) {
  90222. var _a = eventsMap[date],
  90223. parent = _a.parent,
  90224. events = _a.events,
  90225. more = _a.more;
  90226. if (!more) {
  90227. break;
  90228. }
  90229. var parentBounds = parent.getBoundingClientRect();
  90230. var last = events.length - 1;
  90231. var hide = false;
  90232. var hidden = 0;
  90233. for (var i = 0; i <= last; i++) {
  90234. if (!hide) {
  90235. var eventBounds = events[i].getBoundingClientRect();
  90236. hide = i === last ? eventBounds.bottom > parentBounds.bottom : eventBounds.bottom + eventHeight > parentBounds.bottom;
  90237. }
  90238. if (hide) {
  90239. events[i].style.display = 'none';
  90240. hidden++;
  90241. }
  90242. }
  90243. if (hide) {
  90244. more.style.display = '';
  90245. more.innerHTML = this.$vuetify.lang.t(this.eventMoreText, hidden);
  90246. } else {
  90247. more.style.display = 'none';
  90248. }
  90249. }
  90250. },
  90251. getEventsMap: function getEventsMap() {
  90252. var eventsMap = {};
  90253. var elements = this.$refs.events;
  90254. if (!elements || !elements.forEach) {
  90255. return eventsMap;
  90256. }
  90257. elements.forEach(function (el) {
  90258. var date = el.getAttribute('data-date');
  90259. if (el.parentElement && date) {
  90260. if (!(date in eventsMap)) {
  90261. eventsMap[date] = {
  90262. parent: el.parentElement,
  90263. more: null,
  90264. events: []
  90265. };
  90266. }
  90267. if (el.getAttribute('data-more')) {
  90268. eventsMap[date].more = el;
  90269. } else {
  90270. eventsMap[date].events.push(el);
  90271. el.style.display = '';
  90272. }
  90273. }
  90274. });
  90275. return eventsMap;
  90276. },
  90277. genDayEvent: function genDayEvent(_a, day) {
  90278. var event = _a.event;
  90279. var eventHeight = this.eventHeight;
  90280. var eventMarginBottom = this.eventMarginBottom;
  90281. var dayIdentifier = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_6__["getDayIdentifier"])(day);
  90282. var week = day.week;
  90283. var start = dayIdentifier === event.startIdentifier;
  90284. var end = dayIdentifier === event.endIdentifier;
  90285. var width = WIDTH_START;
  90286. for (var i = day.index + 1; i < week.length; i++) {
  90287. var weekdayIdentifier = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_6__["getDayIdentifier"])(week[i]);
  90288. if (event.endIdentifier >= weekdayIdentifier) {
  90289. width += WIDTH_FULL;
  90290. if (weekdayIdentifier === event.endIdentifier) {
  90291. end = true;
  90292. }
  90293. } else {
  90294. end = true;
  90295. break;
  90296. }
  90297. }
  90298. var scope = {
  90299. event: event.input,
  90300. day: day,
  90301. outside: day.outside,
  90302. start: start,
  90303. end: end,
  90304. timed: false
  90305. };
  90306. return this.genEvent(event, scope, false, {
  90307. staticClass: 'v-event',
  90308. class: {
  90309. 'v-event-start': start,
  90310. 'v-event-end': end
  90311. },
  90312. style: {
  90313. height: eventHeight + "px",
  90314. width: width + "%",
  90315. 'margin-bottom': eventMarginBottom + "px"
  90316. },
  90317. attrs: {
  90318. 'data-date': day.date
  90319. },
  90320. key: event.index,
  90321. ref: 'events',
  90322. refInFor: true
  90323. });
  90324. },
  90325. genTimedEvent: function genTimedEvent(_a, day) {
  90326. var event = _a.event,
  90327. left = _a.left,
  90328. width = _a.width;
  90329. var dayIdentifier = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_6__["getDayIdentifier"])(day);
  90330. var start = event.startIdentifier >= dayIdentifier;
  90331. var end = event.endIdentifier > dayIdentifier;
  90332. var top = start ? day.timeToY(event.start) : 0;
  90333. var bottom = end ? day.timeToY(MINUTES_IN_DAY) : day.timeToY(event.end);
  90334. var height = Math.max(this.eventHeight, bottom - top);
  90335. var scope = {
  90336. event: event.input,
  90337. day: day,
  90338. outside: day.outside,
  90339. start: start,
  90340. end: end,
  90341. timed: true
  90342. };
  90343. return this.genEvent(event, scope, true, {
  90344. staticClass: 'v-event-timed',
  90345. style: {
  90346. top: top + "px",
  90347. height: height + "px",
  90348. left: left + "%",
  90349. width: width + "%"
  90350. }
  90351. });
  90352. },
  90353. genEvent: function genEvent(event, scope, timedEvent, data) {
  90354. var slot = this.$scopedSlots.event;
  90355. var text = this.eventTextColorFunction(event.input);
  90356. var background = this.eventColorFunction(event.input);
  90357. return this.$createElement('div', this.setTextColor(text, this.setBackgroundColor(background, __assign({
  90358. on: this.getDefaultMouseEventHandlers(':event', function (nativeEvent) {
  90359. return __assign({}, scope, {
  90360. nativeEvent: nativeEvent
  90361. });
  90362. }),
  90363. directives: [{
  90364. name: 'ripple',
  90365. value: this.eventRipple != null ? this.eventRipple : true
  90366. }]
  90367. }, data))), slot ? slot(scope) : [this.genName(event, timedEvent)]);
  90368. },
  90369. genName: function genName(event, timedEvent) {
  90370. return this.$createElement('div', {
  90371. staticClass: 'pl-1',
  90372. domProps: {
  90373. innerHTML: this.eventNameFunction(event, timedEvent)
  90374. }
  90375. });
  90376. },
  90377. genPlaceholder: function genPlaceholder(day) {
  90378. var height = this.eventHeight + this.eventMarginBottom;
  90379. return this.$createElement('div', {
  90380. style: {
  90381. height: height + "px"
  90382. },
  90383. attrs: {
  90384. 'data-date': day.date
  90385. },
  90386. ref: 'events',
  90387. refInFor: true
  90388. });
  90389. },
  90390. genMore: function genMore(day) {
  90391. var _this = this;
  90392. var eventHeight = this.eventHeight;
  90393. var eventMarginBottom = this.eventMarginBottom;
  90394. return this.$createElement('div', {
  90395. staticClass: 'v-event-more pl-1',
  90396. class: {
  90397. 'v-outside': day.outside
  90398. },
  90399. attrs: {
  90400. 'data-date': day.date,
  90401. 'data-more': 1
  90402. },
  90403. directives: [{
  90404. name: 'ripple',
  90405. value: this.eventRipple != null ? this.eventRipple : true
  90406. }],
  90407. on: {
  90408. click: function click() {
  90409. return _this.$emit('click:more', day);
  90410. }
  90411. },
  90412. style: {
  90413. display: 'none',
  90414. height: eventHeight + "px",
  90415. 'margin-bottom': eventMarginBottom + "px"
  90416. },
  90417. ref: 'events',
  90418. refInFor: true
  90419. });
  90420. },
  90421. getVisibleEvents: function getVisibleEvents() {
  90422. var start = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_6__["getDayIdentifier"])(this.days[0]);
  90423. var end = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_6__["getDayIdentifier"])(this.days[this.days.length - 1]);
  90424. return this.parsedEvents.filter(function (event) {
  90425. return Object(_util_events__WEBPACK_IMPORTED_MODULE_7__["isEventOverlapping"])(event, start, end);
  90426. });
  90427. },
  90428. getEventsForDay: function getEventsForDay(day) {
  90429. var identifier = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_6__["getDayIdentifier"])(day);
  90430. var firstWeekday = this.eventWeekdays[0];
  90431. return this.parsedEvents.filter(function (event) {
  90432. return Object(_util_events__WEBPACK_IMPORTED_MODULE_7__["isEventStart"])(event, day, identifier, firstWeekday);
  90433. });
  90434. },
  90435. getEventsForDayAll: function getEventsForDayAll(day) {
  90436. var identifier = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_6__["getDayIdentifier"])(day);
  90437. var firstWeekday = this.eventWeekdays[0];
  90438. return this.parsedEvents.filter(function (event) {
  90439. return event.allDay && Object(_util_events__WEBPACK_IMPORTED_MODULE_7__["isEventStart"])(event, day, identifier, firstWeekday);
  90440. });
  90441. },
  90442. getEventsForDayTimed: function getEventsForDayTimed(day) {
  90443. var identifier = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_6__["getDayIdentifier"])(day);
  90444. return this.parsedEvents.filter(function (event) {
  90445. return !event.allDay && Object(_util_events__WEBPACK_IMPORTED_MODULE_7__["isEventOn"])(event, identifier);
  90446. });
  90447. },
  90448. getScopedSlots: function getScopedSlots() {
  90449. var _this = this;
  90450. if (this.noEvents) {
  90451. return __assign({}, this.$scopedSlots);
  90452. }
  90453. var mode = this.eventModeFunction(this.parsedEvents, this.eventWeekdays[0], this.parsedEventOverlapThreshold);
  90454. var getSlotChildren = function getSlotChildren(day, getter, mapper, timed) {
  90455. var events = getter(day);
  90456. if (events.length === 0) {
  90457. return;
  90458. }
  90459. var visuals = mode(day, events, timed);
  90460. if (timed) {
  90461. return visuals.map(function (visual) {
  90462. return mapper(visual, day);
  90463. });
  90464. }
  90465. var children = [];
  90466. visuals.forEach(function (visual, index) {
  90467. while (children.length < visual.column) {
  90468. children.push(_this.genPlaceholder(day));
  90469. }
  90470. children.push(mapper(visual, day));
  90471. });
  90472. return children;
  90473. };
  90474. var slots = this.$scopedSlots;
  90475. var slotDay = slots.day;
  90476. var slotDayHeader = slots['day-header'];
  90477. var slotDayBody = slots['day-body'];
  90478. return __assign({}, slots, {
  90479. day: function day(_day) {
  90480. var children = getSlotChildren(_day, _this.getEventsForDay, _this.genDayEvent, false);
  90481. if (children && children.length > 0 && _this.eventMore) {
  90482. children.push(_this.genMore(_day));
  90483. }
  90484. if (slotDay) {
  90485. var slot = slotDay(_day);
  90486. if (slot) {
  90487. children = children ? children.concat(slot) : slot;
  90488. }
  90489. }
  90490. return children;
  90491. },
  90492. 'day-header': function dayHeader(day) {
  90493. var children = getSlotChildren(day, _this.getEventsForDayAll, _this.genDayEvent, false);
  90494. if (slotDayHeader) {
  90495. var slot = slotDayHeader(day);
  90496. if (slot) {
  90497. children = children ? children.concat(slot) : slot;
  90498. }
  90499. }
  90500. return children;
  90501. },
  90502. 'day-body': function dayBody(day) {
  90503. var events = getSlotChildren(day, _this.getEventsForDayTimed, _this.genTimedEvent, true);
  90504. var children = [_this.$createElement('div', {
  90505. staticClass: 'v-event-timed-container'
  90506. }, events)];
  90507. if (slotDayBody) {
  90508. var slot = slotDayBody(day);
  90509. if (slot) {
  90510. children = children.concat(slot);
  90511. }
  90512. }
  90513. return children;
  90514. }
  90515. });
  90516. }
  90517. }
  90518. }));
  90519. /***/ }),
  90520. /***/ "./src/components/VCalendar/mixins/calendar-with-intervals.ts":
  90521. /*!********************************************************************!*\
  90522. !*** ./src/components/VCalendar/mixins/calendar-with-intervals.ts ***!
  90523. \********************************************************************/
  90524. /*! exports provided: default */
  90525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90526. "use strict";
  90527. __webpack_require__.r(__webpack_exports__);
  90528. /* harmony import */ var _calendar_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./calendar-base */ "./src/components/VCalendar/mixins/calendar-base.ts");
  90529. /* harmony import */ var _util_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/props */ "./src/components/VCalendar/util/props.ts");
  90530. /* harmony import */ var _util_timestamp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  90531. // Mixins
  90532. // Util
  90533. /* @vue/component */
  90534. /* harmony default export */ __webpack_exports__["default"] = (_calendar_base__WEBPACK_IMPORTED_MODULE_0__["default"].extend({
  90535. name: 'calendar-with-intervals',
  90536. props: _util_props__WEBPACK_IMPORTED_MODULE_1__["default"].intervals,
  90537. computed: {
  90538. parsedFirstInterval: function parsedFirstInterval() {
  90539. return parseInt(this.firstInterval);
  90540. },
  90541. parsedIntervalMinutes: function parsedIntervalMinutes() {
  90542. return parseInt(this.intervalMinutes);
  90543. },
  90544. parsedIntervalCount: function parsedIntervalCount() {
  90545. return parseInt(this.intervalCount);
  90546. },
  90547. parsedIntervalHeight: function parsedIntervalHeight() {
  90548. return parseFloat(this.intervalHeight);
  90549. },
  90550. firstMinute: function firstMinute() {
  90551. return this.parsedFirstInterval * this.parsedIntervalMinutes;
  90552. },
  90553. bodyHeight: function bodyHeight() {
  90554. return this.parsedIntervalCount * this.parsedIntervalHeight;
  90555. },
  90556. days: function days() {
  90557. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["createDayList"])(this.parsedStart, this.parsedEnd, this.times.today, this.weekdaySkips, this.maxDays);
  90558. },
  90559. intervals: function intervals() {
  90560. var days = this.days;
  90561. var first = this.parsedFirstInterval;
  90562. var minutes = this.parsedIntervalMinutes;
  90563. var count = this.parsedIntervalCount;
  90564. var now = this.times.now;
  90565. return days.map(function (d) {
  90566. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["createIntervalList"])(d, first, minutes, count, now);
  90567. });
  90568. },
  90569. intervalFormatter: function intervalFormatter() {
  90570. if (this.intervalFormat) {
  90571. return this.intervalFormat;
  90572. }
  90573. var longOptions = {
  90574. timeZone: 'UTC',
  90575. hour: '2-digit',
  90576. minute: '2-digit'
  90577. };
  90578. var shortOptions = {
  90579. timeZone: 'UTC',
  90580. hour: 'numeric',
  90581. minute: '2-digit'
  90582. };
  90583. var shortHourOptions = {
  90584. timeZone: 'UTC',
  90585. hour: 'numeric'
  90586. };
  90587. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["createNativeLocaleFormatter"])(this.currentLocale, function (tms, short) {
  90588. return short ? tms.minute === 0 ? shortHourOptions : shortOptions : longOptions;
  90589. });
  90590. }
  90591. },
  90592. methods: {
  90593. showIntervalLabelDefault: function showIntervalLabelDefault(interval) {
  90594. var first = this.intervals[0][0];
  90595. var isFirst = first.hour === interval.hour && first.minute === interval.minute;
  90596. return !isFirst;
  90597. },
  90598. intervalStyleDefault: function intervalStyleDefault(_interval) {
  90599. return undefined;
  90600. },
  90601. getTimestampAtEvent: function getTimestampAtEvent(e, day) {
  90602. var timestamp = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["copyTimestamp"])(day);
  90603. var bounds = e.currentTarget.getBoundingClientRect();
  90604. var baseMinutes = this.firstMinute;
  90605. var touchEvent = e;
  90606. var mouseEvent = e;
  90607. var touches = touchEvent.changedTouches || touchEvent.touches;
  90608. var clientY = touches && touches[0] ? touches[0].clientY : mouseEvent.clientY;
  90609. var addIntervals = (clientY - bounds.top) / this.parsedIntervalHeight;
  90610. var addMinutes = Math.floor(addIntervals * this.parsedIntervalMinutes);
  90611. var minutes = baseMinutes + addMinutes;
  90612. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["updateMinutes"])(timestamp, minutes, this.times.now);
  90613. },
  90614. getSlotScope: function getSlotScope(timestamp) {
  90615. var scope = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["copyTimestamp"])(timestamp);
  90616. scope.timeToY = this.timeToY;
  90617. scope.minutesToPixels = this.minutesToPixels;
  90618. scope.week = this.days;
  90619. return scope;
  90620. },
  90621. scrollToTime: function scrollToTime(time) {
  90622. var y = this.timeToY(time);
  90623. var pane = this.$refs.scrollArea;
  90624. if (y === false || !pane) {
  90625. return false;
  90626. }
  90627. pane.scrollTop = y;
  90628. return true;
  90629. },
  90630. minutesToPixels: function minutesToPixels(minutes) {
  90631. return minutes / this.parsedIntervalMinutes * this.parsedIntervalHeight;
  90632. },
  90633. timeToY: function timeToY(time, clamp) {
  90634. if (clamp === void 0) {
  90635. clamp = true;
  90636. }
  90637. var minutes = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_2__["parseTime"])(time);
  90638. if (minutes === false) {
  90639. return false;
  90640. }
  90641. var min = this.firstMinute;
  90642. var gap = this.parsedIntervalCount * this.parsedIntervalMinutes;
  90643. var delta = (minutes - min) / gap;
  90644. var y = delta * this.bodyHeight;
  90645. if (clamp) {
  90646. if (y < 0) {
  90647. y = 0;
  90648. }
  90649. if (y > this.bodyHeight) {
  90650. y = this.bodyHeight;
  90651. }
  90652. }
  90653. return y;
  90654. }
  90655. }
  90656. }));
  90657. /***/ }),
  90658. /***/ "./src/components/VCalendar/mixins/mouse.ts":
  90659. /*!**************************************************!*\
  90660. !*** ./src/components/VCalendar/mixins/mouse.ts ***!
  90661. \**************************************************/
  90662. /*! exports provided: default */
  90663. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90664. "use strict";
  90665. __webpack_require__.r(__webpack_exports__);
  90666. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  90667. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  90668. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  90669. name: 'mouse',
  90670. methods: {
  90671. getDefaultMouseEventHandlers: function getDefaultMouseEventHandlers(suffix, getEvent) {
  90672. var _a;
  90673. return this.getMouseEventHandlers((_a = {}, _a['click' + suffix] = {
  90674. event: 'click'
  90675. }, _a['contextmenu' + suffix] = {
  90676. event: 'contextmenu',
  90677. prevent: true,
  90678. result: false
  90679. }, _a['mousedown' + suffix] = {
  90680. event: 'mousedown'
  90681. }, _a['mousemove' + suffix] = {
  90682. event: 'mousemove'
  90683. }, _a['mouseup' + suffix] = {
  90684. event: 'mouseup'
  90685. }, _a['mouseenter' + suffix] = {
  90686. event: 'mouseenter'
  90687. }, _a['mouseleave' + suffix] = {
  90688. event: 'mouseleave'
  90689. }, _a['touchstart' + suffix] = {
  90690. event: 'touchstart'
  90691. }, _a['touchmove' + suffix] = {
  90692. event: 'touchmove'
  90693. }, _a['touchend' + suffix] = {
  90694. event: 'touchend'
  90695. }, _a), getEvent);
  90696. },
  90697. getMouseEventHandlers: function getMouseEventHandlers(events, getEvent) {
  90698. var _this = this;
  90699. var on = {};
  90700. var _loop_1 = function _loop_1(event) {
  90701. var eventOptions = events[event];
  90702. if (!this_1.$listeners[event]) return "continue"; // TODO somehow pull in modifiers
  90703. var prefix = eventOptions.passive ? '&' : (eventOptions.once ? '~' : '') + (eventOptions.capture ? '!' : '');
  90704. var key = prefix + eventOptions.event;
  90705. var handler = function handler(e) {
  90706. var mouseEvent = e;
  90707. if (eventOptions.button === undefined || mouseEvent.buttons > 0 && mouseEvent.button === eventOptions.button) {
  90708. if (eventOptions.prevent) {
  90709. e.preventDefault();
  90710. }
  90711. if (eventOptions.stop) {
  90712. e.stopPropagation();
  90713. }
  90714. _this.$emit(event, getEvent(e));
  90715. }
  90716. return eventOptions.result;
  90717. };
  90718. if (key in on) {
  90719. /* istanbul ignore next */
  90720. if (Array.isArray(on[key])) {
  90721. on[key].push(handler);
  90722. } else {
  90723. on[key] = [on[key], handler];
  90724. }
  90725. } else {
  90726. on[key] = handler;
  90727. }
  90728. };
  90729. var this_1 = this;
  90730. for (var event in events) {
  90731. _loop_1(event);
  90732. }
  90733. return on;
  90734. }
  90735. }
  90736. }));
  90737. /***/ }),
  90738. /***/ "./src/components/VCalendar/mixins/times.ts":
  90739. /*!**************************************************!*\
  90740. !*** ./src/components/VCalendar/mixins/times.ts ***!
  90741. \**************************************************/
  90742. /*! exports provided: default */
  90743. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90744. "use strict";
  90745. __webpack_require__.r(__webpack_exports__);
  90746. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  90747. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  90748. /* harmony import */ var _util_timestamp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  90749. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  90750. name: 'times',
  90751. props: {
  90752. now: {
  90753. type: String,
  90754. validator: _util_timestamp__WEBPACK_IMPORTED_MODULE_1__["validateTimestamp"]
  90755. }
  90756. },
  90757. data: function data() {
  90758. return {
  90759. times: {
  90760. now: Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_1__["parseTimestamp"])('0000-00-00 00:00', true),
  90761. today: Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_1__["parseTimestamp"])('0000-00-00', true)
  90762. }
  90763. };
  90764. },
  90765. computed: {
  90766. parsedNow: function parsedNow() {
  90767. return this.now ? Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_1__["parseTimestamp"])(this.now, true) : null;
  90768. }
  90769. },
  90770. watch: {
  90771. parsedNow: 'updateTimes'
  90772. },
  90773. created: function created() {
  90774. this.updateTimes();
  90775. this.setPresent();
  90776. },
  90777. methods: {
  90778. setPresent: function setPresent() {
  90779. this.times.now.present = this.times.today.present = true;
  90780. this.times.now.past = this.times.today.past = false;
  90781. this.times.now.future = this.times.today.future = false;
  90782. },
  90783. updateTimes: function updateTimes() {
  90784. var now = this.parsedNow || this.getNow();
  90785. this.updateDay(now, this.times.now);
  90786. this.updateTime(now, this.times.now);
  90787. this.updateDay(now, this.times.today);
  90788. },
  90789. getNow: function getNow() {
  90790. return Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_1__["parseDate"])(new Date());
  90791. },
  90792. updateDay: function updateDay(now, target) {
  90793. if (now.date !== target.date) {
  90794. target.year = now.year;
  90795. target.month = now.month;
  90796. target.day = now.day;
  90797. target.weekday = now.weekday;
  90798. target.date = now.date;
  90799. }
  90800. },
  90801. updateTime: function updateTime(now, target) {
  90802. if (now.time !== target.time) {
  90803. target.hour = now.hour;
  90804. target.minute = now.minute;
  90805. target.time = now.time;
  90806. }
  90807. }
  90808. }
  90809. }));
  90810. /***/ }),
  90811. /***/ "./src/components/VCalendar/modes/column.ts":
  90812. /*!**************************************************!*\
  90813. !*** ./src/components/VCalendar/modes/column.ts ***!
  90814. \**************************************************/
  90815. /*! exports provided: column */
  90816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90817. "use strict";
  90818. __webpack_require__.r(__webpack_exports__);
  90819. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "column", function() { return column; });
  90820. /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "./src/components/VCalendar/modes/common.ts");
  90821. var FULL_WIDTH = 100;
  90822. var column = function column(events, firstWeekday, overlapThreshold) {
  90823. var handler = Object(_common__WEBPACK_IMPORTED_MODULE_0__["getOverlapGroupHandler"])(firstWeekday);
  90824. return function (day, dayEvents, timed) {
  90825. var visuals = handler.getVisuals(day, dayEvents, timed);
  90826. if (timed) {
  90827. visuals.forEach(function (visual) {
  90828. visual.left = visual.column * FULL_WIDTH / visual.columnCount;
  90829. visual.width = FULL_WIDTH / visual.columnCount;
  90830. });
  90831. }
  90832. return visuals;
  90833. };
  90834. };
  90835. /***/ }),
  90836. /***/ "./src/components/VCalendar/modes/common.ts":
  90837. /*!**************************************************!*\
  90838. !*** ./src/components/VCalendar/modes/common.ts ***!
  90839. \**************************************************/
  90840. /*! exports provided: getVisuals, hasOverlap, setColumnCount, getRange, getDayRange, getNormalizedRange, getOpenGroup, getOverlapGroupHandler */
  90841. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90842. "use strict";
  90843. __webpack_require__.r(__webpack_exports__);
  90844. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVisuals", function() { return _getVisuals; });
  90845. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasOverlap", function() { return hasOverlap; });
  90846. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setColumnCount", function() { return setColumnCount; });
  90847. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRange", function() { return getRange; });
  90848. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDayRange", function() { return getDayRange; });
  90849. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNormalizedRange", function() { return getNormalizedRange; });
  90850. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOpenGroup", function() { return getOpenGroup; });
  90851. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOverlapGroupHandler", function() { return getOverlapGroupHandler; });
  90852. /* harmony import */ var _util_timestamp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  90853. var __read = undefined && undefined.__read || function (o, n) {
  90854. var m = typeof Symbol === "function" && o[Symbol.iterator];
  90855. if (!m) return o;
  90856. var i = m.call(o),
  90857. r,
  90858. ar = [],
  90859. e;
  90860. try {
  90861. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  90862. ar.push(r.value);
  90863. }
  90864. } catch (error) {
  90865. e = {
  90866. error: error
  90867. };
  90868. } finally {
  90869. try {
  90870. if (r && !r.done && (m = i["return"])) m.call(i);
  90871. } finally {
  90872. if (e) throw e.error;
  90873. }
  90874. }
  90875. return ar;
  90876. };
  90877. var MILLIS_IN_DAY = 86400000;
  90878. function _getVisuals(events, minStart) {
  90879. if (minStart === void 0) {
  90880. minStart = 0;
  90881. }
  90882. var visuals = events.map(function (event) {
  90883. return {
  90884. event: event,
  90885. columnCount: 0,
  90886. column: 0,
  90887. left: 0,
  90888. width: 100
  90889. };
  90890. });
  90891. visuals.sort(function (a, b) {
  90892. return Math.max(minStart, a.event.startTimestampIdentifier) - Math.max(minStart, b.event.startTimestampIdentifier) || b.event.endTimestampIdentifier - a.event.endTimestampIdentifier;
  90893. });
  90894. return visuals;
  90895. }
  90896. function hasOverlap(s0, e0, s1, e1, exclude) {
  90897. if (exclude === void 0) {
  90898. exclude = true;
  90899. }
  90900. return exclude ? !(s0 >= e1 || e0 <= s1) : !(s0 > e1 || e0 < s1);
  90901. }
  90902. function setColumnCount(groups) {
  90903. groups.forEach(function (group) {
  90904. group.visuals.forEach(function (groupVisual) {
  90905. groupVisual.columnCount = groups.length;
  90906. });
  90907. });
  90908. }
  90909. function getRange(event) {
  90910. return [event.startTimestampIdentifier, event.endTimestampIdentifier];
  90911. }
  90912. function getDayRange(event) {
  90913. return [event.startIdentifier, event.endIdentifier];
  90914. }
  90915. function getNormalizedRange(event, dayStart) {
  90916. return [Math.max(dayStart, event.startTimestampIdentifier), Math.min(dayStart + MILLIS_IN_DAY, event.endTimestampIdentifier)];
  90917. }
  90918. function getOpenGroup(groups, start, end, timed) {
  90919. for (var i = 0; i < groups.length; i++) {
  90920. var group = groups[i];
  90921. var intersected = false;
  90922. if (hasOverlap(start, end, group.start, group.end, timed)) {
  90923. for (var k = 0; k < group.visuals.length; k++) {
  90924. var groupVisual = group.visuals[k];
  90925. var _a = __read(timed ? getRange(groupVisual.event) : getDayRange(groupVisual.event), 2),
  90926. groupStart = _a[0],
  90927. groupEnd = _a[1];
  90928. if (hasOverlap(start, end, groupStart, groupEnd, timed)) {
  90929. intersected = true;
  90930. break;
  90931. }
  90932. }
  90933. }
  90934. if (!intersected) {
  90935. return i;
  90936. }
  90937. }
  90938. return -1;
  90939. }
  90940. function getOverlapGroupHandler(firstWeekday) {
  90941. var handler = {
  90942. groups: [],
  90943. min: -1,
  90944. max: -1,
  90945. reset: function reset() {
  90946. handler.groups = [];
  90947. handler.min = handler.max = -1;
  90948. },
  90949. getVisuals: function getVisuals(day, dayEvents, timed) {
  90950. if (day.weekday === firstWeekday || timed) {
  90951. handler.reset();
  90952. }
  90953. var dayStart = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_0__["getTimestampIdentifier"])(day);
  90954. var visuals = _getVisuals(dayEvents, dayStart);
  90955. visuals.forEach(function (visual) {
  90956. var _a = __read(timed ? getRange(visual.event) : getDayRange(visual.event), 2),
  90957. start = _a[0],
  90958. end = _a[1];
  90959. if (handler.groups.length > 0 && !hasOverlap(start, end, handler.min, handler.max, timed)) {
  90960. setColumnCount(handler.groups);
  90961. handler.reset();
  90962. }
  90963. var targetGroup = getOpenGroup(handler.groups, start, end, timed);
  90964. if (targetGroup === -1) {
  90965. targetGroup = handler.groups.length;
  90966. handler.groups.push({
  90967. start: start,
  90968. end: end,
  90969. visuals: []
  90970. });
  90971. }
  90972. var target = handler.groups[targetGroup];
  90973. target.visuals.push(visual);
  90974. target.start = Math.min(target.start, start);
  90975. target.end = Math.max(target.end, end);
  90976. visual.column = targetGroup;
  90977. if (handler.min === -1) {
  90978. handler.min = start;
  90979. handler.max = end;
  90980. } else {
  90981. handler.min = Math.min(handler.min, start);
  90982. handler.max = Math.max(handler.max, end);
  90983. }
  90984. });
  90985. setColumnCount(handler.groups);
  90986. return visuals;
  90987. }
  90988. };
  90989. return handler;
  90990. }
  90991. /***/ }),
  90992. /***/ "./src/components/VCalendar/modes/index.ts":
  90993. /*!*************************************************!*\
  90994. !*** ./src/components/VCalendar/modes/index.ts ***!
  90995. \*************************************************/
  90996. /*! exports provided: CalendarEventOverlapModes */
  90997. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90998. "use strict";
  90999. __webpack_require__.r(__webpack_exports__);
  91000. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CalendarEventOverlapModes", function() { return CalendarEventOverlapModes; });
  91001. /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./stack */ "./src/components/VCalendar/modes/stack.ts");
  91002. /* harmony import */ var _column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./column */ "./src/components/VCalendar/modes/column.ts");
  91003. var CalendarEventOverlapModes = {
  91004. stack: _stack__WEBPACK_IMPORTED_MODULE_0__["stack"],
  91005. column: _column__WEBPACK_IMPORTED_MODULE_1__["column"]
  91006. };
  91007. /***/ }),
  91008. /***/ "./src/components/VCalendar/modes/stack.ts":
  91009. /*!*************************************************!*\
  91010. !*** ./src/components/VCalendar/modes/stack.ts ***!
  91011. \*************************************************/
  91012. /*! exports provided: stack */
  91013. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91014. "use strict";
  91015. __webpack_require__.r(__webpack_exports__);
  91016. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stack", function() { return stack; });
  91017. /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "./src/components/VCalendar/modes/common.ts");
  91018. /* harmony import */ var _util_timestamp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  91019. var __values = undefined && undefined.__values || function (o) {
  91020. var m = typeof Symbol === "function" && o[Symbol.iterator],
  91021. i = 0;
  91022. if (m) return m.call(o);
  91023. return {
  91024. next: function next() {
  91025. if (o && i >= o.length) o = void 0;
  91026. return {
  91027. value: o && o[i++],
  91028. done: !o
  91029. };
  91030. }
  91031. };
  91032. };
  91033. var __read = undefined && undefined.__read || function (o, n) {
  91034. var m = typeof Symbol === "function" && o[Symbol.iterator];
  91035. if (!m) return o;
  91036. var i = m.call(o),
  91037. r,
  91038. ar = [],
  91039. e;
  91040. try {
  91041. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  91042. ar.push(r.value);
  91043. }
  91044. } catch (error) {
  91045. e = {
  91046. error: error
  91047. };
  91048. } finally {
  91049. try {
  91050. if (r && !r.done && (m = i["return"])) m.call(i);
  91051. } finally {
  91052. if (e) throw e.error;
  91053. }
  91054. }
  91055. return ar;
  91056. };
  91057. var FULL_WIDTH = 100;
  91058. var DEFAULT_OFFSET = 5;
  91059. var WIDTH_MULTIPLIER = 1.7;
  91060. /**
  91061. * Variation of column mode where events can be stacked. The priority of this
  91062. * mode is to stack events together taking up the least amount of space while
  91063. * trying to ensure the content of the event is always visible as well as its
  91064. * start and end. A sibling column has intersecting event content and must be
  91065. * placed beside each other. Non-sibling columns are offset by 5% from the
  91066. * previous column. The width is scaled by 1.7 so the events overlap and
  91067. * whitespace is reduced. If there is a hole in columns the event width is
  91068. * scaled up so it intersects with the next column. The columns have equal
  91069. * width in the space they are given. If the event doesn't have any to the
  91070. * right of it that intersect with it's content it's right side is extended
  91071. * to the right side.
  91072. */
  91073. var stack = function stack(events, firstWeekday, overlapThreshold) {
  91074. var handler = Object(_common__WEBPACK_IMPORTED_MODULE_0__["getOverlapGroupHandler"])(firstWeekday); // eslint-disable-next-line max-statements
  91075. return function (day, dayEvents, timed) {
  91076. var e_1, _a, e_2, _b, e_3, _c;
  91077. if (!timed) {
  91078. return handler.getVisuals(day, dayEvents, timed);
  91079. }
  91080. var dayStart = Object(_util_timestamp__WEBPACK_IMPORTED_MODULE_1__["getTimestampIdentifier"])(day);
  91081. var visuals = Object(_common__WEBPACK_IMPORTED_MODULE_0__["getVisuals"])(dayEvents, dayStart);
  91082. var groups = getGroups(visuals, dayStart);
  91083. try {
  91084. for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
  91085. var group = groups_1_1.value;
  91086. var nodes = [];
  91087. try {
  91088. for (var _d = (e_2 = void 0, __values(group.visuals)), _e = _d.next(); !_e.done; _e = _d.next()) {
  91089. var visual = _e.value;
  91090. var child = getNode(visual, dayStart);
  91091. var index = getNextIndex(child, nodes);
  91092. if (index === false) {
  91093. var parent = getParent(child, nodes);
  91094. if (parent) {
  91095. child.parent = parent;
  91096. child.sibling = Object(_common__WEBPACK_IMPORTED_MODULE_0__["hasOverlap"])(child.start, child.end, parent.start, addTime(parent.start, overlapThreshold));
  91097. child.index = parent.index + 1;
  91098. parent.children.push(child);
  91099. }
  91100. } else {
  91101. var _f = __read(getOverlappingRange(child, nodes, index - 1, index - 1), 1),
  91102. parent = _f[0];
  91103. var children = getOverlappingRange(child, nodes, index + 1, index + nodes.length, true);
  91104. child.children = children;
  91105. child.index = index;
  91106. if (parent) {
  91107. child.parent = parent;
  91108. child.sibling = Object(_common__WEBPACK_IMPORTED_MODULE_0__["hasOverlap"])(child.start, child.end, parent.start, addTime(parent.start, overlapThreshold));
  91109. parent.children.push(child);
  91110. }
  91111. try {
  91112. for (var children_1 = (e_3 = void 0, __values(children)), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
  91113. var grand = children_1_1.value;
  91114. if (grand.parent === parent) {
  91115. grand.parent = child;
  91116. }
  91117. var grandNext = grand.index - child.index <= 1;
  91118. if (grandNext && child.sibling && Object(_common__WEBPACK_IMPORTED_MODULE_0__["hasOverlap"])(child.start, addTime(child.start, overlapThreshold), grand.start, grand.end)) {
  91119. grand.sibling = true;
  91120. }
  91121. }
  91122. } catch (e_3_1) {
  91123. e_3 = {
  91124. error: e_3_1
  91125. };
  91126. } finally {
  91127. try {
  91128. if (children_1_1 && !children_1_1.done && (_c = children_1.return)) _c.call(children_1);
  91129. } finally {
  91130. if (e_3) throw e_3.error;
  91131. }
  91132. }
  91133. }
  91134. nodes.push(child);
  91135. }
  91136. } catch (e_2_1) {
  91137. e_2 = {
  91138. error: e_2_1
  91139. };
  91140. } finally {
  91141. try {
  91142. if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
  91143. } finally {
  91144. if (e_2) throw e_2.error;
  91145. }
  91146. }
  91147. calculateBounds(nodes, overlapThreshold);
  91148. }
  91149. } catch (e_1_1) {
  91150. e_1 = {
  91151. error: e_1_1
  91152. };
  91153. } finally {
  91154. try {
  91155. if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) _a.call(groups_1);
  91156. } finally {
  91157. if (e_1) throw e_1.error;
  91158. }
  91159. }
  91160. visuals.sort(function (a, b) {
  91161. return a.left - b.left || a.event.startTimestampIdentifier - b.event.startTimestampIdentifier;
  91162. });
  91163. return visuals;
  91164. };
  91165. };
  91166. function calculateBounds(nodes, overlapThreshold) {
  91167. var e_4, _a;
  91168. try {
  91169. for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
  91170. var node = nodes_1_1.value;
  91171. var visual = node.visual,
  91172. parent = node.parent;
  91173. var columns = getMaxChildIndex(node) + 1;
  91174. var spaceLeft = parent ? parent.visual.left : 0;
  91175. var spaceWidth = FULL_WIDTH - spaceLeft;
  91176. var offset = Math.min(DEFAULT_OFFSET, FULL_WIDTH / columns);
  91177. var columnWidthMultiplier = getColumnWidthMultiplier(node, nodes);
  91178. var columnOffset = spaceWidth / (columns - node.index + 1);
  91179. var columnWidth = spaceWidth / (columns - node.index + (node.sibling ? 1 : 0)) * columnWidthMultiplier;
  91180. if (parent) {
  91181. visual.left = node.sibling ? spaceLeft + columnOffset : spaceLeft + offset;
  91182. }
  91183. visual.width = hasFullWidth(node, nodes, overlapThreshold) ? FULL_WIDTH - visual.left : Math.min(FULL_WIDTH - visual.left, columnWidth * WIDTH_MULTIPLIER);
  91184. }
  91185. } catch (e_4_1) {
  91186. e_4 = {
  91187. error: e_4_1
  91188. };
  91189. } finally {
  91190. try {
  91191. if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
  91192. } finally {
  91193. if (e_4) throw e_4.error;
  91194. }
  91195. }
  91196. }
  91197. function getColumnWidthMultiplier(node, nodes) {
  91198. if (!node.children.length) {
  91199. return 1;
  91200. }
  91201. var maxColumn = node.index + nodes.length;
  91202. var minColumn = node.children.reduce(function (min, c) {
  91203. return Math.min(min, c.index);
  91204. }, maxColumn);
  91205. return minColumn - node.index;
  91206. }
  91207. function getOverlappingIndices(node, nodes) {
  91208. var e_5, _a;
  91209. var indices = [];
  91210. try {
  91211. for (var nodes_2 = __values(nodes), nodes_2_1 = nodes_2.next(); !nodes_2_1.done; nodes_2_1 = nodes_2.next()) {
  91212. var other = nodes_2_1.value;
  91213. if (Object(_common__WEBPACK_IMPORTED_MODULE_0__["hasOverlap"])(node.start, node.end, other.start, other.end)) {
  91214. indices.push(other.index);
  91215. }
  91216. }
  91217. } catch (e_5_1) {
  91218. e_5 = {
  91219. error: e_5_1
  91220. };
  91221. } finally {
  91222. try {
  91223. if (nodes_2_1 && !nodes_2_1.done && (_a = nodes_2.return)) _a.call(nodes_2);
  91224. } finally {
  91225. if (e_5) throw e_5.error;
  91226. }
  91227. }
  91228. return indices;
  91229. }
  91230. function getNextIndex(node, nodes) {
  91231. var indices = getOverlappingIndices(node, nodes);
  91232. indices.sort();
  91233. for (var i = 0; i < indices.length; i++) {
  91234. if (i < indices[i]) {
  91235. return i;
  91236. }
  91237. }
  91238. return false;
  91239. }
  91240. function getOverlappingRange(node, nodes, indexMin, indexMax, returnFirstColumn) {
  91241. var e_6, _a;
  91242. if (returnFirstColumn === void 0) {
  91243. returnFirstColumn = false;
  91244. }
  91245. var overlapping = [];
  91246. try {
  91247. for (var nodes_3 = __values(nodes), nodes_3_1 = nodes_3.next(); !nodes_3_1.done; nodes_3_1 = nodes_3.next()) {
  91248. var other = nodes_3_1.value;
  91249. if (other.index >= indexMin && other.index <= indexMax && Object(_common__WEBPACK_IMPORTED_MODULE_0__["hasOverlap"])(node.start, node.end, other.start, other.end)) {
  91250. overlapping.push(other);
  91251. }
  91252. }
  91253. } catch (e_6_1) {
  91254. e_6 = {
  91255. error: e_6_1
  91256. };
  91257. } finally {
  91258. try {
  91259. if (nodes_3_1 && !nodes_3_1.done && (_a = nodes_3.return)) _a.call(nodes_3);
  91260. } finally {
  91261. if (e_6) throw e_6.error;
  91262. }
  91263. }
  91264. if (returnFirstColumn && overlapping.length > 0) {
  91265. var first_1 = overlapping.reduce(function (min, n) {
  91266. return Math.min(min, n.index);
  91267. }, overlapping[0].index);
  91268. return overlapping.filter(function (n) {
  91269. return n.index === first_1;
  91270. });
  91271. }
  91272. return overlapping;
  91273. }
  91274. function getParent(node, nodes) {
  91275. var e_7, _a;
  91276. var parent = null;
  91277. try {
  91278. for (var nodes_4 = __values(nodes), nodes_4_1 = nodes_4.next(); !nodes_4_1.done; nodes_4_1 = nodes_4.next()) {
  91279. var other = nodes_4_1.value;
  91280. if (Object(_common__WEBPACK_IMPORTED_MODULE_0__["hasOverlap"])(node.start, node.end, other.start, other.end) && (parent === null || other.index > parent.index)) {
  91281. parent = other;
  91282. }
  91283. }
  91284. } catch (e_7_1) {
  91285. e_7 = {
  91286. error: e_7_1
  91287. };
  91288. } finally {
  91289. try {
  91290. if (nodes_4_1 && !nodes_4_1.done && (_a = nodes_4.return)) _a.call(nodes_4);
  91291. } finally {
  91292. if (e_7) throw e_7.error;
  91293. }
  91294. }
  91295. return parent;
  91296. }
  91297. function hasFullWidth(node, nodes, overlapThreshold) {
  91298. var e_8, _a;
  91299. try {
  91300. for (var nodes_5 = __values(nodes), nodes_5_1 = nodes_5.next(); !nodes_5_1.done; nodes_5_1 = nodes_5.next()) {
  91301. var other = nodes_5_1.value;
  91302. if (other !== node && other.index > node.index && Object(_common__WEBPACK_IMPORTED_MODULE_0__["hasOverlap"])(node.start, addTime(node.start, overlapThreshold), other.start, other.end)) {
  91303. return false;
  91304. }
  91305. }
  91306. } catch (e_8_1) {
  91307. e_8 = {
  91308. error: e_8_1
  91309. };
  91310. } finally {
  91311. try {
  91312. if (nodes_5_1 && !nodes_5_1.done && (_a = nodes_5.return)) _a.call(nodes_5);
  91313. } finally {
  91314. if (e_8) throw e_8.error;
  91315. }
  91316. }
  91317. return true;
  91318. }
  91319. function getGroups(visuals, dayStart) {
  91320. var e_9, _a, e_10, _b;
  91321. var groups = [];
  91322. try {
  91323. for (var visuals_1 = __values(visuals), visuals_1_1 = visuals_1.next(); !visuals_1_1.done; visuals_1_1 = visuals_1.next()) {
  91324. var visual = visuals_1_1.value;
  91325. var _c = __read(Object(_common__WEBPACK_IMPORTED_MODULE_0__["getNormalizedRange"])(visual.event, dayStart), 2),
  91326. start = _c[0],
  91327. end = _c[1];
  91328. var added = false;
  91329. try {
  91330. for (var groups_2 = (e_10 = void 0, __values(groups)), groups_2_1 = groups_2.next(); !groups_2_1.done; groups_2_1 = groups_2.next()) {
  91331. var group = groups_2_1.value;
  91332. if (Object(_common__WEBPACK_IMPORTED_MODULE_0__["hasOverlap"])(start, end, group.start, group.end)) {
  91333. group.visuals.push(visual);
  91334. group.end = Math.max(group.end, end);
  91335. added = true;
  91336. break;
  91337. }
  91338. }
  91339. } catch (e_10_1) {
  91340. e_10 = {
  91341. error: e_10_1
  91342. };
  91343. } finally {
  91344. try {
  91345. if (groups_2_1 && !groups_2_1.done && (_b = groups_2.return)) _b.call(groups_2);
  91346. } finally {
  91347. if (e_10) throw e_10.error;
  91348. }
  91349. }
  91350. if (!added) {
  91351. groups.push({
  91352. start: start,
  91353. end: end,
  91354. visuals: [visual]
  91355. });
  91356. }
  91357. }
  91358. } catch (e_9_1) {
  91359. e_9 = {
  91360. error: e_9_1
  91361. };
  91362. } finally {
  91363. try {
  91364. if (visuals_1_1 && !visuals_1_1.done && (_a = visuals_1.return)) _a.call(visuals_1);
  91365. } finally {
  91366. if (e_9) throw e_9.error;
  91367. }
  91368. }
  91369. return groups;
  91370. }
  91371. function getNode(visual, dayStart) {
  91372. var _a = __read(Object(_common__WEBPACK_IMPORTED_MODULE_0__["getNormalizedRange"])(visual.event, dayStart), 2),
  91373. start = _a[0],
  91374. end = _a[1];
  91375. return {
  91376. parent: null,
  91377. sibling: true,
  91378. index: 0,
  91379. visual: visual,
  91380. start: start,
  91381. end: end,
  91382. children: []
  91383. };
  91384. }
  91385. function getMaxChildIndex(node) {
  91386. var e_11, _a;
  91387. var max = node.index;
  91388. try {
  91389. for (var _b = __values(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {
  91390. var child = _c.value;
  91391. var childMax = getMaxChildIndex(child);
  91392. if (childMax > max) {
  91393. max = childMax;
  91394. }
  91395. }
  91396. } catch (e_11_1) {
  91397. e_11 = {
  91398. error: e_11_1
  91399. };
  91400. } finally {
  91401. try {
  91402. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  91403. } finally {
  91404. if (e_11) throw e_11.error;
  91405. }
  91406. }
  91407. return max;
  91408. }
  91409. function addTime(identifier, minutes) {
  91410. var removeMinutes = identifier % 100;
  91411. var totalMinutes = removeMinutes + minutes;
  91412. var addHours = Math.floor(totalMinutes / 60);
  91413. var addMinutes = totalMinutes % 60;
  91414. return identifier - removeMinutes + addHours * 100 + addMinutes;
  91415. }
  91416. /***/ }),
  91417. /***/ "./src/components/VCalendar/util/events.ts":
  91418. /*!*************************************************!*\
  91419. !*** ./src/components/VCalendar/util/events.ts ***!
  91420. \*************************************************/
  91421. /*! exports provided: parseEvent, isEventOn, isEventStart, isEventOverlapping */
  91422. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91423. "use strict";
  91424. __webpack_require__.r(__webpack_exports__);
  91425. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseEvent", function() { return parseEvent; });
  91426. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEventOn", function() { return isEventOn; });
  91427. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEventStart", function() { return isEventStart; });
  91428. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEventOverlapping", function() { return isEventOverlapping; });
  91429. /* harmony import */ var _timestamp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  91430. function parseEvent(input, index, startProperty, endProperty) {
  91431. var start = Object(_timestamp__WEBPACK_IMPORTED_MODULE_0__["parseTimestamp"])(input[startProperty], true);
  91432. var end = input[endProperty] ? Object(_timestamp__WEBPACK_IMPORTED_MODULE_0__["parseTimestamp"])(input[endProperty], true) : start;
  91433. var startIdentifier = Object(_timestamp__WEBPACK_IMPORTED_MODULE_0__["getDayIdentifier"])(start);
  91434. var startTimestampIdentifier = Object(_timestamp__WEBPACK_IMPORTED_MODULE_0__["getTimestampIdentifier"])(start);
  91435. var endIdentifier = Object(_timestamp__WEBPACK_IMPORTED_MODULE_0__["getDayIdentifier"])(end);
  91436. var endOffset = start.hasTime ? 0 : 2359;
  91437. var endTimestampIdentifier = Object(_timestamp__WEBPACK_IMPORTED_MODULE_0__["getTimestampIdentifier"])(end) + endOffset;
  91438. var allDay = !start.hasTime;
  91439. return {
  91440. input: input,
  91441. start: start,
  91442. startIdentifier: startIdentifier,
  91443. startTimestampIdentifier: startTimestampIdentifier,
  91444. end: end,
  91445. endIdentifier: endIdentifier,
  91446. endTimestampIdentifier: endTimestampIdentifier,
  91447. allDay: allDay,
  91448. index: index
  91449. };
  91450. }
  91451. function isEventOn(event, dayIdentifier) {
  91452. return dayIdentifier >= event.startIdentifier && dayIdentifier <= event.endIdentifier && dayIdentifier * _timestamp__WEBPACK_IMPORTED_MODULE_0__["OFFSET_TIME"] !== event.endTimestampIdentifier;
  91453. }
  91454. function isEventStart(event, day, dayIdentifier, firstWeekday) {
  91455. return dayIdentifier === event.startIdentifier || firstWeekday === day.weekday && isEventOn(event, dayIdentifier);
  91456. }
  91457. function isEventOverlapping(event, startIdentifier, endIdentifier) {
  91458. return startIdentifier <= event.endIdentifier && endIdentifier >= event.startIdentifier;
  91459. }
  91460. /***/ }),
  91461. /***/ "./src/components/VCalendar/util/props.ts":
  91462. /*!************************************************!*\
  91463. !*** ./src/components/VCalendar/util/props.ts ***!
  91464. \************************************************/
  91465. /*! exports provided: default, validateNumber, validateWeekdays */
  91466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91467. "use strict";
  91468. __webpack_require__.r(__webpack_exports__);
  91469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateNumber", function() { return validateNumber; });
  91470. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateWeekdays", function() { return validateWeekdays; });
  91471. /* harmony import */ var _timestamp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  91472. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modes */ "./src/components/VCalendar/modes/index.ts");
  91473. /* harmony default export */ __webpack_exports__["default"] = ({
  91474. base: {
  91475. start: {
  91476. type: String,
  91477. validate: _timestamp__WEBPACK_IMPORTED_MODULE_0__["validateTimestamp"],
  91478. default: function _default() {
  91479. return Object(_timestamp__WEBPACK_IMPORTED_MODULE_0__["parseDate"])(new Date()).date;
  91480. }
  91481. },
  91482. end: {
  91483. type: String,
  91484. validate: _timestamp__WEBPACK_IMPORTED_MODULE_0__["validateTimestamp"]
  91485. },
  91486. weekdays: {
  91487. type: [Array, String],
  91488. default: function _default() {
  91489. return [0, 1, 2, 3, 4, 5, 6];
  91490. },
  91491. validate: validateWeekdays
  91492. },
  91493. hideHeader: {
  91494. type: Boolean,
  91495. default: false
  91496. },
  91497. shortWeekdays: {
  91498. type: Boolean,
  91499. default: true
  91500. },
  91501. weekdayFormat: {
  91502. type: Function,
  91503. default: null
  91504. },
  91505. dayFormat: {
  91506. type: Function,
  91507. default: null
  91508. }
  91509. },
  91510. intervals: {
  91511. maxDays: {
  91512. type: Number,
  91513. default: 7
  91514. },
  91515. shortIntervals: {
  91516. type: Boolean,
  91517. default: true
  91518. },
  91519. intervalHeight: {
  91520. type: [Number, String],
  91521. default: 48,
  91522. validate: validateNumber
  91523. },
  91524. intervalWidth: {
  91525. type: [Number, String],
  91526. default: 60,
  91527. validate: validateNumber
  91528. },
  91529. intervalMinutes: {
  91530. type: [Number, String],
  91531. default: 60,
  91532. validate: validateNumber
  91533. },
  91534. firstInterval: {
  91535. type: [Number, String],
  91536. default: 0,
  91537. validate: validateNumber
  91538. },
  91539. intervalCount: {
  91540. type: [Number, String],
  91541. default: 24,
  91542. validate: validateNumber
  91543. },
  91544. intervalFormat: {
  91545. type: Function,
  91546. default: null
  91547. },
  91548. intervalStyle: {
  91549. type: Function,
  91550. default: null
  91551. },
  91552. showIntervalLabel: {
  91553. type: Function,
  91554. default: null
  91555. }
  91556. },
  91557. weeks: {
  91558. minWeeks: {
  91559. validate: validateNumber,
  91560. default: 1
  91561. },
  91562. shortMonths: {
  91563. type: Boolean,
  91564. default: true
  91565. },
  91566. showMonthOnFirst: {
  91567. type: Boolean,
  91568. default: true
  91569. },
  91570. monthFormat: {
  91571. type: Function,
  91572. default: null
  91573. }
  91574. },
  91575. calendar: {
  91576. type: {
  91577. type: String,
  91578. default: 'month'
  91579. },
  91580. value: {
  91581. type: String,
  91582. validate: _timestamp__WEBPACK_IMPORTED_MODULE_0__["validateTimestamp"]
  91583. }
  91584. },
  91585. events: {
  91586. events: {
  91587. type: Array,
  91588. default: function _default() {
  91589. return [];
  91590. }
  91591. },
  91592. eventStart: {
  91593. type: String,
  91594. default: 'start'
  91595. },
  91596. eventEnd: {
  91597. type: String,
  91598. default: 'end'
  91599. },
  91600. eventHeight: {
  91601. type: Number,
  91602. default: 20
  91603. },
  91604. eventColor: {
  91605. type: [String, Function],
  91606. default: 'primary'
  91607. },
  91608. eventTextColor: {
  91609. type: [String, Function],
  91610. default: 'white'
  91611. },
  91612. eventName: {
  91613. type: [String, Function],
  91614. default: 'name'
  91615. },
  91616. eventOverlapThreshold: {
  91617. type: [String, Number],
  91618. default: 60
  91619. },
  91620. eventOverlapMode: {
  91621. type: [String, Function],
  91622. default: 'stack',
  91623. validate: function validate(mode) {
  91624. return mode in _modes__WEBPACK_IMPORTED_MODULE_1__["CalendarEventOverlapModes"] || typeof mode === 'function';
  91625. }
  91626. },
  91627. eventMore: {
  91628. type: Boolean,
  91629. default: true
  91630. },
  91631. eventMoreText: {
  91632. type: String,
  91633. default: '$vuetify.calendar.moreEvents'
  91634. },
  91635. eventRipple: {
  91636. type: [Boolean, Object],
  91637. default: null
  91638. },
  91639. eventMarginBottom: {
  91640. type: Number,
  91641. default: 1
  91642. }
  91643. }
  91644. });
  91645. function validateNumber(input) {
  91646. return isFinite(parseInt(input));
  91647. }
  91648. function validateWeekdays(input) {
  91649. if (typeof input === 'string') {
  91650. input = input.split(',');
  91651. }
  91652. if (Array.isArray(input)) {
  91653. var ints = input.map(function (x) {
  91654. return parseInt(x);
  91655. });
  91656. if (ints.length > _timestamp__WEBPACK_IMPORTED_MODULE_0__["DAYS_IN_WEEK"] || ints.length === 0) {
  91657. return false;
  91658. }
  91659. var visited = {};
  91660. var wrapped = false;
  91661. for (var i = 0; i < ints.length; i++) {
  91662. var x = ints[i];
  91663. if (!isFinite(x) || x < 0 || x >= _timestamp__WEBPACK_IMPORTED_MODULE_0__["DAYS_IN_WEEK"]) {
  91664. return false;
  91665. }
  91666. if (i > 0) {
  91667. var d = x - ints[i - 1];
  91668. if (d < 0) {
  91669. if (wrapped) {
  91670. return false;
  91671. }
  91672. wrapped = true;
  91673. } else if (d === 0) {
  91674. return false;
  91675. }
  91676. }
  91677. if (visited[x]) {
  91678. return false;
  91679. }
  91680. visited[x] = true;
  91681. }
  91682. return true;
  91683. }
  91684. return false;
  91685. }
  91686. /***/ }),
  91687. /***/ "./src/components/VCalendar/util/timestamp.ts":
  91688. /*!****************************************************!*\
  91689. !*** ./src/components/VCalendar/util/timestamp.ts ***!
  91690. \****************************************************/
  91691. /*! exports provided: PARSE_REGEX, PARSE_TIME, DAYS_IN_MONTH, DAYS_IN_MONTH_LEAP, DAYS_IN_MONTH_MIN, DAYS_IN_MONTH_MAX, MONTH_MAX, MONTH_MIN, DAY_MIN, DAYS_IN_WEEK, MINUTES_IN_HOUR, HOURS_IN_DAY, FIRST_HOUR, OFFSET_YEAR, OFFSET_MONTH, OFFSET_HOUR, OFFSET_TIME, getStartOfWeek, getEndOfWeek, getStartOfMonth, getEndOfMonth, parseTime, validateTimestamp, parseTimestamp, parseDate, getDayIdentifier, getTimeIdentifier, getTimestampIdentifier, updateRelative, updateMinutes, updateWeekday, updateFormatted, getWeekday, daysInMonth, copyTimestamp, padNumber, getDate, getTime, nextMinutes, nextDay, prevDay, relativeDays, diffMinutes, findWeekday, getWeekdaySkips, createDayList, createIntervalList, createNativeLocaleFormatter */
  91692. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91693. "use strict";
  91694. __webpack_require__.r(__webpack_exports__);
  91695. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PARSE_REGEX", function() { return PARSE_REGEX; });
  91696. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PARSE_TIME", function() { return PARSE_TIME; });
  91697. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DAYS_IN_MONTH", function() { return DAYS_IN_MONTH; });
  91698. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DAYS_IN_MONTH_LEAP", function() { return DAYS_IN_MONTH_LEAP; });
  91699. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DAYS_IN_MONTH_MIN", function() { return DAYS_IN_MONTH_MIN; });
  91700. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DAYS_IN_MONTH_MAX", function() { return DAYS_IN_MONTH_MAX; });
  91701. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MONTH_MAX", function() { return MONTH_MAX; });
  91702. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MONTH_MIN", function() { return MONTH_MIN; });
  91703. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DAY_MIN", function() { return DAY_MIN; });
  91704. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DAYS_IN_WEEK", function() { return DAYS_IN_WEEK; });
  91705. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MINUTES_IN_HOUR", function() { return MINUTES_IN_HOUR; });
  91706. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HOURS_IN_DAY", function() { return HOURS_IN_DAY; });
  91707. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIRST_HOUR", function() { return FIRST_HOUR; });
  91708. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OFFSET_YEAR", function() { return OFFSET_YEAR; });
  91709. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OFFSET_MONTH", function() { return OFFSET_MONTH; });
  91710. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OFFSET_HOUR", function() { return OFFSET_HOUR; });
  91711. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OFFSET_TIME", function() { return OFFSET_TIME; });
  91712. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStartOfWeek", function() { return getStartOfWeek; });
  91713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEndOfWeek", function() { return getEndOfWeek; });
  91714. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStartOfMonth", function() { return getStartOfMonth; });
  91715. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEndOfMonth", function() { return getEndOfMonth; });
  91716. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseTime", function() { return parseTime; });
  91717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateTimestamp", function() { return validateTimestamp; });
  91718. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseTimestamp", function() { return parseTimestamp; });
  91719. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDate", function() { return parseDate; });
  91720. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDayIdentifier", function() { return getDayIdentifier; });
  91721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTimeIdentifier", function() { return getTimeIdentifier; });
  91722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTimestampIdentifier", function() { return getTimestampIdentifier; });
  91723. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateRelative", function() { return updateRelative; });
  91724. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateMinutes", function() { return updateMinutes; });
  91725. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateWeekday", function() { return updateWeekday; });
  91726. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateFormatted", function() { return updateFormatted; });
  91727. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWeekday", function() { return getWeekday; });
  91728. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "daysInMonth", function() { return daysInMonth; });
  91729. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyTimestamp", function() { return copyTimestamp; });
  91730. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "padNumber", function() { return padNumber; });
  91731. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDate", function() { return getDate; });
  91732. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTime", function() { return getTime; });
  91733. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nextMinutes", function() { return nextMinutes; });
  91734. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nextDay", function() { return nextDay; });
  91735. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prevDay", function() { return prevDay; });
  91736. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relativeDays", function() { return relativeDays; });
  91737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffMinutes", function() { return diffMinutes; });
  91738. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findWeekday", function() { return findWeekday; });
  91739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWeekdaySkips", function() { return getWeekdaySkips; });
  91740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDayList", function() { return createDayList; });
  91741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIntervalList", function() { return createIntervalList; });
  91742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNativeLocaleFormatter", function() { return createNativeLocaleFormatter; });
  91743. /* harmony import */ var _util_dateTimeUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/dateTimeUtils */ "./src/util/dateTimeUtils.ts");
  91744. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  91745. var PARSE_REGEX = /^(\d{4})-(\d{1,2})(-(\d{1,2}))?([^\d]+(\d{1,2}))?(:(\d{1,2}))?(:(\d{1,2}))?$/;
  91746. var PARSE_TIME = /(\d\d?)(:(\d\d?)|)(:(\d\d?)|)/;
  91747. var DAYS_IN_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  91748. var DAYS_IN_MONTH_LEAP = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  91749. var DAYS_IN_MONTH_MIN = 28;
  91750. var DAYS_IN_MONTH_MAX = 31;
  91751. var MONTH_MAX = 12;
  91752. var MONTH_MIN = 1;
  91753. var DAY_MIN = 1;
  91754. var DAYS_IN_WEEK = 7;
  91755. var MINUTES_IN_HOUR = 60;
  91756. var HOURS_IN_DAY = 24;
  91757. var FIRST_HOUR = 0;
  91758. var OFFSET_YEAR = 10000;
  91759. var OFFSET_MONTH = 100;
  91760. var OFFSET_HOUR = 100;
  91761. var OFFSET_TIME = 10000;
  91762. function getStartOfWeek(timestamp, weekdays, today) {
  91763. var start = copyTimestamp(timestamp);
  91764. findWeekday(start, weekdays[0], prevDay);
  91765. updateFormatted(start);
  91766. if (today) {
  91767. updateRelative(start, today, start.hasTime);
  91768. }
  91769. return start;
  91770. }
  91771. function getEndOfWeek(timestamp, weekdays, today) {
  91772. var end = copyTimestamp(timestamp);
  91773. findWeekday(end, weekdays[weekdays.length - 1]);
  91774. updateFormatted(end);
  91775. if (today) {
  91776. updateRelative(end, today, end.hasTime);
  91777. }
  91778. return end;
  91779. }
  91780. function getStartOfMonth(timestamp) {
  91781. var start = copyTimestamp(timestamp);
  91782. start.day = DAY_MIN;
  91783. updateWeekday(start);
  91784. updateFormatted(start);
  91785. return start;
  91786. }
  91787. function getEndOfMonth(timestamp) {
  91788. var end = copyTimestamp(timestamp);
  91789. end.day = daysInMonth(end.year, end.month);
  91790. updateWeekday(end);
  91791. updateFormatted(end);
  91792. return end;
  91793. }
  91794. function parseTime(input) {
  91795. if (typeof input === 'number') {
  91796. // when a number is given, it's minutes since 12:00am
  91797. return input;
  91798. } else if (typeof input === 'string') {
  91799. // when a string is given, it's a hh:mm:ss format where seconds are optional
  91800. var parts = PARSE_TIME.exec(input);
  91801. if (!parts) {
  91802. return false;
  91803. }
  91804. return parseInt(parts[1]) * 60 + parseInt(parts[3] || 0);
  91805. } else if (_typeof(input) === 'object') {
  91806. // when an object is given, it must have hour and minute
  91807. if (typeof input.hour !== 'number' || typeof input.minute !== 'number') {
  91808. return false;
  91809. }
  91810. return input.hour * 60 + input.minute;
  91811. } else {
  91812. // unsupported type
  91813. return false;
  91814. }
  91815. }
  91816. function validateTimestamp(input) {
  91817. return !!PARSE_REGEX.exec(input);
  91818. }
  91819. function parseTimestamp(input, required, now) {
  91820. if (required === void 0) {
  91821. required = false;
  91822. } // YYYY-MM-DD hh:mm:ss
  91823. var parts = PARSE_REGEX.exec(input);
  91824. if (!parts) {
  91825. if (required) {
  91826. throw new Error(input + " is not a valid timestamp. It must be in the format of YYYY-MM-DD or YYYY-MM-DD hh:mm. Zero-padding is optional and seconds are ignored.");
  91827. }
  91828. return null;
  91829. }
  91830. var timestamp = {
  91831. date: input,
  91832. time: '',
  91833. year: parseInt(parts[1]),
  91834. month: parseInt(parts[2]),
  91835. day: parseInt(parts[4]) || 1,
  91836. hour: parseInt(parts[6]) || 0,
  91837. minute: parseInt(parts[8]) || 0,
  91838. weekday: 0,
  91839. hasDay: !!parts[4],
  91840. hasTime: !!(parts[6] && parts[8]),
  91841. past: false,
  91842. present: false,
  91843. future: false
  91844. };
  91845. updateWeekday(timestamp);
  91846. updateFormatted(timestamp);
  91847. if (now) {
  91848. updateRelative(timestamp, now, timestamp.hasTime);
  91849. }
  91850. return timestamp;
  91851. }
  91852. function parseDate(date) {
  91853. return updateFormatted({
  91854. date: '',
  91855. time: '',
  91856. year: date.getFullYear(),
  91857. month: date.getMonth() + 1,
  91858. day: date.getDate(),
  91859. weekday: date.getDay(),
  91860. hour: date.getHours(),
  91861. minute: date.getMinutes(),
  91862. hasDay: true,
  91863. hasTime: true,
  91864. past: false,
  91865. present: true,
  91866. future: false
  91867. });
  91868. }
  91869. function getDayIdentifier(timestamp) {
  91870. return timestamp.year * OFFSET_YEAR + timestamp.month * OFFSET_MONTH + timestamp.day;
  91871. }
  91872. function getTimeIdentifier(timestamp) {
  91873. return timestamp.hour * OFFSET_HOUR + timestamp.minute;
  91874. }
  91875. function getTimestampIdentifier(timestamp) {
  91876. return getDayIdentifier(timestamp) * OFFSET_TIME + getTimeIdentifier(timestamp);
  91877. }
  91878. function updateRelative(timestamp, now, time) {
  91879. if (time === void 0) {
  91880. time = false;
  91881. }
  91882. var a = getDayIdentifier(now);
  91883. var b = getDayIdentifier(timestamp);
  91884. var present = a === b;
  91885. if (timestamp.hasTime && time && present) {
  91886. a = getTimeIdentifier(now);
  91887. b = getTimeIdentifier(timestamp);
  91888. present = a === b;
  91889. }
  91890. timestamp.past = b < a;
  91891. timestamp.present = present;
  91892. timestamp.future = b > a;
  91893. return timestamp;
  91894. }
  91895. function updateMinutes(timestamp, minutes, now) {
  91896. timestamp.hasTime = true;
  91897. timestamp.hour = Math.floor(minutes / MINUTES_IN_HOUR);
  91898. timestamp.minute = minutes % MINUTES_IN_HOUR;
  91899. timestamp.time = getTime(timestamp);
  91900. if (now) {
  91901. updateRelative(timestamp, now, true);
  91902. }
  91903. return timestamp;
  91904. }
  91905. function updateWeekday(timestamp) {
  91906. timestamp.weekday = getWeekday(timestamp);
  91907. return timestamp;
  91908. }
  91909. function updateFormatted(timestamp) {
  91910. timestamp.time = getTime(timestamp);
  91911. timestamp.date = getDate(timestamp);
  91912. return timestamp;
  91913. }
  91914. function getWeekday(timestamp) {
  91915. if (timestamp.hasDay) {
  91916. var _ = Math.floor;
  91917. var k = timestamp.day;
  91918. var m = (timestamp.month + 9) % MONTH_MAX + 1;
  91919. var C = _(timestamp.year / 100);
  91920. var Y = timestamp.year % 100 - (timestamp.month <= 2 ? 1 : 0);
  91921. return ((k + _(2.6 * m - 0.2) - 2 * C + Y + _(Y / 4) + _(C / 4)) % 7 + 7) % 7;
  91922. }
  91923. return timestamp.weekday;
  91924. }
  91925. function daysInMonth(year, month) {
  91926. return Object(_util_dateTimeUtils__WEBPACK_IMPORTED_MODULE_0__["isLeapYear"])(year) ? DAYS_IN_MONTH_LEAP[month] : DAYS_IN_MONTH[month];
  91927. }
  91928. function copyTimestamp(timestamp) {
  91929. var date = timestamp.date,
  91930. time = timestamp.time,
  91931. year = timestamp.year,
  91932. month = timestamp.month,
  91933. day = timestamp.day,
  91934. weekday = timestamp.weekday,
  91935. hour = timestamp.hour,
  91936. minute = timestamp.minute,
  91937. hasDay = timestamp.hasDay,
  91938. hasTime = timestamp.hasTime,
  91939. past = timestamp.past,
  91940. present = timestamp.present,
  91941. future = timestamp.future;
  91942. return {
  91943. date: date,
  91944. time: time,
  91945. year: year,
  91946. month: month,
  91947. day: day,
  91948. weekday: weekday,
  91949. hour: hour,
  91950. minute: minute,
  91951. hasDay: hasDay,
  91952. hasTime: hasTime,
  91953. past: past,
  91954. present: present,
  91955. future: future
  91956. };
  91957. }
  91958. function padNumber(x, length) {
  91959. var padded = String(x);
  91960. while (padded.length < length) {
  91961. padded = '0' + padded;
  91962. }
  91963. return padded;
  91964. }
  91965. function getDate(timestamp) {
  91966. var str = padNumber(timestamp.year, 4) + "-" + padNumber(timestamp.month, 2);
  91967. if (timestamp.hasDay) str += "-" + padNumber(timestamp.day, 2);
  91968. return str;
  91969. }
  91970. function getTime(timestamp) {
  91971. if (!timestamp.hasTime) {
  91972. return '';
  91973. }
  91974. return padNumber(timestamp.hour, 2) + ":" + padNumber(timestamp.minute, 2);
  91975. }
  91976. function nextMinutes(timestamp, minutes) {
  91977. timestamp.minute += minutes;
  91978. while (timestamp.minute > MINUTES_IN_HOUR) {
  91979. timestamp.minute -= MINUTES_IN_HOUR;
  91980. timestamp.hour++;
  91981. if (timestamp.hour >= HOURS_IN_DAY) {
  91982. nextDay(timestamp);
  91983. timestamp.hour = FIRST_HOUR;
  91984. }
  91985. }
  91986. return timestamp;
  91987. }
  91988. function nextDay(timestamp) {
  91989. timestamp.day++;
  91990. timestamp.weekday = (timestamp.weekday + 1) % DAYS_IN_WEEK;
  91991. if (timestamp.day > DAYS_IN_MONTH_MIN && timestamp.day > daysInMonth(timestamp.year, timestamp.month)) {
  91992. timestamp.day = DAY_MIN;
  91993. timestamp.month++;
  91994. if (timestamp.month > MONTH_MAX) {
  91995. timestamp.month = MONTH_MIN;
  91996. timestamp.year++;
  91997. }
  91998. }
  91999. return timestamp;
  92000. }
  92001. function prevDay(timestamp) {
  92002. timestamp.day--;
  92003. timestamp.weekday = (timestamp.weekday + 6) % DAYS_IN_WEEK;
  92004. if (timestamp.day < DAY_MIN) {
  92005. timestamp.month--;
  92006. if (timestamp.month < MONTH_MIN) {
  92007. timestamp.year--;
  92008. timestamp.month = MONTH_MAX;
  92009. }
  92010. timestamp.day = daysInMonth(timestamp.year, timestamp.month);
  92011. }
  92012. return timestamp;
  92013. }
  92014. function relativeDays(timestamp, mover, days) {
  92015. if (mover === void 0) {
  92016. mover = nextDay;
  92017. }
  92018. if (days === void 0) {
  92019. days = 1;
  92020. }
  92021. while (--days >= 0) {
  92022. mover(timestamp);
  92023. }
  92024. return timestamp;
  92025. }
  92026. function diffMinutes(min, max) {
  92027. var Y = (max.year - min.year) * 525600;
  92028. var M = (max.month - min.month) * 43800;
  92029. var D = (max.day - min.day) * 1440;
  92030. var h = (max.hour - min.hour) * 60;
  92031. var m = max.minute - min.minute;
  92032. return Y + M + D + h + m;
  92033. }
  92034. function findWeekday(timestamp, weekday, mover, maxDays) {
  92035. if (mover === void 0) {
  92036. mover = nextDay;
  92037. }
  92038. if (maxDays === void 0) {
  92039. maxDays = 6;
  92040. }
  92041. while (timestamp.weekday !== weekday && --maxDays >= 0) {
  92042. mover(timestamp);
  92043. }
  92044. return timestamp;
  92045. }
  92046. function getWeekdaySkips(weekdays) {
  92047. var skips = [1, 1, 1, 1, 1, 1, 1];
  92048. var filled = [0, 0, 0, 0, 0, 0, 0];
  92049. for (var i = 0; i < weekdays.length; i++) {
  92050. filled[weekdays[i]] = 1;
  92051. }
  92052. for (var k = 0; k < DAYS_IN_WEEK; k++) {
  92053. var skip = 1;
  92054. for (var j = 1; j < DAYS_IN_WEEK; j++) {
  92055. var next = (k + j) % DAYS_IN_WEEK;
  92056. if (filled[next]) {
  92057. break;
  92058. }
  92059. skip++;
  92060. }
  92061. skips[k] = filled[k] * skip;
  92062. }
  92063. return skips;
  92064. }
  92065. function createDayList(start, end, now, weekdaySkips, max, min) {
  92066. if (max === void 0) {
  92067. max = 42;
  92068. }
  92069. if (min === void 0) {
  92070. min = 0;
  92071. }
  92072. var stop = getDayIdentifier(end);
  92073. var days = [];
  92074. var current = copyTimestamp(start);
  92075. var currentIdentifier = 0;
  92076. var stopped = currentIdentifier === stop;
  92077. if (stop < getDayIdentifier(start)) {
  92078. throw new Error('End date is earlier than start date.');
  92079. }
  92080. while ((!stopped || days.length < min) && days.length < max) {
  92081. currentIdentifier = getDayIdentifier(current);
  92082. stopped = stopped || currentIdentifier === stop;
  92083. if (weekdaySkips[current.weekday] === 0) {
  92084. current = nextDay(current);
  92085. continue;
  92086. }
  92087. var day = copyTimestamp(current);
  92088. updateFormatted(day);
  92089. updateRelative(day, now);
  92090. days.push(day);
  92091. current = relativeDays(current, nextDay, weekdaySkips[current.weekday]);
  92092. }
  92093. if (!days.length) throw new Error('No dates found using specified start date, end date, and weekdays.');
  92094. return days;
  92095. }
  92096. function createIntervalList(timestamp, first, minutes, count, now) {
  92097. var intervals = [];
  92098. for (var i = 0; i < count; i++) {
  92099. var mins = (first + i) * minutes;
  92100. var int = copyTimestamp(timestamp);
  92101. intervals.push(updateMinutes(int, mins, now));
  92102. }
  92103. return intervals;
  92104. }
  92105. function createNativeLocaleFormatter(locale, getOptions) {
  92106. var emptyFormatter = function emptyFormatter(_t, _s) {
  92107. return '';
  92108. };
  92109. if (typeof Intl === 'undefined' || typeof Intl.DateTimeFormat === 'undefined') {
  92110. return emptyFormatter;
  92111. }
  92112. return function (timestamp, short) {
  92113. try {
  92114. var intlFormatter = new Intl.DateTimeFormat(locale || undefined, getOptions(timestamp, short));
  92115. var time = padNumber(timestamp.hour, 2) + ":" + padNumber(timestamp.minute, 2);
  92116. var date = timestamp.date;
  92117. return intlFormatter.format(new Date(date + "T" + time + ":00+00:00"));
  92118. } catch (e) {
  92119. return '';
  92120. }
  92121. };
  92122. }
  92123. /***/ }),
  92124. /***/ "./src/components/VCard/VCard.sass":
  92125. /*!*****************************************!*\
  92126. !*** ./src/components/VCard/VCard.sass ***!
  92127. \*****************************************/
  92128. /*! no static exports found */
  92129. /***/ (function(module, exports, __webpack_require__) {
  92130. // extracted by mini-css-extract-plugin
  92131. /***/ }),
  92132. /***/ "./src/components/VCard/VCard.ts":
  92133. /*!***************************************!*\
  92134. !*** ./src/components/VCard/VCard.ts ***!
  92135. \***************************************/
  92136. /*! exports provided: default */
  92137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92138. "use strict";
  92139. __webpack_require__.r(__webpack_exports__);
  92140. /* harmony import */ var _VCard_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCard.sass */ "./src/components/VCard/VCard.sass");
  92141. /* harmony import */ var _VCard_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VCard_sass__WEBPACK_IMPORTED_MODULE_0__);
  92142. /* harmony import */ var _VSheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSheet */ "./src/components/VSheet/index.ts");
  92143. /* harmony import */ var _mixins_loadable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/loadable */ "./src/mixins/loadable/index.ts");
  92144. /* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable/index.ts");
  92145. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  92146. var __assign = undefined && undefined.__assign || function () {
  92147. __assign = Object.assign || function (t) {
  92148. for (var s, i = 1, n = arguments.length; i < n; i++) {
  92149. s = arguments[i];
  92150. for (var p in s) {
  92151. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  92152. }
  92153. }
  92154. return t;
  92155. };
  92156. return __assign.apply(this, arguments);
  92157. }; // Styles
  92158. // Extensions
  92159. // Mixins
  92160. // Helpers
  92161. /* @vue/component */
  92162. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_loadable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_routable__WEBPACK_IMPORTED_MODULE_3__["default"], _VSheet__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
  92163. name: 'v-card',
  92164. props: {
  92165. flat: Boolean,
  92166. hover: Boolean,
  92167. img: String,
  92168. link: Boolean,
  92169. loaderHeight: {
  92170. type: [Number, String],
  92171. default: 4
  92172. },
  92173. outlined: Boolean,
  92174. raised: Boolean,
  92175. shaped: Boolean
  92176. },
  92177. computed: {
  92178. classes: function classes() {
  92179. return __assign({
  92180. 'v-card': true
  92181. }, _mixins_routable__WEBPACK_IMPORTED_MODULE_3__["default"].options.computed.classes.call(this), {
  92182. 'v-card--flat': this.flat,
  92183. 'v-card--hover': this.hover,
  92184. 'v-card--link': this.isClickable,
  92185. 'v-card--loading': this.loading,
  92186. 'v-card--disabled': this.disabled,
  92187. 'v-card--outlined': this.outlined,
  92188. 'v-card--raised': this.raised,
  92189. 'v-card--shaped': this.shaped
  92190. }, _VSheet__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this));
  92191. },
  92192. styles: function styles() {
  92193. var style = __assign({}, _VSheet__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.styles.call(this));
  92194. if (this.img) {
  92195. style.background = "url(\"" + this.img + "\") center center / cover no-repeat";
  92196. }
  92197. return style;
  92198. }
  92199. },
  92200. methods: {
  92201. genProgress: function genProgress() {
  92202. var render = _mixins_loadable__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genProgress.call(this);
  92203. if (!render) return null;
  92204. return this.$createElement('div', {
  92205. staticClass: 'v-card__progress',
  92206. key: 'progress'
  92207. }, [render]);
  92208. }
  92209. },
  92210. render: function render(h) {
  92211. var _a = this.generateRouteLink(),
  92212. tag = _a.tag,
  92213. data = _a.data;
  92214. data.style = this.styles;
  92215. if (this.isClickable) {
  92216. data.attrs = data.attrs || {};
  92217. data.attrs.tabindex = 0;
  92218. }
  92219. return h(tag, this.setBackgroundColor(this.color, data), [this.genProgress(), this.$slots.default]);
  92220. }
  92221. }));
  92222. /***/ }),
  92223. /***/ "./src/components/VCard/index.ts":
  92224. /*!***************************************!*\
  92225. !*** ./src/components/VCard/index.ts ***!
  92226. \***************************************/
  92227. /*! exports provided: VCard, VCardActions, VCardSubtitle, VCardText, VCardTitle, default */
  92228. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92229. "use strict";
  92230. __webpack_require__.r(__webpack_exports__);
  92231. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCardActions", function() { return VCardActions; });
  92232. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCardSubtitle", function() { return VCardSubtitle; });
  92233. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCardText", function() { return VCardText; });
  92234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCardTitle", function() { return VCardTitle; });
  92235. /* harmony import */ var _VCard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCard */ "./src/components/VCard/VCard.ts");
  92236. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCard", function() { return _VCard__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  92237. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  92238. var VCardActions = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["createSimpleFunctional"])('v-card__actions');
  92239. var VCardSubtitle = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["createSimpleFunctional"])('v-card__subtitle');
  92240. var VCardText = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["createSimpleFunctional"])('v-card__text');
  92241. var VCardTitle = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["createSimpleFunctional"])('v-card__title');
  92242. /* harmony default export */ __webpack_exports__["default"] = ({
  92243. $_vuetify_subcomponents: {
  92244. VCard: _VCard__WEBPACK_IMPORTED_MODULE_0__["default"],
  92245. VCardActions: VCardActions,
  92246. VCardSubtitle: VCardSubtitle,
  92247. VCardText: VCardText,
  92248. VCardTitle: VCardTitle
  92249. }
  92250. });
  92251. /***/ }),
  92252. /***/ "./src/components/VCarousel/VCarousel.sass":
  92253. /*!*************************************************!*\
  92254. !*** ./src/components/VCarousel/VCarousel.sass ***!
  92255. \*************************************************/
  92256. /*! no static exports found */
  92257. /***/ (function(module, exports, __webpack_require__) {
  92258. // extracted by mini-css-extract-plugin
  92259. /***/ }),
  92260. /***/ "./src/components/VCarousel/VCarousel.ts":
  92261. /*!***********************************************!*\
  92262. !*** ./src/components/VCarousel/VCarousel.ts ***!
  92263. \***********************************************/
  92264. /*! exports provided: default */
  92265. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92266. "use strict";
  92267. __webpack_require__.r(__webpack_exports__);
  92268. /* harmony import */ var _VCarousel_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCarousel.sass */ "./src/components/VCarousel/VCarousel.sass");
  92269. /* harmony import */ var _VCarousel_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VCarousel_sass__WEBPACK_IMPORTED_MODULE_0__);
  92270. /* harmony import */ var _VWindow_VWindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VWindow/VWindow */ "./src/components/VWindow/VWindow.ts");
  92271. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  92272. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  92273. /* harmony import */ var _VProgressLinear__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../VProgressLinear */ "./src/components/VProgressLinear/index.ts");
  92274. /* harmony import */ var _mixins_button_group__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/button-group */ "./src/mixins/button-group/index.ts");
  92275. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  92276. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  92277. var __assign = undefined && undefined.__assign || function () {
  92278. __assign = Object.assign || function (t) {
  92279. for (var s, i = 1, n = arguments.length; i < n; i++) {
  92280. s = arguments[i];
  92281. for (var p in s) {
  92282. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  92283. }
  92284. }
  92285. return t;
  92286. };
  92287. return __assign.apply(this, arguments);
  92288. }; // Styles
  92289. // Extensions
  92290. // Components
  92291. // Mixins
  92292. // TODO: Move this into core components v2.0
  92293. // Utilities
  92294. /* harmony default export */ __webpack_exports__["default"] = (_VWindow_VWindow__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  92295. name: 'v-carousel',
  92296. props: {
  92297. continuous: {
  92298. type: Boolean,
  92299. default: true
  92300. },
  92301. cycle: Boolean,
  92302. delimiterIcon: {
  92303. type: String,
  92304. default: '$delimiter'
  92305. },
  92306. height: {
  92307. type: [Number, String],
  92308. default: 500
  92309. },
  92310. hideDelimiters: Boolean,
  92311. hideDelimiterBackground: Boolean,
  92312. interval: {
  92313. type: [Number, String],
  92314. default: 6000,
  92315. validator: function validator(value) {
  92316. return value > 0;
  92317. }
  92318. },
  92319. mandatory: {
  92320. type: Boolean,
  92321. default: true
  92322. },
  92323. progress: Boolean,
  92324. progressColor: String,
  92325. showArrows: {
  92326. type: Boolean,
  92327. default: true
  92328. },
  92329. verticalDelimiters: {
  92330. type: String,
  92331. default: undefined
  92332. }
  92333. },
  92334. data: function data() {
  92335. return {
  92336. internalHeight: this.height,
  92337. slideTimeout: undefined
  92338. };
  92339. },
  92340. computed: {
  92341. classes: function classes() {
  92342. return __assign({}, _VWindow_VWindow__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  92343. 'v-carousel': true,
  92344. 'v-carousel--hide-delimiter-background': this.hideDelimiterBackground,
  92345. 'v-carousel--vertical-delimiters': this.isVertical
  92346. });
  92347. },
  92348. isDark: function isDark() {
  92349. return this.dark || !this.light;
  92350. },
  92351. isVertical: function isVertical() {
  92352. return this.verticalDelimiters != null;
  92353. }
  92354. },
  92355. watch: {
  92356. internalValue: 'restartTimeout',
  92357. interval: 'restartTimeout',
  92358. height: function height(val, oldVal) {
  92359. if (val === oldVal || !val) return;
  92360. this.internalHeight = val;
  92361. },
  92362. cycle: function cycle(val) {
  92363. if (val) {
  92364. this.restartTimeout();
  92365. } else {
  92366. clearTimeout(this.slideTimeout);
  92367. this.slideTimeout = undefined;
  92368. }
  92369. }
  92370. },
  92371. created: function created() {
  92372. /* istanbul ignore next */
  92373. if (this.$attrs.hasOwnProperty('hide-controls')) {
  92374. Object(_util_console__WEBPACK_IMPORTED_MODULE_7__["breaking"])('hide-controls', ':show-arrows="false"', this);
  92375. }
  92376. },
  92377. mounted: function mounted() {
  92378. this.startTimeout();
  92379. },
  92380. methods: {
  92381. genControlIcons: function genControlIcons() {
  92382. if (this.isVertical) return null;
  92383. return _VWindow_VWindow__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genControlIcons.call(this);
  92384. },
  92385. genDelimiters: function genDelimiters() {
  92386. return this.$createElement('div', {
  92387. staticClass: 'v-carousel__controls',
  92388. style: {
  92389. left: this.verticalDelimiters === 'left' && this.isVertical ? 0 : 'auto',
  92390. right: this.verticalDelimiters === 'right' ? 0 : 'auto'
  92391. }
  92392. }, [this.genItems()]);
  92393. },
  92394. genItems: function genItems() {
  92395. var _this = this;
  92396. var length = this.items.length;
  92397. var children = [];
  92398. for (var i = 0; i < length; i++) {
  92399. var child = this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_2__["default"], {
  92400. staticClass: 'v-carousel__controls__item',
  92401. attrs: {
  92402. 'aria-label': this.$vuetify.lang.t('$vuetify.carousel.ariaLabel.delimiter', i + 1, length)
  92403. },
  92404. props: {
  92405. icon: true,
  92406. small: true,
  92407. value: this.getValue(this.items[i], i)
  92408. }
  92409. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_3__["default"], {
  92410. props: {
  92411. size: 18
  92412. }
  92413. }, this.delimiterIcon)]);
  92414. children.push(child);
  92415. }
  92416. return this.$createElement(_mixins_button_group__WEBPACK_IMPORTED_MODULE_5__["default"], {
  92417. props: {
  92418. value: this.internalValue,
  92419. mandatory: this.mandatory
  92420. },
  92421. on: {
  92422. change: function change(val) {
  92423. _this.internalValue = val;
  92424. }
  92425. }
  92426. }, children);
  92427. },
  92428. genProgress: function genProgress() {
  92429. return this.$createElement(_VProgressLinear__WEBPACK_IMPORTED_MODULE_4__["default"], {
  92430. staticClass: 'v-carousel__progress',
  92431. props: {
  92432. color: this.progressColor,
  92433. value: (this.internalIndex + 1) / this.items.length * 100
  92434. }
  92435. });
  92436. },
  92437. restartTimeout: function restartTimeout() {
  92438. this.slideTimeout && clearTimeout(this.slideTimeout);
  92439. this.slideTimeout = undefined;
  92440. window.requestAnimationFrame(this.startTimeout);
  92441. },
  92442. startTimeout: function startTimeout() {
  92443. if (!this.cycle) return;
  92444. this.slideTimeout = window.setTimeout(this.next, +this.interval > 0 ? +this.interval : 6000);
  92445. }
  92446. },
  92447. render: function render(h) {
  92448. var render = _VWindow_VWindow__WEBPACK_IMPORTED_MODULE_1__["default"].options.render.call(this, h);
  92449. render.data.style = "height: " + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["convertToUnit"])(this.height) + ";";
  92450. /* istanbul ignore else */
  92451. if (!this.hideDelimiters) {
  92452. render.children.push(this.genDelimiters());
  92453. }
  92454. /* istanbul ignore else */
  92455. if (this.progress || this.progressColor) {
  92456. render.children.push(this.genProgress());
  92457. }
  92458. return render;
  92459. }
  92460. }));
  92461. /***/ }),
  92462. /***/ "./src/components/VCarousel/VCarouselItem.ts":
  92463. /*!***************************************************!*\
  92464. !*** ./src/components/VCarousel/VCarouselItem.ts ***!
  92465. \***************************************************/
  92466. /*! exports provided: default */
  92467. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92468. "use strict";
  92469. __webpack_require__.r(__webpack_exports__);
  92470. /* harmony import */ var _VWindow_VWindowItem__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VWindow/VWindowItem */ "./src/components/VWindow/VWindowItem.ts");
  92471. /* harmony import */ var _VImg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VImg */ "./src/components/VImg/index.ts");
  92472. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  92473. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  92474. /* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable/index.ts");
  92475. var __assign = undefined && undefined.__assign || function () {
  92476. __assign = Object.assign || function (t) {
  92477. for (var s, i = 1, n = arguments.length; i < n; i++) {
  92478. s = arguments[i];
  92479. for (var p in s) {
  92480. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  92481. }
  92482. }
  92483. return t;
  92484. };
  92485. return __assign.apply(this, arguments);
  92486. }; // Extensions
  92487. // Components
  92488. // Utilities
  92489. // Types
  92490. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_VWindow_VWindowItem__WEBPACK_IMPORTED_MODULE_0__["default"], _mixins_routable__WEBPACK_IMPORTED_MODULE_4__["default"]);
  92491. /* @vue/component */
  92492. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  92493. name: 'v-carousel-item',
  92494. inheritAttrs: false,
  92495. methods: {
  92496. genDefaultSlot: function genDefaultSlot() {
  92497. return [this.$createElement(_VImg__WEBPACK_IMPORTED_MODULE_1__["VImg"], {
  92498. staticClass: 'v-carousel__item',
  92499. props: __assign({}, this.$attrs, {
  92500. height: this.windowGroup.internalHeight
  92501. }),
  92502. on: this.$listeners,
  92503. scopedSlots: {
  92504. placeholder: this.$scopedSlots.placeholder
  92505. }
  92506. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this))];
  92507. },
  92508. genWindowItem: function genWindowItem() {
  92509. var _a = this.generateRouteLink(),
  92510. tag = _a.tag,
  92511. data = _a.data;
  92512. data.staticClass = 'v-window-item';
  92513. data.directives.push({
  92514. name: 'show',
  92515. value: this.isActive
  92516. });
  92517. return this.$createElement(tag, data, this.genDefaultSlot());
  92518. }
  92519. }
  92520. }));
  92521. /***/ }),
  92522. /***/ "./src/components/VCarousel/index.ts":
  92523. /*!*******************************************!*\
  92524. !*** ./src/components/VCarousel/index.ts ***!
  92525. \*******************************************/
  92526. /*! exports provided: VCarousel, VCarouselItem, default */
  92527. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92528. "use strict";
  92529. __webpack_require__.r(__webpack_exports__);
  92530. /* harmony import */ var _VCarousel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCarousel */ "./src/components/VCarousel/VCarousel.ts");
  92531. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCarousel", function() { return _VCarousel__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  92532. /* harmony import */ var _VCarouselItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VCarouselItem */ "./src/components/VCarousel/VCarouselItem.ts");
  92533. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCarouselItem", function() { return _VCarouselItem__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  92534. /* harmony default export */ __webpack_exports__["default"] = ({
  92535. $_vuetify_subcomponents: {
  92536. VCarousel: _VCarousel__WEBPACK_IMPORTED_MODULE_0__["default"],
  92537. VCarouselItem: _VCarouselItem__WEBPACK_IMPORTED_MODULE_1__["default"]
  92538. }
  92539. });
  92540. /***/ }),
  92541. /***/ "./src/components/VCheckbox/VCheckbox.sass":
  92542. /*!*************************************************!*\
  92543. !*** ./src/components/VCheckbox/VCheckbox.sass ***!
  92544. \*************************************************/
  92545. /*! no static exports found */
  92546. /***/ (function(module, exports, __webpack_require__) {
  92547. // extracted by mini-css-extract-plugin
  92548. /***/ }),
  92549. /***/ "./src/components/VCheckbox/VCheckbox.ts":
  92550. /*!***********************************************!*\
  92551. !*** ./src/components/VCheckbox/VCheckbox.ts ***!
  92552. \***********************************************/
  92553. /*! exports provided: default */
  92554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92555. "use strict";
  92556. __webpack_require__.r(__webpack_exports__);
  92557. /* harmony import */ var _VCheckbox_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCheckbox.sass */ "./src/components/VCheckbox/VCheckbox.sass");
  92558. /* harmony import */ var _VCheckbox_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VCheckbox_sass__WEBPACK_IMPORTED_MODULE_0__);
  92559. /* harmony import */ var _styles_components_selection_controls_sass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../styles/components/_selection-controls.sass */ "./src/styles/components/_selection-controls.sass");
  92560. /* harmony import */ var _styles_components_selection_controls_sass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_styles_components_selection_controls_sass__WEBPACK_IMPORTED_MODULE_1__);
  92561. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  92562. /* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.ts");
  92563. /* harmony import */ var _mixins_selectable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/selectable */ "./src/mixins/selectable/index.ts");
  92564. var __assign = undefined && undefined.__assign || function () {
  92565. __assign = Object.assign || function (t) {
  92566. for (var s, i = 1, n = arguments.length; i < n; i++) {
  92567. s = arguments[i];
  92568. for (var p in s) {
  92569. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  92570. }
  92571. }
  92572. return t;
  92573. };
  92574. return __assign.apply(this, arguments);
  92575. }; // Styles
  92576. // Components
  92577. // Mixins
  92578. /* @vue/component */
  92579. /* harmony default export */ __webpack_exports__["default"] = (_mixins_selectable__WEBPACK_IMPORTED_MODULE_4__["default"].extend({
  92580. name: 'v-checkbox',
  92581. props: {
  92582. indeterminate: Boolean,
  92583. indeterminateIcon: {
  92584. type: String,
  92585. default: '$checkboxIndeterminate'
  92586. },
  92587. offIcon: {
  92588. type: String,
  92589. default: '$checkboxOff'
  92590. },
  92591. onIcon: {
  92592. type: String,
  92593. default: '$checkboxOn'
  92594. }
  92595. },
  92596. data: function data() {
  92597. return {
  92598. inputIndeterminate: this.indeterminate
  92599. };
  92600. },
  92601. computed: {
  92602. classes: function classes() {
  92603. return __assign({}, _VInput__WEBPACK_IMPORTED_MODULE_3__["default"].options.computed.classes.call(this), {
  92604. 'v-input--selection-controls': true,
  92605. 'v-input--checkbox': true,
  92606. 'v-input--indeterminate': this.inputIndeterminate
  92607. });
  92608. },
  92609. computedIcon: function computedIcon() {
  92610. if (this.inputIndeterminate) {
  92611. return this.indeterminateIcon;
  92612. } else if (this.isActive) {
  92613. return this.onIcon;
  92614. } else {
  92615. return this.offIcon;
  92616. }
  92617. },
  92618. // Do not return undefined if disabled,
  92619. // according to spec, should still show
  92620. // a color when disabled and active
  92621. validationState: function validationState() {
  92622. if (this.disabled && !this.inputIndeterminate) return undefined;
  92623. if (this.hasError && this.shouldValidate) return 'error';
  92624. if (this.hasSuccess) return 'success';
  92625. if (this.hasColor !== null) return this.computedColor;
  92626. return undefined;
  92627. }
  92628. },
  92629. watch: {
  92630. indeterminate: function indeterminate(val) {
  92631. var _this = this; // https://github.com/vuetifyjs/vuetify/issues/8270
  92632. this.$nextTick(function () {
  92633. return _this.inputIndeterminate = val;
  92634. });
  92635. },
  92636. inputIndeterminate: function inputIndeterminate(val) {
  92637. this.$emit('update:indeterminate', val);
  92638. },
  92639. isActive: function isActive() {
  92640. if (!this.indeterminate) return;
  92641. this.inputIndeterminate = false;
  92642. }
  92643. },
  92644. methods: {
  92645. genCheckbox: function genCheckbox() {
  92646. return this.$createElement('div', {
  92647. staticClass: 'v-input--selection-controls__input'
  92648. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], this.setTextColor(this.validationState, {
  92649. props: {
  92650. dense: this.dense,
  92651. dark: this.dark,
  92652. light: this.light
  92653. }
  92654. }), this.computedIcon), this.genInput('checkbox', __assign({}, this.attrs$, {
  92655. 'aria-checked': this.inputIndeterminate ? 'mixed' : this.isActive.toString()
  92656. })), this.genRipple(this.setTextColor(this.rippleState))]);
  92657. },
  92658. genDefaultSlot: function genDefaultSlot() {
  92659. return [this.genCheckbox(), this.genLabel()];
  92660. }
  92661. }
  92662. }));
  92663. /***/ }),
  92664. /***/ "./src/components/VCheckbox/VSimpleCheckbox.sass":
  92665. /*!*******************************************************!*\
  92666. !*** ./src/components/VCheckbox/VSimpleCheckbox.sass ***!
  92667. \*******************************************************/
  92668. /*! no static exports found */
  92669. /***/ (function(module, exports, __webpack_require__) {
  92670. // extracted by mini-css-extract-plugin
  92671. /***/ }),
  92672. /***/ "./src/components/VCheckbox/VSimpleCheckbox.ts":
  92673. /*!*****************************************************!*\
  92674. !*** ./src/components/VCheckbox/VSimpleCheckbox.ts ***!
  92675. \*****************************************************/
  92676. /*! exports provided: default */
  92677. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92678. "use strict";
  92679. __webpack_require__.r(__webpack_exports__);
  92680. /* harmony import */ var _VSimpleCheckbox_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSimpleCheckbox.sass */ "./src/components/VCheckbox/VSimpleCheckbox.sass");
  92681. /* harmony import */ var _VSimpleCheckbox_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSimpleCheckbox_sass__WEBPACK_IMPORTED_MODULE_0__);
  92682. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  92683. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "vue");
  92684. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);
  92685. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  92686. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  92687. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  92688. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  92689. var __assign = undefined && undefined.__assign || function () {
  92690. __assign = Object.assign || function (t) {
  92691. for (var s, i = 1, n = arguments.length; i < n; i++) {
  92692. s = arguments[i];
  92693. for (var p in s) {
  92694. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  92695. }
  92696. }
  92697. return t;
  92698. };
  92699. return __assign.apply(this, arguments);
  92700. };
  92701. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_2___default.a.extend({
  92702. name: 'v-simple-checkbox',
  92703. functional: true,
  92704. directives: {
  92705. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_1__["default"]
  92706. },
  92707. props: __assign({}, _mixins_colorable__WEBPACK_IMPORTED_MODULE_4__["default"].options.props, _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__["default"].options.props, {
  92708. disabled: Boolean,
  92709. ripple: {
  92710. type: Boolean,
  92711. default: true
  92712. },
  92713. value: Boolean,
  92714. indeterminate: Boolean,
  92715. indeterminateIcon: {
  92716. type: String,
  92717. default: '$checkboxIndeterminate'
  92718. },
  92719. onIcon: {
  92720. type: String,
  92721. default: '$checkboxOn'
  92722. },
  92723. offIcon: {
  92724. type: String,
  92725. default: '$checkboxOff'
  92726. }
  92727. }),
  92728. render: function render(h, _a) {
  92729. var props = _a.props,
  92730. data = _a.data;
  92731. var children = [];
  92732. if (props.ripple && !props.disabled) {
  92733. var ripple_1 = h('div', _mixins_colorable__WEBPACK_IMPORTED_MODULE_4__["default"].options.methods.setTextColor(props.color, {
  92734. staticClass: 'v-input--selection-controls__ripple',
  92735. directives: [{
  92736. name: 'ripple',
  92737. value: {
  92738. center: true
  92739. }
  92740. }]
  92741. }));
  92742. children.push(ripple_1);
  92743. }
  92744. var icon = props.offIcon;
  92745. if (props.indeterminate) icon = props.indeterminateIcon;else if (props.value) icon = props.onIcon;
  92746. children.push(h(_VIcon__WEBPACK_IMPORTED_MODULE_3__["VIcon"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_4__["default"].options.methods.setTextColor(props.value && props.color, {
  92747. props: {
  92748. disabled: props.disabled,
  92749. dark: props.dark,
  92750. light: props.light
  92751. }
  92752. }), icon));
  92753. var classes = {
  92754. 'v-simple-checkbox': true,
  92755. 'v-simple-checkbox--disabled': props.disabled
  92756. };
  92757. return h('div', __assign({}, data, {
  92758. class: classes,
  92759. on: {
  92760. click: function click(e) {
  92761. e.stopPropagation();
  92762. if (data.on && data.on.input && !props.disabled) {
  92763. Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["wrapInArray"])(data.on.input).forEach(function (f) {
  92764. return f(!props.value);
  92765. });
  92766. }
  92767. }
  92768. }
  92769. }), children);
  92770. }
  92771. }));
  92772. /***/ }),
  92773. /***/ "./src/components/VCheckbox/index.ts":
  92774. /*!*******************************************!*\
  92775. !*** ./src/components/VCheckbox/index.ts ***!
  92776. \*******************************************/
  92777. /*! exports provided: VCheckbox, VSimpleCheckbox, default */
  92778. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92779. "use strict";
  92780. __webpack_require__.r(__webpack_exports__);
  92781. /* harmony import */ var _VCheckbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCheckbox */ "./src/components/VCheckbox/VCheckbox.ts");
  92782. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCheckbox", function() { return _VCheckbox__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  92783. /* harmony import */ var _VSimpleCheckbox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VSimpleCheckbox */ "./src/components/VCheckbox/VSimpleCheckbox.ts");
  92784. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSimpleCheckbox", function() { return _VSimpleCheckbox__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  92785. /* harmony default export */ __webpack_exports__["default"] = ({
  92786. $_vuetify_subcomponents: {
  92787. VCheckbox: _VCheckbox__WEBPACK_IMPORTED_MODULE_0__["default"],
  92788. VSimpleCheckbox: _VSimpleCheckbox__WEBPACK_IMPORTED_MODULE_1__["default"]
  92789. }
  92790. });
  92791. /***/ }),
  92792. /***/ "./src/components/VChip/VChip.sass":
  92793. /*!*****************************************!*\
  92794. !*** ./src/components/VChip/VChip.sass ***!
  92795. \*****************************************/
  92796. /*! no static exports found */
  92797. /***/ (function(module, exports, __webpack_require__) {
  92798. // extracted by mini-css-extract-plugin
  92799. /***/ }),
  92800. /***/ "./src/components/VChip/VChip.ts":
  92801. /*!***************************************!*\
  92802. !*** ./src/components/VChip/VChip.ts ***!
  92803. \***************************************/
  92804. /*! exports provided: default */
  92805. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92806. "use strict";
  92807. __webpack_require__.r(__webpack_exports__);
  92808. /* harmony import */ var _VChip_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VChip.sass */ "./src/components/VChip/VChip.sass");
  92809. /* harmony import */ var _VChip_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VChip_sass__WEBPACK_IMPORTED_MODULE_0__);
  92810. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  92811. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  92812. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  92813. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  92814. /* harmony import */ var _mixins_groupable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/groupable */ "./src/mixins/groupable/index.ts");
  92815. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  92816. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  92817. /* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable/index.ts");
  92818. /* harmony import */ var _mixins_sizeable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../mixins/sizeable */ "./src/mixins/sizeable/index.ts");
  92819. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  92820. var __assign = undefined && undefined.__assign || function () {
  92821. __assign = Object.assign || function (t) {
  92822. for (var s, i = 1, n = arguments.length; i < n; i++) {
  92823. s = arguments[i];
  92824. for (var p in s) {
  92825. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  92826. }
  92827. }
  92828. return t;
  92829. };
  92830. return __assign.apply(this, arguments);
  92831. };
  92832. var __read = undefined && undefined.__read || function (o, n) {
  92833. var m = typeof Symbol === "function" && o[Symbol.iterator];
  92834. if (!m) return o;
  92835. var i = m.call(o),
  92836. r,
  92837. ar = [],
  92838. e;
  92839. try {
  92840. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  92841. ar.push(r.value);
  92842. }
  92843. } catch (error) {
  92844. e = {
  92845. error: error
  92846. };
  92847. } finally {
  92848. try {
  92849. if (r && !r.done && (m = i["return"])) m.call(i);
  92850. } finally {
  92851. if (e) throw e.error;
  92852. }
  92853. }
  92854. return ar;
  92855. }; // Styles
  92856. // Components
  92857. // Mixins
  92858. // Utilities
  92859. /* @vue/component */
  92860. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_sizeable__WEBPACK_IMPORTED_MODULE_9__["default"], _mixins_routable__WEBPACK_IMPORTED_MODULE_8__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_mixins_groupable__WEBPACK_IMPORTED_MODULE_5__["factory"])('chipGroup'), Object(_mixins_toggleable__WEBPACK_IMPORTED_MODULE_7__["factory"])('inputValue')).extend({
  92861. name: 'v-chip',
  92862. props: {
  92863. active: {
  92864. type: Boolean,
  92865. default: true
  92866. },
  92867. activeClass: {
  92868. type: String,
  92869. default: function _default() {
  92870. if (!this.chipGroup) return '';
  92871. return this.chipGroup.activeClass;
  92872. }
  92873. },
  92874. close: Boolean,
  92875. closeIcon: {
  92876. type: String,
  92877. default: '$delete'
  92878. },
  92879. disabled: Boolean,
  92880. draggable: Boolean,
  92881. filter: Boolean,
  92882. filterIcon: {
  92883. type: String,
  92884. default: '$complete'
  92885. },
  92886. label: Boolean,
  92887. link: Boolean,
  92888. outlined: Boolean,
  92889. pill: Boolean,
  92890. tag: {
  92891. type: String,
  92892. default: 'span'
  92893. },
  92894. textColor: String,
  92895. value: null
  92896. },
  92897. data: function data() {
  92898. return {
  92899. proxyClass: 'v-chip--active'
  92900. };
  92901. },
  92902. computed: {
  92903. classes: function classes() {
  92904. return __assign({
  92905. 'v-chip': true
  92906. }, _mixins_routable__WEBPACK_IMPORTED_MODULE_8__["default"].options.computed.classes.call(this), {
  92907. 'v-chip--clickable': this.isClickable,
  92908. 'v-chip--disabled': this.disabled,
  92909. 'v-chip--draggable': this.draggable,
  92910. 'v-chip--label': this.label,
  92911. 'v-chip--link': this.isLink,
  92912. 'v-chip--no-color': !this.color,
  92913. 'v-chip--outlined': this.outlined,
  92914. 'v-chip--pill': this.pill,
  92915. 'v-chip--removable': this.hasClose
  92916. }, this.themeClasses, this.sizeableClasses, this.groupClasses);
  92917. },
  92918. hasClose: function hasClose() {
  92919. return Boolean(this.close);
  92920. },
  92921. isClickable: function isClickable() {
  92922. return Boolean(_mixins_routable__WEBPACK_IMPORTED_MODULE_8__["default"].options.computed.isClickable.call(this) || this.chipGroup);
  92923. }
  92924. },
  92925. created: function created() {
  92926. var _this = this;
  92927. var breakingProps = [['outline', 'outlined'], ['selected', 'input-value'], ['value', 'active'], ['@input', '@active.sync']];
  92928. /* istanbul ignore next */
  92929. breakingProps.forEach(function (_a) {
  92930. var _b = __read(_a, 2),
  92931. original = _b[0],
  92932. replacement = _b[1];
  92933. if (_this.$attrs.hasOwnProperty(original)) Object(_util_console__WEBPACK_IMPORTED_MODULE_10__["breaking"])(original, replacement, _this);
  92934. });
  92935. },
  92936. methods: {
  92937. click: function click(e) {
  92938. this.$emit('click', e);
  92939. this.chipGroup && this.toggle();
  92940. },
  92941. genFilter: function genFilter() {
  92942. var children = [];
  92943. if (this.isActive) {
  92944. children.push(this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_3__["default"], {
  92945. staticClass: 'v-chip__filter',
  92946. props: {
  92947. left: true
  92948. }
  92949. }, this.filterIcon));
  92950. }
  92951. return this.$createElement(_transitions__WEBPACK_IMPORTED_MODULE_2__["VExpandXTransition"], children);
  92952. },
  92953. genClose: function genClose() {
  92954. var _this = this;
  92955. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_3__["default"], {
  92956. staticClass: 'v-chip__close',
  92957. props: {
  92958. right: true,
  92959. size: 18
  92960. },
  92961. on: {
  92962. click: function click(e) {
  92963. e.stopPropagation();
  92964. e.preventDefault();
  92965. _this.$emit('click:close');
  92966. _this.$emit('update:active', false);
  92967. }
  92968. }
  92969. }, this.closeIcon);
  92970. },
  92971. genContent: function genContent() {
  92972. return this.$createElement('span', {
  92973. staticClass: 'v-chip__content'
  92974. }, [this.filter && this.genFilter(), this.$slots.default, this.hasClose && this.genClose()]);
  92975. }
  92976. },
  92977. render: function render(h) {
  92978. var children = [this.genContent()];
  92979. var _a = this.generateRouteLink(),
  92980. tag = _a.tag,
  92981. data = _a.data;
  92982. data.attrs = __assign({}, data.attrs, {
  92983. draggable: this.draggable ? 'true' : undefined,
  92984. tabindex: this.chipGroup && !this.disabled ? 0 : data.attrs.tabindex
  92985. });
  92986. data.directives.push({
  92987. name: 'show',
  92988. value: this.active
  92989. });
  92990. data = this.setBackgroundColor(this.color, data);
  92991. var color = this.textColor || this.outlined && this.color;
  92992. return h(tag, this.setTextColor(color, data), children);
  92993. }
  92994. }));
  92995. /***/ }),
  92996. /***/ "./src/components/VChip/index.ts":
  92997. /*!***************************************!*\
  92998. !*** ./src/components/VChip/index.ts ***!
  92999. \***************************************/
  93000. /*! exports provided: VChip, default */
  93001. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93002. "use strict";
  93003. __webpack_require__.r(__webpack_exports__);
  93004. /* harmony import */ var _VChip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VChip */ "./src/components/VChip/VChip.ts");
  93005. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VChip", function() { return _VChip__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  93006. /* harmony default export */ __webpack_exports__["default"] = (_VChip__WEBPACK_IMPORTED_MODULE_0__["default"]);
  93007. /***/ }),
  93008. /***/ "./src/components/VChipGroup/VChipGroup.sass":
  93009. /*!***************************************************!*\
  93010. !*** ./src/components/VChipGroup/VChipGroup.sass ***!
  93011. \***************************************************/
  93012. /*! no static exports found */
  93013. /***/ (function(module, exports, __webpack_require__) {
  93014. // extracted by mini-css-extract-plugin
  93015. /***/ }),
  93016. /***/ "./src/components/VChipGroup/VChipGroup.ts":
  93017. /*!*************************************************!*\
  93018. !*** ./src/components/VChipGroup/VChipGroup.ts ***!
  93019. \*************************************************/
  93020. /*! exports provided: default */
  93021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93022. "use strict";
  93023. __webpack_require__.r(__webpack_exports__);
  93024. /* harmony import */ var _VChipGroup_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VChipGroup.sass */ "./src/components/VChipGroup/VChipGroup.sass");
  93025. /* harmony import */ var _VChipGroup_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VChipGroup_sass__WEBPACK_IMPORTED_MODULE_0__);
  93026. /* harmony import */ var _VSlideGroup_VSlideGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSlideGroup/VSlideGroup */ "./src/components/VSlideGroup/VSlideGroup.ts");
  93027. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  93028. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  93029. var __assign = undefined && undefined.__assign || function () {
  93030. __assign = Object.assign || function (t) {
  93031. for (var s, i = 1, n = arguments.length; i < n; i++) {
  93032. s = arguments[i];
  93033. for (var p in s) {
  93034. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  93035. }
  93036. }
  93037. return t;
  93038. };
  93039. return __assign.apply(this, arguments);
  93040. }; // Styles
  93041. // Extensions
  93042. // Mixins
  93043. // Utilities
  93044. /* @vue/component */
  93045. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_VSlideGroup_VSlideGroup__WEBPACK_IMPORTED_MODULE_1__["BaseSlideGroup"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"]).extend({
  93046. name: 'v-chip-group',
  93047. provide: function provide() {
  93048. return {
  93049. chipGroup: this
  93050. };
  93051. },
  93052. props: {
  93053. column: Boolean
  93054. },
  93055. computed: {
  93056. classes: function classes() {
  93057. return __assign({}, _VSlideGroup_VSlideGroup__WEBPACK_IMPORTED_MODULE_1__["BaseSlideGroup"].options.computed.classes.call(this), {
  93058. 'v-chip-group': true,
  93059. 'v-chip-group--column': this.column
  93060. });
  93061. }
  93062. },
  93063. watch: {
  93064. column: function column(val) {
  93065. if (val) this.scrollOffset = 0;
  93066. this.$nextTick(this.onResize);
  93067. }
  93068. },
  93069. methods: {
  93070. genData: function genData() {
  93071. return this.setTextColor(this.color, __assign({}, _VSlideGroup_VSlideGroup__WEBPACK_IMPORTED_MODULE_1__["BaseSlideGroup"].options.methods.genData.call(this)));
  93072. }
  93073. }
  93074. }));
  93075. /***/ }),
  93076. /***/ "./src/components/VChipGroup/index.ts":
  93077. /*!********************************************!*\
  93078. !*** ./src/components/VChipGroup/index.ts ***!
  93079. \********************************************/
  93080. /*! exports provided: VChipGroup, default */
  93081. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93082. "use strict";
  93083. __webpack_require__.r(__webpack_exports__);
  93084. /* harmony import */ var _VChipGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VChipGroup */ "./src/components/VChipGroup/VChipGroup.ts");
  93085. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VChipGroup", function() { return _VChipGroup__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  93086. /* harmony default export */ __webpack_exports__["default"] = (_VChipGroup__WEBPACK_IMPORTED_MODULE_0__["default"]);
  93087. /***/ }),
  93088. /***/ "./src/components/VColorPicker/VColorPicker.sass":
  93089. /*!*******************************************************!*\
  93090. !*** ./src/components/VColorPicker/VColorPicker.sass ***!
  93091. \*******************************************************/
  93092. /*! no static exports found */
  93093. /***/ (function(module, exports, __webpack_require__) {
  93094. // extracted by mini-css-extract-plugin
  93095. /***/ }),
  93096. /***/ "./src/components/VColorPicker/VColorPicker.ts":
  93097. /*!*****************************************************!*\
  93098. !*** ./src/components/VColorPicker/VColorPicker.ts ***!
  93099. \*****************************************************/
  93100. /*! exports provided: default */
  93101. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93102. "use strict";
  93103. __webpack_require__.r(__webpack_exports__);
  93104. /* harmony import */ var _VColorPicker_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VColorPicker.sass */ "./src/components/VColorPicker/VColorPicker.sass");
  93105. /* harmony import */ var _VColorPicker_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VColorPicker_sass__WEBPACK_IMPORTED_MODULE_0__);
  93106. /* harmony import */ var _VSheet_VSheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSheet/VSheet */ "./src/components/VSheet/VSheet.ts");
  93107. /* harmony import */ var _VColorPickerPreview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VColorPickerPreview */ "./src/components/VColorPicker/VColorPickerPreview.ts");
  93108. /* harmony import */ var _VColorPickerCanvas__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VColorPickerCanvas */ "./src/components/VColorPicker/VColorPickerCanvas.ts");
  93109. /* harmony import */ var _VColorPickerEdit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VColorPickerEdit */ "./src/components/VColorPicker/VColorPickerEdit.ts");
  93110. /* harmony import */ var _VColorPickerSwatches__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VColorPickerSwatches */ "./src/components/VColorPicker/VColorPickerSwatches.ts");
  93111. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ "./src/components/VColorPicker/util/index.ts");
  93112. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  93113. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  93114. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  93115. var __assign = undefined && undefined.__assign || function () {
  93116. __assign = Object.assign || function (t) {
  93117. for (var s, i = 1, n = arguments.length; i < n; i++) {
  93118. s = arguments[i];
  93119. for (var p in s) {
  93120. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  93121. }
  93122. }
  93123. return t;
  93124. };
  93125. return __assign.apply(this, arguments);
  93126. }; // Styles
  93127. // Components
  93128. // Helpers
  93129. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_7__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_9__["default"]).extend({
  93130. name: 'v-color-picker',
  93131. props: {
  93132. canvasHeight: {
  93133. type: [String, Number],
  93134. default: 150
  93135. },
  93136. disabled: Boolean,
  93137. dotSize: {
  93138. type: [Number, String],
  93139. default: 10
  93140. },
  93141. flat: Boolean,
  93142. hideCanvas: Boolean,
  93143. hideInputs: Boolean,
  93144. hideModeSwitch: Boolean,
  93145. mode: {
  93146. type: String,
  93147. default: 'rgba',
  93148. validator: function validator(v) {
  93149. return Object.keys(_VColorPickerEdit__WEBPACK_IMPORTED_MODULE_4__["modes"]).includes(v);
  93150. }
  93151. },
  93152. showSwatches: Boolean,
  93153. swatches: Array,
  93154. swatchesMaxHeight: {
  93155. type: [Number, String],
  93156. default: 150
  93157. },
  93158. value: {
  93159. type: [Object, String]
  93160. },
  93161. width: {
  93162. type: [Number, String],
  93163. default: 300
  93164. }
  93165. },
  93166. data: function data() {
  93167. return {
  93168. internalValue: Object(_util__WEBPACK_IMPORTED_MODULE_6__["fromRGBA"])({
  93169. r: 255,
  93170. g: 0,
  93171. b: 0,
  93172. a: 1
  93173. })
  93174. };
  93175. },
  93176. computed: {
  93177. hideAlpha: function hideAlpha() {
  93178. if (!this.value) return false;
  93179. return !Object(_util__WEBPACK_IMPORTED_MODULE_6__["hasAlpha"])(this.value);
  93180. }
  93181. },
  93182. watch: {
  93183. value: {
  93184. handler: function handler(color) {
  93185. this.updateColor(Object(_util__WEBPACK_IMPORTED_MODULE_6__["parseColor"])(color, this.internalValue));
  93186. },
  93187. immediate: true
  93188. }
  93189. },
  93190. methods: {
  93191. updateColor: function updateColor(color) {
  93192. this.internalValue = color;
  93193. var value = Object(_util__WEBPACK_IMPORTED_MODULE_6__["extractColor"])(this.internalValue, this.value);
  93194. if (!Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["deepEqual"])(value, this.value)) {
  93195. this.$emit('input', value);
  93196. this.$emit('update:color', this.internalValue);
  93197. }
  93198. },
  93199. genCanvas: function genCanvas() {
  93200. return this.$createElement(_VColorPickerCanvas__WEBPACK_IMPORTED_MODULE_3__["default"], {
  93201. props: {
  93202. color: this.internalValue,
  93203. disabled: this.disabled,
  93204. dotSize: this.dotSize,
  93205. width: this.width,
  93206. height: this.canvasHeight
  93207. },
  93208. on: {
  93209. 'update:color': this.updateColor
  93210. }
  93211. });
  93212. },
  93213. genControls: function genControls() {
  93214. return this.$createElement('div', {
  93215. staticClass: 'v-color-picker__controls'
  93216. }, [this.genPreview(), !this.hideInputs && this.genEdit()]);
  93217. },
  93218. genEdit: function genEdit() {
  93219. var _this = this;
  93220. return this.$createElement(_VColorPickerEdit__WEBPACK_IMPORTED_MODULE_4__["default"], {
  93221. props: {
  93222. color: this.internalValue,
  93223. disabled: this.disabled,
  93224. hideAlpha: this.hideAlpha,
  93225. hideModeSwitch: this.hideModeSwitch,
  93226. mode: this.mode
  93227. },
  93228. on: {
  93229. 'update:color': this.updateColor,
  93230. 'update:mode': function updateMode(v) {
  93231. return _this.$emit('update:mode', v);
  93232. }
  93233. }
  93234. });
  93235. },
  93236. genPreview: function genPreview() {
  93237. return this.$createElement(_VColorPickerPreview__WEBPACK_IMPORTED_MODULE_2__["default"], {
  93238. props: {
  93239. color: this.internalValue,
  93240. disabled: this.disabled,
  93241. hideAlpha: this.hideAlpha
  93242. },
  93243. on: {
  93244. 'update:color': this.updateColor
  93245. }
  93246. });
  93247. },
  93248. genSwatches: function genSwatches() {
  93249. return this.$createElement(_VColorPickerSwatches__WEBPACK_IMPORTED_MODULE_5__["default"], {
  93250. props: {
  93251. dark: this.dark,
  93252. light: this.light,
  93253. swatches: this.swatches,
  93254. color: this.internalValue,
  93255. maxHeight: this.swatchesMaxHeight
  93256. },
  93257. on: {
  93258. 'update:color': this.updateColor
  93259. }
  93260. });
  93261. }
  93262. },
  93263. render: function render(h) {
  93264. return h(_VSheet_VSheet__WEBPACK_IMPORTED_MODULE_1__["default"], {
  93265. staticClass: 'v-color-picker',
  93266. class: __assign({
  93267. 'v-color-picker--flat': this.flat
  93268. }, this.themeClasses),
  93269. props: {
  93270. maxWidth: this.width
  93271. }
  93272. }, [!this.hideCanvas && this.genCanvas(), this.genControls(), this.showSwatches && this.genSwatches()]);
  93273. }
  93274. }));
  93275. /***/ }),
  93276. /***/ "./src/components/VColorPicker/VColorPickerCanvas.sass":
  93277. /*!*************************************************************!*\
  93278. !*** ./src/components/VColorPicker/VColorPickerCanvas.sass ***!
  93279. \*************************************************************/
  93280. /*! no static exports found */
  93281. /***/ (function(module, exports, __webpack_require__) {
  93282. // extracted by mini-css-extract-plugin
  93283. /***/ }),
  93284. /***/ "./src/components/VColorPicker/VColorPickerCanvas.ts":
  93285. /*!***********************************************************!*\
  93286. !*** ./src/components/VColorPicker/VColorPickerCanvas.ts ***!
  93287. \***********************************************************/
  93288. /*! exports provided: default */
  93289. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93290. "use strict";
  93291. __webpack_require__.r(__webpack_exports__);
  93292. /* harmony import */ var _VColorPickerCanvas_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VColorPickerCanvas.sass */ "./src/components/VColorPicker/VColorPickerCanvas.sass");
  93293. /* harmony import */ var _VColorPickerCanvas_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VColorPickerCanvas_sass__WEBPACK_IMPORTED_MODULE_0__);
  93294. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  93295. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ "./src/components/VColorPicker/util/index.ts");
  93296. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue */ "vue");
  93297. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_3__);
  93298. // Styles
  93299. // Helpers
  93300. // Types
  93301. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_3___default.a.extend({
  93302. name: 'v-color-picker-canvas',
  93303. props: {
  93304. color: {
  93305. type: Object,
  93306. default: function _default() {
  93307. return Object(_util__WEBPACK_IMPORTED_MODULE_2__["fromRGBA"])({
  93308. r: 255,
  93309. g: 0,
  93310. b: 0,
  93311. a: 1
  93312. });
  93313. }
  93314. },
  93315. disabled: Boolean,
  93316. dotSize: {
  93317. type: [Number, String],
  93318. default: 10
  93319. },
  93320. height: {
  93321. type: [Number, String],
  93322. default: 150
  93323. },
  93324. width: {
  93325. type: [Number, String],
  93326. default: 300
  93327. }
  93328. },
  93329. data: function data() {
  93330. return {
  93331. boundingRect: {
  93332. width: 0,
  93333. height: 0,
  93334. left: 0,
  93335. top: 0
  93336. }
  93337. };
  93338. },
  93339. computed: {
  93340. dot: function dot() {
  93341. if (!this.color) return {
  93342. x: 0,
  93343. y: 0
  93344. };
  93345. return {
  93346. x: this.color.hsva.s * parseInt(this.width, 10),
  93347. y: (1 - this.color.hsva.v) * parseInt(this.height, 10)
  93348. };
  93349. }
  93350. },
  93351. watch: {
  93352. 'color.hue': 'updateCanvas'
  93353. },
  93354. mounted: function mounted() {
  93355. this.updateCanvas();
  93356. },
  93357. methods: {
  93358. emitColor: function emitColor(x, y) {
  93359. var _a = this.boundingRect,
  93360. left = _a.left,
  93361. top = _a.top,
  93362. width = _a.width,
  93363. height = _a.height;
  93364. this.$emit('update:color', Object(_util__WEBPACK_IMPORTED_MODULE_2__["fromHSVA"])({
  93365. h: this.color.hue,
  93366. s: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["clamp"])(x - left, 0, width) / width,
  93367. v: 1 - Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["clamp"])(y - top, 0, height) / height,
  93368. a: this.color.alpha
  93369. }));
  93370. },
  93371. updateCanvas: function updateCanvas() {
  93372. if (!this.color) return;
  93373. var canvas = this.$refs.canvas;
  93374. var ctx = canvas.getContext('2d');
  93375. if (!ctx) return;
  93376. var saturationGradient = ctx.createLinearGradient(0, 0, canvas.width, 0);
  93377. saturationGradient.addColorStop(0, 'hsla(0, 0%, 100%, 1)'); // white
  93378. saturationGradient.addColorStop(1, "hsla(" + this.color.hue + ", 100%, 50%, 1)");
  93379. ctx.fillStyle = saturationGradient;
  93380. ctx.fillRect(0, 0, canvas.width, canvas.height);
  93381. var valueGradient = ctx.createLinearGradient(0, 0, 0, canvas.height);
  93382. valueGradient.addColorStop(0, 'hsla(0, 0%, 100%, 0)'); // transparent
  93383. valueGradient.addColorStop(1, 'hsla(0, 0%, 0%, 1)'); // black
  93384. ctx.fillStyle = valueGradient;
  93385. ctx.fillRect(0, 0, canvas.width, canvas.height);
  93386. },
  93387. handleClick: function handleClick(e) {
  93388. if (this.disabled) return;
  93389. this.boundingRect = this.$el.getBoundingClientRect();
  93390. this.emitColor(e.clientX, e.clientY);
  93391. },
  93392. handleMouseDown: function handleMouseDown(e) {
  93393. // To prevent selection while moving cursor
  93394. e.preventDefault();
  93395. if (this.disabled) return;
  93396. this.boundingRect = this.$el.getBoundingClientRect();
  93397. window.addEventListener('mousemove', this.handleMouseMove);
  93398. window.addEventListener('mouseup', this.handleMouseUp);
  93399. },
  93400. handleMouseMove: function handleMouseMove(e) {
  93401. if (this.disabled) return;
  93402. this.emitColor(e.clientX, e.clientY);
  93403. },
  93404. handleMouseUp: function handleMouseUp() {
  93405. window.removeEventListener('mousemove', this.handleMouseMove);
  93406. window.removeEventListener('mouseup', this.handleMouseUp);
  93407. },
  93408. genCanvas: function genCanvas() {
  93409. return this.$createElement('canvas', {
  93410. ref: 'canvas',
  93411. attrs: {
  93412. width: this.width,
  93413. height: this.height
  93414. }
  93415. });
  93416. },
  93417. genDot: function genDot() {
  93418. var radius = parseInt(this.dotSize, 10) / 2;
  93419. var x = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["convertToUnit"])(this.dot.x - radius);
  93420. var y = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["convertToUnit"])(this.dot.y - radius);
  93421. return this.$createElement('div', {
  93422. staticClass: 'v-color-picker__canvas-dot',
  93423. class: {
  93424. 'v-color-picker__canvas-dot--disabled': this.disabled
  93425. },
  93426. style: {
  93427. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["convertToUnit"])(this.dotSize),
  93428. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["convertToUnit"])(this.dotSize),
  93429. transform: "translate(" + x + ", " + y + ")"
  93430. }
  93431. });
  93432. }
  93433. },
  93434. render: function render(h) {
  93435. return h('div', {
  93436. staticClass: 'v-color-picker__canvas',
  93437. style: {
  93438. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["convertToUnit"])(this.width),
  93439. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["convertToUnit"])(this.height)
  93440. },
  93441. on: {
  93442. click: this.handleClick,
  93443. mousedown: this.handleMouseDown
  93444. }
  93445. }, [this.genCanvas(), this.genDot()]);
  93446. }
  93447. }));
  93448. /***/ }),
  93449. /***/ "./src/components/VColorPicker/VColorPickerEdit.sass":
  93450. /*!***********************************************************!*\
  93451. !*** ./src/components/VColorPicker/VColorPickerEdit.sass ***!
  93452. \***********************************************************/
  93453. /*! no static exports found */
  93454. /***/ (function(module, exports, __webpack_require__) {
  93455. // extracted by mini-css-extract-plugin
  93456. /***/ }),
  93457. /***/ "./src/components/VColorPicker/VColorPickerEdit.ts":
  93458. /*!*********************************************************!*\
  93459. !*** ./src/components/VColorPicker/VColorPickerEdit.ts ***!
  93460. \*********************************************************/
  93461. /*! exports provided: modes, default */
  93462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93463. "use strict";
  93464. __webpack_require__.r(__webpack_exports__);
  93465. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modes", function() { return modes; });
  93466. /* harmony import */ var _VColorPickerEdit_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VColorPickerEdit.sass */ "./src/components/VColorPicker/VColorPickerEdit.sass");
  93467. /* harmony import */ var _VColorPickerEdit_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VColorPickerEdit_sass__WEBPACK_IMPORTED_MODULE_0__);
  93468. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  93469. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  93470. /* harmony import */ var _util_colorUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/colorUtils */ "./src/util/colorUtils.ts");
  93471. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue */ "vue");
  93472. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_4__);
  93473. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util */ "./src/components/VColorPicker/util/index.ts");
  93474. var __read = undefined && undefined.__read || function (o, n) {
  93475. var m = typeof Symbol === "function" && o[Symbol.iterator];
  93476. if (!m) return o;
  93477. var i = m.call(o),
  93478. r,
  93479. ar = [],
  93480. e;
  93481. try {
  93482. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  93483. ar.push(r.value);
  93484. }
  93485. } catch (error) {
  93486. e = {
  93487. error: error
  93488. };
  93489. } finally {
  93490. try {
  93491. if (r && !r.done && (m = i["return"])) m.call(i);
  93492. } finally {
  93493. if (e) throw e.error;
  93494. }
  93495. }
  93496. return ar;
  93497. }; // Styles
  93498. // Components
  93499. // Helpers
  93500. // Types
  93501. var modes = {
  93502. rgba: {
  93503. inputs: [['r', 255, 'int'], ['g', 255, 'int'], ['b', 255, 'int'], ['a', 1, 'float']],
  93504. from: _util__WEBPACK_IMPORTED_MODULE_5__["fromRGBA"]
  93505. },
  93506. hsla: {
  93507. inputs: [['h', 360, 'int'], ['s', 1, 'float'], ['l', 1, 'float'], ['a', 1, 'float']],
  93508. from: _util__WEBPACK_IMPORTED_MODULE_5__["fromHSLA"]
  93509. },
  93510. hexa: {
  93511. from: _util__WEBPACK_IMPORTED_MODULE_5__["fromHexa"]
  93512. }
  93513. };
  93514. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_4___default.a.extend({
  93515. name: 'v-color-picker-edit',
  93516. props: {
  93517. color: Object,
  93518. disabled: Boolean,
  93519. hideAlpha: Boolean,
  93520. hideModeSwitch: Boolean,
  93521. mode: {
  93522. type: String,
  93523. default: 'rgba',
  93524. validator: function validator(v) {
  93525. return Object.keys(modes).includes(v);
  93526. }
  93527. }
  93528. },
  93529. data: function data() {
  93530. return {
  93531. modes: modes,
  93532. internalMode: this.mode
  93533. };
  93534. },
  93535. computed: {
  93536. currentMode: function currentMode() {
  93537. return this.modes[this.internalMode];
  93538. }
  93539. },
  93540. watch: {
  93541. mode: function mode(_mode) {
  93542. this.internalMode = _mode;
  93543. }
  93544. },
  93545. created: function created() {
  93546. this.internalMode = this.mode;
  93547. },
  93548. methods: {
  93549. getValue: function getValue(v, type) {
  93550. if (type === 'float') return Math.round(v * 100) / 100;else if (type === 'int') return Math.round(v);else return 0;
  93551. },
  93552. parseValue: function parseValue(v, type) {
  93553. if (type === 'float') return parseFloat(v);else if (type === 'int') return parseInt(v, 10) || 0;else return 0;
  93554. },
  93555. changeMode: function changeMode() {
  93556. var modes = Object.keys(this.modes);
  93557. var index = modes.indexOf(this.internalMode);
  93558. var newMode = modes[(index + 1) % modes.length];
  93559. this.internalMode = newMode;
  93560. this.$emit('update:mode', newMode);
  93561. },
  93562. genInput: function genInput(target, attrs, value, on) {
  93563. return this.$createElement('div', {
  93564. staticClass: 'v-color-picker__input'
  93565. }, [this.$createElement('input', {
  93566. key: target,
  93567. attrs: attrs,
  93568. domProps: {
  93569. value: value
  93570. },
  93571. on: on
  93572. }), this.$createElement('span', target.toUpperCase())]);
  93573. },
  93574. genInputs: function genInputs() {
  93575. var _this = this;
  93576. switch (this.internalMode) {
  93577. case 'hexa':
  93578. {
  93579. var hex = this.color.hexa;
  93580. var value = this.hideAlpha && hex.endsWith('FF') ? hex.substr(0, 7) : hex;
  93581. return this.genInput('hex', {
  93582. maxlength: this.hideAlpha ? 7 : 9,
  93583. disabled: this.disabled
  93584. }, value, {
  93585. change: function change(e) {
  93586. var el = e.target;
  93587. _this.$emit('update:color', _this.currentMode.from(Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_3__["parseHex"])(el.value)));
  93588. }
  93589. });
  93590. }
  93591. default:
  93592. {
  93593. var inputs = this.hideAlpha ? this.currentMode.inputs.slice(0, -1) : this.currentMode.inputs;
  93594. return inputs.map(function (_a) {
  93595. var _b = __read(_a, 3),
  93596. target = _b[0],
  93597. max = _b[1],
  93598. type = _b[2];
  93599. var value = _this.color[_this.internalMode];
  93600. return _this.genInput(target, {
  93601. type: 'number',
  93602. min: 0,
  93603. max: max,
  93604. step: type === 'float' ? '0.01' : type === 'int' ? '1' : undefined,
  93605. disabled: _this.disabled
  93606. }, _this.getValue(value[target], type), {
  93607. input: function input(e) {
  93608. var _a;
  93609. var el = e.target;
  93610. var newVal = _this.parseValue(el.value || '0', type);
  93611. _this.$emit('update:color', _this.currentMode.from(Object.assign({}, value, (_a = {}, _a[target] = newVal, _a)), _this.color.alpha));
  93612. }
  93613. });
  93614. });
  93615. }
  93616. }
  93617. },
  93618. genSwitch: function genSwitch() {
  93619. return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_1__["default"], {
  93620. props: {
  93621. small: true,
  93622. icon: true,
  93623. disabled: this.disabled
  93624. },
  93625. on: {
  93626. click: this.changeMode
  93627. }
  93628. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], '$unfold')]);
  93629. }
  93630. },
  93631. render: function render(h) {
  93632. return h('div', {
  93633. staticClass: 'v-color-picker__edit'
  93634. }, [this.genInputs(), !this.hideModeSwitch && this.genSwitch()]);
  93635. }
  93636. }));
  93637. /***/ }),
  93638. /***/ "./src/components/VColorPicker/VColorPickerPreview.sass":
  93639. /*!**************************************************************!*\
  93640. !*** ./src/components/VColorPicker/VColorPickerPreview.sass ***!
  93641. \**************************************************************/
  93642. /*! no static exports found */
  93643. /***/ (function(module, exports, __webpack_require__) {
  93644. // extracted by mini-css-extract-plugin
  93645. /***/ }),
  93646. /***/ "./src/components/VColorPicker/VColorPickerPreview.ts":
  93647. /*!************************************************************!*\
  93648. !*** ./src/components/VColorPicker/VColorPickerPreview.ts ***!
  93649. \************************************************************/
  93650. /*! exports provided: default */
  93651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93652. "use strict";
  93653. __webpack_require__.r(__webpack_exports__);
  93654. /* harmony import */ var _VColorPickerPreview_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VColorPickerPreview.sass */ "./src/components/VColorPicker/VColorPickerPreview.sass");
  93655. /* harmony import */ var _VColorPickerPreview_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VColorPickerPreview_sass__WEBPACK_IMPORTED_MODULE_0__);
  93656. /* harmony import */ var _VSlider_VSlider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSlider/VSlider */ "./src/components/VSlider/VSlider.ts");
  93657. /* harmony import */ var _util_colorUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/colorUtils */ "./src/util/colorUtils.ts");
  93658. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue */ "vue");
  93659. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_3__);
  93660. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ "./src/components/VColorPicker/util/index.ts");
  93661. var __assign = undefined && undefined.__assign || function () {
  93662. __assign = Object.assign || function (t) {
  93663. for (var s, i = 1, n = arguments.length; i < n; i++) {
  93664. s = arguments[i];
  93665. for (var p in s) {
  93666. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  93667. }
  93668. }
  93669. return t;
  93670. };
  93671. return __assign.apply(this, arguments);
  93672. }; // Styles
  93673. // Components
  93674. // Utilities
  93675. // Types
  93676. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_3___default.a.extend({
  93677. name: 'v-color-picker-preview',
  93678. props: {
  93679. color: Object,
  93680. disabled: Boolean,
  93681. hideAlpha: Boolean
  93682. },
  93683. methods: {
  93684. genAlpha: function genAlpha() {
  93685. var _this = this;
  93686. return this.genTrack({
  93687. staticClass: 'v-color-picker__alpha',
  93688. props: {
  93689. thumbColor: 'grey lighten-2',
  93690. hideDetails: true,
  93691. value: this.color.alpha,
  93692. step: 0,
  93693. min: 0,
  93694. max: 1
  93695. },
  93696. style: {
  93697. backgroundImage: this.disabled ? undefined : "linear-gradient(to " + (this.$vuetify.rtl ? 'left' : 'right') + ", transparent, " + Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_2__["RGBtoCSS"])(this.color.rgba) + ")"
  93698. },
  93699. on: {
  93700. input: function input(val) {
  93701. return _this.color.alpha !== val && _this.$emit('update:color', Object(_util__WEBPACK_IMPORTED_MODULE_4__["fromHSVA"])(__assign({}, _this.color.hsva, {
  93702. a: val
  93703. })));
  93704. }
  93705. }
  93706. });
  93707. },
  93708. genSliders: function genSliders() {
  93709. return this.$createElement('div', {
  93710. staticClass: 'v-color-picker__sliders'
  93711. }, [this.genHue(), !this.hideAlpha && this.genAlpha()]);
  93712. },
  93713. genDot: function genDot() {
  93714. return this.$createElement('div', {
  93715. staticClass: 'v-color-picker__dot'
  93716. }, [this.$createElement('div', {
  93717. style: {
  93718. background: Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_2__["RGBAtoCSS"])(this.color.rgba)
  93719. }
  93720. })]);
  93721. },
  93722. genHue: function genHue() {
  93723. var _this = this;
  93724. return this.genTrack({
  93725. staticClass: 'v-color-picker__hue',
  93726. props: {
  93727. thumbColor: 'grey lighten-2',
  93728. hideDetails: true,
  93729. value: this.color.hue,
  93730. step: 0,
  93731. min: 0,
  93732. max: 360
  93733. },
  93734. on: {
  93735. input: function input(val) {
  93736. return _this.color.hue !== val && _this.$emit('update:color', Object(_util__WEBPACK_IMPORTED_MODULE_4__["fromHSVA"])(__assign({}, _this.color.hsva, {
  93737. h: val
  93738. })));
  93739. }
  93740. }
  93741. });
  93742. },
  93743. genTrack: function genTrack(options) {
  93744. return this.$createElement(_VSlider_VSlider__WEBPACK_IMPORTED_MODULE_1__["default"], __assign({
  93745. class: 'v-color-picker__track'
  93746. }, options, {
  93747. props: __assign({
  93748. disabled: this.disabled
  93749. }, options.props)
  93750. }));
  93751. }
  93752. },
  93753. render: function render(h) {
  93754. return h('div', {
  93755. staticClass: 'v-color-picker__preview',
  93756. class: {
  93757. 'v-color-picker__preview--hide-alpha': this.hideAlpha
  93758. }
  93759. }, [this.genDot(), this.genSliders()]);
  93760. }
  93761. }));
  93762. /***/ }),
  93763. /***/ "./src/components/VColorPicker/VColorPickerSwatches.sass":
  93764. /*!***************************************************************!*\
  93765. !*** ./src/components/VColorPicker/VColorPickerSwatches.sass ***!
  93766. \***************************************************************/
  93767. /*! no static exports found */
  93768. /***/ (function(module, exports, __webpack_require__) {
  93769. // extracted by mini-css-extract-plugin
  93770. /***/ }),
  93771. /***/ "./src/components/VColorPicker/VColorPickerSwatches.ts":
  93772. /*!*************************************************************!*\
  93773. !*** ./src/components/VColorPicker/VColorPickerSwatches.ts ***!
  93774. \*************************************************************/
  93775. /*! exports provided: default */
  93776. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93777. "use strict";
  93778. __webpack_require__.r(__webpack_exports__);
  93779. /* harmony import */ var _VColorPickerSwatches_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VColorPickerSwatches.sass */ "./src/components/VColorPicker/VColorPickerSwatches.sass");
  93780. /* harmony import */ var _VColorPickerSwatches_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VColorPickerSwatches_sass__WEBPACK_IMPORTED_MODULE_0__);
  93781. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  93782. /* harmony import */ var _util_colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/colors */ "./src/util/colors.ts");
  93783. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util */ "./src/components/VColorPicker/util/index.ts");
  93784. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  93785. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  93786. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  93787. /* harmony import */ var _util_colorUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/colorUtils */ "./src/util/colorUtils.ts");
  93788. // Styles
  93789. // Components
  93790. // Helpers
  93791. function parseDefaultColors(colors) {
  93792. return Object.keys(colors).map(function (key) {
  93793. var color = colors[key];
  93794. return color.base ? [color.base, color.darken4, color.darken3, color.darken2, color.darken1, color.lighten1, color.lighten2, color.lighten3, color.lighten4, color.lighten5] : [color.black, color.white, color.transparent];
  93795. });
  93796. }
  93797. var white = Object(_util__WEBPACK_IMPORTED_MODULE_3__["fromHex"])('#FFFFFF').rgba;
  93798. var black = Object(_util__WEBPACK_IMPORTED_MODULE_3__["fromHex"])('#000000').rgba;
  93799. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_6__["default"]).extend({
  93800. name: 'v-color-picker-swatches',
  93801. props: {
  93802. swatches: {
  93803. type: Array,
  93804. default: function _default() {
  93805. return parseDefaultColors(_util_colors__WEBPACK_IMPORTED_MODULE_2__["default"]);
  93806. }
  93807. },
  93808. color: Object,
  93809. maxWidth: [Number, String],
  93810. maxHeight: [Number, String]
  93811. },
  93812. methods: {
  93813. genColor: function genColor(color) {
  93814. var _this = this;
  93815. var content = this.$createElement('div', {
  93816. style: {
  93817. background: color
  93818. }
  93819. }, [Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["deepEqual"])(this.color, Object(_util__WEBPACK_IMPORTED_MODULE_3__["parseColor"])(color, null)) && this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], {
  93820. props: {
  93821. small: true,
  93822. dark: Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_7__["contrastRatio"])(this.color.rgba, white) > 2 && this.color.alpha > 0.5,
  93823. light: Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_7__["contrastRatio"])(this.color.rgba, black) > 2 && this.color.alpha > 0.5
  93824. }
  93825. }, '$success')]);
  93826. return this.$createElement('div', {
  93827. staticClass: 'v-color-picker__color',
  93828. on: {
  93829. // TODO: Less hacky way of catching transparent
  93830. click: function click() {
  93831. return _this.$emit('update:color', Object(_util__WEBPACK_IMPORTED_MODULE_3__["fromHex"])(color === 'transparent' ? '#00000000' : color));
  93832. }
  93833. }
  93834. }, [content]);
  93835. },
  93836. genSwatches: function genSwatches() {
  93837. var _this = this;
  93838. return this.swatches.map(function (swatch) {
  93839. var colors = swatch.map(_this.genColor);
  93840. return _this.$createElement('div', {
  93841. staticClass: 'v-color-picker__swatch'
  93842. }, colors);
  93843. });
  93844. }
  93845. },
  93846. render: function render(h) {
  93847. return h('div', {
  93848. staticClass: 'v-color-picker__swatches',
  93849. style: {
  93850. maxWidth: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.maxWidth),
  93851. maxHeight: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.maxHeight)
  93852. }
  93853. }, [this.$createElement('div', this.genSwatches())]);
  93854. }
  93855. }));
  93856. /***/ }),
  93857. /***/ "./src/components/VColorPicker/index.ts":
  93858. /*!**********************************************!*\
  93859. !*** ./src/components/VColorPicker/index.ts ***!
  93860. \**********************************************/
  93861. /*! exports provided: VColorPicker, VColorPickerSwatches, VColorPickerCanvas, default */
  93862. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93863. "use strict";
  93864. __webpack_require__.r(__webpack_exports__);
  93865. /* harmony import */ var _VColorPicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VColorPicker */ "./src/components/VColorPicker/VColorPicker.ts");
  93866. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VColorPicker", function() { return _VColorPicker__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  93867. /* harmony import */ var _VColorPickerSwatches__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VColorPickerSwatches */ "./src/components/VColorPicker/VColorPickerSwatches.ts");
  93868. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VColorPickerSwatches", function() { return _VColorPickerSwatches__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  93869. /* harmony import */ var _VColorPickerCanvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VColorPickerCanvas */ "./src/components/VColorPicker/VColorPickerCanvas.ts");
  93870. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VColorPickerCanvas", function() { return _VColorPickerCanvas__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  93871. /* harmony default export */ __webpack_exports__["default"] = (_VColorPicker__WEBPACK_IMPORTED_MODULE_0__["default"]);
  93872. /***/ }),
  93873. /***/ "./src/components/VColorPicker/util/index.ts":
  93874. /*!***************************************************!*\
  93875. !*** ./src/components/VColorPicker/util/index.ts ***!
  93876. \***************************************************/
  93877. /*! exports provided: fromHSVA, fromHSLA, fromRGBA, fromHexa, fromHex, parseColor, extractColor, hasAlpha */
  93878. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93879. "use strict";
  93880. __webpack_require__.r(__webpack_exports__);
  93881. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromHSVA", function() { return fromHSVA; });
  93882. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromHSLA", function() { return fromHSLA; });
  93883. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRGBA", function() { return fromRGBA; });
  93884. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromHexa", function() { return fromHexa; });
  93885. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromHex", function() { return fromHex; });
  93886. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseColor", function() { return parseColor; });
  93887. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractColor", function() { return extractColor; });
  93888. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAlpha", function() { return hasAlpha; });
  93889. /* harmony import */ var _util_colorUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/colorUtils */ "./src/util/colorUtils.ts");
  93890. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  93891. var __assign = undefined && undefined.__assign || function () {
  93892. __assign = Object.assign || function (t) {
  93893. for (var s, i = 1, n = arguments.length; i < n; i++) {
  93894. s = arguments[i];
  93895. for (var p in s) {
  93896. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  93897. }
  93898. }
  93899. return t;
  93900. };
  93901. return __assign.apply(this, arguments);
  93902. };
  93903. var __rest = undefined && undefined.__rest || function (s, e) {
  93904. var t = {};
  93905. for (var p in s) {
  93906. if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  93907. }
  93908. if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  93909. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  93910. }
  93911. return t;
  93912. }; // Utilities
  93913. function fromHSVA(hsva) {
  93914. hsva = __assign({}, hsva);
  93915. var hexa = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HSVAtoHex"])(hsva);
  93916. var hsla = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HSVAtoHSLA"])(hsva);
  93917. var rgba = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HSVAtoRGBA"])(hsva);
  93918. return {
  93919. alpha: hsva.a,
  93920. hex: hexa.substr(0, 7),
  93921. hexa: hexa,
  93922. hsla: hsla,
  93923. hsva: hsva,
  93924. hue: hsva.h,
  93925. rgba: rgba
  93926. };
  93927. }
  93928. function fromHSLA(hsla) {
  93929. var hsva = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HSLAtoHSVA"])(hsla);
  93930. var hexa = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HSVAtoHex"])(hsva);
  93931. var rgba = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HSVAtoRGBA"])(hsva);
  93932. return {
  93933. alpha: hsva.a,
  93934. hex: hexa.substr(0, 7),
  93935. hexa: hexa,
  93936. hsla: hsla,
  93937. hsva: hsva,
  93938. hue: hsva.h,
  93939. rgba: rgba
  93940. };
  93941. }
  93942. function fromRGBA(rgba) {
  93943. var hsva = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["RGBAtoHSVA"])(rgba);
  93944. var hexa = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["RGBAtoHex"])(rgba);
  93945. var hsla = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HSVAtoHSLA"])(hsva);
  93946. return {
  93947. alpha: hsva.a,
  93948. hex: hexa.substr(0, 7),
  93949. hexa: hexa,
  93950. hsla: hsla,
  93951. hsva: hsva,
  93952. hue: hsva.h,
  93953. rgba: rgba
  93954. };
  93955. }
  93956. function fromHexa(hexa) {
  93957. var hsva = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HexToHSVA"])(hexa);
  93958. var hsla = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HSVAtoHSLA"])(hsva);
  93959. var rgba = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["HSVAtoRGBA"])(hsva);
  93960. return {
  93961. alpha: hsva.a,
  93962. hex: hexa.substr(0, 7),
  93963. hexa: hexa,
  93964. hsla: hsla,
  93965. hsva: hsva,
  93966. hue: hsva.h,
  93967. rgba: rgba
  93968. };
  93969. }
  93970. function fromHex(hex) {
  93971. return fromHexa(Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["parseHex"])(hex));
  93972. }
  93973. function has(obj, key) {
  93974. return key.every(function (k) {
  93975. return obj.hasOwnProperty(k);
  93976. });
  93977. }
  93978. function parseColor(color, oldColor) {
  93979. if (!color) return fromRGBA({
  93980. r: 255,
  93981. g: 0,
  93982. b: 0,
  93983. a: 1
  93984. });
  93985. if (typeof color === 'string') {
  93986. if (color === 'transparent') return fromHexa('#00000000');
  93987. var hex = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["parseHex"])(color);
  93988. if (oldColor && hex === oldColor.hexa) return oldColor;else return fromHexa(hex);
  93989. }
  93990. if (_typeof(color) === 'object') {
  93991. if (color.hasOwnProperty('alpha')) return color;
  93992. var a = color.hasOwnProperty('a') ? parseFloat(color.a) : 1;
  93993. if (has(color, ['r', 'g', 'b'])) {
  93994. if (oldColor && color === oldColor.rgba) return oldColor;else return fromRGBA(__assign({}, color, {
  93995. a: a
  93996. }));
  93997. } else if (has(color, ['h', 's', 'l'])) {
  93998. if (oldColor && color === oldColor.hsla) return oldColor;else return fromHSLA(__assign({}, color, {
  93999. a: a
  94000. }));
  94001. } else if (has(color, ['h', 's', 'v'])) {
  94002. if (oldColor && color === oldColor.hsva) return oldColor;else return fromHSVA(__assign({}, color, {
  94003. a: a
  94004. }));
  94005. }
  94006. }
  94007. return fromRGBA({
  94008. r: 255,
  94009. g: 0,
  94010. b: 0,
  94011. a: 1
  94012. });
  94013. }
  94014. function stripAlpha(color, stripAlpha) {
  94015. if (stripAlpha) {
  94016. var a = color.a,
  94017. rest = __rest(color, ["a"]);
  94018. return rest;
  94019. }
  94020. return color;
  94021. }
  94022. function extractColor(color, input) {
  94023. if (input == null) return color;
  94024. if (typeof input === 'string') {
  94025. return input.length === 7 ? color.hex : color.hexa;
  94026. }
  94027. if (_typeof(input) === 'object') {
  94028. if (has(input, ['r', 'g', 'b'])) return stripAlpha(color.rgba, !input.a);else if (has(input, ['h', 's', 'l'])) return stripAlpha(color.hsla, !input.a);else if (has(input, ['h', 's', 'v'])) return stripAlpha(color.hsva, !input.a);
  94029. }
  94030. return color;
  94031. }
  94032. function hasAlpha(color) {
  94033. if (!color) return false;
  94034. if (typeof color === 'string') {
  94035. return color.length > 7;
  94036. }
  94037. if (_typeof(color) === 'object') {
  94038. return has(color, ['a']) || has(color, ['alpha']);
  94039. }
  94040. return false;
  94041. }
  94042. /***/ }),
  94043. /***/ "./src/components/VCombobox/VCombobox.ts":
  94044. /*!***********************************************!*\
  94045. !*** ./src/components/VCombobox/VCombobox.ts ***!
  94046. \***********************************************/
  94047. /*! exports provided: default */
  94048. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94049. "use strict";
  94050. __webpack_require__.r(__webpack_exports__);
  94051. /* harmony import */ var _VAutocomplete_VAutocomplete_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VAutocomplete/VAutocomplete.sass */ "./src/components/VAutocomplete/VAutocomplete.sass");
  94052. /* harmony import */ var _VAutocomplete_VAutocomplete_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VAutocomplete_VAutocomplete_sass__WEBPACK_IMPORTED_MODULE_0__);
  94053. /* harmony import */ var _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSelect/VSelect */ "./src/components/VSelect/VSelect.ts");
  94054. /* harmony import */ var _VAutocomplete_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VAutocomplete/VAutocomplete */ "./src/components/VAutocomplete/VAutocomplete.ts");
  94055. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  94056. var __assign = undefined && undefined.__assign || function () {
  94057. __assign = Object.assign || function (t) {
  94058. for (var s, i = 1, n = arguments.length; i < n; i++) {
  94059. s = arguments[i];
  94060. for (var p in s) {
  94061. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  94062. }
  94063. }
  94064. return t;
  94065. };
  94066. return __assign.apply(this, arguments);
  94067. }; // Styles
  94068. // Extensions
  94069. // Utils
  94070. /* @vue/component */
  94071. /* harmony default export */ __webpack_exports__["default"] = (_VAutocomplete_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].extend({
  94072. name: 'v-combobox',
  94073. props: {
  94074. delimiters: {
  94075. type: Array,
  94076. default: function _default() {
  94077. return [];
  94078. }
  94079. },
  94080. returnObject: {
  94081. type: Boolean,
  94082. default: true
  94083. }
  94084. },
  94085. data: function data() {
  94086. return {
  94087. editingIndex: -1
  94088. };
  94089. },
  94090. computed: {
  94091. computedCounterValue: function computedCounterValue() {
  94092. return this.multiple ? this.selectedItems.length : (this.internalSearch || '').toString().length;
  94093. },
  94094. hasSlot: function hasSlot() {
  94095. return _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.hasSlot.call(this) || this.multiple;
  94096. },
  94097. isAnyValueAllowed: function isAnyValueAllowed() {
  94098. return true;
  94099. },
  94100. menuCanShow: function menuCanShow() {
  94101. if (!this.isFocused) return false;
  94102. return this.hasDisplayedItems || !!this.$slots['no-data'] && !this.hideNoData;
  94103. }
  94104. },
  94105. methods: {
  94106. onInternalSearchChanged: function onInternalSearchChanged(val) {
  94107. if (val && this.multiple && this.delimiters.length) {
  94108. var delimiter = this.delimiters.find(function (d) {
  94109. return val.endsWith(d);
  94110. });
  94111. if (delimiter != null) {
  94112. this.internalSearch = val.slice(0, val.length - delimiter.length);
  94113. this.updateTags();
  94114. }
  94115. }
  94116. this.updateMenuDimensions();
  94117. },
  94118. genInput: function genInput() {
  94119. var input = _VAutocomplete_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genInput.call(this);
  94120. delete input.data.attrs.name;
  94121. input.data.on.paste = this.onPaste;
  94122. return input;
  94123. },
  94124. genChipSelection: function genChipSelection(item, index) {
  94125. var _this = this;
  94126. var chip = _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genChipSelection.call(this, item, index); // Allow user to update an existing value
  94127. if (this.multiple) {
  94128. chip.componentOptions.listeners = __assign({}, chip.componentOptions.listeners, {
  94129. dblclick: function dblclick() {
  94130. _this.editingIndex = index;
  94131. _this.internalSearch = _this.getText(item);
  94132. _this.selectedIndex = -1;
  94133. }
  94134. });
  94135. }
  94136. return chip;
  94137. },
  94138. onChipInput: function onChipInput(item) {
  94139. _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.onChipInput.call(this, item);
  94140. this.editingIndex = -1;
  94141. },
  94142. // Requires a manual definition
  94143. // to overwrite removal in v-autocomplete
  94144. onEnterDown: function onEnterDown(e) {
  94145. e.preventDefault(); // If has menu index, let v-select-list handle
  94146. if (this.getMenuIndex() > -1) return;
  94147. this.$nextTick(this.updateSelf);
  94148. },
  94149. onFilteredItemsChanged: function onFilteredItemsChanged(val, oldVal) {
  94150. if (!this.autoSelectFirst) return;
  94151. _VAutocomplete_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.onFilteredItemsChanged.call(this, val, oldVal);
  94152. },
  94153. onKeyDown: function onKeyDown(e) {
  94154. var keyCode = e.keyCode;
  94155. _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.onKeyDown.call(this, e); // If user is at selection index of 0
  94156. // create a new tag
  94157. if (this.multiple && keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].left && this.$refs.input.selectionStart === 0) {
  94158. this.updateSelf();
  94159. } else if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].enter) {
  94160. this.onEnterDown(e);
  94161. } // The ordering is important here
  94162. // allows new value to be updated
  94163. // and then moves the index to the
  94164. // proper location
  94165. this.changeSelectedIndex(keyCode);
  94166. },
  94167. onTabDown: function onTabDown(e) {
  94168. // When adding tags, if searching and
  94169. // there is not a filtered options,
  94170. // add the value to the tags list
  94171. if (this.multiple && this.internalSearch && this.getMenuIndex() === -1) {
  94172. e.preventDefault();
  94173. e.stopPropagation();
  94174. return this.updateTags();
  94175. }
  94176. _VAutocomplete_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.onTabDown.call(this, e);
  94177. },
  94178. selectItem: function selectItem(item) {
  94179. // Currently only supports items:<string[]>
  94180. if (this.editingIndex > -1) {
  94181. this.updateEditing();
  94182. } else {
  94183. _VAutocomplete_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.selectItem.call(this, item);
  94184. }
  94185. },
  94186. setSelectedItems: function setSelectedItems() {
  94187. if (this.internalValue == null || this.internalValue === '') {
  94188. this.selectedItems = [];
  94189. } else {
  94190. this.selectedItems = this.multiple ? this.internalValue : [this.internalValue];
  94191. }
  94192. },
  94193. setValue: function setValue(value) {
  94194. _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.setValue.call(this, value != null ? value : this.internalSearch);
  94195. },
  94196. updateEditing: function updateEditing() {
  94197. var value = this.internalValue.slice();
  94198. value[this.editingIndex] = this.internalSearch;
  94199. this.setValue(value);
  94200. this.editingIndex = -1;
  94201. },
  94202. updateCombobox: function updateCombobox() {
  94203. var isUsingSlot = Boolean(this.$scopedSlots.selection) || this.hasChips; // If search is not dirty and is
  94204. // using slot, do nothing
  94205. if (isUsingSlot && !this.searchIsDirty) return; // The internal search is not matching
  94206. // the internal value, update the input
  94207. if (this.internalSearch !== this.getText(this.internalValue)) this.setValue(); // Reset search if using slot
  94208. // to avoid a double input
  94209. if (isUsingSlot) this.internalSearch = undefined;
  94210. },
  94211. updateSelf: function updateSelf() {
  94212. this.multiple ? this.updateTags() : this.updateCombobox();
  94213. },
  94214. updateTags: function updateTags() {
  94215. var menuIndex = this.getMenuIndex(); // If the user is not searching
  94216. // and no menu item is selected
  94217. // do nothing
  94218. if (menuIndex < 0 && !this.searchIsDirty) return;
  94219. if (this.editingIndex > -1) {
  94220. return this.updateEditing();
  94221. }
  94222. var index = this.selectedItems.indexOf(this.internalSearch); // If it already exists, do nothing
  94223. // this might need to change to bring
  94224. // the duplicated item to the last entered
  94225. if (index > -1) {
  94226. var internalValue = this.internalValue.slice();
  94227. internalValue.splice(index, 1);
  94228. this.setValue(internalValue);
  94229. } // If menu index is greater than 1
  94230. // the selection is handled elsewhere
  94231. // TODO: find out where
  94232. if (menuIndex > -1) return this.internalSearch = null;
  94233. this.selectItem(this.internalSearch);
  94234. this.internalSearch = null;
  94235. },
  94236. onPaste: function onPaste(event) {
  94237. if (!this.multiple || this.searchIsDirty) return;
  94238. var pastedItemText = event.clipboardData.getData('text/vnd.vuetify.autocomplete.item+plain');
  94239. if (pastedItemText && this.findExistingIndex(pastedItemText) === -1) {
  94240. event.preventDefault();
  94241. _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.selectItem.call(this, pastedItemText);
  94242. }
  94243. }
  94244. }
  94245. }));
  94246. /***/ }),
  94247. /***/ "./src/components/VCombobox/index.ts":
  94248. /*!*******************************************!*\
  94249. !*** ./src/components/VCombobox/index.ts ***!
  94250. \*******************************************/
  94251. /*! exports provided: VCombobox, default */
  94252. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94253. "use strict";
  94254. __webpack_require__.r(__webpack_exports__);
  94255. /* harmony import */ var _VCombobox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCombobox */ "./src/components/VCombobox/VCombobox.ts");
  94256. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCombobox", function() { return _VCombobox__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  94257. /* harmony default export */ __webpack_exports__["default"] = (_VCombobox__WEBPACK_IMPORTED_MODULE_0__["default"]);
  94258. /***/ }),
  94259. /***/ "./src/components/VContent/VContent.sass":
  94260. /*!***********************************************!*\
  94261. !*** ./src/components/VContent/VContent.sass ***!
  94262. \***********************************************/
  94263. /*! no static exports found */
  94264. /***/ (function(module, exports, __webpack_require__) {
  94265. // extracted by mini-css-extract-plugin
  94266. /***/ }),
  94267. /***/ "./src/components/VContent/VContent.ts":
  94268. /*!*********************************************!*\
  94269. !*** ./src/components/VContent/VContent.ts ***!
  94270. \*********************************************/
  94271. /*! exports provided: default */
  94272. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94273. "use strict";
  94274. __webpack_require__.r(__webpack_exports__);
  94275. /* harmony import */ var _VContent_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VContent.sass */ "./src/components/VContent/VContent.sass");
  94276. /* harmony import */ var _VContent_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VContent_sass__WEBPACK_IMPORTED_MODULE_0__);
  94277. /* harmony import */ var _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/ssr-bootable */ "./src/mixins/ssr-bootable/index.ts");
  94278. // Styles
  94279. // Mixins
  94280. /* @vue/component */
  94281. /* harmony default export */ __webpack_exports__["default"] = (_mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  94282. name: 'v-content',
  94283. props: {
  94284. tag: {
  94285. type: String,
  94286. default: 'main'
  94287. }
  94288. },
  94289. computed: {
  94290. styles: function styles() {
  94291. var _a = this.$vuetify.application,
  94292. bar = _a.bar,
  94293. top = _a.top,
  94294. right = _a.right,
  94295. footer = _a.footer,
  94296. insetFooter = _a.insetFooter,
  94297. bottom = _a.bottom,
  94298. left = _a.left;
  94299. return {
  94300. paddingTop: top + bar + "px",
  94301. paddingRight: right + "px",
  94302. paddingBottom: footer + insetFooter + bottom + "px",
  94303. paddingLeft: left + "px"
  94304. };
  94305. }
  94306. },
  94307. render: function render(h) {
  94308. var data = {
  94309. staticClass: 'v-content',
  94310. style: this.styles,
  94311. ref: 'content'
  94312. };
  94313. return h(this.tag, data, [h('div', {
  94314. staticClass: 'v-content__wrap'
  94315. }, this.$slots.default)]);
  94316. }
  94317. }));
  94318. /***/ }),
  94319. /***/ "./src/components/VContent/index.ts":
  94320. /*!******************************************!*\
  94321. !*** ./src/components/VContent/index.ts ***!
  94322. \******************************************/
  94323. /*! exports provided: VContent, default */
  94324. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94325. "use strict";
  94326. __webpack_require__.r(__webpack_exports__);
  94327. /* harmony import */ var _VContent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VContent */ "./src/components/VContent/VContent.ts");
  94328. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VContent", function() { return _VContent__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  94329. /* harmony default export */ __webpack_exports__["default"] = (_VContent__WEBPACK_IMPORTED_MODULE_0__["default"]);
  94330. /***/ }),
  94331. /***/ "./src/components/VCounter/VCounter.sass":
  94332. /*!***********************************************!*\
  94333. !*** ./src/components/VCounter/VCounter.sass ***!
  94334. \***********************************************/
  94335. /*! no static exports found */
  94336. /***/ (function(module, exports, __webpack_require__) {
  94337. // extracted by mini-css-extract-plugin
  94338. /***/ }),
  94339. /***/ "./src/components/VCounter/VCounter.ts":
  94340. /*!*********************************************!*\
  94341. !*** ./src/components/VCounter/VCounter.ts ***!
  94342. \*********************************************/
  94343. /*! exports provided: default */
  94344. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94345. "use strict";
  94346. __webpack_require__.r(__webpack_exports__);
  94347. /* harmony import */ var _VCounter_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCounter.sass */ "./src/components/VCounter/VCounter.sass");
  94348. /* harmony import */ var _VCounter_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VCounter_sass__WEBPACK_IMPORTED_MODULE_0__);
  94349. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  94350. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  94351. var __assign = undefined && undefined.__assign || function () {
  94352. __assign = Object.assign || function (t) {
  94353. for (var s, i = 1, n = arguments.length; i < n; i++) {
  94354. s = arguments[i];
  94355. for (var p in s) {
  94356. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  94357. }
  94358. }
  94359. return t;
  94360. };
  94361. return __assign.apply(this, arguments);
  94362. }; // Styles
  94363. // Mixins
  94364. /* @vue/component */
  94365. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
  94366. name: 'v-counter',
  94367. functional: true,
  94368. props: {
  94369. value: {
  94370. type: [Number, String],
  94371. default: ''
  94372. },
  94373. max: [Number, String]
  94374. },
  94375. render: function render(h, ctx) {
  94376. var props = ctx.props;
  94377. var max = parseInt(props.max, 10);
  94378. var value = parseInt(props.value, 10);
  94379. var content = max ? value + " / " + max : String(props.value);
  94380. var isGreater = max && value > max;
  94381. return h('div', {
  94382. staticClass: 'v-counter',
  94383. class: __assign({
  94384. 'error--text': isGreater
  94385. }, Object(_mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["functionalThemeClasses"])(ctx))
  94386. }, content);
  94387. }
  94388. }));
  94389. /***/ }),
  94390. /***/ "./src/components/VCounter/index.ts":
  94391. /*!******************************************!*\
  94392. !*** ./src/components/VCounter/index.ts ***!
  94393. \******************************************/
  94394. /*! exports provided: VCounter, default */
  94395. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94396. "use strict";
  94397. __webpack_require__.r(__webpack_exports__);
  94398. /* harmony import */ var _VCounter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCounter */ "./src/components/VCounter/VCounter.ts");
  94399. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCounter", function() { return _VCounter__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  94400. /* harmony default export */ __webpack_exports__["default"] = (_VCounter__WEBPACK_IMPORTED_MODULE_0__["default"]);
  94401. /***/ }),
  94402. /***/ "./src/components/VData/VData.ts":
  94403. /*!***************************************!*\
  94404. !*** ./src/components/VData/VData.ts ***!
  94405. \***************************************/
  94406. /*! exports provided: default */
  94407. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94408. "use strict";
  94409. __webpack_require__.r(__webpack_exports__);
  94410. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  94411. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "vue");
  94412. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
  94413. var __assign = undefined && undefined.__assign || function () {
  94414. __assign = Object.assign || function (t) {
  94415. for (var s, i = 1, n = arguments.length; i < n; i++) {
  94416. s = arguments[i];
  94417. for (var p in s) {
  94418. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  94419. }
  94420. }
  94421. return t;
  94422. };
  94423. return __assign.apply(this, arguments);
  94424. };
  94425. var __read = undefined && undefined.__read || function (o, n) {
  94426. var m = typeof Symbol === "function" && o[Symbol.iterator];
  94427. if (!m) return o;
  94428. var i = m.call(o),
  94429. r,
  94430. ar = [],
  94431. e;
  94432. try {
  94433. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  94434. ar.push(r.value);
  94435. }
  94436. } catch (error) {
  94437. e = {
  94438. error: error
  94439. };
  94440. } finally {
  94441. try {
  94442. if (r && !r.done && (m = i["return"])) m.call(i);
  94443. } finally {
  94444. if (e) throw e.error;
  94445. }
  94446. }
  94447. return ar;
  94448. };
  94449. var __spread = undefined && undefined.__spread || function () {
  94450. for (var ar = [], i = 0; i < arguments.length; i++) {
  94451. ar = ar.concat(__read(arguments[i]));
  94452. }
  94453. return ar;
  94454. }; // Helpers
  94455. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_1___default.a.extend({
  94456. name: 'v-data',
  94457. inheritAttrs: false,
  94458. props: {
  94459. items: {
  94460. type: Array,
  94461. default: function _default() {
  94462. return [];
  94463. }
  94464. },
  94465. options: {
  94466. type: Object,
  94467. default: function _default() {
  94468. return {};
  94469. }
  94470. },
  94471. sortBy: {
  94472. type: [String, Array],
  94473. default: function _default() {
  94474. return [];
  94475. }
  94476. },
  94477. sortDesc: {
  94478. type: [Boolean, Array],
  94479. default: function _default() {
  94480. return [];
  94481. }
  94482. },
  94483. customSort: {
  94484. type: Function,
  94485. default: _util_helpers__WEBPACK_IMPORTED_MODULE_0__["sortItems"]
  94486. },
  94487. mustSort: Boolean,
  94488. multiSort: Boolean,
  94489. page: {
  94490. type: Number,
  94491. default: 1
  94492. },
  94493. itemsPerPage: {
  94494. type: Number,
  94495. default: 10
  94496. },
  94497. groupBy: {
  94498. type: [String, Array],
  94499. default: function _default() {
  94500. return [];
  94501. }
  94502. },
  94503. groupDesc: {
  94504. type: [Boolean, Array],
  94505. default: function _default() {
  94506. return [];
  94507. }
  94508. },
  94509. customGroup: {
  94510. type: Function,
  94511. default: _util_helpers__WEBPACK_IMPORTED_MODULE_0__["groupItems"]
  94512. },
  94513. locale: {
  94514. type: String,
  94515. default: 'en-US'
  94516. },
  94517. disableSort: Boolean,
  94518. disablePagination: Boolean,
  94519. disableFiltering: Boolean,
  94520. search: String,
  94521. customFilter: {
  94522. type: Function,
  94523. default: _util_helpers__WEBPACK_IMPORTED_MODULE_0__["searchItems"]
  94524. },
  94525. serverItemsLength: {
  94526. type: Number,
  94527. default: -1
  94528. }
  94529. },
  94530. data: function data() {
  94531. var _a, _b;
  94532. var internalOptions = {
  94533. page: this.page,
  94534. itemsPerPage: this.itemsPerPage,
  94535. sortBy: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["wrapInArray"])(this.sortBy),
  94536. sortDesc: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["wrapInArray"])(this.sortDesc),
  94537. groupBy: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["wrapInArray"])(this.groupBy),
  94538. groupDesc: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["wrapInArray"])(this.groupDesc),
  94539. mustSort: this.mustSort,
  94540. multiSort: this.multiSort
  94541. };
  94542. if (this.options) {
  94543. internalOptions = Object.assign(internalOptions, this.options);
  94544. }
  94545. var sortBy = internalOptions.sortBy,
  94546. sortDesc = internalOptions.sortDesc,
  94547. groupBy = internalOptions.groupBy,
  94548. groupDesc = internalOptions.groupDesc;
  94549. var sortDiff = sortBy.length - sortDesc.length;
  94550. var groupDiff = groupBy.length - groupDesc.length;
  94551. if (sortDiff > 0) {
  94552. (_a = internalOptions.sortDesc).push.apply(_a, __spread(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["fillArray"])(sortDiff, false)));
  94553. }
  94554. if (groupDiff > 0) {
  94555. (_b = internalOptions.groupDesc).push.apply(_b, __spread(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["fillArray"])(groupDiff, false)));
  94556. }
  94557. return {
  94558. internalOptions: internalOptions
  94559. };
  94560. },
  94561. computed: {
  94562. itemsLength: function itemsLength() {
  94563. return this.serverItemsLength >= 0 ? this.serverItemsLength : this.filteredItems.length;
  94564. },
  94565. pageCount: function pageCount() {
  94566. return this.internalOptions.itemsPerPage <= 0 ? 1 : Math.ceil(this.itemsLength / this.internalOptions.itemsPerPage);
  94567. },
  94568. pageStart: function pageStart() {
  94569. if (this.internalOptions.itemsPerPage === -1 || !this.items.length) return 0;
  94570. return (this.internalOptions.page - 1) * this.internalOptions.itemsPerPage;
  94571. },
  94572. pageStop: function pageStop() {
  94573. if (this.internalOptions.itemsPerPage === -1) return this.itemsLength;
  94574. if (!this.items.length) return 0;
  94575. return Math.min(this.itemsLength, this.internalOptions.page * this.internalOptions.itemsPerPage);
  94576. },
  94577. isGrouped: function isGrouped() {
  94578. return !!this.internalOptions.groupBy.length;
  94579. },
  94580. pagination: function pagination() {
  94581. return {
  94582. page: this.internalOptions.page,
  94583. itemsPerPage: this.internalOptions.itemsPerPage,
  94584. pageStart: this.pageStart,
  94585. pageStop: this.pageStop,
  94586. pageCount: this.pageCount,
  94587. itemsLength: this.itemsLength
  94588. };
  94589. },
  94590. filteredItems: function filteredItems() {
  94591. var items = this.items.slice();
  94592. if (!this.disableFiltering && this.serverItemsLength <= 0) {
  94593. items = this.customFilter(items, this.search);
  94594. }
  94595. return items;
  94596. },
  94597. computedItems: function computedItems() {
  94598. var items = this.filteredItems.slice();
  94599. if (!this.disableSort && this.serverItemsLength <= 0) {
  94600. items = this.sortItems(items);
  94601. }
  94602. if (!this.disablePagination && this.serverItemsLength <= 0) {
  94603. items = this.paginateItems(items);
  94604. }
  94605. return items;
  94606. },
  94607. groupedItems: function groupedItems() {
  94608. return this.isGrouped ? this.groupItems(this.computedItems) : null;
  94609. },
  94610. scopedProps: function scopedProps() {
  94611. var props = {
  94612. sort: this.sort,
  94613. sortArray: this.sortArray,
  94614. group: this.group,
  94615. items: this.computedItems,
  94616. options: this.internalOptions,
  94617. updateOptions: this.updateOptions,
  94618. pagination: this.pagination,
  94619. groupedItems: this.groupedItems,
  94620. originalItemsLength: this.items.length
  94621. };
  94622. return props;
  94623. },
  94624. computedOptions: function computedOptions() {
  94625. return __assign({}, this.options);
  94626. }
  94627. },
  94628. watch: {
  94629. computedOptions: {
  94630. handler: function handler(options, old) {
  94631. if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(options, old)) return;
  94632. this.updateOptions(options);
  94633. },
  94634. deep: true,
  94635. immediate: true
  94636. },
  94637. internalOptions: {
  94638. handler: function handler(options, old) {
  94639. if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(options, old)) return;
  94640. this.$emit('update:options', options);
  94641. },
  94642. deep: true,
  94643. immediate: true
  94644. },
  94645. page: function page(_page) {
  94646. this.updateOptions({
  94647. page: _page
  94648. });
  94649. },
  94650. 'internalOptions.page': function internalOptionsPage(page) {
  94651. this.$emit('update:page', page);
  94652. },
  94653. itemsPerPage: function itemsPerPage(_itemsPerPage) {
  94654. this.updateOptions({
  94655. itemsPerPage: _itemsPerPage
  94656. });
  94657. },
  94658. 'internalOptions.itemsPerPage': function internalOptionsItemsPerPage(itemsPerPage) {
  94659. this.$emit('update:items-per-page', itemsPerPage);
  94660. },
  94661. sortBy: function sortBy(_sortBy) {
  94662. this.updateOptions({
  94663. sortBy: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["wrapInArray"])(_sortBy)
  94664. });
  94665. },
  94666. 'internalOptions.sortBy': function internalOptionsSortBy(sortBy, old) {
  94667. !Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(sortBy, old) && this.$emit('update:sort-by', Array.isArray(this.sortBy) ? sortBy : sortBy[0]);
  94668. },
  94669. sortDesc: function sortDesc(_sortDesc) {
  94670. this.updateOptions({
  94671. sortDesc: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["wrapInArray"])(_sortDesc)
  94672. });
  94673. },
  94674. 'internalOptions.sortDesc': function internalOptionsSortDesc(sortDesc, old) {
  94675. !Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(sortDesc, old) && this.$emit('update:sort-desc', Array.isArray(this.sortDesc) ? sortDesc : sortDesc[0]);
  94676. },
  94677. groupBy: function groupBy(_groupBy) {
  94678. this.updateOptions({
  94679. groupBy: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["wrapInArray"])(_groupBy)
  94680. });
  94681. },
  94682. 'internalOptions.groupBy': function internalOptionsGroupBy(groupBy, old) {
  94683. !Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(groupBy, old) && this.$emit('update:group-by', Array.isArray(this.groupBy) ? groupBy : groupBy[0]);
  94684. },
  94685. groupDesc: function groupDesc(_groupDesc) {
  94686. this.updateOptions({
  94687. groupDesc: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["wrapInArray"])(_groupDesc)
  94688. });
  94689. },
  94690. 'internalOptions.groupDesc': function internalOptionsGroupDesc(groupDesc, old) {
  94691. !Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(groupDesc, old) && this.$emit('update:group-desc', Array.isArray(this.groupDesc) ? groupDesc : groupDesc[0]);
  94692. },
  94693. multiSort: function multiSort(_multiSort) {
  94694. this.updateOptions({
  94695. multiSort: _multiSort
  94696. });
  94697. },
  94698. 'internalOptions.multiSort': function internalOptionsMultiSort(multiSort) {
  94699. this.$emit('update:multi-sort', multiSort);
  94700. },
  94701. mustSort: function mustSort(_mustSort) {
  94702. this.updateOptions({
  94703. mustSort: _mustSort
  94704. });
  94705. },
  94706. 'internalOptions.mustSort': function internalOptionsMustSort(mustSort) {
  94707. this.$emit('update:must-sort', mustSort);
  94708. },
  94709. pageCount: {
  94710. handler: function handler(pageCount) {
  94711. this.$emit('page-count', pageCount);
  94712. },
  94713. immediate: true
  94714. },
  94715. computedItems: {
  94716. handler: function handler(computedItems) {
  94717. this.$emit('current-items', computedItems);
  94718. },
  94719. immediate: true
  94720. },
  94721. pagination: {
  94722. handler: function handler(pagination, old) {
  94723. if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(pagination, old)) return;
  94724. this.$emit('pagination', this.pagination);
  94725. },
  94726. immediate: true
  94727. }
  94728. },
  94729. methods: {
  94730. toggle: function toggle(key, oldBy, oldDesc, page, mustSort, multiSort) {
  94731. var by = oldBy.slice();
  94732. var desc = oldDesc.slice();
  94733. var byIndex = by.findIndex(function (k) {
  94734. return k === key;
  94735. });
  94736. if (byIndex < 0) {
  94737. if (!multiSort) {
  94738. by = [];
  94739. desc = [];
  94740. }
  94741. by.push(key);
  94742. desc.push(false);
  94743. } else if (byIndex >= 0 && !desc[byIndex]) {
  94744. desc[byIndex] = true;
  94745. } else if (!mustSort) {
  94746. by.splice(byIndex, 1);
  94747. desc.splice(byIndex, 1);
  94748. } else {
  94749. desc[byIndex] = false;
  94750. } // Reset page to 1 if sortBy or sortDesc have changed
  94751. if (!Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(by, oldBy) || !Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(desc, oldDesc)) {
  94752. page = 1;
  94753. }
  94754. return {
  94755. by: by,
  94756. desc: desc,
  94757. page: page
  94758. };
  94759. },
  94760. group: function group(key) {
  94761. var _a = this.toggle(key, this.internalOptions.groupBy, this.internalOptions.groupDesc, this.internalOptions.page, true, false),
  94762. groupBy = _a.by,
  94763. groupDesc = _a.desc,
  94764. page = _a.page;
  94765. this.updateOptions({
  94766. groupBy: groupBy,
  94767. groupDesc: groupDesc,
  94768. page: page
  94769. });
  94770. },
  94771. sort: function sort(key) {
  94772. if (Array.isArray(key)) return this.sortArray(key);
  94773. var _a = this.toggle(key, this.internalOptions.sortBy, this.internalOptions.sortDesc, this.internalOptions.page, this.internalOptions.mustSort, this.internalOptions.multiSort),
  94774. sortBy = _a.by,
  94775. sortDesc = _a.desc,
  94776. page = _a.page;
  94777. this.updateOptions({
  94778. sortBy: sortBy,
  94779. sortDesc: sortDesc,
  94780. page: page
  94781. });
  94782. },
  94783. sortArray: function sortArray(sortBy) {
  94784. var _this = this;
  94785. var sortDesc = sortBy.map(function (s) {
  94786. var i = _this.internalOptions.sortBy.findIndex(function (k) {
  94787. return k === s;
  94788. });
  94789. return i > -1 ? _this.internalOptions.sortDesc[i] : false;
  94790. });
  94791. this.updateOptions({
  94792. sortBy: sortBy,
  94793. sortDesc: sortDesc
  94794. });
  94795. },
  94796. updateOptions: function updateOptions(options) {
  94797. this.internalOptions = __assign({}, this.internalOptions, options, {
  94798. page: this.serverItemsLength < 0 ? Math.max(1, Math.min(options.page || this.internalOptions.page, this.pageCount)) : options.page || this.internalOptions.page
  94799. });
  94800. },
  94801. sortItems: function sortItems(items) {
  94802. var sortBy = this.internalOptions.sortBy;
  94803. var sortDesc = this.internalOptions.sortDesc;
  94804. if (this.internalOptions.groupBy.length) {
  94805. sortBy = __spread(this.internalOptions.groupBy, sortBy);
  94806. sortDesc = __spread(this.internalOptions.groupDesc, sortDesc);
  94807. }
  94808. return this.customSort(items, sortBy, sortDesc, this.locale);
  94809. },
  94810. groupItems: function groupItems(items) {
  94811. return this.customGroup(items, this.internalOptions.groupBy, this.internalOptions.groupDesc);
  94812. },
  94813. paginateItems: function paginateItems(items) {
  94814. // Make sure we don't try to display non-existant page if items suddenly change
  94815. // TODO: Could possibly move this to pageStart/pageStop?
  94816. if (this.serverItemsLength === -1 && items.length <= this.pageStart) {
  94817. this.internalOptions.page = Math.max(1, this.internalOptions.page - 1);
  94818. }
  94819. return items.slice(this.pageStart, this.pageStop);
  94820. }
  94821. },
  94822. render: function render() {
  94823. return this.$scopedSlots.default && this.$scopedSlots.default(this.scopedProps);
  94824. }
  94825. }));
  94826. /***/ }),
  94827. /***/ "./src/components/VData/index.ts":
  94828. /*!***************************************!*\
  94829. !*** ./src/components/VData/index.ts ***!
  94830. \***************************************/
  94831. /*! exports provided: VData, default */
  94832. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94833. "use strict";
  94834. __webpack_require__.r(__webpack_exports__);
  94835. /* harmony import */ var _VData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VData */ "./src/components/VData/VData.ts");
  94836. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VData", function() { return _VData__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  94837. /* harmony default export */ __webpack_exports__["default"] = (_VData__WEBPACK_IMPORTED_MODULE_0__["default"]);
  94838. /***/ }),
  94839. /***/ "./src/components/VDataIterator/VDataFooter.sass":
  94840. /*!*******************************************************!*\
  94841. !*** ./src/components/VDataIterator/VDataFooter.sass ***!
  94842. \*******************************************************/
  94843. /*! no static exports found */
  94844. /***/ (function(module, exports, __webpack_require__) {
  94845. // extracted by mini-css-extract-plugin
  94846. /***/ }),
  94847. /***/ "./src/components/VDataIterator/VDataFooter.ts":
  94848. /*!*****************************************************!*\
  94849. !*** ./src/components/VDataIterator/VDataFooter.ts ***!
  94850. \*****************************************************/
  94851. /*! exports provided: default */
  94852. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94853. "use strict";
  94854. __webpack_require__.r(__webpack_exports__);
  94855. /* harmony import */ var _VDataFooter_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDataFooter.sass */ "./src/components/VDataIterator/VDataFooter.sass");
  94856. /* harmony import */ var _VDataFooter_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VDataFooter_sass__WEBPACK_IMPORTED_MODULE_0__);
  94857. /* harmony import */ var _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSelect/VSelect */ "./src/components/VSelect/VSelect.ts");
  94858. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  94859. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  94860. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue */ "vue");
  94861. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_4__);
  94862. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  94863. // Components
  94864. // Types
  94865. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_4___default.a.extend({
  94866. name: 'v-data-footer',
  94867. props: {
  94868. options: {
  94869. type: Object,
  94870. required: true
  94871. },
  94872. pagination: {
  94873. type: Object,
  94874. required: true
  94875. },
  94876. itemsPerPageOptions: {
  94877. type: Array,
  94878. default: function _default() {
  94879. return [5, 10, 15, -1];
  94880. }
  94881. },
  94882. prevIcon: {
  94883. type: String,
  94884. default: '$prev'
  94885. },
  94886. nextIcon: {
  94887. type: String,
  94888. default: '$next'
  94889. },
  94890. firstIcon: {
  94891. type: String,
  94892. default: '$first'
  94893. },
  94894. lastIcon: {
  94895. type: String,
  94896. default: '$last'
  94897. },
  94898. itemsPerPageText: {
  94899. type: String,
  94900. default: '$vuetify.dataFooter.itemsPerPageText'
  94901. },
  94902. itemsPerPageAllText: {
  94903. type: String,
  94904. default: '$vuetify.dataFooter.itemsPerPageAll'
  94905. },
  94906. showFirstLastPage: Boolean,
  94907. showCurrentPage: Boolean,
  94908. disablePagination: Boolean,
  94909. disableItemsPerPage: Boolean,
  94910. pageText: {
  94911. type: String,
  94912. default: '$vuetify.dataFooter.pageText'
  94913. }
  94914. },
  94915. computed: {
  94916. disableNextPageIcon: function disableNextPageIcon() {
  94917. return this.options.itemsPerPage <= 0 || this.options.page * this.options.itemsPerPage >= this.pagination.itemsLength || this.pagination.pageStop < 0;
  94918. },
  94919. computedDataItemsPerPageOptions: function computedDataItemsPerPageOptions() {
  94920. var _this = this;
  94921. return this.itemsPerPageOptions.map(function (option) {
  94922. if (_typeof(option) === 'object') return option;else return _this.genDataItemsPerPageOption(option);
  94923. });
  94924. }
  94925. },
  94926. methods: {
  94927. updateOptions: function updateOptions(obj) {
  94928. this.$emit('update:options', Object.assign({}, this.options, obj));
  94929. },
  94930. onFirstPage: function onFirstPage() {
  94931. this.updateOptions({
  94932. page: 1
  94933. });
  94934. },
  94935. onPreviousPage: function onPreviousPage() {
  94936. this.updateOptions({
  94937. page: this.options.page - 1
  94938. });
  94939. },
  94940. onNextPage: function onNextPage() {
  94941. this.updateOptions({
  94942. page: this.options.page + 1
  94943. });
  94944. },
  94945. onLastPage: function onLastPage() {
  94946. this.updateOptions({
  94947. page: this.pagination.pageCount
  94948. });
  94949. },
  94950. onChangeItemsPerPage: function onChangeItemsPerPage(itemsPerPage) {
  94951. this.updateOptions({
  94952. itemsPerPage: itemsPerPage,
  94953. page: 1
  94954. });
  94955. },
  94956. genDataItemsPerPageOption: function genDataItemsPerPageOption(option) {
  94957. return {
  94958. text: option === -1 ? this.$vuetify.lang.t(this.itemsPerPageAllText) : String(option),
  94959. value: option
  94960. };
  94961. },
  94962. genItemsPerPageSelect: function genItemsPerPageSelect() {
  94963. var value = this.options.itemsPerPage;
  94964. var computedIPPO = this.computedDataItemsPerPageOptions;
  94965. if (computedIPPO.length <= 1) return null;
  94966. if (!computedIPPO.find(function (ippo) {
  94967. return ippo.value === value;
  94968. })) value = computedIPPO[0];
  94969. return this.$createElement('div', {
  94970. staticClass: 'v-data-footer__select'
  94971. }, [this.$vuetify.lang.t(this.itemsPerPageText), this.$createElement(_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"], {
  94972. attrs: {
  94973. 'aria-label': this.itemsPerPageText
  94974. },
  94975. props: {
  94976. disabled: this.disableItemsPerPage,
  94977. items: computedIPPO,
  94978. value: value,
  94979. hideDetails: true,
  94980. auto: true,
  94981. minWidth: '75px'
  94982. },
  94983. on: {
  94984. input: this.onChangeItemsPerPage
  94985. }
  94986. })]);
  94987. },
  94988. genPaginationInfo: function genPaginationInfo() {
  94989. var children = ['–'];
  94990. if (this.pagination.itemsLength && this.pagination.itemsPerPage) {
  94991. var itemsLength = this.pagination.itemsLength;
  94992. var pageStart = this.pagination.pageStart + 1;
  94993. var pageStop = itemsLength < this.pagination.pageStop || this.pagination.pageStop < 0 ? itemsLength : this.pagination.pageStop;
  94994. children = this.$scopedSlots['page-text'] ? [this.$scopedSlots['page-text']({
  94995. pageStart: pageStart,
  94996. pageStop: pageStop,
  94997. itemsLength: itemsLength
  94998. })] : [this.$vuetify.lang.t(this.pageText, pageStart, pageStop, itemsLength)];
  94999. }
  95000. return this.$createElement('div', {
  95001. class: 'v-data-footer__pagination'
  95002. }, children);
  95003. },
  95004. genIcon: function genIcon(click, disabled, label, icon) {
  95005. return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_3__["default"], {
  95006. props: {
  95007. disabled: disabled || this.disablePagination,
  95008. icon: true,
  95009. text: true
  95010. },
  95011. on: {
  95012. click: click
  95013. },
  95014. attrs: {
  95015. 'aria-label': label
  95016. }
  95017. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], icon)]);
  95018. },
  95019. genIcons: function genIcons() {
  95020. var before = [];
  95021. var after = [];
  95022. before.push(this.genIcon(this.onPreviousPage, this.options.page === 1, this.$vuetify.lang.t('$vuetify.dataFooter.prevPage'), this.$vuetify.rtl ? this.nextIcon : this.prevIcon));
  95023. after.push(this.genIcon(this.onNextPage, this.disableNextPageIcon, this.$vuetify.lang.t('$vuetify.dataFooter.nextPage'), this.$vuetify.rtl ? this.prevIcon : this.nextIcon));
  95024. if (this.showFirstLastPage) {
  95025. before.unshift(this.genIcon(this.onFirstPage, this.options.page === 1, this.$vuetify.lang.t('$vuetify.dataFooter.firstPage'), this.$vuetify.rtl ? this.lastIcon : this.firstIcon));
  95026. after.push(this.genIcon(this.onLastPage, this.options.page >= this.pagination.pageCount || this.options.itemsPerPage === -1, this.$vuetify.lang.t('$vuetify.dataFooter.lastPage'), this.$vuetify.rtl ? this.firstIcon : this.lastIcon));
  95027. }
  95028. return [this.$createElement('div', {
  95029. staticClass: 'v-data-footer__icons-before'
  95030. }, before), this.showCurrentPage && this.$createElement('span', [this.options.page.toString()]), this.$createElement('div', {
  95031. staticClass: 'v-data-footer__icons-after'
  95032. }, after)];
  95033. }
  95034. },
  95035. render: function render() {
  95036. return this.$createElement('div', {
  95037. staticClass: 'v-data-footer'
  95038. }, [this.genItemsPerPageSelect(), this.genPaginationInfo(), this.genIcons()]);
  95039. }
  95040. }));
  95041. /***/ }),
  95042. /***/ "./src/components/VDataIterator/VDataIterator.ts":
  95043. /*!*******************************************************!*\
  95044. !*** ./src/components/VDataIterator/VDataIterator.ts ***!
  95045. \*******************************************************/
  95046. /*! exports provided: default */
  95047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95048. "use strict";
  95049. __webpack_require__.r(__webpack_exports__);
  95050. /* harmony import */ var _VData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VData */ "./src/components/VData/index.ts");
  95051. /* harmony import */ var _VDataFooter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VDataFooter */ "./src/components/VDataIterator/VDataFooter.ts");
  95052. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  95053. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  95054. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  95055. var __assign = undefined && undefined.__assign || function () {
  95056. __assign = Object.assign || function (t) {
  95057. for (var s, i = 1, n = arguments.length; i < n; i++) {
  95058. s = arguments[i];
  95059. for (var p in s) {
  95060. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  95061. }
  95062. }
  95063. return t;
  95064. };
  95065. return __assign.apply(this, arguments);
  95066. };
  95067. var __read = undefined && undefined.__read || function (o, n) {
  95068. var m = typeof Symbol === "function" && o[Symbol.iterator];
  95069. if (!m) return o;
  95070. var i = m.call(o),
  95071. r,
  95072. ar = [],
  95073. e;
  95074. try {
  95075. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  95076. ar.push(r.value);
  95077. }
  95078. } catch (error) {
  95079. e = {
  95080. error: error
  95081. };
  95082. } finally {
  95083. try {
  95084. if (r && !r.done && (m = i["return"])) m.call(i);
  95085. } finally {
  95086. if (e) throw e.error;
  95087. }
  95088. }
  95089. return ar;
  95090. }; // Components
  95091. // Mixins
  95092. // Helpers
  95093. /* @vue/component */
  95094. /* harmony default export */ __webpack_exports__["default"] = (_mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"].extend({
  95095. name: 'v-data-iterator',
  95096. props: __assign({}, _VData__WEBPACK_IMPORTED_MODULE_0__["VData"].options.props, {
  95097. itemKey: {
  95098. type: String,
  95099. default: 'id'
  95100. },
  95101. value: {
  95102. type: Array,
  95103. default: function _default() {
  95104. return [];
  95105. }
  95106. },
  95107. singleSelect: Boolean,
  95108. expanded: {
  95109. type: Array,
  95110. default: function _default() {
  95111. return [];
  95112. }
  95113. },
  95114. mobileBreakpoint: {
  95115. type: [Number, String],
  95116. default: 600
  95117. },
  95118. singleExpand: Boolean,
  95119. loading: [Boolean, String],
  95120. noResultsText: {
  95121. type: String,
  95122. default: '$vuetify.dataIterator.noResultsText'
  95123. },
  95124. noDataText: {
  95125. type: String,
  95126. default: '$vuetify.noDataText'
  95127. },
  95128. loadingText: {
  95129. type: String,
  95130. default: '$vuetify.dataIterator.loadingText'
  95131. },
  95132. hideDefaultFooter: Boolean,
  95133. footerProps: Object,
  95134. selectableKey: {
  95135. type: String,
  95136. default: 'isSelectable'
  95137. }
  95138. }),
  95139. data: function data() {
  95140. return {
  95141. selection: {},
  95142. expansion: {},
  95143. internalCurrentItems: []
  95144. };
  95145. },
  95146. computed: {
  95147. everyItem: function everyItem() {
  95148. var _this = this;
  95149. return !!this.selectableItems.length && this.selectableItems.every(function (i) {
  95150. return _this.isSelected(i);
  95151. });
  95152. },
  95153. someItems: function someItems() {
  95154. var _this = this;
  95155. return this.selectableItems.some(function (i) {
  95156. return _this.isSelected(i);
  95157. });
  95158. },
  95159. sanitizedFooterProps: function sanitizedFooterProps() {
  95160. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["camelizeObjectKeys"])(this.footerProps);
  95161. },
  95162. selectableItems: function selectableItems() {
  95163. var _this = this;
  95164. return this.internalCurrentItems.filter(function (item) {
  95165. return _this.isSelectable(item);
  95166. });
  95167. },
  95168. isMobile: function isMobile() {
  95169. // Guard against SSR render
  95170. // https://github.com/vuetifyjs/vuetify/issues/7410
  95171. if (this.$vuetify.breakpoint.width === 0) return false;
  95172. return this.$vuetify.breakpoint.width < parseInt(this.mobileBreakpoint, 10);
  95173. }
  95174. },
  95175. watch: {
  95176. value: {
  95177. handler: function handler(value) {
  95178. var _this = this;
  95179. this.selection = value.reduce(function (selection, item) {
  95180. selection[Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(item, _this.itemKey)] = item;
  95181. return selection;
  95182. }, {});
  95183. },
  95184. immediate: true
  95185. },
  95186. selection: function selection(value, old) {
  95187. if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["deepEqual"])(Object.keys(value), Object.keys(old))) return;
  95188. this.$emit('input', Object.values(value));
  95189. },
  95190. expanded: {
  95191. handler: function handler(value) {
  95192. var _this = this;
  95193. this.expansion = value.reduce(function (expansion, item) {
  95194. expansion[Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(item, _this.itemKey)] = true;
  95195. return expansion;
  95196. }, {});
  95197. },
  95198. immediate: true
  95199. },
  95200. expansion: function expansion(value, old) {
  95201. var _this = this;
  95202. if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["deepEqual"])(value, old)) return;
  95203. var keys = Object.keys(value).filter(function (k) {
  95204. return value[k];
  95205. });
  95206. var expanded = !keys.length ? [] : this.items.filter(function (i) {
  95207. return keys.includes(String(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(i, _this.itemKey)));
  95208. });
  95209. this.$emit('update:expanded', expanded);
  95210. }
  95211. },
  95212. created: function created() {
  95213. var _this = this;
  95214. var breakingProps = [['disable-initial-sort', 'sort-by'], ['filter', 'custom-filter'], ['pagination', 'options'], ['total-items', 'server-items-length'], ['hide-actions', 'hide-default-footer'], ['rows-per-page-items', 'footer-props.items-per-page-options'], ['rows-per-page-text', 'footer-props.items-per-page-text'], ['prev-icon', 'footer-props.prev-icon'], ['next-icon', 'footer-props.next-icon']];
  95215. /* istanbul ignore next */
  95216. breakingProps.forEach(function (_a) {
  95217. var _b = __read(_a, 2),
  95218. original = _b[0],
  95219. replacement = _b[1];
  95220. if (_this.$attrs.hasOwnProperty(original)) Object(_util_console__WEBPACK_IMPORTED_MODULE_4__["breaking"])(original, replacement, _this);
  95221. });
  95222. var removedProps = ['expand', 'content-class', 'content-props', 'content-tag'];
  95223. /* istanbul ignore next */
  95224. removedProps.forEach(function (prop) {
  95225. if (_this.$attrs.hasOwnProperty(prop)) Object(_util_console__WEBPACK_IMPORTED_MODULE_4__["removed"])(prop);
  95226. });
  95227. },
  95228. methods: {
  95229. toggleSelectAll: function toggleSelectAll(value) {
  95230. var selection = Object.assign({}, this.selection);
  95231. for (var i = 0; i < this.selectableItems.length; i++) {
  95232. var item = this.selectableItems[i];
  95233. if (!this.isSelectable(item)) continue;
  95234. var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(item, this.itemKey);
  95235. if (value) selection[key] = item;else delete selection[key];
  95236. }
  95237. this.selection = selection;
  95238. this.$emit('toggle-select-all', {
  95239. items: this.internalCurrentItems,
  95240. value: value
  95241. });
  95242. },
  95243. isSelectable: function isSelectable(item) {
  95244. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(item, this.selectableKey) !== false;
  95245. },
  95246. isSelected: function isSelected(item) {
  95247. return !!this.selection[Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(item, this.itemKey)] || false;
  95248. },
  95249. select: function select(item, value, emit) {
  95250. if (value === void 0) {
  95251. value = true;
  95252. }
  95253. if (emit === void 0) {
  95254. emit = true;
  95255. }
  95256. if (!this.isSelectable(item)) return;
  95257. var selection = this.singleSelect ? {} : Object.assign({}, this.selection);
  95258. var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(item, this.itemKey);
  95259. if (value) selection[key] = item;else delete selection[key];
  95260. if (this.singleSelect && emit) {
  95261. var keys = Object.keys(this.selection);
  95262. var old = keys.length && Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(this.selection[keys[0]], this.itemKey);
  95263. old && old !== key && this.$emit('item-selected', {
  95264. item: this.selection[old],
  95265. value: false
  95266. });
  95267. }
  95268. this.selection = selection;
  95269. emit && this.$emit('item-selected', {
  95270. item: item,
  95271. value: value
  95272. });
  95273. },
  95274. isExpanded: function isExpanded(item) {
  95275. return this.expansion[Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(item, this.itemKey)] || false;
  95276. },
  95277. expand: function expand(item, value) {
  95278. if (value === void 0) {
  95279. value = true;
  95280. }
  95281. var expansion = this.singleExpand ? {} : Object.assign({}, this.expansion);
  95282. var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(item, this.itemKey);
  95283. if (value) expansion[key] = true;else delete expansion[key];
  95284. this.expansion = expansion;
  95285. this.$emit('item-expanded', {
  95286. item: item,
  95287. value: value
  95288. });
  95289. },
  95290. createItemProps: function createItemProps(item) {
  95291. var _this = this;
  95292. return {
  95293. item: item,
  95294. select: function select(v) {
  95295. return _this.select(item, v);
  95296. },
  95297. isSelected: this.isSelected(item),
  95298. expand: function expand(v) {
  95299. return _this.expand(item, v);
  95300. },
  95301. isExpanded: this.isExpanded(item),
  95302. isMobile: this.isMobile
  95303. };
  95304. },
  95305. genEmptyWrapper: function genEmptyWrapper(content) {
  95306. return this.$createElement('div', content);
  95307. },
  95308. genEmpty: function genEmpty(originalItemsLength, filteredItemsLength) {
  95309. if (originalItemsLength === 0 && this.loading) {
  95310. var loading = this.$slots['loading'] || this.$vuetify.lang.t(this.loadingText);
  95311. return this.genEmptyWrapper(loading);
  95312. } else if (originalItemsLength === 0) {
  95313. var noData = this.$slots['no-data'] || this.$vuetify.lang.t(this.noDataText);
  95314. return this.genEmptyWrapper(noData);
  95315. } else if (filteredItemsLength === 0) {
  95316. var noResults = this.$slots['no-results'] || this.$vuetify.lang.t(this.noResultsText);
  95317. return this.genEmptyWrapper(noResults);
  95318. }
  95319. return null;
  95320. },
  95321. genItems: function genItems(props) {
  95322. var _this = this;
  95323. var empty = this.genEmpty(props.originalItemsLength, props.pagination.itemsLength);
  95324. if (empty) return [empty];
  95325. if (this.$scopedSlots.default) {
  95326. return this.$scopedSlots.default(__assign({}, props, {
  95327. isSelected: this.isSelected,
  95328. select: this.select,
  95329. isExpanded: this.isExpanded,
  95330. expand: this.expand
  95331. }));
  95332. }
  95333. if (this.$scopedSlots.item) {
  95334. return props.items.map(function (item) {
  95335. return _this.$scopedSlots.item(_this.createItemProps(item));
  95336. });
  95337. }
  95338. return [];
  95339. },
  95340. genFooter: function genFooter(props) {
  95341. if (this.hideDefaultFooter) return null;
  95342. var data = {
  95343. props: __assign({}, this.sanitizedFooterProps, {
  95344. options: props.options,
  95345. pagination: props.pagination
  95346. }),
  95347. on: {
  95348. 'update:options': function updateOptions(value) {
  95349. return props.updateOptions(value);
  95350. }
  95351. }
  95352. };
  95353. var scopedSlots = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getPrefixedScopedSlots"])('footer.', this.$scopedSlots);
  95354. return this.$createElement(_VDataFooter__WEBPACK_IMPORTED_MODULE_1__["default"], __assign({
  95355. scopedSlots: scopedSlots
  95356. }, data));
  95357. },
  95358. genDefaultScopedSlot: function genDefaultScopedSlot(props) {
  95359. var outerProps = __assign({}, props, {
  95360. someItems: this.someItems,
  95361. everyItem: this.everyItem,
  95362. toggleSelectAll: this.toggleSelectAll
  95363. });
  95364. return this.$createElement('div', {
  95365. staticClass: 'v-data-iterator'
  95366. }, [Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this, 'header', outerProps, true), this.genItems(props), this.genFooter(props), Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this, 'footer', outerProps, true)]);
  95367. }
  95368. },
  95369. render: function render() {
  95370. var _this = this;
  95371. return this.$createElement(_VData__WEBPACK_IMPORTED_MODULE_0__["VData"], {
  95372. props: this.$props,
  95373. on: {
  95374. 'update:options': function updateOptions(v, old) {
  95375. return !Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["deepEqual"])(v, old) && _this.$emit('update:options', v);
  95376. },
  95377. 'update:page': function updatePage(v) {
  95378. return _this.$emit('update:page', v);
  95379. },
  95380. 'update:items-per-page': function updateItemsPerPage(v) {
  95381. return _this.$emit('update:items-per-page', v);
  95382. },
  95383. 'update:sort-by': function updateSortBy(v) {
  95384. return _this.$emit('update:sort-by', v);
  95385. },
  95386. 'update:sort-desc': function updateSortDesc(v) {
  95387. return _this.$emit('update:sort-desc', v);
  95388. },
  95389. 'update:group-by': function updateGroupBy(v) {
  95390. return _this.$emit('update:group-by', v);
  95391. },
  95392. 'update:group-desc': function updateGroupDesc(v) {
  95393. return _this.$emit('update:group-desc', v);
  95394. },
  95395. pagination: function pagination(v, old) {
  95396. return !Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["deepEqual"])(v, old) && _this.$emit('pagination', v);
  95397. },
  95398. 'current-items': function currentItems(v) {
  95399. _this.internalCurrentItems = v;
  95400. _this.$emit('current-items', v);
  95401. },
  95402. 'page-count': function pageCount(v) {
  95403. return _this.$emit('page-count', v);
  95404. }
  95405. },
  95406. scopedSlots: {
  95407. default: this.genDefaultScopedSlot
  95408. }
  95409. });
  95410. }
  95411. }));
  95412. /***/ }),
  95413. /***/ "./src/components/VDataIterator/index.ts":
  95414. /*!***********************************************!*\
  95415. !*** ./src/components/VDataIterator/index.ts ***!
  95416. \***********************************************/
  95417. /*! exports provided: VDataIterator, VDataFooter, default */
  95418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95419. "use strict";
  95420. __webpack_require__.r(__webpack_exports__);
  95421. /* harmony import */ var _VDataIterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDataIterator */ "./src/components/VDataIterator/VDataIterator.ts");
  95422. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataIterator", function() { return _VDataIterator__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  95423. /* harmony import */ var _VDataFooter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VDataFooter */ "./src/components/VDataIterator/VDataFooter.ts");
  95424. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataFooter", function() { return _VDataFooter__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  95425. /* harmony default export */ __webpack_exports__["default"] = ({
  95426. $_vuetify_subcomponents: {
  95427. VDataIterator: _VDataIterator__WEBPACK_IMPORTED_MODULE_0__["default"],
  95428. VDataFooter: _VDataFooter__WEBPACK_IMPORTED_MODULE_1__["default"]
  95429. }
  95430. });
  95431. /***/ }),
  95432. /***/ "./src/components/VDataTable/MobileRow.ts":
  95433. /*!************************************************!*\
  95434. !*** ./src/components/VDataTable/MobileRow.ts ***!
  95435. \************************************************/
  95436. /*! exports provided: default */
  95437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95438. "use strict";
  95439. __webpack_require__.r(__webpack_exports__);
  95440. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  95441. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  95442. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  95443. var __assign = undefined && undefined.__assign || function () {
  95444. __assign = Object.assign || function (t) {
  95445. for (var s, i = 1, n = arguments.length; i < n; i++) {
  95446. s = arguments[i];
  95447. for (var p in s) {
  95448. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  95449. }
  95450. }
  95451. return t;
  95452. };
  95453. return __assign.apply(this, arguments);
  95454. };
  95455. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  95456. name: 'row',
  95457. functional: true,
  95458. props: {
  95459. headers: Array,
  95460. item: Object,
  95461. rtl: Boolean
  95462. },
  95463. render: function render(h, _a) {
  95464. var props = _a.props,
  95465. slots = _a.slots,
  95466. data = _a.data;
  95467. var computedSlots = slots();
  95468. var columns = props.headers.map(function (header) {
  95469. var classes = {
  95470. 'v-data-table__mobile-row': true
  95471. };
  95472. var children = [];
  95473. var value = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["getObjectValueByPath"])(props.item, header.value);
  95474. var slotName = header.value;
  95475. var scopedSlot = data.scopedSlots && data.scopedSlots[slotName];
  95476. var regularSlot = computedSlots[slotName];
  95477. if (scopedSlot) {
  95478. children.push(scopedSlot({
  95479. item: props.item,
  95480. header: header,
  95481. value: value
  95482. }));
  95483. } else if (regularSlot) {
  95484. children.push(regularSlot);
  95485. } else {
  95486. children.push(value == null ? value : String(value));
  95487. }
  95488. var mobileRowChildren = [h('div', {
  95489. staticClass: 'v-data-table__mobile-row__cell'
  95490. }, children)];
  95491. if (header.value !== 'dataTableSelect') {
  95492. mobileRowChildren.unshift(h('div', {
  95493. staticClass: 'v-data-table__mobile-row__header'
  95494. }, [header.text]));
  95495. }
  95496. return h('td', {
  95497. class: classes
  95498. }, mobileRowChildren);
  95499. });
  95500. return h('tr', __assign({}, data, {
  95501. staticClass: 'v-data-table__mobile-table-row'
  95502. }), columns);
  95503. }
  95504. }));
  95505. /***/ }),
  95506. /***/ "./src/components/VDataTable/Row.ts":
  95507. /*!******************************************!*\
  95508. !*** ./src/components/VDataTable/Row.ts ***!
  95509. \******************************************/
  95510. /*! exports provided: default */
  95511. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95512. "use strict";
  95513. __webpack_require__.r(__webpack_exports__);
  95514. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  95515. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  95516. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  95517. // Types
  95518. // Utils
  95519. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  95520. name: 'row',
  95521. functional: true,
  95522. props: {
  95523. headers: Array,
  95524. item: Object,
  95525. rtl: Boolean
  95526. },
  95527. render: function render(h, _a) {
  95528. var props = _a.props,
  95529. slots = _a.slots,
  95530. data = _a.data;
  95531. var computedSlots = slots();
  95532. var columns = props.headers.map(function (header) {
  95533. var _a;
  95534. var children = [];
  95535. var value = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["getObjectValueByPath"])(props.item, header.value);
  95536. var slotName = header.value;
  95537. var scopedSlot = data.scopedSlots && data.scopedSlots[slotName];
  95538. var regularSlot = computedSlots[slotName];
  95539. if (scopedSlot) {
  95540. children.push(scopedSlot({
  95541. item: props.item,
  95542. header: header,
  95543. value: value
  95544. }));
  95545. } else if (regularSlot) {
  95546. children.push(regularSlot);
  95547. } else {
  95548. children.push(value == null ? value : String(value));
  95549. }
  95550. var textAlign = "text-" + (header.align || 'start');
  95551. return h('td', {
  95552. class: (_a = {}, _a[textAlign] = true, _a['v-data-table__divider'] = header.divider, _a)
  95553. }, children);
  95554. });
  95555. return h('tr', data, columns);
  95556. }
  95557. }));
  95558. /***/ }),
  95559. /***/ "./src/components/VDataTable/RowGroup.ts":
  95560. /*!***********************************************!*\
  95561. !*** ./src/components/VDataTable/RowGroup.ts ***!
  95562. \***********************************************/
  95563. /*! exports provided: default */
  95564. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95565. "use strict";
  95566. __webpack_require__.r(__webpack_exports__);
  95567. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  95568. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  95569. var __read = undefined && undefined.__read || function (o, n) {
  95570. var m = typeof Symbol === "function" && o[Symbol.iterator];
  95571. if (!m) return o;
  95572. var i = m.call(o),
  95573. r,
  95574. ar = [],
  95575. e;
  95576. try {
  95577. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  95578. ar.push(r.value);
  95579. }
  95580. } catch (error) {
  95581. e = {
  95582. error: error
  95583. };
  95584. } finally {
  95585. try {
  95586. if (r && !r.done && (m = i["return"])) m.call(i);
  95587. } finally {
  95588. if (e) throw e.error;
  95589. }
  95590. }
  95591. return ar;
  95592. };
  95593. var __spread = undefined && undefined.__spread || function () {
  95594. for (var ar = [], i = 0; i < arguments.length; i++) {
  95595. ar = ar.concat(__read(arguments[i]));
  95596. }
  95597. return ar;
  95598. };
  95599. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  95600. name: 'row-group',
  95601. functional: true,
  95602. props: {
  95603. value: {
  95604. type: Boolean,
  95605. default: true
  95606. },
  95607. headerClass: {
  95608. type: String,
  95609. default: 'v-row-group__header'
  95610. },
  95611. contentClass: String,
  95612. summaryClass: {
  95613. type: String,
  95614. default: 'v-row-group__summary'
  95615. }
  95616. },
  95617. render: function render(h, _a) {
  95618. var slots = _a.slots,
  95619. props = _a.props;
  95620. var computedSlots = slots();
  95621. var children = [];
  95622. if (computedSlots['column.header']) {
  95623. children.push(h('tr', {
  95624. staticClass: props.headerClass
  95625. }, computedSlots['column.header']));
  95626. } else if (computedSlots['row.header']) {
  95627. children.push.apply(children, __spread(computedSlots['row.header']));
  95628. }
  95629. if (computedSlots['row.content'] && props.value) children.push.apply(children, __spread(computedSlots['row.content']));
  95630. if (computedSlots['column.summary']) {
  95631. children.push(h('tr', {
  95632. staticClass: props.summaryClass
  95633. }, computedSlots['column.summary']));
  95634. } else if (computedSlots['row.summary']) {
  95635. children.push.apply(children, __spread(computedSlots['row.summary']));
  95636. }
  95637. return children;
  95638. }
  95639. }));
  95640. /***/ }),
  95641. /***/ "./src/components/VDataTable/VDataTable.sass":
  95642. /*!***************************************************!*\
  95643. !*** ./src/components/VDataTable/VDataTable.sass ***!
  95644. \***************************************************/
  95645. /*! no static exports found */
  95646. /***/ (function(module, exports, __webpack_require__) {
  95647. // extracted by mini-css-extract-plugin
  95648. /***/ }),
  95649. /***/ "./src/components/VDataTable/VDataTable.ts":
  95650. /*!*************************************************!*\
  95651. !*** ./src/components/VDataTable/VDataTable.ts ***!
  95652. \*************************************************/
  95653. /*! exports provided: default */
  95654. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95655. "use strict";
  95656. __webpack_require__.r(__webpack_exports__);
  95657. /* harmony import */ var _VDataTable_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDataTable.sass */ "./src/components/VDataTable/VDataTable.sass");
  95658. /* harmony import */ var _VDataTable_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VDataTable_sass__WEBPACK_IMPORTED_MODULE_0__);
  95659. /* harmony import */ var _VData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VData */ "./src/components/VData/index.ts");
  95660. /* harmony import */ var _VDataIterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VDataIterator */ "./src/components/VDataIterator/index.ts");
  95661. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  95662. /* harmony import */ var _VDataTableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VDataTableHeader */ "./src/components/VDataTable/VDataTableHeader.ts");
  95663. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  95664. /* harmony import */ var _VProgressLinear__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../VProgressLinear */ "./src/components/VProgressLinear/index.ts");
  95665. /* harmony import */ var _Row__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Row */ "./src/components/VDataTable/Row.ts");
  95666. /* harmony import */ var _RowGroup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./RowGroup */ "./src/components/VDataTable/RowGroup.ts");
  95667. /* harmony import */ var _VCheckbox_VSimpleCheckbox__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../VCheckbox/VSimpleCheckbox */ "./src/components/VCheckbox/VSimpleCheckbox.ts");
  95668. /* harmony import */ var _VSimpleTable__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./VSimpleTable */ "./src/components/VDataTable/VSimpleTable.ts");
  95669. /* harmony import */ var _MobileRow__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./MobileRow */ "./src/components/VDataTable/MobileRow.ts");
  95670. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  95671. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  95672. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  95673. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  95674. var __assign = undefined && undefined.__assign || function () {
  95675. __assign = Object.assign || function (t) {
  95676. for (var s, i = 1, n = arguments.length; i < n; i++) {
  95677. s = arguments[i];
  95678. for (var p in s) {
  95679. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  95680. }
  95681. }
  95682. return t;
  95683. };
  95684. return __assign.apply(this, arguments);
  95685. };
  95686. var __read = undefined && undefined.__read || function (o, n) {
  95687. var m = typeof Symbol === "function" && o[Symbol.iterator];
  95688. if (!m) return o;
  95689. var i = m.call(o),
  95690. r,
  95691. ar = [],
  95692. e;
  95693. try {
  95694. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  95695. ar.push(r.value);
  95696. }
  95697. } catch (error) {
  95698. e = {
  95699. error: error
  95700. };
  95701. } finally {
  95702. try {
  95703. if (r && !r.done && (m = i["return"])) m.call(i);
  95704. } finally {
  95705. if (e) throw e.error;
  95706. }
  95707. }
  95708. return ar;
  95709. };
  95710. // Components
  95711. // import VVirtualTable from './VVirtualTable'
  95712. // Directives
  95713. // Helpers
  95714. function filterFn(item, search, filter) {
  95715. return function (header) {
  95716. var value = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getObjectValueByPath"])(item, header.value);
  95717. return header.filter ? header.filter(value, search, item) : filter(value, search, item);
  95718. };
  95719. }
  95720. function searchTableItems(items, search, headersWithCustomFilters, headersWithoutCustomFilters, customFilter) {
  95721. search = typeof search === 'string' ? search.trim() : null; // If the `search` property is empty and there are no custom filters in use, there is nothing to do.
  95722. if (!(search && headersWithoutCustomFilters.length) && !headersWithCustomFilters.length) return items;
  95723. return items.filter(function (item) {
  95724. // Headers with custom filters are evaluated whether or not a search term has been provided.
  95725. if (headersWithCustomFilters.length && headersWithCustomFilters.every(filterFn(item, search, _util_helpers__WEBPACK_IMPORTED_MODULE_13__["defaultFilter"]))) {
  95726. return true;
  95727. } // Otherwise, the `search` property is used to filter columns without a custom filter.
  95728. return search && headersWithoutCustomFilters.some(filterFn(item, search, customFilter));
  95729. });
  95730. }
  95731. /* @vue/component */
  95732. /* harmony default export */ __webpack_exports__["default"] = (_VDataIterator__WEBPACK_IMPORTED_MODULE_2__["VDataIterator"].extend({
  95733. name: 'v-data-table',
  95734. // https://github.com/vuejs/vue/issues/6872
  95735. directives: {
  95736. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_12__["default"]
  95737. },
  95738. props: {
  95739. headers: {
  95740. type: Array,
  95741. default: function _default() {
  95742. return [];
  95743. }
  95744. },
  95745. showSelect: Boolean,
  95746. showExpand: Boolean,
  95747. showGroupBy: Boolean,
  95748. // TODO: Fix
  95749. // virtualRows: Boolean,
  95750. height: [Number, String],
  95751. hideDefaultHeader: Boolean,
  95752. caption: String,
  95753. dense: Boolean,
  95754. headerProps: Object,
  95755. calculateWidths: Boolean,
  95756. fixedHeader: Boolean,
  95757. headersLength: Number,
  95758. expandIcon: {
  95759. type: String,
  95760. default: '$expand'
  95761. },
  95762. customFilter: {
  95763. type: Function,
  95764. default: _util_helpers__WEBPACK_IMPORTED_MODULE_13__["defaultFilter"]
  95765. }
  95766. },
  95767. data: function data() {
  95768. return {
  95769. internalGroupBy: [],
  95770. openCache: {},
  95771. widths: []
  95772. };
  95773. },
  95774. computed: {
  95775. computedHeaders: function computedHeaders() {
  95776. var _this = this;
  95777. if (!this.headers) return [];
  95778. var headers = this.headers.filter(function (h) {
  95779. return h.value === undefined || !_this.internalGroupBy.find(function (v) {
  95780. return v === h.value;
  95781. });
  95782. });
  95783. var defaultHeader = {
  95784. text: '',
  95785. sortable: false,
  95786. width: '1px'
  95787. };
  95788. if (this.showSelect) {
  95789. var index = headers.findIndex(function (h) {
  95790. return h.value === 'data-table-select';
  95791. });
  95792. if (index < 0) headers.unshift(__assign({}, defaultHeader, {
  95793. value: 'data-table-select'
  95794. }));else headers.splice(index, 1, __assign({}, defaultHeader, headers[index]));
  95795. }
  95796. if (this.showExpand) {
  95797. var index = headers.findIndex(function (h) {
  95798. return h.value === 'data-table-expand';
  95799. });
  95800. if (index < 0) headers.unshift(__assign({}, defaultHeader, {
  95801. value: 'data-table-expand'
  95802. }));else headers.splice(index, 1, __assign({}, defaultHeader, headers[index]));
  95803. }
  95804. return headers;
  95805. },
  95806. colspanAttrs: function colspanAttrs() {
  95807. return this.isMobile ? undefined : {
  95808. colspan: this.headersLength || this.computedHeaders.length
  95809. };
  95810. },
  95811. columnSorters: function columnSorters() {
  95812. return this.computedHeaders.reduce(function (acc, header) {
  95813. if (header.sort) acc[header.value] = header.sort;
  95814. return acc;
  95815. }, {});
  95816. },
  95817. headersWithCustomFilters: function headersWithCustomFilters() {
  95818. return this.headers.filter(function (header) {
  95819. return header.filter && (!header.hasOwnProperty('filterable') || header.filterable === true);
  95820. });
  95821. },
  95822. headersWithoutCustomFilters: function headersWithoutCustomFilters() {
  95823. return this.headers.filter(function (header) {
  95824. return !header.filter && (!header.hasOwnProperty('filterable') || header.filterable === true);
  95825. });
  95826. },
  95827. sanitizedHeaderProps: function sanitizedHeaderProps() {
  95828. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["camelizeObjectKeys"])(this.headerProps);
  95829. },
  95830. computedItemsPerPage: function computedItemsPerPage() {
  95831. var itemsPerPage = this.options && this.options.itemsPerPage ? this.options.itemsPerPage : this.itemsPerPage;
  95832. var itemsPerPageOptions = this.sanitizedFooterProps.itemsPerPageOptions;
  95833. if (itemsPerPageOptions && !itemsPerPageOptions.find(function (item) {
  95834. return typeof item === 'number' ? item === itemsPerPage : item.value === itemsPerPage;
  95835. })) {
  95836. var firstOption = itemsPerPageOptions[0];
  95837. return _typeof(firstOption) === 'object' ? firstOption.value : firstOption;
  95838. }
  95839. return itemsPerPage;
  95840. }
  95841. },
  95842. created: function created() {
  95843. var _this = this;
  95844. var breakingProps = [['sort-icon', 'header-props.sort-icon'], ['hide-headers', 'hide-default-header'], ['select-all', 'show-select']];
  95845. /* istanbul ignore next */
  95846. breakingProps.forEach(function (_a) {
  95847. var _b = __read(_a, 2),
  95848. original = _b[0],
  95849. replacement = _b[1];
  95850. if (_this.$attrs.hasOwnProperty(original)) Object(_util_console__WEBPACK_IMPORTED_MODULE_14__["breaking"])(original, replacement, _this);
  95851. });
  95852. },
  95853. mounted: function mounted() {
  95854. // if ((!this.sortBy || !this.sortBy.length) && (!this.options.sortBy || !this.options.sortBy.length)) {
  95855. // const firstSortable = this.headers.find(h => !('sortable' in h) || !!h.sortable)
  95856. // if (firstSortable) this.updateOptions({ sortBy: [firstSortable.value], sortDesc: [false] })
  95857. // }
  95858. if (this.calculateWidths) {
  95859. window.addEventListener('resize', this.calcWidths);
  95860. this.calcWidths();
  95861. }
  95862. },
  95863. beforeDestroy: function beforeDestroy() {
  95864. if (this.calculateWidths) {
  95865. window.removeEventListener('resize', this.calcWidths);
  95866. }
  95867. },
  95868. methods: {
  95869. calcWidths: function calcWidths() {
  95870. this.widths = Array.from(this.$el.querySelectorAll('th')).map(function (e) {
  95871. return e.clientWidth;
  95872. });
  95873. },
  95874. customFilterWithColumns: function customFilterWithColumns(items, search) {
  95875. return searchTableItems(items, search, this.headersWithCustomFilters, this.headersWithoutCustomFilters, this.customFilter);
  95876. },
  95877. customSortWithHeaders: function customSortWithHeaders(items, sortBy, sortDesc, locale) {
  95878. return this.customSort(items, sortBy, sortDesc, locale, this.columnSorters);
  95879. },
  95880. createItemProps: function createItemProps(item) {
  95881. var props = _VDataIterator__WEBPACK_IMPORTED_MODULE_2__["VDataIterator"].options.methods.createItemProps.call(this, item);
  95882. return Object.assign(props, {
  95883. headers: this.computedHeaders
  95884. });
  95885. },
  95886. genCaption: function genCaption(props) {
  95887. if (this.caption) return [this.$createElement('caption', [this.caption])];
  95888. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getSlot"])(this, 'caption', props, true);
  95889. },
  95890. genColgroup: function genColgroup(props) {
  95891. var _this = this;
  95892. return this.$createElement('colgroup', this.computedHeaders.map(function (header) {
  95893. return _this.$createElement('col', {
  95894. class: {
  95895. divider: header.divider
  95896. }
  95897. });
  95898. }));
  95899. },
  95900. genLoading: function genLoading() {
  95901. var progress = this.$slots['progress'] ? this.$slots.progress : this.$createElement(_VProgressLinear__WEBPACK_IMPORTED_MODULE_6__["default"], {
  95902. props: {
  95903. color: this.loading === true ? 'primary' : this.loading,
  95904. height: 2,
  95905. indeterminate: true
  95906. }
  95907. });
  95908. var th = this.$createElement('th', {
  95909. staticClass: 'column',
  95910. attrs: this.colspanAttrs
  95911. }, [progress]);
  95912. var tr = this.$createElement('tr', {
  95913. staticClass: 'v-data-table__progress'
  95914. }, [th]);
  95915. return this.$createElement('thead', [tr]);
  95916. },
  95917. genHeaders: function genHeaders(props) {
  95918. var data = {
  95919. props: __assign({}, this.sanitizedHeaderProps, {
  95920. headers: this.computedHeaders,
  95921. options: props.options,
  95922. mobile: this.isMobile,
  95923. showGroupBy: this.showGroupBy,
  95924. someItems: this.someItems,
  95925. everyItem: this.everyItem,
  95926. singleSelect: this.singleSelect,
  95927. disableSort: this.disableSort
  95928. }),
  95929. on: {
  95930. sort: props.sort,
  95931. group: props.group,
  95932. 'toggle-select-all': this.toggleSelectAll
  95933. }
  95934. };
  95935. var children = [Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getSlot"])(this, 'header', data)];
  95936. if (!this.hideDefaultHeader) {
  95937. var scopedSlots = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getPrefixedScopedSlots"])('header.', this.$scopedSlots);
  95938. children.push(this.$createElement(_VDataTableHeader__WEBPACK_IMPORTED_MODULE_4__["default"], __assign({}, data, {
  95939. scopedSlots: scopedSlots
  95940. })));
  95941. }
  95942. if (this.loading) children.push(this.genLoading());
  95943. return children;
  95944. },
  95945. genEmptyWrapper: function genEmptyWrapper(content) {
  95946. return this.$createElement('tr', {
  95947. staticClass: 'v-data-table__empty-wrapper'
  95948. }, [this.$createElement('td', {
  95949. attrs: this.colspanAttrs
  95950. }, content)]);
  95951. },
  95952. genItems: function genItems(items, props) {
  95953. var empty = this.genEmpty(props.originalItemsLength, props.pagination.itemsLength);
  95954. if (empty) return [empty];
  95955. return props.groupedItems ? this.genGroupedRows(props.groupedItems, props) : this.genRows(items, props);
  95956. },
  95957. genGroupedRows: function genGroupedRows(groupedItems, props) {
  95958. var _this = this;
  95959. return groupedItems.map(function (group) {
  95960. if (!_this.openCache.hasOwnProperty(group.name)) _this.$set(_this.openCache, group.name, true);
  95961. if (_this.$scopedSlots.group) {
  95962. return _this.$scopedSlots.group({
  95963. group: group.name,
  95964. options: props.options,
  95965. items: group.items,
  95966. headers: _this.computedHeaders
  95967. });
  95968. } else {
  95969. return _this.genDefaultGroupedRow(group.name, group.items, props);
  95970. }
  95971. });
  95972. },
  95973. genDefaultGroupedRow: function genDefaultGroupedRow(group, items, props) {
  95974. var _this = this;
  95975. var isOpen = !!this.openCache[group];
  95976. var children = [this.$createElement('template', {
  95977. slot: 'row.content'
  95978. }, this.genRows(items, props))];
  95979. var toggleFn = function toggleFn() {
  95980. return _this.$set(_this.openCache, group, !_this.openCache[group]);
  95981. };
  95982. var removeFn = function removeFn() {
  95983. return props.updateOptions({
  95984. groupBy: [],
  95985. groupDesc: []
  95986. });
  95987. };
  95988. if (this.$scopedSlots['group.header']) {
  95989. children.unshift(this.$createElement('template', {
  95990. slot: 'column.header'
  95991. }, [this.$scopedSlots['group.header']({
  95992. group: group,
  95993. groupBy: props.options.groupBy,
  95994. items: items,
  95995. headers: this.computedHeaders,
  95996. isOpen: isOpen,
  95997. toggle: toggleFn,
  95998. remove: removeFn
  95999. })]));
  96000. } else {
  96001. var toggle = this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_3__["default"], {
  96002. staticClass: 'ma-0',
  96003. props: {
  96004. icon: true,
  96005. small: true
  96006. },
  96007. on: {
  96008. click: toggleFn
  96009. }
  96010. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_5__["default"], [isOpen ? '$minus' : '$plus'])]);
  96011. var remove = this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_3__["default"], {
  96012. staticClass: 'ma-0',
  96013. props: {
  96014. icon: true,
  96015. small: true
  96016. },
  96017. on: {
  96018. click: removeFn
  96019. }
  96020. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_5__["default"], ['$close'])]);
  96021. var column = this.$createElement('td', {
  96022. staticClass: 'text-start',
  96023. attrs: this.colspanAttrs
  96024. }, [toggle, props.options.groupBy[0] + ": " + group, remove]);
  96025. children.unshift(this.$createElement('template', {
  96026. slot: 'column.header'
  96027. }, [column]));
  96028. }
  96029. if (this.$scopedSlots['group.summary']) {
  96030. children.push(this.$createElement('template', {
  96031. slot: 'column.summary'
  96032. }, [this.$scopedSlots['group.summary']({
  96033. group: group,
  96034. groupBy: props.options.groupBy,
  96035. items: items,
  96036. headers: this.computedHeaders,
  96037. isOpen: isOpen,
  96038. toggle: toggleFn
  96039. })]));
  96040. }
  96041. return this.$createElement(_RowGroup__WEBPACK_IMPORTED_MODULE_8__["default"], {
  96042. key: group,
  96043. props: {
  96044. value: isOpen
  96045. }
  96046. }, children);
  96047. },
  96048. genRows: function genRows(items, props) {
  96049. return this.$scopedSlots.item ? this.genScopedRows(items, props) : this.genDefaultRows(items, props);
  96050. },
  96051. genScopedRows: function genScopedRows(items, props) {
  96052. var rows = [];
  96053. for (var i = 0; i < items.length; i++) {
  96054. var item = items[i];
  96055. rows.push(this.$scopedSlots.item(__assign({}, this.createItemProps(item), {
  96056. index: i
  96057. })));
  96058. if (this.isExpanded(item)) {
  96059. rows.push(this.$scopedSlots['expanded-item']({
  96060. item: item,
  96061. headers: this.computedHeaders
  96062. }));
  96063. }
  96064. }
  96065. return rows;
  96066. },
  96067. genDefaultRows: function genDefaultRows(items, props) {
  96068. var _this = this;
  96069. return this.$scopedSlots['expanded-item'] ? items.map(function (item) {
  96070. return _this.genDefaultExpandedRow(item);
  96071. }) : items.map(function (item) {
  96072. return _this.genDefaultSimpleRow(item);
  96073. });
  96074. },
  96075. genDefaultExpandedRow: function genDefaultExpandedRow(item) {
  96076. var isExpanded = this.isExpanded(item);
  96077. var classes = {
  96078. 'v-data-table__expanded v-data-table__expanded__row': isExpanded
  96079. };
  96080. var headerRow = this.genDefaultSimpleRow(item, classes);
  96081. var expandedRow = this.$createElement('tr', {
  96082. staticClass: 'v-data-table__expanded v-data-table__expanded__content'
  96083. }, [this.$scopedSlots['expanded-item']({
  96084. item: item,
  96085. headers: this.computedHeaders
  96086. })]);
  96087. return this.$createElement(_RowGroup__WEBPACK_IMPORTED_MODULE_8__["default"], {
  96088. props: {
  96089. value: isExpanded
  96090. }
  96091. }, [this.$createElement('template', {
  96092. slot: 'row.header'
  96093. }, [headerRow]), this.$createElement('template', {
  96094. slot: 'row.content'
  96095. }, [expandedRow])]);
  96096. },
  96097. genDefaultSimpleRow: function genDefaultSimpleRow(item, classes) {
  96098. var _this = this;
  96099. if (classes === void 0) {
  96100. classes = {};
  96101. }
  96102. var scopedSlots = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getPrefixedScopedSlots"])('item.', this.$scopedSlots);
  96103. var data = this.createItemProps(item);
  96104. if (this.showSelect) {
  96105. var slot_1 = scopedSlots['data-table-select'];
  96106. scopedSlots['data-table-select'] = slot_1 ? function () {
  96107. return slot_1(data);
  96108. } : function () {
  96109. return _this.$createElement(_VCheckbox_VSimpleCheckbox__WEBPACK_IMPORTED_MODULE_9__["default"], {
  96110. staticClass: 'v-data-table__checkbox',
  96111. props: {
  96112. value: data.isSelected,
  96113. disabled: !_this.isSelectable(item)
  96114. },
  96115. on: {
  96116. input: function input(val) {
  96117. return data.select(val);
  96118. }
  96119. }
  96120. });
  96121. };
  96122. }
  96123. if (this.showExpand) {
  96124. var slot_2 = scopedSlots['data-table-expand'];
  96125. scopedSlots['data-table-expand'] = slot_2 ? function () {
  96126. return slot_2(data);
  96127. } : function () {
  96128. return _this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_5__["default"], {
  96129. staticClass: 'v-data-table__expand-icon',
  96130. class: {
  96131. 'v-data-table__expand-icon--active': data.isExpanded
  96132. },
  96133. on: {
  96134. click: function click(e) {
  96135. e.stopPropagation();
  96136. data.expand(!data.isExpanded);
  96137. }
  96138. }
  96139. }, [_this.expandIcon]);
  96140. };
  96141. }
  96142. return this.$createElement(this.isMobile ? _MobileRow__WEBPACK_IMPORTED_MODULE_11__["default"] : _Row__WEBPACK_IMPORTED_MODULE_7__["default"], {
  96143. key: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getObjectValueByPath"])(item, this.itemKey),
  96144. class: __assign({}, classes, {
  96145. 'v-data-table__selected': data.isSelected
  96146. }),
  96147. props: {
  96148. headers: this.computedHeaders,
  96149. item: item,
  96150. rtl: this.$vuetify.rtl
  96151. },
  96152. scopedSlots: scopedSlots,
  96153. on: {
  96154. // TODO: first argument should be the data object
  96155. // but this is a breaking change so it's for v3
  96156. click: function click() {
  96157. return _this.$emit('click:row', item, data);
  96158. }
  96159. }
  96160. });
  96161. },
  96162. genBody: function genBody(props) {
  96163. var data = __assign({}, props, {
  96164. expand: this.expand,
  96165. headers: this.computedHeaders,
  96166. isExpanded: this.isExpanded,
  96167. isMobile: this.isMobile,
  96168. isSelected: this.isSelected,
  96169. select: this.select
  96170. });
  96171. if (this.$scopedSlots.body) {
  96172. return this.$scopedSlots.body(data);
  96173. }
  96174. return this.$createElement('tbody', [Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getSlot"])(this, 'body.prepend', data, true), this.genItems(props.items, props), Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getSlot"])(this, 'body.append', data, true)]);
  96175. },
  96176. genFooters: function genFooters(props) {
  96177. var data = {
  96178. props: __assign({
  96179. options: props.options,
  96180. pagination: props.pagination,
  96181. itemsPerPageText: '$vuetify.dataTable.itemsPerPageText'
  96182. }, this.sanitizedFooterProps),
  96183. on: {
  96184. 'update:options': function updateOptions(value) {
  96185. return props.updateOptions(value);
  96186. }
  96187. },
  96188. widths: this.widths,
  96189. headers: this.computedHeaders
  96190. };
  96191. var children = [Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getSlot"])(this, 'footer', data, true)];
  96192. if (!this.hideDefaultFooter) {
  96193. children.push(this.$createElement(_VDataIterator__WEBPACK_IMPORTED_MODULE_2__["VDataFooter"], __assign({}, data, {
  96194. scopedSlots: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getPrefixedScopedSlots"])('footer.', this.$scopedSlots)
  96195. })));
  96196. }
  96197. return children;
  96198. },
  96199. genDefaultScopedSlot: function genDefaultScopedSlot(props) {
  96200. var simpleProps = {
  96201. height: this.height,
  96202. fixedHeader: this.fixedHeader,
  96203. dense: this.dense
  96204. }; // if (this.virtualRows) {
  96205. // return this.$createElement(VVirtualTable, {
  96206. // props: Object.assign(simpleProps, {
  96207. // items: props.items,
  96208. // height: this.height,
  96209. // rowHeight: this.dense ? 24 : 48,
  96210. // headerHeight: this.dense ? 32 : 48,
  96211. // // TODO: expose rest of props from virtual table?
  96212. // }),
  96213. // scopedSlots: {
  96214. // items: ({ items }) => this.genItems(items, props) as any,
  96215. // },
  96216. // }, [
  96217. // this.proxySlot('body.before', [this.genCaption(props), this.genHeaders(props)]),
  96218. // this.proxySlot('bottom', this.genFooters(props)),
  96219. // ])
  96220. // }
  96221. return this.$createElement(_VSimpleTable__WEBPACK_IMPORTED_MODULE_10__["default"], {
  96222. props: simpleProps
  96223. }, [this.proxySlot('top', Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["getSlot"])(this, 'top', props, true)), this.genCaption(props), this.genColgroup(props), this.genHeaders(props), this.genBody(props), this.proxySlot('bottom', this.genFooters(props))]);
  96224. },
  96225. proxySlot: function proxySlot(slot, content) {
  96226. return this.$createElement('template', {
  96227. slot: slot
  96228. }, content);
  96229. }
  96230. },
  96231. render: function render() {
  96232. var _this = this;
  96233. return this.$createElement(_VData__WEBPACK_IMPORTED_MODULE_1__["VData"], {
  96234. props: __assign({}, this.$props, {
  96235. customFilter: this.customFilterWithColumns,
  96236. customSort: this.customSortWithHeaders,
  96237. itemsPerPage: this.computedItemsPerPage
  96238. }),
  96239. on: {
  96240. 'update:options': function updateOptions(v, old) {
  96241. _this.internalGroupBy = v.groupBy || [];
  96242. !Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["deepEqual"])(v, old) && _this.$emit('update:options', v);
  96243. },
  96244. 'update:page': function updatePage(v) {
  96245. return _this.$emit('update:page', v);
  96246. },
  96247. 'update:items-per-page': function updateItemsPerPage(v) {
  96248. return _this.$emit('update:items-per-page', v);
  96249. },
  96250. 'update:sort-by': function updateSortBy(v) {
  96251. return _this.$emit('update:sort-by', v);
  96252. },
  96253. 'update:sort-desc': function updateSortDesc(v) {
  96254. return _this.$emit('update:sort-desc', v);
  96255. },
  96256. 'update:group-by': function updateGroupBy(v) {
  96257. return _this.$emit('update:group-by', v);
  96258. },
  96259. 'update:group-desc': function updateGroupDesc(v) {
  96260. return _this.$emit('update:group-desc', v);
  96261. },
  96262. pagination: function pagination(v, old) {
  96263. return !Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["deepEqual"])(v, old) && _this.$emit('pagination', v);
  96264. },
  96265. 'current-items': function currentItems(v) {
  96266. _this.internalCurrentItems = v;
  96267. _this.$emit('current-items', v);
  96268. },
  96269. 'page-count': function pageCount(v) {
  96270. return _this.$emit('page-count', v);
  96271. }
  96272. },
  96273. scopedSlots: {
  96274. default: this.genDefaultScopedSlot
  96275. }
  96276. });
  96277. }
  96278. }));
  96279. /***/ }),
  96280. /***/ "./src/components/VDataTable/VDataTableHeader.sass":
  96281. /*!*********************************************************!*\
  96282. !*** ./src/components/VDataTable/VDataTableHeader.sass ***!
  96283. \*********************************************************/
  96284. /*! no static exports found */
  96285. /***/ (function(module, exports, __webpack_require__) {
  96286. // extracted by mini-css-extract-plugin
  96287. /***/ }),
  96288. /***/ "./src/components/VDataTable/VDataTableHeader.ts":
  96289. /*!*******************************************************!*\
  96290. !*** ./src/components/VDataTable/VDataTableHeader.ts ***!
  96291. \*******************************************************/
  96292. /*! exports provided: default */
  96293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96294. "use strict";
  96295. __webpack_require__.r(__webpack_exports__);
  96296. /* harmony import */ var _VDataTableHeader_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDataTableHeader.sass */ "./src/components/VDataTable/VDataTableHeader.sass");
  96297. /* harmony import */ var _VDataTableHeader_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VDataTableHeader_sass__WEBPACK_IMPORTED_MODULE_0__);
  96298. /* harmony import */ var _VDataTableHeaderMobile__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VDataTableHeaderMobile */ "./src/components/VDataTable/VDataTableHeaderMobile.ts");
  96299. /* harmony import */ var _VDataTableHeaderDesktop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VDataTableHeaderDesktop */ "./src/components/VDataTable/VDataTableHeaderDesktop.ts");
  96300. /* harmony import */ var _mixins_header__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mixins/header */ "./src/components/VDataTable/mixins/header.ts");
  96301. /* harmony import */ var _util_dedupeModelListeners__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/dedupeModelListeners */ "./src/util/dedupeModelListeners.ts");
  96302. /* harmony import */ var _util_mergeData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mergeData */ "./src/util/mergeData.ts");
  96303. /* harmony import */ var _util_rebuildFunctionalSlots__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/rebuildFunctionalSlots */ "./src/util/rebuildFunctionalSlots.ts");
  96304. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vue */ "vue");
  96305. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_7__);
  96306. var __assign = undefined && undefined.__assign || function () {
  96307. __assign = Object.assign || function (t) {
  96308. for (var s, i = 1, n = arguments.length; i < n; i++) {
  96309. s = arguments[i];
  96310. for (var p in s) {
  96311. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  96312. }
  96313. }
  96314. return t;
  96315. };
  96316. return __assign.apply(this, arguments);
  96317. }; // Styles
  96318. // Components
  96319. // Mixins
  96320. // Utilities
  96321. // Types
  96322. /* @vue/component */
  96323. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_7___default.a.extend({
  96324. name: 'v-data-table-header',
  96325. functional: true,
  96326. props: __assign({}, _mixins_header__WEBPACK_IMPORTED_MODULE_3__["default"].options.props, {
  96327. mobile: Boolean
  96328. }),
  96329. render: function render(h, _a) {
  96330. var props = _a.props,
  96331. data = _a.data,
  96332. slots = _a.slots;
  96333. Object(_util_dedupeModelListeners__WEBPACK_IMPORTED_MODULE_4__["default"])(data);
  96334. var children = Object(_util_rebuildFunctionalSlots__WEBPACK_IMPORTED_MODULE_6__["default"])(slots(), h);
  96335. data = Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_5__["default"])(data, {
  96336. props: props
  96337. });
  96338. if (props.mobile) {
  96339. return h(_VDataTableHeaderMobile__WEBPACK_IMPORTED_MODULE_1__["default"], data, children);
  96340. } else {
  96341. return h(_VDataTableHeaderDesktop__WEBPACK_IMPORTED_MODULE_2__["default"], data, children);
  96342. }
  96343. }
  96344. }));
  96345. /***/ }),
  96346. /***/ "./src/components/VDataTable/VDataTableHeaderDesktop.ts":
  96347. /*!**************************************************************!*\
  96348. !*** ./src/components/VDataTable/VDataTableHeaderDesktop.ts ***!
  96349. \**************************************************************/
  96350. /*! exports provided: default */
  96351. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96352. "use strict";
  96353. __webpack_require__.r(__webpack_exports__);
  96354. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  96355. /* harmony import */ var _mixins_header__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mixins/header */ "./src/components/VDataTable/mixins/header.ts");
  96356. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  96357. var __read = undefined && undefined.__read || function (o, n) {
  96358. var m = typeof Symbol === "function" && o[Symbol.iterator];
  96359. if (!m) return o;
  96360. var i = m.call(o),
  96361. r,
  96362. ar = [],
  96363. e;
  96364. try {
  96365. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  96366. ar.push(r.value);
  96367. }
  96368. } catch (error) {
  96369. e = {
  96370. error: error
  96371. };
  96372. } finally {
  96373. try {
  96374. if (r && !r.done && (m = i["return"])) m.call(i);
  96375. } finally {
  96376. if (e) throw e.error;
  96377. }
  96378. }
  96379. return ar;
  96380. };
  96381. var __spread = undefined && undefined.__spread || function () {
  96382. for (var ar = [], i = 0; i < arguments.length; i++) {
  96383. ar = ar.concat(__read(arguments[i]));
  96384. }
  96385. return ar;
  96386. };
  96387. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_0__["default"])(_mixins_header__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
  96388. name: 'v-data-table-header-desktop',
  96389. methods: {
  96390. genGroupByToggle: function genGroupByToggle(header) {
  96391. var _this = this;
  96392. return this.$createElement('span', {
  96393. on: {
  96394. click: function click(e) {
  96395. e.stopPropagation();
  96396. _this.$emit('group', header.value);
  96397. }
  96398. }
  96399. }, ['group']);
  96400. },
  96401. getAria: function getAria(beingSorted, isDesc) {
  96402. var _this = this;
  96403. var $t = function $t(key) {
  96404. return _this.$vuetify.lang.t("$vuetify.dataTable.ariaLabel." + key);
  96405. };
  96406. var ariaSort = 'none';
  96407. var ariaLabel = [$t('sortNone'), $t('activateAscending')];
  96408. if (!beingSorted) {
  96409. return {
  96410. ariaSort: ariaSort,
  96411. ariaLabel: ariaLabel.join(' ')
  96412. };
  96413. }
  96414. if (isDesc) {
  96415. ariaSort = 'descending';
  96416. ariaLabel = [$t('sortDescending'), $t(this.options.mustSort ? 'activateAscending' : 'activateNone')];
  96417. } else {
  96418. ariaSort = 'ascending';
  96419. ariaLabel = [$t('sortAscending'), $t('activateDescending')];
  96420. }
  96421. return {
  96422. ariaSort: ariaSort,
  96423. ariaLabel: ariaLabel.join(' ')
  96424. };
  96425. },
  96426. genHeader: function genHeader(header) {
  96427. var _this = this;
  96428. var data = {
  96429. attrs: {
  96430. role: 'columnheader',
  96431. scope: 'col',
  96432. 'aria-label': header.text || ''
  96433. },
  96434. style: {
  96435. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["convertToUnit"])(header.width),
  96436. minWidth: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["convertToUnit"])(header.width)
  96437. },
  96438. class: __spread(["text-" + (header.align || 'start')], Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["wrapInArray"])(header.class), [header.divider && 'v-data-table__divider']),
  96439. on: {}
  96440. };
  96441. var children = [];
  96442. if (header.value === 'data-table-select' && !this.singleSelect) {
  96443. return this.$createElement('th', data, [this.genSelectAll()]);
  96444. }
  96445. children.push(this.$scopedSlots[header.value] ? this.$scopedSlots[header.value]({
  96446. header: header
  96447. }) : this.$createElement('span', [header.text]));
  96448. if (!this.disableSort && (header.sortable || !header.hasOwnProperty('sortable'))) {
  96449. data.on['click'] = function () {
  96450. return _this.$emit('sort', header.value);
  96451. };
  96452. var sortIndex = this.options.sortBy.findIndex(function (k) {
  96453. return k === header.value;
  96454. });
  96455. var beingSorted = sortIndex >= 0;
  96456. var isDesc = this.options.sortDesc[sortIndex];
  96457. data.class.push('sortable');
  96458. var _a = this.getAria(beingSorted, isDesc),
  96459. ariaLabel = _a.ariaLabel,
  96460. ariaSort = _a.ariaSort;
  96461. data.attrs['aria-label'] += "" + (header.text ? ': ' : '') + ariaLabel;
  96462. data.attrs['aria-sort'] = ariaSort;
  96463. if (beingSorted) {
  96464. data.class.push('active');
  96465. data.class.push(isDesc ? 'desc' : 'asc');
  96466. }
  96467. if (header.align === 'end') children.unshift(this.genSortIcon());else children.push(this.genSortIcon());
  96468. if (this.options.multiSort && beingSorted) {
  96469. children.push(this.$createElement('span', {
  96470. class: 'v-data-table-header__sort-badge'
  96471. }, [String(sortIndex + 1)]));
  96472. }
  96473. }
  96474. if (this.showGroupBy) children.push(this.genGroupByToggle(header));
  96475. return this.$createElement('th', data, children);
  96476. }
  96477. },
  96478. render: function render() {
  96479. var _this = this;
  96480. return this.$createElement('thead', {
  96481. staticClass: 'v-data-table-header'
  96482. }, [this.$createElement('tr', this.headers.map(function (header) {
  96483. return _this.genHeader(header);
  96484. }))]);
  96485. }
  96486. }));
  96487. /***/ }),
  96488. /***/ "./src/components/VDataTable/VDataTableHeaderMobile.ts":
  96489. /*!*************************************************************!*\
  96490. !*** ./src/components/VDataTable/VDataTableHeaderMobile.ts ***!
  96491. \*************************************************************/
  96492. /*! exports provided: default */
  96493. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96494. "use strict";
  96495. __webpack_require__.r(__webpack_exports__);
  96496. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  96497. /* harmony import */ var _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSelect/VSelect */ "./src/components/VSelect/VSelect.ts");
  96498. /* harmony import */ var _VChip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VChip */ "./src/components/VChip/index.ts");
  96499. /* harmony import */ var _mixins_header__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mixins/header */ "./src/components/VDataTable/mixins/header.ts");
  96500. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  96501. var __read = undefined && undefined.__read || function (o, n) {
  96502. var m = typeof Symbol === "function" && o[Symbol.iterator];
  96503. if (!m) return o;
  96504. var i = m.call(o),
  96505. r,
  96506. ar = [],
  96507. e;
  96508. try {
  96509. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  96510. ar.push(r.value);
  96511. }
  96512. } catch (error) {
  96513. e = {
  96514. error: error
  96515. };
  96516. } finally {
  96517. try {
  96518. if (r && !r.done && (m = i["return"])) m.call(i);
  96519. } finally {
  96520. if (e) throw e.error;
  96521. }
  96522. }
  96523. return ar;
  96524. };
  96525. var __spread = undefined && undefined.__spread || function () {
  96526. for (var ar = [], i = 0; i < arguments.length; i++) {
  96527. ar = ar.concat(__read(arguments[i]));
  96528. }
  96529. return ar;
  96530. };
  96531. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_0__["default"])(_mixins_header__WEBPACK_IMPORTED_MODULE_3__["default"]).extend({
  96532. name: 'v-data-table-header-mobile',
  96533. props: {
  96534. sortByText: {
  96535. type: String,
  96536. default: '$vuetify.dataTable.sortBy'
  96537. }
  96538. },
  96539. methods: {
  96540. genSortChip: function genSortChip(props) {
  96541. var _this = this;
  96542. var children = [props.item.text];
  96543. var sortIndex = this.options.sortBy.findIndex(function (k) {
  96544. return k === props.item.value;
  96545. });
  96546. var beingSorted = sortIndex >= 0;
  96547. var isDesc = this.options.sortDesc[sortIndex];
  96548. children.push(this.$createElement('div', {
  96549. staticClass: 'v-chip__close',
  96550. class: {
  96551. sortable: true,
  96552. active: beingSorted,
  96553. asc: beingSorted && !isDesc,
  96554. desc: beingSorted && isDesc
  96555. }
  96556. }, [this.genSortIcon()]));
  96557. return this.$createElement(_VChip__WEBPACK_IMPORTED_MODULE_2__["default"], {
  96558. staticClass: 'sortable',
  96559. nativeOn: {
  96560. click: function click(e) {
  96561. e.stopPropagation();
  96562. _this.$emit('sort', props.item.value);
  96563. }
  96564. }
  96565. }, children);
  96566. },
  96567. genSortSelect: function genSortSelect(items) {
  96568. var _this = this;
  96569. return this.$createElement(_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"], {
  96570. props: {
  96571. label: this.$vuetify.lang.t(this.sortByText),
  96572. items: items,
  96573. hideDetails: true,
  96574. multiple: this.options.multiSort,
  96575. value: this.options.multiSort ? this.options.sortBy : this.options.sortBy[0],
  96576. menuProps: {
  96577. closeOnContentClick: true
  96578. }
  96579. },
  96580. on: {
  96581. change: function change(v) {
  96582. return _this.$emit('sort', v);
  96583. }
  96584. },
  96585. scopedSlots: {
  96586. selection: function selection(props) {
  96587. return _this.genSortChip(props);
  96588. }
  96589. }
  96590. });
  96591. }
  96592. },
  96593. render: function render(h) {
  96594. var children = [];
  96595. var header = this.headers.find(function (h) {
  96596. return h.value === 'data-table-select';
  96597. });
  96598. if (header && !this.singleSelect) {
  96599. children.push(this.$createElement('div', {
  96600. class: __spread(['v-data-table-header-mobile__select'], Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["wrapInArray"])(header.class)),
  96601. attrs: {
  96602. width: header.width
  96603. }
  96604. }, [this.genSelectAll()]));
  96605. }
  96606. var sortHeaders = this.headers.filter(function (h) {
  96607. return h.sortable !== false && h.value !== 'data-table-select';
  96608. }).map(function (h) {
  96609. return {
  96610. text: h.text,
  96611. value: h.value
  96612. };
  96613. });
  96614. if (!this.disableSort && sortHeaders.length) {
  96615. children.push(this.genSortSelect(sortHeaders));
  96616. }
  96617. var th = h('th', [h('div', {
  96618. staticClass: 'v-data-table-header-mobile__wrapper'
  96619. }, children)]);
  96620. var tr = h('tr', [th]);
  96621. return h('thead', {
  96622. staticClass: 'v-data-table-header v-data-table-header-mobile'
  96623. }, [tr]);
  96624. }
  96625. }));
  96626. /***/ }),
  96627. /***/ "./src/components/VDataTable/VEditDialog.sass":
  96628. /*!****************************************************!*\
  96629. !*** ./src/components/VDataTable/VEditDialog.sass ***!
  96630. \****************************************************/
  96631. /*! no static exports found */
  96632. /***/ (function(module, exports, __webpack_require__) {
  96633. // extracted by mini-css-extract-plugin
  96634. /***/ }),
  96635. /***/ "./src/components/VDataTable/VEditDialog.ts":
  96636. /*!**************************************************!*\
  96637. !*** ./src/components/VDataTable/VEditDialog.ts ***!
  96638. \**************************************************/
  96639. /*! exports provided: default */
  96640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96641. "use strict";
  96642. __webpack_require__.r(__webpack_exports__);
  96643. /* harmony import */ var _VEditDialog_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VEditDialog.sass */ "./src/components/VDataTable/VEditDialog.sass");
  96644. /* harmony import */ var _VEditDialog_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VEditDialog_sass__WEBPACK_IMPORTED_MODULE_0__);
  96645. /* harmony import */ var _mixins_returnable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/returnable */ "./src/mixins/returnable/index.ts");
  96646. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  96647. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  96648. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  96649. /* harmony import */ var _VMenu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../VMenu */ "./src/components/VMenu/index.ts");
  96650. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  96651. // Styles
  96652. // Mixins
  96653. // Utils
  96654. // Component
  96655. /* @vue/component */
  96656. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_6__["default"])(_mixins_returnable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]).extend({
  96657. name: 'v-edit-dialog',
  96658. props: {
  96659. cancelText: {
  96660. default: 'Cancel'
  96661. },
  96662. large: Boolean,
  96663. eager: Boolean,
  96664. persistent: Boolean,
  96665. saveText: {
  96666. default: 'Save'
  96667. },
  96668. transition: {
  96669. type: String,
  96670. default: 'slide-x-reverse-transition'
  96671. }
  96672. },
  96673. data: function data() {
  96674. return {
  96675. isActive: false
  96676. };
  96677. },
  96678. watch: {
  96679. isActive: function isActive(val) {
  96680. if (val) {
  96681. this.$emit('open');
  96682. setTimeout(this.focus, 50); // Give DOM time to paint
  96683. } else {
  96684. this.$emit('close');
  96685. }
  96686. }
  96687. },
  96688. methods: {
  96689. cancel: function cancel() {
  96690. this.isActive = false;
  96691. this.$emit('cancel');
  96692. },
  96693. focus: function focus() {
  96694. var input = this.$refs.content.querySelector('input');
  96695. input && input.focus();
  96696. },
  96697. genButton: function genButton(fn, text) {
  96698. return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_4__["default"], {
  96699. props: {
  96700. text: true,
  96701. color: 'primary',
  96702. light: true
  96703. },
  96704. on: {
  96705. click: fn
  96706. }
  96707. }, text);
  96708. },
  96709. genActions: function genActions() {
  96710. var _this = this;
  96711. return this.$createElement('div', {
  96712. class: 'v-small-dialog__actions'
  96713. }, [this.genButton(this.cancel, this.cancelText), this.genButton(function () {
  96714. _this.save(_this.returnValue);
  96715. _this.$emit('save');
  96716. }, this.saveText)]);
  96717. },
  96718. genContent: function genContent() {
  96719. var _this = this;
  96720. return this.$createElement('div', {
  96721. staticClass: 'v-small-dialog__content',
  96722. on: {
  96723. keydown: function keydown(e) {
  96724. var input = _this.$refs.content.querySelector('input');
  96725. e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].esc && _this.cancel();
  96726. if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].enter && input) {
  96727. _this.save(input.value);
  96728. _this.$emit('save');
  96729. }
  96730. }
  96731. },
  96732. ref: 'content'
  96733. }, [this.$slots.input]);
  96734. }
  96735. },
  96736. render: function render(h) {
  96737. var _this = this;
  96738. return h(_VMenu__WEBPACK_IMPORTED_MODULE_5__["default"], {
  96739. staticClass: 'v-small-dialog',
  96740. class: this.themeClasses,
  96741. props: {
  96742. contentClass: 'v-small-dialog__menu-content',
  96743. transition: this.transition,
  96744. origin: 'top right',
  96745. right: true,
  96746. value: this.isActive,
  96747. closeOnClick: !this.persistent,
  96748. closeOnContentClick: false,
  96749. eager: this.eager,
  96750. light: this.light,
  96751. dark: this.dark
  96752. },
  96753. on: {
  96754. input: function input(val) {
  96755. return _this.isActive = val;
  96756. }
  96757. },
  96758. scopedSlots: {
  96759. activator: function activator(_a) {
  96760. var on = _a.on;
  96761. return h('div', {
  96762. staticClass: 'v-small-dialog__activator',
  96763. on: on
  96764. }, [h('span', {
  96765. staticClass: 'v-small-dialog__activator__content'
  96766. }, _this.$slots.default)]);
  96767. }
  96768. }
  96769. }, [this.genContent(), this.large ? this.genActions() : null]);
  96770. }
  96771. }));
  96772. /***/ }),
  96773. /***/ "./src/components/VDataTable/VSimpleTable.sass":
  96774. /*!*****************************************************!*\
  96775. !*** ./src/components/VDataTable/VSimpleTable.sass ***!
  96776. \*****************************************************/
  96777. /*! no static exports found */
  96778. /***/ (function(module, exports, __webpack_require__) {
  96779. // extracted by mini-css-extract-plugin
  96780. /***/ }),
  96781. /***/ "./src/components/VDataTable/VSimpleTable.ts":
  96782. /*!***************************************************!*\
  96783. !*** ./src/components/VDataTable/VSimpleTable.ts ***!
  96784. \***************************************************/
  96785. /*! exports provided: default */
  96786. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96787. "use strict";
  96788. __webpack_require__.r(__webpack_exports__);
  96789. /* harmony import */ var _VSimpleTable_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSimpleTable.sass */ "./src/components/VDataTable/VSimpleTable.sass");
  96790. /* harmony import */ var _VSimpleTable_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSimpleTable_sass__WEBPACK_IMPORTED_MODULE_0__);
  96791. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  96792. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  96793. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  96794. var __assign = undefined && undefined.__assign || function () {
  96795. __assign = Object.assign || function (t) {
  96796. for (var s, i = 1, n = arguments.length; i < n; i++) {
  96797. s = arguments[i];
  96798. for (var p in s) {
  96799. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  96800. }
  96801. }
  96802. return t;
  96803. };
  96804. return __assign.apply(this, arguments);
  96805. };
  96806. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]).extend({
  96807. name: 'v-simple-table',
  96808. props: {
  96809. dense: Boolean,
  96810. fixedHeader: Boolean,
  96811. height: [Number, String]
  96812. },
  96813. computed: {
  96814. classes: function classes() {
  96815. return __assign({
  96816. 'v-data-table--dense': this.dense,
  96817. 'v-data-table--fixed-height': !!this.height && !this.fixedHeader,
  96818. 'v-data-table--fixed-header': this.fixedHeader
  96819. }, this.themeClasses);
  96820. }
  96821. },
  96822. methods: {
  96823. genWrapper: function genWrapper() {
  96824. return this.$slots.wrapper || this.$createElement('div', {
  96825. staticClass: 'v-data-table__wrapper',
  96826. style: {
  96827. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["convertToUnit"])(this.height)
  96828. }
  96829. }, [this.$createElement('table', this.$slots.default)]);
  96830. }
  96831. },
  96832. render: function render(h) {
  96833. return h('div', {
  96834. staticClass: 'v-data-table',
  96835. class: this.classes
  96836. }, [this.$slots.top, this.genWrapper(), this.$slots.bottom]);
  96837. }
  96838. }));
  96839. /***/ }),
  96840. /***/ "./src/components/VDataTable/VVirtualTable.sass":
  96841. /*!******************************************************!*\
  96842. !*** ./src/components/VDataTable/VVirtualTable.sass ***!
  96843. \******************************************************/
  96844. /*! no static exports found */
  96845. /***/ (function(module, exports, __webpack_require__) {
  96846. // extracted by mini-css-extract-plugin
  96847. /***/ }),
  96848. /***/ "./src/components/VDataTable/VVirtualTable.ts":
  96849. /*!****************************************************!*\
  96850. !*** ./src/components/VDataTable/VVirtualTable.ts ***!
  96851. \****************************************************/
  96852. /*! exports provided: default */
  96853. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96854. "use strict";
  96855. __webpack_require__.r(__webpack_exports__);
  96856. /* harmony import */ var _VVirtualTable_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VVirtualTable.sass */ "./src/components/VDataTable/VVirtualTable.sass");
  96857. /* harmony import */ var _VVirtualTable_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VVirtualTable_sass__WEBPACK_IMPORTED_MODULE_0__);
  96858. /* harmony import */ var _VSimpleTable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VSimpleTable */ "./src/components/VDataTable/VSimpleTable.ts");
  96859. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  96860. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  96861. // Components
  96862. // Utiltiies
  96863. // Types
  96864. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_VSimpleTable__WEBPACK_IMPORTED_MODULE_1__["default"]);
  96865. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  96866. name: 'v-virtual-table',
  96867. props: {
  96868. chunkSize: {
  96869. type: Number,
  96870. default: 25
  96871. },
  96872. headerHeight: {
  96873. type: Number,
  96874. default: 48
  96875. },
  96876. items: {
  96877. type: Array,
  96878. default: function _default() {
  96879. return [];
  96880. }
  96881. },
  96882. rowHeight: {
  96883. type: Number,
  96884. default: 48
  96885. }
  96886. },
  96887. data: function data() {
  96888. return {
  96889. scrollTop: 0,
  96890. oldChunk: 0,
  96891. scrollDebounce: null,
  96892. invalidateCache: false
  96893. };
  96894. },
  96895. computed: {
  96896. itemsLength: function itemsLength() {
  96897. return this.items.length;
  96898. },
  96899. totalHeight: function totalHeight() {
  96900. return this.itemsLength * this.rowHeight + this.headerHeight;
  96901. },
  96902. topIndex: function topIndex() {
  96903. return Math.floor(this.scrollTop / this.rowHeight);
  96904. },
  96905. chunkIndex: function chunkIndex() {
  96906. return Math.floor(this.topIndex / this.chunkSize);
  96907. },
  96908. startIndex: function startIndex() {
  96909. return Math.max(0, this.chunkIndex * this.chunkSize - this.chunkSize);
  96910. },
  96911. offsetTop: function offsetTop() {
  96912. return Math.max(0, this.startIndex * this.rowHeight);
  96913. },
  96914. stopIndex: function stopIndex() {
  96915. return Math.min(this.startIndex + this.chunkSize * 3, this.itemsLength);
  96916. },
  96917. offsetBottom: function offsetBottom() {
  96918. return Math.max(0, (this.itemsLength - this.stopIndex - this.startIndex) * this.rowHeight);
  96919. }
  96920. },
  96921. watch: {
  96922. chunkIndex: function chunkIndex(newValue, oldValue) {
  96923. this.oldChunk = oldValue;
  96924. },
  96925. items: function items() {
  96926. this.cachedItems = null;
  96927. this.$refs.table.scrollTop = 0;
  96928. }
  96929. },
  96930. created: function created() {
  96931. this.cachedItems = null;
  96932. },
  96933. mounted: function mounted() {
  96934. this.scrollDebounce = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["debounce"])(this.onScroll, 50);
  96935. this.$refs.table.addEventListener('scroll', this.scrollDebounce, {
  96936. passive: true
  96937. });
  96938. },
  96939. beforeDestroy: function beforeDestroy() {
  96940. this.$refs.table.removeEventListener('scroll', this.scrollDebounce);
  96941. },
  96942. methods: {
  96943. createStyleHeight: function createStyleHeight(height) {
  96944. return {
  96945. height: height + "px"
  96946. };
  96947. },
  96948. genBody: function genBody() {
  96949. if (this.cachedItems === null || this.chunkIndex !== this.oldChunk) {
  96950. this.cachedItems = this.genItems();
  96951. this.oldChunk = this.chunkIndex;
  96952. }
  96953. return this.$createElement('tbody', [this.$createElement('tr', {
  96954. style: this.createStyleHeight(this.offsetTop)
  96955. }), this.cachedItems, this.$createElement('tr', {
  96956. style: this.createStyleHeight(this.offsetBottom)
  96957. })]);
  96958. },
  96959. genItems: function genItems() {
  96960. return this.$scopedSlots.items({
  96961. items: this.items.slice(this.startIndex, this.stopIndex)
  96962. });
  96963. },
  96964. onScroll: function onScroll(e) {
  96965. var target = e.target;
  96966. this.scrollTop = target.scrollTop;
  96967. },
  96968. genTable: function genTable() {
  96969. return this.$createElement('div', {
  96970. ref: 'table',
  96971. staticClass: 'v-virtual-table__table'
  96972. }, [this.$createElement('table', [this.$slots['body.before'], this.genBody(), this.$slots['body.after']])]);
  96973. },
  96974. genWrapper: function genWrapper() {
  96975. return this.$createElement('div', {
  96976. staticClass: 'v-virtual-table__wrapper',
  96977. style: {
  96978. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.height)
  96979. }
  96980. }, [this.genTable()]);
  96981. }
  96982. },
  96983. render: function render(h) {
  96984. return h('div', {
  96985. staticClass: 'v-data-table v-virtual-table',
  96986. class: this.classes
  96987. }, [this.$slots.top, this.genWrapper(), this.$slots.bottom]);
  96988. }
  96989. }));
  96990. /***/ }),
  96991. /***/ "./src/components/VDataTable/index.ts":
  96992. /*!********************************************!*\
  96993. !*** ./src/components/VDataTable/index.ts ***!
  96994. \********************************************/
  96995. /*! exports provided: VDataTable, VEditDialog, VTableOverflow, VDataTableHeader, VSimpleTable, VVirtualTable, default */
  96996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96997. "use strict";
  96998. __webpack_require__.r(__webpack_exports__);
  96999. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VTableOverflow", function() { return VTableOverflow; });
  97000. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  97001. /* harmony import */ var _VDataTable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VDataTable */ "./src/components/VDataTable/VDataTable.ts");
  97002. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataTable", function() { return _VDataTable__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  97003. /* harmony import */ var _VDataTableHeader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VDataTableHeader */ "./src/components/VDataTable/VDataTableHeader.ts");
  97004. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataTableHeader", function() { return _VDataTableHeader__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  97005. /* harmony import */ var _VEditDialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VEditDialog */ "./src/components/VDataTable/VEditDialog.ts");
  97006. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VEditDialog", function() { return _VEditDialog__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  97007. /* harmony import */ var _VSimpleTable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VSimpleTable */ "./src/components/VDataTable/VSimpleTable.ts");
  97008. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSimpleTable", function() { return _VSimpleTable__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  97009. /* harmony import */ var _VVirtualTable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VVirtualTable */ "./src/components/VDataTable/VVirtualTable.ts");
  97010. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VVirtualTable", function() { return _VVirtualTable__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  97011. var VTableOverflow = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-table__overflow');
  97012. /* harmony default export */ __webpack_exports__["default"] = ({
  97013. $_vuetify_subcomponents: {
  97014. VDataTable: _VDataTable__WEBPACK_IMPORTED_MODULE_1__["default"],
  97015. VDataTableHeader: _VDataTableHeader__WEBPACK_IMPORTED_MODULE_2__["default"],
  97016. VEditDialog: _VEditDialog__WEBPACK_IMPORTED_MODULE_3__["default"],
  97017. VTableOverflow: VTableOverflow,
  97018. VSimpleTable: _VSimpleTable__WEBPACK_IMPORTED_MODULE_4__["default"],
  97019. VVirtualTable: _VVirtualTable__WEBPACK_IMPORTED_MODULE_5__["default"]
  97020. }
  97021. });
  97022. /***/ }),
  97023. /***/ "./src/components/VDataTable/mixins/header.ts":
  97024. /*!****************************************************!*\
  97025. !*** ./src/components/VDataTable/mixins/header.ts ***!
  97026. \****************************************************/
  97027. /*! exports provided: default */
  97028. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97029. "use strict";
  97030. __webpack_require__.r(__webpack_exports__);
  97031. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../VIcon */ "./src/components/VIcon/index.ts");
  97032. /* harmony import */ var _VCheckbox_VSimpleCheckbox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../VCheckbox/VSimpleCheckbox */ "./src/components/VCheckbox/VSimpleCheckbox.ts");
  97033. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../directives/ripple */ "./src/directives/ripple/index.ts");
  97034. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../util/mixins */ "./src/util/mixins.ts");
  97035. var __assign = undefined && undefined.__assign || function () {
  97036. __assign = Object.assign || function (t) {
  97037. for (var s, i = 1, n = arguments.length; i < n; i++) {
  97038. s = arguments[i];
  97039. for (var p in s) {
  97040. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  97041. }
  97042. }
  97043. return t;
  97044. };
  97045. return __assign.apply(this, arguments);
  97046. };
  97047. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])().extend({
  97048. // https://github.com/vuejs/vue/issues/6872
  97049. directives: {
  97050. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_2__["default"]
  97051. },
  97052. props: {
  97053. headers: {
  97054. type: Array,
  97055. default: function _default() {
  97056. return [];
  97057. }
  97058. },
  97059. options: {
  97060. type: Object,
  97061. default: function _default() {
  97062. return {
  97063. page: 1,
  97064. itemsPerPage: 10,
  97065. sortBy: [],
  97066. sortDesc: [],
  97067. groupBy: [],
  97068. groupDesc: [],
  97069. multiSort: false,
  97070. mustSort: false
  97071. };
  97072. }
  97073. },
  97074. sortIcon: {
  97075. type: String,
  97076. default: '$sort'
  97077. },
  97078. everyItem: Boolean,
  97079. someItems: Boolean,
  97080. showGroupBy: Boolean,
  97081. singleSelect: Boolean,
  97082. disableSort: Boolean
  97083. },
  97084. methods: {
  97085. genSelectAll: function genSelectAll() {
  97086. var _this = this;
  97087. var data = {
  97088. props: {
  97089. value: this.everyItem,
  97090. indeterminate: !this.everyItem && this.someItems
  97091. },
  97092. on: {
  97093. input: function input(v) {
  97094. return _this.$emit('toggle-select-all', v);
  97095. }
  97096. }
  97097. };
  97098. if (this.$scopedSlots['data-table-select']) {
  97099. return this.$scopedSlots['data-table-select'](data);
  97100. }
  97101. return this.$createElement(_VCheckbox_VSimpleCheckbox__WEBPACK_IMPORTED_MODULE_1__["default"], __assign({
  97102. staticClass: 'v-data-table__checkbox'
  97103. }, data));
  97104. },
  97105. genSortIcon: function genSortIcon() {
  97106. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"], {
  97107. staticClass: 'v-data-table-header__icon',
  97108. props: {
  97109. size: 18
  97110. }
  97111. }, [this.sortIcon]);
  97112. }
  97113. }
  97114. }));
  97115. /***/ }),
  97116. /***/ "./src/components/VDatePicker/VDatePicker.ts":
  97117. /*!***************************************************!*\
  97118. !*** ./src/components/VDatePicker/VDatePicker.ts ***!
  97119. \***************************************************/
  97120. /*! exports provided: default */
  97121. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97122. "use strict";
  97123. __webpack_require__.r(__webpack_exports__);
  97124. /* harmony import */ var _VDatePickerTitle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDatePickerTitle */ "./src/components/VDatePicker/VDatePickerTitle.ts");
  97125. /* harmony import */ var _VDatePickerHeader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VDatePickerHeader */ "./src/components/VDatePicker/VDatePickerHeader.ts");
  97126. /* harmony import */ var _VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VDatePickerDateTable */ "./src/components/VDatePicker/VDatePickerDateTable.ts");
  97127. /* harmony import */ var _VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VDatePickerMonthTable */ "./src/components/VDatePicker/VDatePickerMonthTable.ts");
  97128. /* harmony import */ var _VDatePickerYears__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VDatePickerYears */ "./src/components/VDatePicker/VDatePickerYears.ts");
  97129. /* harmony import */ var _mixins_localable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/localable */ "./src/mixins/localable/index.ts");
  97130. /* harmony import */ var _mixins_picker__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/picker */ "./src/mixins/picker/index.ts");
  97131. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.ts");
  97132. /* harmony import */ var _util_isDateAllowed__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util/isDateAllowed */ "./src/components/VDatePicker/util/isDateAllowed.ts");
  97133. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  97134. /* harmony import */ var _VCalendar_util_timestamp__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../VCalendar/util/timestamp */ "./src/components/VCalendar/util/timestamp.ts");
  97135. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  97136. var __read = undefined && undefined.__read || function (o, n) {
  97137. var m = typeof Symbol === "function" && o[Symbol.iterator];
  97138. if (!m) return o;
  97139. var i = m.call(o),
  97140. r,
  97141. ar = [],
  97142. e;
  97143. try {
  97144. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  97145. ar.push(r.value);
  97146. }
  97147. } catch (error) {
  97148. e = {
  97149. error: error
  97150. };
  97151. } finally {
  97152. try {
  97153. if (r && !r.done && (m = i["return"])) m.call(i);
  97154. } finally {
  97155. if (e) throw e.error;
  97156. }
  97157. }
  97158. return ar;
  97159. };
  97160. var __spread = undefined && undefined.__spread || function () {
  97161. for (var ar = [], i = 0; i < arguments.length; i++) {
  97162. ar = ar.concat(__read(arguments[i]));
  97163. }
  97164. return ar;
  97165. }; // Components
  97166. // Mixins
  97167. // Utils
  97168. // Adds leading zero to month/day if necessary, returns 'YYYY' if type = 'year',
  97169. // 'YYYY-MM' if 'month' and 'YYYY-MM-DD' if 'date'
  97170. function sanitizeDateString(dateString, type) {
  97171. var _a = __read(dateString.split('-'), 3),
  97172. year = _a[0],
  97173. _b = _a[1],
  97174. month = _b === void 0 ? 1 : _b,
  97175. _c = _a[2],
  97176. date = _c === void 0 ? 1 : _c;
  97177. return (year + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(month) + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(date)).substr(0, {
  97178. date: 10,
  97179. month: 7,
  97180. year: 4
  97181. }[type]);
  97182. }
  97183. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_11__["default"])(_mixins_localable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_picker__WEBPACK_IMPORTED_MODULE_6__["default"]
  97184. /* @vue/component */
  97185. ).extend({
  97186. name: 'v-date-picker',
  97187. props: {
  97188. allowedDates: Function,
  97189. // Function formatting the day in date picker table
  97190. dayFormat: Function,
  97191. disabled: Boolean,
  97192. events: {
  97193. type: [Array, Function, Object],
  97194. default: function _default() {
  97195. return null;
  97196. }
  97197. },
  97198. eventColor: {
  97199. type: [Array, Function, Object, String],
  97200. default: function _default() {
  97201. return 'warning';
  97202. }
  97203. },
  97204. firstDayOfWeek: {
  97205. type: [String, Number],
  97206. default: 0
  97207. },
  97208. // Function formatting the tableDate in the day/month table header
  97209. headerDateFormat: Function,
  97210. localeFirstDayOfYear: {
  97211. type: [String, Number],
  97212. default: 0
  97213. },
  97214. max: String,
  97215. min: String,
  97216. // Function formatting month in the months table
  97217. monthFormat: Function,
  97218. multiple: Boolean,
  97219. nextIcon: {
  97220. type: String,
  97221. default: '$next'
  97222. },
  97223. pickerDate: String,
  97224. prevIcon: {
  97225. type: String,
  97226. default: '$prev'
  97227. },
  97228. range: Boolean,
  97229. reactive: Boolean,
  97230. readonly: Boolean,
  97231. scrollable: Boolean,
  97232. showCurrent: {
  97233. type: [Boolean, String],
  97234. default: true
  97235. },
  97236. selectedItemsText: {
  97237. type: String,
  97238. default: '$vuetify.datePicker.itemsSelected'
  97239. },
  97240. showWeek: Boolean,
  97241. // Function formatting currently selected date in the picker title
  97242. titleDateFormat: Function,
  97243. type: {
  97244. type: String,
  97245. default: 'date',
  97246. validator: function validator(type) {
  97247. return ['date', 'month'].includes(type);
  97248. }
  97249. },
  97250. value: [Array, String],
  97251. weekdayFormat: Function,
  97252. // Function formatting the year in table header and pickup title
  97253. yearFormat: Function,
  97254. yearIcon: String
  97255. },
  97256. data: function data() {
  97257. var _this = this;
  97258. var now = new Date();
  97259. return {
  97260. activePicker: this.type.toUpperCase(),
  97261. inputDay: null,
  97262. inputMonth: null,
  97263. inputYear: null,
  97264. isReversing: false,
  97265. now: now,
  97266. // tableDate is a string in 'YYYY' / 'YYYY-M' format (leading zero for month is not required)
  97267. tableDate: function () {
  97268. if (_this.pickerDate) {
  97269. return _this.pickerDate;
  97270. }
  97271. var date = (_this.multiple || _this.range ? _this.value[_this.value.length - 1] : _this.value) || now.getFullYear() + "-" + (now.getMonth() + 1);
  97272. return sanitizeDateString(date, _this.type === 'date' ? 'month' : 'year');
  97273. }()
  97274. };
  97275. },
  97276. computed: {
  97277. isMultiple: function isMultiple() {
  97278. return this.multiple || this.range;
  97279. },
  97280. lastValue: function lastValue() {
  97281. return this.isMultiple ? this.value[this.value.length - 1] : this.value;
  97282. },
  97283. selectedMonths: function selectedMonths() {
  97284. if (!this.value || !this.value.length || this.type === 'month') {
  97285. return this.value;
  97286. } else if (this.isMultiple) {
  97287. return this.value.map(function (val) {
  97288. return val.substr(0, 7);
  97289. });
  97290. } else {
  97291. return this.value.substr(0, 7);
  97292. }
  97293. },
  97294. current: function current() {
  97295. if (this.showCurrent === true) {
  97296. return sanitizeDateString(this.now.getFullYear() + "-" + (this.now.getMonth() + 1) + "-" + this.now.getDate(), this.type);
  97297. }
  97298. return this.showCurrent || null;
  97299. },
  97300. inputDate: function inputDate() {
  97301. return this.type === 'date' ? this.inputYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(this.inputMonth + 1) + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(this.inputDay) : this.inputYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(this.inputMonth + 1);
  97302. },
  97303. tableMonth: function tableMonth() {
  97304. return Number((this.pickerDate || this.tableDate).split('-')[1]) - 1;
  97305. },
  97306. tableYear: function tableYear() {
  97307. return Number((this.pickerDate || this.tableDate).split('-')[0]);
  97308. },
  97309. minMonth: function minMonth() {
  97310. return this.min ? sanitizeDateString(this.min, 'month') : null;
  97311. },
  97312. maxMonth: function maxMonth() {
  97313. return this.max ? sanitizeDateString(this.max, 'month') : null;
  97314. },
  97315. minYear: function minYear() {
  97316. return this.min ? sanitizeDateString(this.min, 'year') : null;
  97317. },
  97318. maxYear: function maxYear() {
  97319. return this.max ? sanitizeDateString(this.max, 'year') : null;
  97320. },
  97321. formatters: function formatters() {
  97322. return {
  97323. year: this.yearFormat || Object(_util__WEBPACK_IMPORTED_MODULE_7__["createNativeLocaleFormatter"])(this.currentLocale, {
  97324. year: 'numeric',
  97325. timeZone: 'UTC'
  97326. }, {
  97327. length: 4
  97328. }),
  97329. titleDate: this.titleDateFormat || (this.isMultiple ? this.defaultTitleMultipleDateFormatter : this.defaultTitleDateFormatter)
  97330. };
  97331. },
  97332. defaultTitleMultipleDateFormatter: function defaultTitleMultipleDateFormatter() {
  97333. var _this = this;
  97334. return function (dates) {
  97335. if (!dates.length) {
  97336. return '-';
  97337. }
  97338. if (dates.length === 1) {
  97339. return _this.defaultTitleDateFormatter(dates[0]);
  97340. }
  97341. return _this.$vuetify.lang.t(_this.selectedItemsText, dates.length);
  97342. };
  97343. },
  97344. defaultTitleDateFormatter: function defaultTitleDateFormatter() {
  97345. var titleFormats = {
  97346. year: {
  97347. year: 'numeric',
  97348. timeZone: 'UTC'
  97349. },
  97350. month: {
  97351. month: 'long',
  97352. timeZone: 'UTC'
  97353. },
  97354. date: {
  97355. weekday: 'short',
  97356. month: 'short',
  97357. day: 'numeric',
  97358. timeZone: 'UTC'
  97359. }
  97360. };
  97361. var titleDateFormatter = Object(_util__WEBPACK_IMPORTED_MODULE_7__["createNativeLocaleFormatter"])(this.currentLocale, titleFormats[this.type], {
  97362. start: 0,
  97363. length: {
  97364. date: 10,
  97365. month: 7,
  97366. year: 4
  97367. }[this.type]
  97368. });
  97369. var landscapeFormatter = function landscapeFormatter(date) {
  97370. return titleDateFormatter(date).replace(/([^\d\s])([\d])/g, function (match, nonDigit, digit) {
  97371. return nonDigit + " " + digit;
  97372. }).replace(', ', ',<br>');
  97373. };
  97374. return this.landscape ? landscapeFormatter : titleDateFormatter;
  97375. }
  97376. },
  97377. watch: {
  97378. tableDate: function tableDate(val, prev) {
  97379. // Make a ISO 8601 strings from val and prev for comparision, otherwise it will incorrectly
  97380. // compare for example '2000-9' and '2000-10'
  97381. var sanitizeType = this.type === 'month' ? 'year' : 'month';
  97382. this.isReversing = sanitizeDateString(val, sanitizeType) < sanitizeDateString(prev, sanitizeType);
  97383. this.$emit('update:picker-date', val);
  97384. },
  97385. pickerDate: function pickerDate(val) {
  97386. if (val) {
  97387. this.tableDate = val;
  97388. } else if (this.lastValue && this.type === 'date') {
  97389. this.tableDate = sanitizeDateString(this.lastValue, 'month');
  97390. } else if (this.lastValue && this.type === 'month') {
  97391. this.tableDate = sanitizeDateString(this.lastValue, 'year');
  97392. }
  97393. },
  97394. value: function value(newValue, oldValue) {
  97395. this.checkMultipleProp();
  97396. this.setInputDate();
  97397. if (!this.isMultiple && this.value && !this.pickerDate) {
  97398. this.tableDate = sanitizeDateString(this.inputDate, this.type === 'month' ? 'year' : 'month');
  97399. } else if (this.isMultiple && this.value.length && !oldValue.length && !this.pickerDate) {
  97400. this.tableDate = sanitizeDateString(this.inputDate, this.type === 'month' ? 'year' : 'month');
  97401. }
  97402. },
  97403. type: function type(_type) {
  97404. this.activePicker = _type.toUpperCase();
  97405. if (this.value && this.value.length) {
  97406. var output = (this.isMultiple ? this.value : [this.value]).map(function (val) {
  97407. return sanitizeDateString(val, _type);
  97408. }).filter(this.isDateAllowed);
  97409. this.$emit('input', this.isMultiple ? output : output[0]);
  97410. }
  97411. }
  97412. },
  97413. created: function created() {
  97414. this.checkMultipleProp();
  97415. if (this.pickerDate !== this.tableDate) {
  97416. this.$emit('update:picker-date', this.tableDate);
  97417. }
  97418. this.setInputDate();
  97419. },
  97420. methods: {
  97421. emitInput: function emitInput(newInput) {
  97422. if (this.range && this.value) {
  97423. if (this.value.length !== 1) {
  97424. this.$emit('input', [newInput]);
  97425. } else {
  97426. var output_1 = __spread(this.value, [newInput]);
  97427. this.$emit('input', output_1);
  97428. this.$emit('change', output_1);
  97429. }
  97430. return;
  97431. }
  97432. var output = this.multiple ? this.value.indexOf(newInput) === -1 ? this.value.concat([newInput]) : this.value.filter(function (x) {
  97433. return x !== newInput;
  97434. }) : newInput;
  97435. this.$emit('input', output);
  97436. this.multiple || this.$emit('change', newInput);
  97437. },
  97438. checkMultipleProp: function checkMultipleProp() {
  97439. if (this.value == null) return;
  97440. var valueType = this.value.constructor.name;
  97441. var expected = this.isMultiple ? 'Array' : 'String';
  97442. if (valueType !== expected) {
  97443. Object(_util_console__WEBPACK_IMPORTED_MODULE_9__["consoleWarn"])("Value must be " + (this.isMultiple ? 'an' : 'a') + " " + expected + ", got " + valueType, this);
  97444. }
  97445. },
  97446. isDateAllowed: function isDateAllowed(value) {
  97447. return Object(_util_isDateAllowed__WEBPACK_IMPORTED_MODULE_8__["default"])(value, this.min, this.max, this.allowedDates);
  97448. },
  97449. yearClick: function yearClick(value) {
  97450. this.inputYear = value;
  97451. if (this.type === 'month') {
  97452. this.tableDate = "" + value;
  97453. } else {
  97454. this.tableDate = value + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])((this.tableMonth || 0) + 1);
  97455. }
  97456. this.activePicker = 'MONTH';
  97457. if (this.reactive && !this.readonly && !this.isMultiple && this.isDateAllowed(this.inputDate)) {
  97458. this.$emit('input', this.inputDate);
  97459. }
  97460. },
  97461. monthClick: function monthClick(value) {
  97462. this.inputYear = parseInt(value.split('-')[0], 10);
  97463. this.inputMonth = parseInt(value.split('-')[1], 10) - 1;
  97464. if (this.type === 'date') {
  97465. if (this.inputDay) {
  97466. this.inputDay = Math.min(this.inputDay, Object(_VCalendar_util_timestamp__WEBPACK_IMPORTED_MODULE_10__["daysInMonth"])(this.inputYear, this.inputMonth + 1));
  97467. }
  97468. this.tableDate = value;
  97469. this.activePicker = 'DATE';
  97470. if (this.reactive && !this.readonly && !this.isMultiple && this.isDateAllowed(this.inputDate)) {
  97471. this.$emit('input', this.inputDate);
  97472. }
  97473. } else {
  97474. this.emitInput(this.inputDate);
  97475. }
  97476. },
  97477. dateClick: function dateClick(value) {
  97478. this.inputYear = parseInt(value.split('-')[0], 10);
  97479. this.inputMonth = parseInt(value.split('-')[1], 10) - 1;
  97480. this.inputDay = parseInt(value.split('-')[2], 10);
  97481. this.emitInput(this.inputDate);
  97482. },
  97483. genPickerTitle: function genPickerTitle() {
  97484. var _this = this;
  97485. return this.$createElement(_VDatePickerTitle__WEBPACK_IMPORTED_MODULE_0__["default"], {
  97486. props: {
  97487. date: this.value ? this.formatters.titleDate(this.value) : '',
  97488. disabled: this.disabled,
  97489. readonly: this.readonly,
  97490. selectingYear: this.activePicker === 'YEAR',
  97491. year: this.formatters.year(this.value ? "" + this.inputYear : this.tableDate),
  97492. yearIcon: this.yearIcon,
  97493. value: this.isMultiple ? this.value[0] : this.value
  97494. },
  97495. slot: 'title',
  97496. on: {
  97497. 'update:selecting-year': function updateSelectingYear(value) {
  97498. return _this.activePicker = value ? 'YEAR' : _this.type.toUpperCase();
  97499. }
  97500. }
  97501. });
  97502. },
  97503. genTableHeader: function genTableHeader() {
  97504. var _this = this;
  97505. return this.$createElement(_VDatePickerHeader__WEBPACK_IMPORTED_MODULE_1__["default"], {
  97506. props: {
  97507. nextIcon: this.nextIcon,
  97508. color: this.color,
  97509. dark: this.dark,
  97510. disabled: this.disabled,
  97511. format: this.headerDateFormat,
  97512. light: this.light,
  97513. locale: this.locale,
  97514. min: this.activePicker === 'DATE' ? this.minMonth : this.minYear,
  97515. max: this.activePicker === 'DATE' ? this.maxMonth : this.maxYear,
  97516. prevIcon: this.prevIcon,
  97517. readonly: this.readonly,
  97518. value: this.activePicker === 'DATE' ? Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(this.tableYear, 4) + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(this.tableMonth + 1) : "" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(this.tableYear, 4)
  97519. },
  97520. on: {
  97521. toggle: function toggle() {
  97522. return _this.activePicker = _this.activePicker === 'DATE' ? 'MONTH' : 'YEAR';
  97523. },
  97524. input: function input(value) {
  97525. return _this.tableDate = value;
  97526. }
  97527. }
  97528. });
  97529. },
  97530. genDateTable: function genDateTable() {
  97531. var _this = this;
  97532. return this.$createElement(_VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_2__["default"], {
  97533. props: {
  97534. allowedDates: this.allowedDates,
  97535. color: this.color,
  97536. current: this.current,
  97537. dark: this.dark,
  97538. disabled: this.disabled,
  97539. events: this.events,
  97540. eventColor: this.eventColor,
  97541. firstDayOfWeek: this.firstDayOfWeek,
  97542. format: this.dayFormat,
  97543. light: this.light,
  97544. locale: this.locale,
  97545. localeFirstDayOfYear: this.localeFirstDayOfYear,
  97546. min: this.min,
  97547. max: this.max,
  97548. range: this.range,
  97549. readonly: this.readonly,
  97550. scrollable: this.scrollable,
  97551. showWeek: this.showWeek,
  97552. tableDate: Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(this.tableYear, 4) + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(this.tableMonth + 1),
  97553. value: this.value,
  97554. weekdayFormat: this.weekdayFormat
  97555. },
  97556. ref: 'table',
  97557. on: {
  97558. input: this.dateClick,
  97559. 'update:table-date': function updateTableDate(value) {
  97560. return _this.tableDate = value;
  97561. },
  97562. 'click:date': function clickDate(value) {
  97563. return _this.$emit('click:date', value);
  97564. },
  97565. 'dblclick:date': function dblclickDate(value) {
  97566. return _this.$emit('dblclick:date', value);
  97567. }
  97568. }
  97569. });
  97570. },
  97571. genMonthTable: function genMonthTable() {
  97572. var _this = this;
  97573. return this.$createElement(_VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_3__["default"], {
  97574. props: {
  97575. allowedDates: this.type === 'month' ? this.allowedDates : null,
  97576. color: this.color,
  97577. current: this.current ? sanitizeDateString(this.current, 'month') : null,
  97578. dark: this.dark,
  97579. disabled: this.disabled,
  97580. events: this.type === 'month' ? this.events : null,
  97581. eventColor: this.type === 'month' ? this.eventColor : null,
  97582. format: this.monthFormat,
  97583. light: this.light,
  97584. locale: this.locale,
  97585. min: this.minMonth,
  97586. max: this.maxMonth,
  97587. range: this.range,
  97588. readonly: this.readonly && this.type === 'month',
  97589. scrollable: this.scrollable,
  97590. value: this.selectedMonths,
  97591. tableDate: "" + Object(_util__WEBPACK_IMPORTED_MODULE_7__["pad"])(this.tableYear, 4)
  97592. },
  97593. ref: 'table',
  97594. on: {
  97595. input: this.monthClick,
  97596. 'update:table-date': function updateTableDate(value) {
  97597. return _this.tableDate = value;
  97598. },
  97599. 'click:month': function clickMonth(value) {
  97600. return _this.$emit('click:month', value);
  97601. },
  97602. 'dblclick:month': function dblclickMonth(value) {
  97603. return _this.$emit('dblclick:month', value);
  97604. }
  97605. }
  97606. });
  97607. },
  97608. genYears: function genYears() {
  97609. return this.$createElement(_VDatePickerYears__WEBPACK_IMPORTED_MODULE_4__["default"], {
  97610. props: {
  97611. color: this.color,
  97612. format: this.yearFormat,
  97613. locale: this.locale,
  97614. min: this.minYear,
  97615. max: this.maxYear,
  97616. value: this.tableYear
  97617. },
  97618. on: {
  97619. input: this.yearClick
  97620. }
  97621. });
  97622. },
  97623. genPickerBody: function genPickerBody() {
  97624. var children = this.activePicker === 'YEAR' ? [this.genYears()] : [this.genTableHeader(), this.activePicker === 'DATE' ? this.genDateTable() : this.genMonthTable()];
  97625. return this.$createElement('div', {
  97626. key: this.activePicker
  97627. }, children);
  97628. },
  97629. setInputDate: function setInputDate() {
  97630. if (this.lastValue) {
  97631. var array = this.lastValue.split('-');
  97632. this.inputYear = parseInt(array[0], 10);
  97633. this.inputMonth = parseInt(array[1], 10) - 1;
  97634. if (this.type === 'date') {
  97635. this.inputDay = parseInt(array[2], 10);
  97636. }
  97637. } else {
  97638. this.inputYear = this.inputYear || this.now.getFullYear();
  97639. this.inputMonth = this.inputMonth == null ? this.inputMonth : this.now.getMonth();
  97640. this.inputDay = this.inputDay || this.now.getDate();
  97641. }
  97642. }
  97643. },
  97644. render: function render() {
  97645. return this.genPicker('v-picker--date');
  97646. }
  97647. }));
  97648. /***/ }),
  97649. /***/ "./src/components/VDatePicker/VDatePickerDateTable.ts":
  97650. /*!************************************************************!*\
  97651. !*** ./src/components/VDatePicker/VDatePickerDateTable.ts ***!
  97652. \************************************************************/
  97653. /*! exports provided: default */
  97654. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97655. "use strict";
  97656. __webpack_require__.r(__webpack_exports__);
  97657. /* harmony import */ var _mixins_date_picker_table__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mixins/date-picker-table */ "./src/components/VDatePicker/mixins/date-picker-table.ts");
  97658. /* harmony import */ var _util_dateTimeUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/dateTimeUtils */ "./src/util/dateTimeUtils.ts");
  97659. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.ts");
  97660. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  97661. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  97662. // Mixins
  97663. // Utils
  97664. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_date_picker_table__WEBPACK_IMPORTED_MODULE_0__["default"]
  97665. /* @vue/component */
  97666. ).extend({
  97667. name: 'v-date-picker-date-table',
  97668. props: {
  97669. firstDayOfWeek: {
  97670. type: [String, Number],
  97671. default: 0
  97672. },
  97673. localeFirstDayOfYear: {
  97674. type: [String, Number],
  97675. default: 0
  97676. },
  97677. showWeek: Boolean,
  97678. weekdayFormat: Function
  97679. },
  97680. computed: {
  97681. formatter: function formatter() {
  97682. return this.format || Object(_util__WEBPACK_IMPORTED_MODULE_2__["createNativeLocaleFormatter"])(this.currentLocale, {
  97683. day: 'numeric',
  97684. timeZone: 'UTC'
  97685. }, {
  97686. start: 8,
  97687. length: 2
  97688. });
  97689. },
  97690. weekdayFormatter: function weekdayFormatter() {
  97691. return this.weekdayFormat || Object(_util__WEBPACK_IMPORTED_MODULE_2__["createNativeLocaleFormatter"])(this.currentLocale, {
  97692. weekday: 'narrow',
  97693. timeZone: 'UTC'
  97694. });
  97695. },
  97696. weekDays: function weekDays() {
  97697. var _this = this;
  97698. var first = parseInt(this.firstDayOfWeek, 10);
  97699. return this.weekdayFormatter ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["createRange"])(7).map(function (i) {
  97700. return _this.weekdayFormatter("2017-01-" + (first + i + 15));
  97701. }) // 2017-01-15 is Sunday
  97702. : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["createRange"])(7).map(function (i) {
  97703. return ['S', 'M', 'T', 'W', 'T', 'F', 'S'][(i + first) % 7];
  97704. });
  97705. }
  97706. },
  97707. methods: {
  97708. calculateTableDate: function calculateTableDate(delta) {
  97709. return Object(_util__WEBPACK_IMPORTED_MODULE_2__["monthChange"])(this.tableDate, Math.sign(delta || 1));
  97710. },
  97711. genTHead: function genTHead() {
  97712. var _this = this;
  97713. var days = this.weekDays.map(function (day) {
  97714. return _this.$createElement('th', day);
  97715. });
  97716. if (this.showWeek) {
  97717. days.unshift(this.$createElement('th'));
  97718. }
  97719. return this.$createElement('thead', this.genTR(days));
  97720. },
  97721. // Returns number of the days from the firstDayOfWeek to the first day of the current month
  97722. weekDaysBeforeFirstDayOfTheMonth: function weekDaysBeforeFirstDayOfTheMonth() {
  97723. var firstDayOfTheMonth = new Date(this.displayedYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_2__["pad"])(this.displayedMonth + 1) + "-01T00:00:00+00:00");
  97724. var weekDay = firstDayOfTheMonth.getUTCDay();
  97725. return (weekDay - parseInt(this.firstDayOfWeek) + 7) % 7;
  97726. },
  97727. getWeekNumber: function getWeekNumber(dayInMonth) {
  97728. return Object(_util_dateTimeUtils__WEBPACK_IMPORTED_MODULE_1__["weekNumber"])(this.displayedYear, this.displayedMonth, dayInMonth, parseInt(this.firstDayOfWeek), parseInt(this.localeFirstDayOfYear));
  97729. },
  97730. genWeekNumber: function genWeekNumber(weekNumber) {
  97731. return this.$createElement('td', [this.$createElement('small', {
  97732. staticClass: 'v-date-picker-table--date__week'
  97733. }, String(weekNumber).padStart(2, '0'))]);
  97734. },
  97735. genTBody: function genTBody() {
  97736. var children = [];
  97737. var daysInMonth = new Date(this.displayedYear, this.displayedMonth + 1, 0).getDate();
  97738. var rows = [];
  97739. var day = this.weekDaysBeforeFirstDayOfTheMonth();
  97740. if (this.showWeek) {
  97741. rows.push(this.genWeekNumber(this.getWeekNumber(1)));
  97742. }
  97743. while (day--) {
  97744. rows.push(this.$createElement('td'));
  97745. }
  97746. for (day = 1; day <= daysInMonth; day++) {
  97747. var date = this.displayedYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_2__["pad"])(this.displayedMonth + 1) + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_2__["pad"])(day);
  97748. rows.push(this.$createElement('td', [this.genButton(date, true, 'date', this.formatter)]));
  97749. if (rows.length % (this.showWeek ? 8 : 7) === 0) {
  97750. children.push(this.genTR(rows));
  97751. rows = [];
  97752. if (this.showWeek && day < daysInMonth) {
  97753. rows.push(this.genWeekNumber(this.getWeekNumber(day + 7)));
  97754. }
  97755. }
  97756. }
  97757. if (rows.length) {
  97758. children.push(this.genTR(rows));
  97759. }
  97760. return this.$createElement('tbody', children);
  97761. },
  97762. genTR: function genTR(children) {
  97763. return [this.$createElement('tr', children)];
  97764. }
  97765. },
  97766. render: function render() {
  97767. return this.genTable('v-date-picker-table v-date-picker-table--date', [this.genTHead(), this.genTBody()], this.calculateTableDate);
  97768. }
  97769. }));
  97770. /***/ }),
  97771. /***/ "./src/components/VDatePicker/VDatePickerHeader.sass":
  97772. /*!***********************************************************!*\
  97773. !*** ./src/components/VDatePicker/VDatePickerHeader.sass ***!
  97774. \***********************************************************/
  97775. /*! no static exports found */
  97776. /***/ (function(module, exports, __webpack_require__) {
  97777. // extracted by mini-css-extract-plugin
  97778. /***/ }),
  97779. /***/ "./src/components/VDatePicker/VDatePickerHeader.ts":
  97780. /*!*********************************************************!*\
  97781. !*** ./src/components/VDatePicker/VDatePickerHeader.ts ***!
  97782. \*********************************************************/
  97783. /*! exports provided: default */
  97784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97785. "use strict";
  97786. __webpack_require__.r(__webpack_exports__);
  97787. /* harmony import */ var _VDatePickerHeader_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDatePickerHeader.sass */ "./src/components/VDatePicker/VDatePickerHeader.sass");
  97788. /* harmony import */ var _VDatePickerHeader_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VDatePickerHeader_sass__WEBPACK_IMPORTED_MODULE_0__);
  97789. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  97790. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  97791. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  97792. /* harmony import */ var _mixins_localable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/localable */ "./src/mixins/localable/index.ts");
  97793. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  97794. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.ts");
  97795. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  97796. var __assign = undefined && undefined.__assign || function () {
  97797. __assign = Object.assign || function (t) {
  97798. for (var s, i = 1, n = arguments.length; i < n; i++) {
  97799. s = arguments[i];
  97800. for (var p in s) {
  97801. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  97802. }
  97803. }
  97804. return t;
  97805. };
  97806. return __assign.apply(this, arguments);
  97807. };
  97808. var __read = undefined && undefined.__read || function (o, n) {
  97809. var m = typeof Symbol === "function" && o[Symbol.iterator];
  97810. if (!m) return o;
  97811. var i = m.call(o),
  97812. r,
  97813. ar = [],
  97814. e;
  97815. try {
  97816. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  97817. ar.push(r.value);
  97818. }
  97819. } catch (error) {
  97820. e = {
  97821. error: error
  97822. };
  97823. } finally {
  97824. try {
  97825. if (r && !r.done && (m = i["return"])) m.call(i);
  97826. } finally {
  97827. if (e) throw e.error;
  97828. }
  97829. }
  97830. return ar;
  97831. };
  97832. // Components
  97833. // Mixins
  97834. // Utils
  97835. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_7__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_localable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__["default"]
  97836. /* @vue/component */
  97837. ).extend({
  97838. name: 'v-date-picker-header',
  97839. props: {
  97840. disabled: Boolean,
  97841. format: Function,
  97842. min: String,
  97843. max: String,
  97844. nextIcon: {
  97845. type: String,
  97846. default: '$next'
  97847. },
  97848. prevIcon: {
  97849. type: String,
  97850. default: '$prev'
  97851. },
  97852. readonly: Boolean,
  97853. value: {
  97854. type: [Number, String],
  97855. required: true
  97856. }
  97857. },
  97858. data: function data() {
  97859. return {
  97860. isReversing: false
  97861. };
  97862. },
  97863. computed: {
  97864. formatter: function formatter() {
  97865. if (this.format) {
  97866. return this.format;
  97867. } else if (String(this.value).split('-')[1]) {
  97868. return Object(_util__WEBPACK_IMPORTED_MODULE_6__["createNativeLocaleFormatter"])(this.currentLocale, {
  97869. month: 'long',
  97870. year: 'numeric',
  97871. timeZone: 'UTC'
  97872. }, {
  97873. length: 7
  97874. });
  97875. } else {
  97876. return Object(_util__WEBPACK_IMPORTED_MODULE_6__["createNativeLocaleFormatter"])(this.currentLocale, {
  97877. year: 'numeric',
  97878. timeZone: 'UTC'
  97879. }, {
  97880. length: 4
  97881. });
  97882. }
  97883. }
  97884. },
  97885. watch: {
  97886. value: function value(newVal, oldVal) {
  97887. this.isReversing = newVal < oldVal;
  97888. }
  97889. },
  97890. methods: {
  97891. genBtn: function genBtn(change) {
  97892. var _this = this;
  97893. var disabled = this.disabled || change < 0 && this.min && this.calculateChange(change) < this.min || change > 0 && this.max && this.calculateChange(change) > this.max;
  97894. return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_1__["default"], {
  97895. props: {
  97896. dark: this.dark,
  97897. disabled: disabled,
  97898. icon: true,
  97899. light: this.light
  97900. },
  97901. nativeOn: {
  97902. click: function click(e) {
  97903. e.stopPropagation();
  97904. _this.$emit('input', _this.calculateChange(change));
  97905. }
  97906. }
  97907. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], change < 0 === !this.$vuetify.rtl ? this.prevIcon : this.nextIcon)]);
  97908. },
  97909. calculateChange: function calculateChange(sign) {
  97910. var _a = __read(String(this.value).split('-').map(Number), 2),
  97911. year = _a[0],
  97912. month = _a[1];
  97913. if (month == null) {
  97914. return "" + (year + sign);
  97915. } else {
  97916. return Object(_util__WEBPACK_IMPORTED_MODULE_6__["monthChange"])(String(this.value), sign);
  97917. }
  97918. },
  97919. genHeader: function genHeader() {
  97920. var _this = this;
  97921. var color = !this.disabled && (this.color || 'accent');
  97922. var header = this.$createElement('div', this.setTextColor(color, {
  97923. key: String(this.value)
  97924. }), [this.$createElement('button', {
  97925. attrs: {
  97926. type: 'button'
  97927. },
  97928. on: {
  97929. click: function click() {
  97930. return _this.$emit('toggle');
  97931. }
  97932. }
  97933. }, [this.$slots.default || this.formatter(String(this.value))])]);
  97934. var transition = this.$createElement('transition', {
  97935. props: {
  97936. name: this.isReversing === !this.$vuetify.rtl ? 'tab-reverse-transition' : 'tab-transition'
  97937. }
  97938. }, [header]);
  97939. return this.$createElement('div', {
  97940. staticClass: 'v-date-picker-header__value',
  97941. class: {
  97942. 'v-date-picker-header__value--disabled': this.disabled
  97943. }
  97944. }, [transition]);
  97945. }
  97946. },
  97947. render: function render() {
  97948. return this.$createElement('div', {
  97949. staticClass: 'v-date-picker-header',
  97950. class: __assign({
  97951. 'v-date-picker-header--disabled': this.disabled
  97952. }, this.themeClasses)
  97953. }, [this.genBtn(-1), this.genHeader(), this.genBtn(+1)]);
  97954. }
  97955. }));
  97956. /***/ }),
  97957. /***/ "./src/components/VDatePicker/VDatePickerMonthTable.ts":
  97958. /*!*************************************************************!*\
  97959. !*** ./src/components/VDatePicker/VDatePickerMonthTable.ts ***!
  97960. \*************************************************************/
  97961. /*! exports provided: default */
  97962. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97963. "use strict";
  97964. __webpack_require__.r(__webpack_exports__);
  97965. /* harmony import */ var _mixins_date_picker_table__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mixins/date-picker-table */ "./src/components/VDatePicker/mixins/date-picker-table.ts");
  97966. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.ts");
  97967. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  97968. // Mixins
  97969. // Utils
  97970. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_date_picker_table__WEBPACK_IMPORTED_MODULE_0__["default"]
  97971. /* @vue/component */
  97972. ).extend({
  97973. name: 'v-date-picker-month-table',
  97974. computed: {
  97975. formatter: function formatter() {
  97976. return this.format || Object(_util__WEBPACK_IMPORTED_MODULE_1__["createNativeLocaleFormatter"])(this.currentLocale, {
  97977. month: 'short',
  97978. timeZone: 'UTC'
  97979. }, {
  97980. start: 5,
  97981. length: 2
  97982. });
  97983. }
  97984. },
  97985. methods: {
  97986. calculateTableDate: function calculateTableDate(delta) {
  97987. return "" + (parseInt(this.tableDate, 10) + Math.sign(delta || 1));
  97988. },
  97989. genTBody: function genTBody() {
  97990. var _this = this;
  97991. var children = [];
  97992. var cols = Array(3).fill(null);
  97993. var rows = 12 / cols.length;
  97994. var _loop_1 = function _loop_1(row) {
  97995. var tds = cols.map(function (_, col) {
  97996. var month = row * cols.length + col;
  97997. var date = _this.displayedYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_1__["pad"])(month + 1);
  97998. return _this.$createElement('td', {
  97999. key: month
  98000. }, [_this.genButton(date, false, 'month', _this.formatter)]);
  98001. });
  98002. children.push(this_1.$createElement('tr', {
  98003. key: row
  98004. }, tds));
  98005. };
  98006. var this_1 = this;
  98007. for (var row = 0; row < rows; row++) {
  98008. _loop_1(row);
  98009. }
  98010. return this.$createElement('tbody', children);
  98011. }
  98012. },
  98013. render: function render() {
  98014. return this.genTable('v-date-picker-table v-date-picker-table--month', [this.genTBody()], this.calculateTableDate);
  98015. }
  98016. }));
  98017. /***/ }),
  98018. /***/ "./src/components/VDatePicker/VDatePickerTable.sass":
  98019. /*!**********************************************************!*\
  98020. !*** ./src/components/VDatePicker/VDatePickerTable.sass ***!
  98021. \**********************************************************/
  98022. /*! no static exports found */
  98023. /***/ (function(module, exports, __webpack_require__) {
  98024. // extracted by mini-css-extract-plugin
  98025. /***/ }),
  98026. /***/ "./src/components/VDatePicker/VDatePickerTitle.sass":
  98027. /*!**********************************************************!*\
  98028. !*** ./src/components/VDatePicker/VDatePickerTitle.sass ***!
  98029. \**********************************************************/
  98030. /*! no static exports found */
  98031. /***/ (function(module, exports, __webpack_require__) {
  98032. // extracted by mini-css-extract-plugin
  98033. /***/ }),
  98034. /***/ "./src/components/VDatePicker/VDatePickerTitle.ts":
  98035. /*!********************************************************!*\
  98036. !*** ./src/components/VDatePicker/VDatePickerTitle.ts ***!
  98037. \********************************************************/
  98038. /*! exports provided: default */
  98039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98040. "use strict";
  98041. __webpack_require__.r(__webpack_exports__);
  98042. /* harmony import */ var _VDatePickerTitle_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDatePickerTitle.sass */ "./src/components/VDatePicker/VDatePickerTitle.sass");
  98043. /* harmony import */ var _VDatePickerTitle_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VDatePickerTitle_sass__WEBPACK_IMPORTED_MODULE_0__);
  98044. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  98045. /* harmony import */ var _mixins_picker_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/picker-button */ "./src/mixins/picker-button/index.ts");
  98046. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  98047. // Components
  98048. // Mixins
  98049. // Utils
  98050. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_picker_button__WEBPACK_IMPORTED_MODULE_2__["default"]
  98051. /* @vue/component */
  98052. ).extend({
  98053. name: 'v-date-picker-title',
  98054. props: {
  98055. date: {
  98056. type: String,
  98057. default: ''
  98058. },
  98059. disabled: Boolean,
  98060. readonly: Boolean,
  98061. selectingYear: Boolean,
  98062. value: {
  98063. type: String
  98064. },
  98065. year: {
  98066. type: [Number, String],
  98067. default: ''
  98068. },
  98069. yearIcon: {
  98070. type: String
  98071. }
  98072. },
  98073. data: function data() {
  98074. return {
  98075. isReversing: false
  98076. };
  98077. },
  98078. computed: {
  98079. computedTransition: function computedTransition() {
  98080. return this.isReversing ? 'picker-reverse-transition' : 'picker-transition';
  98081. }
  98082. },
  98083. watch: {
  98084. value: function value(val, prev) {
  98085. this.isReversing = val < prev;
  98086. }
  98087. },
  98088. methods: {
  98089. genYearIcon: function genYearIcon() {
  98090. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], {
  98091. props: {
  98092. dark: true
  98093. }
  98094. }, this.yearIcon);
  98095. },
  98096. getYearBtn: function getYearBtn() {
  98097. return this.genPickerButton('selectingYear', true, [String(this.year), this.yearIcon ? this.genYearIcon() : null], false, 'v-date-picker-title__year');
  98098. },
  98099. genTitleText: function genTitleText() {
  98100. return this.$createElement('transition', {
  98101. props: {
  98102. name: this.computedTransition
  98103. }
  98104. }, [this.$createElement('div', {
  98105. domProps: {
  98106. innerHTML: this.date || '&nbsp;'
  98107. },
  98108. key: this.value
  98109. })]);
  98110. },
  98111. genTitleDate: function genTitleDate() {
  98112. return this.genPickerButton('selectingYear', false, [this.genTitleText()], false, 'v-date-picker-title__date');
  98113. }
  98114. },
  98115. render: function render(h) {
  98116. return h('div', {
  98117. staticClass: 'v-date-picker-title',
  98118. class: {
  98119. 'v-date-picker-title--disabled': this.disabled
  98120. }
  98121. }, [this.getYearBtn(), this.genTitleDate()]);
  98122. }
  98123. }));
  98124. /***/ }),
  98125. /***/ "./src/components/VDatePicker/VDatePickerYears.sass":
  98126. /*!**********************************************************!*\
  98127. !*** ./src/components/VDatePicker/VDatePickerYears.sass ***!
  98128. \**********************************************************/
  98129. /*! no static exports found */
  98130. /***/ (function(module, exports, __webpack_require__) {
  98131. // extracted by mini-css-extract-plugin
  98132. /***/ }),
  98133. /***/ "./src/components/VDatePicker/VDatePickerYears.ts":
  98134. /*!********************************************************!*\
  98135. !*** ./src/components/VDatePicker/VDatePickerYears.ts ***!
  98136. \********************************************************/
  98137. /*! exports provided: default */
  98138. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98139. "use strict";
  98140. __webpack_require__.r(__webpack_exports__);
  98141. /* harmony import */ var _VDatePickerYears_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDatePickerYears.sass */ "./src/components/VDatePicker/VDatePickerYears.sass");
  98142. /* harmony import */ var _VDatePickerYears_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VDatePickerYears_sass__WEBPACK_IMPORTED_MODULE_0__);
  98143. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  98144. /* harmony import */ var _mixins_localable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/localable */ "./src/mixins/localable/index.ts");
  98145. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.ts");
  98146. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  98147. // Mixins
  98148. // Utils
  98149. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_localable__WEBPACK_IMPORTED_MODULE_2__["default"]
  98150. /* @vue/component */
  98151. ).extend({
  98152. name: 'v-date-picker-years',
  98153. props: {
  98154. format: Function,
  98155. min: [Number, String],
  98156. max: [Number, String],
  98157. readonly: Boolean,
  98158. value: [Number, String]
  98159. },
  98160. data: function data() {
  98161. return {
  98162. defaultColor: 'primary'
  98163. };
  98164. },
  98165. computed: {
  98166. formatter: function formatter() {
  98167. return this.format || Object(_util__WEBPACK_IMPORTED_MODULE_3__["createNativeLocaleFormatter"])(this.currentLocale, {
  98168. year: 'numeric',
  98169. timeZone: 'UTC'
  98170. }, {
  98171. length: 4
  98172. });
  98173. }
  98174. },
  98175. mounted: function mounted() {
  98176. var _this = this;
  98177. setTimeout(function () {
  98178. var activeItem = _this.$el.getElementsByClassName('active')[0];
  98179. if (activeItem) {
  98180. _this.$el.scrollTop = activeItem.offsetTop - _this.$el.offsetHeight / 2 + activeItem.offsetHeight / 2;
  98181. } else if (_this.min && !_this.max) {
  98182. _this.$el.scrollTop = _this.$el.scrollHeight;
  98183. } else if (!_this.min && _this.max) {
  98184. _this.$el.scrollTop = 0;
  98185. } else {
  98186. _this.$el.scrollTop = _this.$el.scrollHeight / 2 - _this.$el.offsetHeight / 2;
  98187. }
  98188. });
  98189. },
  98190. methods: {
  98191. genYearItem: function genYearItem(year) {
  98192. var _this = this;
  98193. var formatted = this.formatter("" + year);
  98194. var active = parseInt(this.value, 10) === year;
  98195. var color = active && (this.color || 'primary');
  98196. return this.$createElement('li', this.setTextColor(color, {
  98197. key: year,
  98198. class: {
  98199. active: active
  98200. },
  98201. on: {
  98202. click: function click() {
  98203. return _this.$emit('input', year);
  98204. }
  98205. }
  98206. }), formatted);
  98207. },
  98208. genYearItems: function genYearItems() {
  98209. var children = [];
  98210. var selectedYear = this.value ? parseInt(this.value, 10) : new Date().getFullYear();
  98211. var maxYear = this.max ? parseInt(this.max, 10) : selectedYear + 100;
  98212. var minYear = Math.min(maxYear, this.min ? parseInt(this.min, 10) : selectedYear - 100);
  98213. for (var year = maxYear; year >= minYear; year--) {
  98214. children.push(this.genYearItem(year));
  98215. }
  98216. return children;
  98217. }
  98218. },
  98219. render: function render() {
  98220. return this.$createElement('ul', {
  98221. staticClass: 'v-date-picker-years',
  98222. ref: 'years'
  98223. }, this.genYearItems());
  98224. }
  98225. }));
  98226. /***/ }),
  98227. /***/ "./src/components/VDatePicker/index.ts":
  98228. /*!*********************************************!*\
  98229. !*** ./src/components/VDatePicker/index.ts ***!
  98230. \*********************************************/
  98231. /*! exports provided: VDatePicker, VDatePickerTitle, VDatePickerHeader, VDatePickerDateTable, VDatePickerMonthTable, VDatePickerYears, default */
  98232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98233. "use strict";
  98234. __webpack_require__.r(__webpack_exports__);
  98235. /* harmony import */ var _VDatePicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDatePicker */ "./src/components/VDatePicker/VDatePicker.ts");
  98236. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePicker", function() { return _VDatePicker__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  98237. /* harmony import */ var _VDatePickerTitle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VDatePickerTitle */ "./src/components/VDatePicker/VDatePickerTitle.ts");
  98238. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerTitle", function() { return _VDatePickerTitle__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  98239. /* harmony import */ var _VDatePickerHeader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VDatePickerHeader */ "./src/components/VDatePicker/VDatePickerHeader.ts");
  98240. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerHeader", function() { return _VDatePickerHeader__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  98241. /* harmony import */ var _VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VDatePickerDateTable */ "./src/components/VDatePicker/VDatePickerDateTable.ts");
  98242. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerDateTable", function() { return _VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  98243. /* harmony import */ var _VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VDatePickerMonthTable */ "./src/components/VDatePicker/VDatePickerMonthTable.ts");
  98244. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerMonthTable", function() { return _VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  98245. /* harmony import */ var _VDatePickerYears__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VDatePickerYears */ "./src/components/VDatePicker/VDatePickerYears.ts");
  98246. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerYears", function() { return _VDatePickerYears__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  98247. /* harmony default export */ __webpack_exports__["default"] = ({
  98248. $_vuetify_subcomponents: {
  98249. VDatePicker: _VDatePicker__WEBPACK_IMPORTED_MODULE_0__["default"],
  98250. VDatePickerTitle: _VDatePickerTitle__WEBPACK_IMPORTED_MODULE_1__["default"],
  98251. VDatePickerHeader: _VDatePickerHeader__WEBPACK_IMPORTED_MODULE_2__["default"],
  98252. VDatePickerDateTable: _VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_3__["default"],
  98253. VDatePickerMonthTable: _VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_4__["default"],
  98254. VDatePickerYears: _VDatePickerYears__WEBPACK_IMPORTED_MODULE_5__["default"]
  98255. }
  98256. });
  98257. /***/ }),
  98258. /***/ "./src/components/VDatePicker/mixins/date-picker-table.ts":
  98259. /*!****************************************************************!*\
  98260. !*** ./src/components/VDatePicker/mixins/date-picker-table.ts ***!
  98261. \****************************************************************/
  98262. /*! exports provided: default */
  98263. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98264. "use strict";
  98265. __webpack_require__.r(__webpack_exports__);
  98266. /* harmony import */ var _VDatePickerTable_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VDatePickerTable.sass */ "./src/components/VDatePicker/VDatePickerTable.sass");
  98267. /* harmony import */ var _VDatePickerTable_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VDatePickerTable_sass__WEBPACK_IMPORTED_MODULE_0__);
  98268. /* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../directives/touch */ "./src/directives/touch/index.ts");
  98269. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  98270. /* harmony import */ var _mixins_localable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../mixins/localable */ "./src/mixins/localable/index.ts");
  98271. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  98272. /* harmony import */ var _util_isDateAllowed__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isDateAllowed */ "./src/components/VDatePicker/util/isDateAllowed.ts");
  98273. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../util/mixins */ "./src/util/mixins.ts");
  98274. var __assign = undefined && undefined.__assign || function () {
  98275. __assign = Object.assign || function (t) {
  98276. for (var s, i = 1, n = arguments.length; i < n; i++) {
  98277. s = arguments[i];
  98278. for (var p in s) {
  98279. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  98280. }
  98281. }
  98282. return t;
  98283. };
  98284. return __assign.apply(this, arguments);
  98285. };
  98286. var __read = undefined && undefined.__read || function (o, n) {
  98287. var m = typeof Symbol === "function" && o[Symbol.iterator];
  98288. if (!m) return o;
  98289. var i = m.call(o),
  98290. r,
  98291. ar = [],
  98292. e;
  98293. try {
  98294. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  98295. ar.push(r.value);
  98296. }
  98297. } catch (error) {
  98298. e = {
  98299. error: error
  98300. };
  98301. } finally {
  98302. try {
  98303. if (r && !r.done && (m = i["return"])) m.call(i);
  98304. } finally {
  98305. if (e) throw e.error;
  98306. }
  98307. }
  98308. return ar;
  98309. };
  98310. var __spread = undefined && undefined.__spread || function () {
  98311. for (var ar = [], i = 0; i < arguments.length; i++) {
  98312. ar = ar.concat(__read(arguments[i]));
  98313. }
  98314. return ar;
  98315. };
  98316. // Directives
  98317. // Mixins
  98318. // Utils
  98319. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_6__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_localable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__["default"]
  98320. /* @vue/component */
  98321. ).extend({
  98322. directives: {
  98323. Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_1__["default"]
  98324. },
  98325. props: {
  98326. allowedDates: Function,
  98327. current: String,
  98328. disabled: Boolean,
  98329. format: Function,
  98330. events: {
  98331. type: [Array, Function, Object],
  98332. default: function _default() {
  98333. return null;
  98334. }
  98335. },
  98336. eventColor: {
  98337. type: [Array, Function, Object, String],
  98338. default: function _default() {
  98339. return 'warning';
  98340. }
  98341. },
  98342. min: String,
  98343. max: String,
  98344. range: Boolean,
  98345. readonly: Boolean,
  98346. scrollable: Boolean,
  98347. tableDate: {
  98348. type: String,
  98349. required: true
  98350. },
  98351. value: [String, Array]
  98352. },
  98353. data: function data() {
  98354. return {
  98355. isReversing: false
  98356. };
  98357. },
  98358. computed: {
  98359. computedTransition: function computedTransition() {
  98360. return this.isReversing === !this.$vuetify.rtl ? 'tab-reverse-transition' : 'tab-transition';
  98361. },
  98362. displayedMonth: function displayedMonth() {
  98363. return Number(this.tableDate.split('-')[1]) - 1;
  98364. },
  98365. displayedYear: function displayedYear() {
  98366. return Number(this.tableDate.split('-')[0]);
  98367. }
  98368. },
  98369. watch: {
  98370. tableDate: function tableDate(newVal, oldVal) {
  98371. this.isReversing = newVal < oldVal;
  98372. }
  98373. },
  98374. methods: {
  98375. genButtonClasses: function genButtonClasses(isAllowed, isFloating, isSelected, isCurrent) {
  98376. return __assign({
  98377. 'v-size--default': !isFloating,
  98378. 'v-date-picker-table__current': isCurrent,
  98379. 'v-btn--active': isSelected,
  98380. 'v-btn--flat': !isAllowed || this.disabled,
  98381. 'v-btn--text': isSelected === isCurrent,
  98382. 'v-btn--rounded': isFloating,
  98383. 'v-btn--disabled': !isAllowed || this.disabled,
  98384. 'v-btn--outlined': isCurrent && !isSelected
  98385. }, this.themeClasses);
  98386. },
  98387. genButtonEvents: function genButtonEvents(value, isAllowed, mouseEventType) {
  98388. var _this = this;
  98389. if (this.disabled) return undefined;
  98390. return {
  98391. click: function click() {
  98392. isAllowed && !_this.readonly && _this.$emit('input', value);
  98393. _this.$emit("click:" + mouseEventType, value);
  98394. },
  98395. dblclick: function dblclick() {
  98396. return _this.$emit("dblclick:" + mouseEventType, value);
  98397. }
  98398. };
  98399. },
  98400. genButton: function genButton(value, isFloating, mouseEventType, formatter) {
  98401. var isAllowed = Object(_util_isDateAllowed__WEBPACK_IMPORTED_MODULE_5__["default"])(value, this.min, this.max, this.allowedDates);
  98402. var isSelected = this.isSelected(value);
  98403. var isCurrent = value === this.current;
  98404. var setColor = isSelected ? this.setBackgroundColor : this.setTextColor;
  98405. var color = (isSelected || isCurrent) && (this.color || 'accent');
  98406. return this.$createElement('button', setColor(color, {
  98407. staticClass: 'v-btn',
  98408. class: this.genButtonClasses(isAllowed, isFloating, isSelected, isCurrent),
  98409. attrs: {
  98410. type: 'button'
  98411. },
  98412. domProps: {
  98413. disabled: this.disabled || !isAllowed
  98414. },
  98415. on: this.genButtonEvents(value, isAllowed, mouseEventType)
  98416. }), [this.$createElement('div', {
  98417. staticClass: 'v-btn__content'
  98418. }, [formatter(value)]), this.genEvents(value)]);
  98419. },
  98420. getEventColors: function getEventColors(date) {
  98421. var arrayize = function arrayize(v) {
  98422. return Array.isArray(v) ? v : [v];
  98423. };
  98424. var eventData;
  98425. var eventColors = [];
  98426. if (Array.isArray(this.events)) {
  98427. eventData = this.events.includes(date);
  98428. } else if (this.events instanceof Function) {
  98429. eventData = this.events(date) || false;
  98430. } else if (this.events) {
  98431. eventData = this.events[date] || false;
  98432. } else {
  98433. eventData = false;
  98434. }
  98435. if (!eventData) {
  98436. return [];
  98437. } else if (eventData !== true) {
  98438. eventColors = arrayize(eventData);
  98439. } else if (typeof this.eventColor === 'string') {
  98440. eventColors = [this.eventColor];
  98441. } else if (typeof this.eventColor === 'function') {
  98442. eventColors = arrayize(this.eventColor(date));
  98443. } else if (Array.isArray(this.eventColor)) {
  98444. eventColors = this.eventColor;
  98445. } else {
  98446. eventColors = arrayize(this.eventColor[date]);
  98447. }
  98448. return eventColors.filter(function (v) {
  98449. return v;
  98450. });
  98451. },
  98452. genEvents: function genEvents(date) {
  98453. var _this = this;
  98454. var eventColors = this.getEventColors(date);
  98455. return eventColors.length ? this.$createElement('div', {
  98456. staticClass: 'v-date-picker-table__events'
  98457. }, eventColors.map(function (color) {
  98458. return _this.$createElement('div', _this.setBackgroundColor(color));
  98459. })) : null;
  98460. },
  98461. wheel: function wheel(e, calculateTableDate) {
  98462. e.preventDefault();
  98463. this.$emit('update:table-date', calculateTableDate(e.deltaY));
  98464. },
  98465. touch: function touch(value, calculateTableDate) {
  98466. this.$emit('update:table-date', calculateTableDate(value));
  98467. },
  98468. genTable: function genTable(staticClass, children, calculateTableDate) {
  98469. var _this = this;
  98470. var transition = this.$createElement('transition', {
  98471. props: {
  98472. name: this.computedTransition
  98473. }
  98474. }, [this.$createElement('table', {
  98475. key: this.tableDate
  98476. }, children)]);
  98477. var touchDirective = {
  98478. name: 'touch',
  98479. value: {
  98480. left: function left(e) {
  98481. return e.offsetX < -15 && _this.touch(1, calculateTableDate);
  98482. },
  98483. right: function right(e) {
  98484. return e.offsetX > 15 && _this.touch(-1, calculateTableDate);
  98485. }
  98486. }
  98487. };
  98488. return this.$createElement('div', {
  98489. staticClass: staticClass,
  98490. class: __assign({
  98491. 'v-date-picker-table--disabled': this.disabled
  98492. }, this.themeClasses),
  98493. on: !this.disabled && this.scrollable ? {
  98494. wheel: function wheel(e) {
  98495. return _this.wheel(e, calculateTableDate);
  98496. }
  98497. } : undefined,
  98498. directives: [touchDirective]
  98499. }, [transition]);
  98500. },
  98501. isSelected: function isSelected(value) {
  98502. if (Array.isArray(this.value)) {
  98503. if (this.range && this.value.length === 2) {
  98504. var _a = __read(__spread(this.value).sort(), 2),
  98505. from = _a[0],
  98506. to = _a[1];
  98507. return from <= value && value <= to;
  98508. } else {
  98509. return this.value.indexOf(value) !== -1;
  98510. }
  98511. }
  98512. return value === this.value;
  98513. }
  98514. }
  98515. }));
  98516. /***/ }),
  98517. /***/ "./src/components/VDatePicker/util/createNativeLocaleFormatter.ts":
  98518. /*!************************************************************************!*\
  98519. !*** ./src/components/VDatePicker/util/createNativeLocaleFormatter.ts ***!
  98520. \************************************************************************/
  98521. /*! exports provided: default */
  98522. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98523. "use strict";
  98524. __webpack_require__.r(__webpack_exports__);
  98525. /* harmony import */ var _pad__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pad */ "./src/components/VDatePicker/util/pad.ts");
  98526. var __read = undefined && undefined.__read || function (o, n) {
  98527. var m = typeof Symbol === "function" && o[Symbol.iterator];
  98528. if (!m) return o;
  98529. var i = m.call(o),
  98530. r,
  98531. ar = [],
  98532. e;
  98533. try {
  98534. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  98535. ar.push(r.value);
  98536. }
  98537. } catch (error) {
  98538. e = {
  98539. error: error
  98540. };
  98541. } finally {
  98542. try {
  98543. if (r && !r.done && (m = i["return"])) m.call(i);
  98544. } finally {
  98545. if (e) throw e.error;
  98546. }
  98547. }
  98548. return ar;
  98549. };
  98550. function createNativeLocaleFormatter(locale, options, substrOptions) {
  98551. if (substrOptions === void 0) {
  98552. substrOptions = {
  98553. start: 0,
  98554. length: 0
  98555. };
  98556. }
  98557. var makeIsoString = function makeIsoString(dateString) {
  98558. var _a = __read(dateString.trim().split(' ')[0].split('-'), 3),
  98559. year = _a[0],
  98560. month = _a[1],
  98561. date = _a[2];
  98562. return [Object(_pad__WEBPACK_IMPORTED_MODULE_0__["default"])(year, 4), Object(_pad__WEBPACK_IMPORTED_MODULE_0__["default"])(month || 1), Object(_pad__WEBPACK_IMPORTED_MODULE_0__["default"])(date || 1)].join('-');
  98563. };
  98564. try {
  98565. var intlFormatter_1 = new Intl.DateTimeFormat(locale || undefined, options);
  98566. return function (dateString) {
  98567. return intlFormatter_1.format(new Date(makeIsoString(dateString) + "T00:00:00+00:00"));
  98568. };
  98569. } catch (e) {
  98570. return substrOptions.start || substrOptions.length ? function (dateString) {
  98571. return makeIsoString(dateString).substr(substrOptions.start || 0, substrOptions.length);
  98572. } : undefined;
  98573. }
  98574. }
  98575. /* harmony default export */ __webpack_exports__["default"] = (createNativeLocaleFormatter);
  98576. /***/ }),
  98577. /***/ "./src/components/VDatePicker/util/index.ts":
  98578. /*!**************************************************!*\
  98579. !*** ./src/components/VDatePicker/util/index.ts ***!
  98580. \**************************************************/
  98581. /*! exports provided: createNativeLocaleFormatter, monthChange, pad */
  98582. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98583. "use strict";
  98584. __webpack_require__.r(__webpack_exports__);
  98585. /* harmony import */ var _createNativeLocaleFormatter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createNativeLocaleFormatter */ "./src/components/VDatePicker/util/createNativeLocaleFormatter.ts");
  98586. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createNativeLocaleFormatter", function() { return _createNativeLocaleFormatter__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  98587. /* harmony import */ var _monthChange__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./monthChange */ "./src/components/VDatePicker/util/monthChange.ts");
  98588. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "monthChange", function() { return _monthChange__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  98589. /* harmony import */ var _pad__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pad */ "./src/components/VDatePicker/util/pad.ts");
  98590. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  98591. /***/ }),
  98592. /***/ "./src/components/VDatePicker/util/isDateAllowed.ts":
  98593. /*!**********************************************************!*\
  98594. !*** ./src/components/VDatePicker/util/isDateAllowed.ts ***!
  98595. \**********************************************************/
  98596. /*! exports provided: default */
  98597. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98598. "use strict";
  98599. __webpack_require__.r(__webpack_exports__);
  98600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isDateAllowed; });
  98601. function isDateAllowed(date, min, max, allowedFn) {
  98602. return (!allowedFn || allowedFn(date)) && (!min || date >= min.substr(0, 10)) && (!max || date <= max);
  98603. }
  98604. /***/ }),
  98605. /***/ "./src/components/VDatePicker/util/monthChange.ts":
  98606. /*!********************************************************!*\
  98607. !*** ./src/components/VDatePicker/util/monthChange.ts ***!
  98608. \********************************************************/
  98609. /*! exports provided: default */
  98610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98611. "use strict";
  98612. __webpack_require__.r(__webpack_exports__);
  98613. /* harmony import */ var _pad__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pad */ "./src/components/VDatePicker/util/pad.ts");
  98614. var __read = undefined && undefined.__read || function (o, n) {
  98615. var m = typeof Symbol === "function" && o[Symbol.iterator];
  98616. if (!m) return o;
  98617. var i = m.call(o),
  98618. r,
  98619. ar = [],
  98620. e;
  98621. try {
  98622. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  98623. ar.push(r.value);
  98624. }
  98625. } catch (error) {
  98626. e = {
  98627. error: error
  98628. };
  98629. } finally {
  98630. try {
  98631. if (r && !r.done && (m = i["return"])) m.call(i);
  98632. } finally {
  98633. if (e) throw e.error;
  98634. }
  98635. }
  98636. return ar;
  98637. };
  98638. /**
  98639. * @param {String} value YYYY-MM format
  98640. * @param {Number} sign -1 or +1
  98641. */
  98642. /* harmony default export */ __webpack_exports__["default"] = (function (value, sign) {
  98643. var _a = __read(value.split('-').map(Number), 2),
  98644. year = _a[0],
  98645. month = _a[1];
  98646. if (month + sign === 0) {
  98647. return year - 1 + "-12";
  98648. } else if (month + sign === 13) {
  98649. return year + 1 + "-01";
  98650. } else {
  98651. return year + "-" + Object(_pad__WEBPACK_IMPORTED_MODULE_0__["default"])(month + sign);
  98652. }
  98653. });
  98654. /***/ }),
  98655. /***/ "./src/components/VDatePicker/util/pad.ts":
  98656. /*!************************************************!*\
  98657. !*** ./src/components/VDatePicker/util/pad.ts ***!
  98658. \************************************************/
  98659. /*! exports provided: default */
  98660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98661. "use strict";
  98662. __webpack_require__.r(__webpack_exports__);
  98663. var padStart = function padStart(string, targetLength, padString) {
  98664. targetLength = targetLength >> 0;
  98665. string = String(string);
  98666. padString = String(padString);
  98667. if (string.length > targetLength) {
  98668. return String(string);
  98669. }
  98670. targetLength = targetLength - string.length;
  98671. if (targetLength > padString.length) {
  98672. padString += padString.repeat(targetLength / padString.length);
  98673. }
  98674. return padString.slice(0, targetLength) + String(string);
  98675. };
  98676. /* harmony default export */ __webpack_exports__["default"] = (function (n, length) {
  98677. if (length === void 0) {
  98678. length = 2;
  98679. }
  98680. return padStart(n, length, '0');
  98681. });
  98682. /***/ }),
  98683. /***/ "./src/components/VDialog/VDialog.sass":
  98684. /*!*********************************************!*\
  98685. !*** ./src/components/VDialog/VDialog.sass ***!
  98686. \*********************************************/
  98687. /*! no static exports found */
  98688. /***/ (function(module, exports, __webpack_require__) {
  98689. // extracted by mini-css-extract-plugin
  98690. /***/ }),
  98691. /***/ "./src/components/VDialog/VDialog.ts":
  98692. /*!*******************************************!*\
  98693. !*** ./src/components/VDialog/VDialog.ts ***!
  98694. \*******************************************/
  98695. /*! exports provided: default */
  98696. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98697. "use strict";
  98698. __webpack_require__.r(__webpack_exports__);
  98699. /* harmony import */ var _VDialog_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDialog.sass */ "./src/components/VDialog/VDialog.sass");
  98700. /* harmony import */ var _VDialog_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VDialog_sass__WEBPACK_IMPORTED_MODULE_0__);
  98701. /* harmony import */ var _VThemeProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VThemeProvider */ "./src/components/VThemeProvider/index.ts");
  98702. /* harmony import */ var _mixins_activatable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/activatable */ "./src/mixins/activatable/index.ts");
  98703. /* harmony import */ var _mixins_dependent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/dependent */ "./src/mixins/dependent/index.ts");
  98704. /* harmony import */ var _mixins_detachable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/detachable */ "./src/mixins/detachable/index.ts");
  98705. /* harmony import */ var _mixins_overlayable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/overlayable */ "./src/mixins/overlayable/index.ts");
  98706. /* harmony import */ var _mixins_returnable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/returnable */ "./src/mixins/returnable/index.ts");
  98707. /* harmony import */ var _mixins_stackable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/stackable */ "./src/mixins/stackable/index.ts");
  98708. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  98709. /* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside/index.ts");
  98710. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  98711. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  98712. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  98713. var __assign = undefined && undefined.__assign || function () {
  98714. __assign = Object.assign || function (t) {
  98715. for (var s, i = 1, n = arguments.length; i < n; i++) {
  98716. s = arguments[i];
  98717. for (var p in s) {
  98718. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  98719. }
  98720. }
  98721. return t;
  98722. };
  98723. return __assign.apply(this, arguments);
  98724. }; // Styles
  98725. // Components
  98726. // Mixins
  98727. // Directives
  98728. // Helpers
  98729. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_10__["default"])(_mixins_activatable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_dependent__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_detachable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_overlayable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_returnable__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_stackable__WEBPACK_IMPORTED_MODULE_7__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_8__["default"]);
  98730. /* @vue/component */
  98731. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  98732. name: 'v-dialog',
  98733. directives: {
  98734. ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_9__["default"]
  98735. },
  98736. props: {
  98737. dark: Boolean,
  98738. disabled: Boolean,
  98739. fullscreen: Boolean,
  98740. light: Boolean,
  98741. maxWidth: {
  98742. type: [String, Number],
  98743. default: 'none'
  98744. },
  98745. noClickAnimation: Boolean,
  98746. origin: {
  98747. type: String,
  98748. default: 'center center'
  98749. },
  98750. persistent: Boolean,
  98751. retainFocus: {
  98752. type: Boolean,
  98753. default: true
  98754. },
  98755. scrollable: Boolean,
  98756. transition: {
  98757. type: [String, Boolean],
  98758. default: 'dialog-transition'
  98759. },
  98760. width: {
  98761. type: [String, Number],
  98762. default: 'auto'
  98763. }
  98764. },
  98765. data: function data() {
  98766. return {
  98767. activatedBy: null,
  98768. animate: false,
  98769. animateTimeout: -1,
  98770. isActive: !!this.value,
  98771. stackMinZIndex: 200
  98772. };
  98773. },
  98774. computed: {
  98775. classes: function classes() {
  98776. var _a;
  98777. return _a = {}, _a[("v-dialog " + this.contentClass).trim()] = true, _a['v-dialog--active'] = this.isActive, _a['v-dialog--persistent'] = this.persistent, _a['v-dialog--fullscreen'] = this.fullscreen, _a['v-dialog--scrollable'] = this.scrollable, _a['v-dialog--animated'] = this.animate, _a;
  98778. },
  98779. contentClasses: function contentClasses() {
  98780. return {
  98781. 'v-dialog__content': true,
  98782. 'v-dialog__content--active': this.isActive
  98783. };
  98784. },
  98785. hasActivator: function hasActivator() {
  98786. return Boolean(!!this.$slots.activator || !!this.$scopedSlots.activator);
  98787. }
  98788. },
  98789. watch: {
  98790. isActive: function isActive(val) {
  98791. if (val) {
  98792. this.show();
  98793. this.hideScroll();
  98794. } else {
  98795. this.removeOverlay();
  98796. this.unbind();
  98797. }
  98798. },
  98799. fullscreen: function fullscreen(val) {
  98800. if (!this.isActive) return;
  98801. if (val) {
  98802. this.hideScroll();
  98803. this.removeOverlay(false);
  98804. } else {
  98805. this.showScroll();
  98806. this.genOverlay();
  98807. }
  98808. }
  98809. },
  98810. created: function created() {
  98811. /* istanbul ignore next */
  98812. if (this.$attrs.hasOwnProperty('full-width')) {
  98813. Object(_util_console__WEBPACK_IMPORTED_MODULE_11__["removed"])('full-width', this);
  98814. }
  98815. },
  98816. beforeMount: function beforeMount() {
  98817. var _this = this;
  98818. this.$nextTick(function () {
  98819. _this.isBooted = _this.isActive;
  98820. _this.isActive && _this.show();
  98821. });
  98822. },
  98823. beforeDestroy: function beforeDestroy() {
  98824. if (typeof window !== 'undefined') this.unbind();
  98825. },
  98826. methods: {
  98827. animateClick: function animateClick() {
  98828. var _this = this;
  98829. this.animate = false; // Needed for when clicking very fast
  98830. // outside of the dialog
  98831. this.$nextTick(function () {
  98832. _this.animate = true;
  98833. window.clearTimeout(_this.animateTimeout);
  98834. _this.animateTimeout = window.setTimeout(function () {
  98835. return _this.animate = false;
  98836. }, 150);
  98837. });
  98838. },
  98839. closeConditional: function closeConditional(e) {
  98840. var target = e.target; // Ignore the click if the dialog is closed or destroyed,
  98841. // if it was on an element inside the content,
  98842. // if it was dragged onto the overlay (#6969),
  98843. // or if this isn't the topmost dialog (#9907)
  98844. return !(this._isDestroyed || !this.isActive || this.$refs.content.contains(target) || this.overlay && target && !this.overlay.$el.contains(target)) && this.activeZIndex >= this.getMaxZIndex();
  98845. },
  98846. hideScroll: function hideScroll() {
  98847. if (this.fullscreen) {
  98848. document.documentElement.classList.add('overflow-y-hidden');
  98849. } else {
  98850. _mixins_overlayable__WEBPACK_IMPORTED_MODULE_5__["default"].options.methods.hideScroll.call(this);
  98851. }
  98852. },
  98853. show: function show() {
  98854. var _this = this;
  98855. !this.fullscreen && !this.hideOverlay && this.genOverlay();
  98856. this.$nextTick(function () {
  98857. _this.$refs.content.focus();
  98858. _this.bind();
  98859. });
  98860. },
  98861. bind: function bind() {
  98862. window.addEventListener('focusin', this.onFocusin);
  98863. },
  98864. unbind: function unbind() {
  98865. window.removeEventListener('focusin', this.onFocusin);
  98866. },
  98867. onClickOutside: function onClickOutside(e) {
  98868. this.$emit('click:outside', e);
  98869. if (this.persistent) {
  98870. this.noClickAnimation || this.animateClick();
  98871. } else {
  98872. this.isActive = false;
  98873. }
  98874. },
  98875. onKeydown: function onKeydown(e) {
  98876. if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_12__["keyCodes"].esc && !this.getOpenDependents().length) {
  98877. if (!this.persistent) {
  98878. this.isActive = false;
  98879. var activator_1 = this.getActivator();
  98880. this.$nextTick(function () {
  98881. return activator_1 && activator_1.focus();
  98882. });
  98883. } else if (!this.noClickAnimation) {
  98884. this.animateClick();
  98885. }
  98886. }
  98887. this.$emit('keydown', e);
  98888. },
  98889. // On focus change, wrap focus to stay inside the dialog
  98890. // https://github.com/vuetifyjs/vuetify/issues/6892
  98891. onFocusin: function onFocusin(e) {
  98892. if (!e || !this.retainFocus) return;
  98893. var target = e.target;
  98894. if (!!target && // It isn't the document or the dialog body
  98895. ![document, this.$refs.content].includes(target) && // It isn't inside the dialog body
  98896. !this.$refs.content.contains(target) && // We're the topmost dialog
  98897. this.activeZIndex >= this.getMaxZIndex() && // It isn't inside a dependent element (like a menu)
  98898. !this.getOpenDependentElements().some(function (el) {
  98899. return el.contains(target);
  98900. }) // So we must have focused something outside the dialog and its children
  98901. ) {
  98902. // Find and focus the first available element inside the dialog
  98903. var focusable = this.$refs.content.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
  98904. focusable.length && focusable[0].focus();
  98905. }
  98906. },
  98907. genContent: function genContent() {
  98908. var _this = this;
  98909. return this.showLazyContent(function () {
  98910. return [_this.$createElement(_VThemeProvider__WEBPACK_IMPORTED_MODULE_1__["VThemeProvider"], {
  98911. props: {
  98912. root: true,
  98913. light: _this.light,
  98914. dark: _this.dark
  98915. }
  98916. }, [_this.$createElement('div', {
  98917. class: _this.contentClasses,
  98918. attrs: __assign({
  98919. role: 'document',
  98920. tabindex: _this.isActive ? 0 : undefined
  98921. }, _this.getScopeIdAttrs()),
  98922. on: {
  98923. keydown: _this.onKeydown
  98924. },
  98925. style: {
  98926. zIndex: _this.activeZIndex
  98927. },
  98928. ref: 'content'
  98929. }, [_this.genTransition()])])];
  98930. });
  98931. },
  98932. genTransition: function genTransition() {
  98933. var content = this.genInnerContent();
  98934. if (!this.transition) return content;
  98935. return this.$createElement('transition', {
  98936. props: {
  98937. name: this.transition,
  98938. origin: this.origin,
  98939. appear: true
  98940. }
  98941. }, [content]);
  98942. },
  98943. genInnerContent: function genInnerContent() {
  98944. var data = {
  98945. class: this.classes,
  98946. ref: 'dialog',
  98947. directives: [{
  98948. name: 'click-outside',
  98949. value: this.onClickOutside,
  98950. args: {
  98951. closeConditional: this.closeConditional,
  98952. include: this.getOpenDependentElements
  98953. }
  98954. }, {
  98955. name: 'show',
  98956. value: this.isActive
  98957. }],
  98958. style: {
  98959. transformOrigin: this.origin
  98960. }
  98961. };
  98962. if (!this.fullscreen) {
  98963. data.style = __assign({}, data.style, {
  98964. maxWidth: this.maxWidth === 'none' ? undefined : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_12__["convertToUnit"])(this.maxWidth),
  98965. width: this.width === 'auto' ? undefined : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_12__["convertToUnit"])(this.width)
  98966. });
  98967. }
  98968. return this.$createElement('div', data, this.getContentSlot());
  98969. }
  98970. },
  98971. render: function render(h) {
  98972. return h('div', {
  98973. staticClass: 'v-dialog__container',
  98974. class: {
  98975. 'v-dialog__container--attached': this.attach === '' || this.attach === true || this.attach === 'attach'
  98976. },
  98977. attrs: {
  98978. role: 'dialog'
  98979. }
  98980. }, [this.genActivator(), this.genContent()]);
  98981. }
  98982. }));
  98983. /***/ }),
  98984. /***/ "./src/components/VDialog/index.ts":
  98985. /*!*****************************************!*\
  98986. !*** ./src/components/VDialog/index.ts ***!
  98987. \*****************************************/
  98988. /*! exports provided: VDialog, default */
  98989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98990. "use strict";
  98991. __webpack_require__.r(__webpack_exports__);
  98992. /* harmony import */ var _VDialog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDialog */ "./src/components/VDialog/VDialog.ts");
  98993. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDialog", function() { return _VDialog__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  98994. /* harmony default export */ __webpack_exports__["default"] = (_VDialog__WEBPACK_IMPORTED_MODULE_0__["default"]);
  98995. /***/ }),
  98996. /***/ "./src/components/VDivider/VDivider.sass":
  98997. /*!***********************************************!*\
  98998. !*** ./src/components/VDivider/VDivider.sass ***!
  98999. \***********************************************/
  99000. /*! no static exports found */
  99001. /***/ (function(module, exports, __webpack_require__) {
  99002. // extracted by mini-css-extract-plugin
  99003. /***/ }),
  99004. /***/ "./src/components/VDivider/VDivider.ts":
  99005. /*!*********************************************!*\
  99006. !*** ./src/components/VDivider/VDivider.ts ***!
  99007. \*********************************************/
  99008. /*! exports provided: default */
  99009. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99010. "use strict";
  99011. __webpack_require__.r(__webpack_exports__);
  99012. /* harmony import */ var _VDivider_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDivider.sass */ "./src/components/VDivider/VDivider.sass");
  99013. /* harmony import */ var _VDivider_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VDivider_sass__WEBPACK_IMPORTED_MODULE_0__);
  99014. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  99015. var __assign = undefined && undefined.__assign || function () {
  99016. __assign = Object.assign || function (t) {
  99017. for (var s, i = 1, n = arguments.length; i < n; i++) {
  99018. s = arguments[i];
  99019. for (var p in s) {
  99020. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  99021. }
  99022. }
  99023. return t;
  99024. };
  99025. return __assign.apply(this, arguments);
  99026. }; // Styles
  99027. // Mixins
  99028. /* harmony default export */ __webpack_exports__["default"] = (_mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  99029. name: 'v-divider',
  99030. props: {
  99031. inset: Boolean,
  99032. vertical: Boolean
  99033. },
  99034. render: function render(h) {
  99035. // WAI-ARIA attributes
  99036. var orientation;
  99037. if (!this.$attrs.role || this.$attrs.role === 'separator') {
  99038. orientation = this.vertical ? 'vertical' : 'horizontal';
  99039. }
  99040. return h('hr', {
  99041. class: __assign({
  99042. 'v-divider': true,
  99043. 'v-divider--inset': this.inset,
  99044. 'v-divider--vertical': this.vertical
  99045. }, this.themeClasses),
  99046. attrs: __assign({
  99047. role: 'separator',
  99048. 'aria-orientation': orientation
  99049. }, this.$attrs),
  99050. on: this.$listeners
  99051. });
  99052. }
  99053. }));
  99054. /***/ }),
  99055. /***/ "./src/components/VDivider/index.ts":
  99056. /*!******************************************!*\
  99057. !*** ./src/components/VDivider/index.ts ***!
  99058. \******************************************/
  99059. /*! exports provided: VDivider, default */
  99060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99061. "use strict";
  99062. __webpack_require__.r(__webpack_exports__);
  99063. /* harmony import */ var _VDivider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDivider */ "./src/components/VDivider/VDivider.ts");
  99064. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDivider", function() { return _VDivider__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  99065. /* harmony default export */ __webpack_exports__["default"] = (_VDivider__WEBPACK_IMPORTED_MODULE_0__["default"]);
  99066. /***/ }),
  99067. /***/ "./src/components/VExpansionPanel/VExpansionPanel.sass":
  99068. /*!*************************************************************!*\
  99069. !*** ./src/components/VExpansionPanel/VExpansionPanel.sass ***!
  99070. \*************************************************************/
  99071. /*! no static exports found */
  99072. /***/ (function(module, exports, __webpack_require__) {
  99073. // extracted by mini-css-extract-plugin
  99074. /***/ }),
  99075. /***/ "./src/components/VExpansionPanel/VExpansionPanel.ts":
  99076. /*!***********************************************************!*\
  99077. !*** ./src/components/VExpansionPanel/VExpansionPanel.ts ***!
  99078. \***********************************************************/
  99079. /*! exports provided: default */
  99080. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99081. "use strict";
  99082. __webpack_require__.r(__webpack_exports__);
  99083. /* harmony import */ var _mixins_groupable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/groupable */ "./src/mixins/groupable/index.ts");
  99084. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  99085. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  99086. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  99087. var __assign = undefined && undefined.__assign || function () {
  99088. __assign = Object.assign || function (t) {
  99089. for (var s, i = 1, n = arguments.length; i < n; i++) {
  99090. s = arguments[i];
  99091. for (var p in s) {
  99092. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  99093. }
  99094. }
  99095. return t;
  99096. };
  99097. return __assign.apply(this, arguments);
  99098. }; // Mixins
  99099. // Utilities
  99100. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_mixins_groupable__WEBPACK_IMPORTED_MODULE_0__["factory"])('expansionPanels', 'v-expansion-panel', 'v-expansion-panels'), Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_1__["provide"])('expansionPanel', true)
  99101. /* @vue/component */
  99102. ).extend({
  99103. name: 'v-expansion-panel',
  99104. props: {
  99105. disabled: Boolean,
  99106. readonly: Boolean
  99107. },
  99108. data: function data() {
  99109. return {
  99110. content: null,
  99111. header: null,
  99112. nextIsActive: false
  99113. };
  99114. },
  99115. computed: {
  99116. classes: function classes() {
  99117. return __assign({
  99118. 'v-expansion-panel--active': this.isActive,
  99119. 'v-expansion-panel--next-active': this.nextIsActive,
  99120. 'v-expansion-panel--disabled': this.isDisabled
  99121. }, this.groupClasses);
  99122. },
  99123. isDisabled: function isDisabled() {
  99124. return this.expansionPanels.disabled || this.disabled;
  99125. },
  99126. isReadonly: function isReadonly() {
  99127. return this.expansionPanels.readonly || this.readonly;
  99128. }
  99129. },
  99130. methods: {
  99131. registerContent: function registerContent(vm) {
  99132. this.content = vm;
  99133. },
  99134. unregisterContent: function unregisterContent() {
  99135. this.content = null;
  99136. },
  99137. registerHeader: function registerHeader(vm) {
  99138. this.header = vm;
  99139. vm.$on('click', this.onClick);
  99140. },
  99141. unregisterHeader: function unregisterHeader() {
  99142. this.header = null;
  99143. },
  99144. onClick: function onClick(e) {
  99145. if (e.detail) this.header.$el.blur();
  99146. this.$emit('click', e);
  99147. this.isReadonly || this.isDisabled || this.toggle();
  99148. },
  99149. toggle: function toggle() {
  99150. var _this = this;
  99151. /* istanbul ignore else */
  99152. if (this.content) this.content.isBooted = true;
  99153. this.$nextTick(function () {
  99154. return _this.$emit('change');
  99155. });
  99156. }
  99157. },
  99158. render: function render(h) {
  99159. return h('div', {
  99160. staticClass: 'v-expansion-panel',
  99161. class: this.classes,
  99162. attrs: {
  99163. 'aria-expanded': String(this.isActive)
  99164. }
  99165. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["getSlot"])(this));
  99166. }
  99167. }));
  99168. /***/ }),
  99169. /***/ "./src/components/VExpansionPanel/VExpansionPanelContent.ts":
  99170. /*!******************************************************************!*\
  99171. !*** ./src/components/VExpansionPanel/VExpansionPanelContent.ts ***!
  99172. \******************************************************************/
  99173. /*! exports provided: default */
  99174. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99175. "use strict";
  99176. __webpack_require__.r(__webpack_exports__);
  99177. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  99178. /* harmony import */ var _mixins_bootable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/bootable */ "./src/mixins/bootable/index.ts");
  99179. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  99180. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  99181. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  99182. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  99183. // Mixins
  99184. // Utilities
  99185. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_mixins_bootable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_3__["inject"])('expansionPanel', 'v-expansion-panel-content', 'v-expansion-panel'));
  99186. /* @vue/component */
  99187. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  99188. name: 'v-expansion-panel-content',
  99189. computed: {
  99190. isActive: function isActive() {
  99191. return this.expansionPanel.isActive;
  99192. }
  99193. },
  99194. created: function created() {
  99195. this.expansionPanel.registerContent(this);
  99196. },
  99197. beforeDestroy: function beforeDestroy() {
  99198. this.expansionPanel.unregisterContent();
  99199. },
  99200. render: function render(h) {
  99201. var _this = this;
  99202. return h(_transitions__WEBPACK_IMPORTED_MODULE_0__["VExpandTransition"], this.showLazyContent(function () {
  99203. return [h('div', _this.setBackgroundColor(_this.color, {
  99204. staticClass: 'v-expansion-panel-content',
  99205. directives: [{
  99206. name: 'show',
  99207. value: _this.isActive
  99208. }]
  99209. }), [h('div', {
  99210. class: 'v-expansion-panel-content__wrap'
  99211. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getSlot"])(_this))])];
  99212. }));
  99213. }
  99214. }));
  99215. /***/ }),
  99216. /***/ "./src/components/VExpansionPanel/VExpansionPanelHeader.ts":
  99217. /*!*****************************************************************!*\
  99218. !*** ./src/components/VExpansionPanel/VExpansionPanelHeader.ts ***!
  99219. \*****************************************************************/
  99220. /*! exports provided: default */
  99221. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99222. "use strict";
  99223. __webpack_require__.r(__webpack_exports__);
  99224. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  99225. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  99226. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  99227. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  99228. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  99229. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  99230. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  99231. var __assign = undefined && undefined.__assign || function () {
  99232. __assign = Object.assign || function (t) {
  99233. for (var s, i = 1, n = arguments.length; i < n; i++) {
  99234. s = arguments[i];
  99235. for (var p in s) {
  99236. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  99237. }
  99238. }
  99239. return t;
  99240. };
  99241. return __assign.apply(this, arguments);
  99242. }; // Components
  99243. // Mixins
  99244. // Directives
  99245. // Utilities
  99246. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_6__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_3__["inject"])('expansionPanel', 'v-expansion-panel-header', 'v-expansion-panel'));
  99247. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  99248. name: 'v-expansion-panel-header',
  99249. directives: {
  99250. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_4__["default"]
  99251. },
  99252. props: {
  99253. disableIconRotate: Boolean,
  99254. expandIcon: {
  99255. type: String,
  99256. default: '$expand'
  99257. },
  99258. hideActions: Boolean,
  99259. ripple: {
  99260. type: [Boolean, Object],
  99261. default: false
  99262. }
  99263. },
  99264. data: function data() {
  99265. return {
  99266. hasMousedown: false
  99267. };
  99268. },
  99269. computed: {
  99270. classes: function classes() {
  99271. return {
  99272. 'v-expansion-panel-header--active': this.isActive,
  99273. 'v-expansion-panel-header--mousedown': this.hasMousedown
  99274. };
  99275. },
  99276. isActive: function isActive() {
  99277. return this.expansionPanel.isActive;
  99278. },
  99279. isDisabled: function isDisabled() {
  99280. return this.expansionPanel.isDisabled;
  99281. },
  99282. isReadonly: function isReadonly() {
  99283. return this.expansionPanel.isReadonly;
  99284. }
  99285. },
  99286. created: function created() {
  99287. this.expansionPanel.registerHeader(this);
  99288. },
  99289. beforeDestroy: function beforeDestroy() {
  99290. this.expansionPanel.unregisterHeader();
  99291. },
  99292. methods: {
  99293. onClick: function onClick(e) {
  99294. this.$emit('click', e);
  99295. },
  99296. genIcon: function genIcon() {
  99297. var icon = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["getSlot"])(this, 'actions') || [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], this.expandIcon)];
  99298. return this.$createElement(_transitions__WEBPACK_IMPORTED_MODULE_0__["VFadeTransition"], [this.$createElement('div', {
  99299. staticClass: 'v-expansion-panel-header__icon',
  99300. class: {
  99301. 'v-expansion-panel-header__icon--disable-rotate': this.disableIconRotate
  99302. },
  99303. directives: [{
  99304. name: 'show',
  99305. value: !this.isDisabled
  99306. }]
  99307. }, icon)]);
  99308. }
  99309. },
  99310. render: function render(h) {
  99311. var _this = this;
  99312. return h('button', this.setBackgroundColor(this.color, {
  99313. staticClass: 'v-expansion-panel-header',
  99314. class: this.classes,
  99315. attrs: {
  99316. tabindex: this.isDisabled ? -1 : null,
  99317. type: 'button'
  99318. },
  99319. directives: [{
  99320. name: 'ripple',
  99321. value: this.ripple
  99322. }],
  99323. on: __assign({}, this.$listeners, {
  99324. click: this.onClick,
  99325. mousedown: function mousedown() {
  99326. return _this.hasMousedown = true;
  99327. },
  99328. mouseup: function mouseup() {
  99329. return _this.hasMousedown = false;
  99330. }
  99331. })
  99332. }), [Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["getSlot"])(this, 'default', {
  99333. open: this.isActive
  99334. }, true), this.hideActions || this.genIcon()]);
  99335. }
  99336. }));
  99337. /***/ }),
  99338. /***/ "./src/components/VExpansionPanel/VExpansionPanels.ts":
  99339. /*!************************************************************!*\
  99340. !*** ./src/components/VExpansionPanel/VExpansionPanels.ts ***!
  99341. \************************************************************/
  99342. /*! exports provided: default */
  99343. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99344. "use strict";
  99345. __webpack_require__.r(__webpack_exports__);
  99346. /* harmony import */ var _VExpansionPanel_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VExpansionPanel.sass */ "./src/components/VExpansionPanel/VExpansionPanel.sass");
  99347. /* harmony import */ var _VExpansionPanel_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VExpansionPanel_sass__WEBPACK_IMPORTED_MODULE_0__);
  99348. /* harmony import */ var _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VItemGroup/VItemGroup */ "./src/components/VItemGroup/VItemGroup.ts");
  99349. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  99350. var __assign = undefined && undefined.__assign || function () {
  99351. __assign = Object.assign || function (t) {
  99352. for (var s, i = 1, n = arguments.length; i < n; i++) {
  99353. s = arguments[i];
  99354. for (var p in s) {
  99355. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  99356. }
  99357. }
  99358. return t;
  99359. };
  99360. return __assign.apply(this, arguments);
  99361. }; // Styles
  99362. // Components
  99363. // Utilities
  99364. /* @vue/component */
  99365. /* harmony default export */ __webpack_exports__["default"] = (_VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_1__["BaseItemGroup"].extend({
  99366. name: 'v-expansion-panels',
  99367. provide: function provide() {
  99368. return {
  99369. expansionPanels: this
  99370. };
  99371. },
  99372. props: {
  99373. accordion: Boolean,
  99374. disabled: Boolean,
  99375. flat: Boolean,
  99376. hover: Boolean,
  99377. focusable: Boolean,
  99378. inset: Boolean,
  99379. popout: Boolean,
  99380. readonly: Boolean,
  99381. tile: Boolean
  99382. },
  99383. computed: {
  99384. classes: function classes() {
  99385. return __assign({}, _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_1__["BaseItemGroup"].options.computed.classes.call(this), {
  99386. 'v-expansion-panels': true,
  99387. 'v-expansion-panels--accordion': this.accordion,
  99388. 'v-expansion-panels--flat': this.flat,
  99389. 'v-expansion-panels--hover': this.hover,
  99390. 'v-expansion-panels--focusable': this.focusable,
  99391. 'v-expansion-panels--inset': this.inset,
  99392. 'v-expansion-panels--popout': this.popout,
  99393. 'v-expansion-panels--tile': this.tile
  99394. });
  99395. }
  99396. },
  99397. created: function created() {
  99398. /* istanbul ignore next */
  99399. if (this.$attrs.hasOwnProperty('expand')) {
  99400. Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["breaking"])('expand', 'multiple', this);
  99401. }
  99402. /* istanbul ignore next */
  99403. if (Array.isArray(this.value) && this.value.length > 0 && typeof this.value[0] === 'boolean') {
  99404. Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["breaking"])(':value="[true, false, true]"', ':value="[0, 2]"', this);
  99405. }
  99406. },
  99407. methods: {
  99408. updateItem: function updateItem(item, index) {
  99409. var value = this.getValue(item, index);
  99410. var nextValue = this.getValue(item, index + 1);
  99411. item.isActive = this.toggleMethod(value);
  99412. item.nextIsActive = this.toggleMethod(nextValue);
  99413. }
  99414. }
  99415. }));
  99416. /***/ }),
  99417. /***/ "./src/components/VExpansionPanel/index.ts":
  99418. /*!*************************************************!*\
  99419. !*** ./src/components/VExpansionPanel/index.ts ***!
  99420. \*************************************************/
  99421. /*! exports provided: VExpansionPanels, VExpansionPanel, VExpansionPanelHeader, VExpansionPanelContent, default */
  99422. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99423. "use strict";
  99424. __webpack_require__.r(__webpack_exports__);
  99425. /* harmony import */ var _VExpansionPanels__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VExpansionPanels */ "./src/components/VExpansionPanel/VExpansionPanels.ts");
  99426. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanels", function() { return _VExpansionPanels__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  99427. /* harmony import */ var _VExpansionPanel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VExpansionPanel */ "./src/components/VExpansionPanel/VExpansionPanel.ts");
  99428. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanel", function() { return _VExpansionPanel__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  99429. /* harmony import */ var _VExpansionPanelContent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VExpansionPanelContent */ "./src/components/VExpansionPanel/VExpansionPanelContent.ts");
  99430. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanelContent", function() { return _VExpansionPanelContent__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  99431. /* harmony import */ var _VExpansionPanelHeader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VExpansionPanelHeader */ "./src/components/VExpansionPanel/VExpansionPanelHeader.ts");
  99432. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanelHeader", function() { return _VExpansionPanelHeader__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  99433. /* harmony default export */ __webpack_exports__["default"] = ({
  99434. $_vuetify_subcomponents: {
  99435. VExpansionPanels: _VExpansionPanels__WEBPACK_IMPORTED_MODULE_0__["default"],
  99436. VExpansionPanel: _VExpansionPanel__WEBPACK_IMPORTED_MODULE_1__["default"],
  99437. VExpansionPanelHeader: _VExpansionPanelHeader__WEBPACK_IMPORTED_MODULE_3__["default"],
  99438. VExpansionPanelContent: _VExpansionPanelContent__WEBPACK_IMPORTED_MODULE_2__["default"]
  99439. }
  99440. });
  99441. /***/ }),
  99442. /***/ "./src/components/VFileInput/VFileInput.sass":
  99443. /*!***************************************************!*\
  99444. !*** ./src/components/VFileInput/VFileInput.sass ***!
  99445. \***************************************************/
  99446. /*! no static exports found */
  99447. /***/ (function(module, exports, __webpack_require__) {
  99448. // extracted by mini-css-extract-plugin
  99449. /***/ }),
  99450. /***/ "./src/components/VFileInput/VFileInput.ts":
  99451. /*!*************************************************!*\
  99452. !*** ./src/components/VFileInput/VFileInput.ts ***!
  99453. \*************************************************/
  99454. /*! exports provided: default */
  99455. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99456. "use strict";
  99457. __webpack_require__.r(__webpack_exports__);
  99458. /* harmony import */ var _VFileInput_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VFileInput.sass */ "./src/components/VFileInput/VFileInput.sass");
  99459. /* harmony import */ var _VFileInput_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VFileInput_sass__WEBPACK_IMPORTED_MODULE_0__);
  99460. /* harmony import */ var _VTextField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VTextField */ "./src/components/VTextField/index.ts");
  99461. /* harmony import */ var _VChip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VChip */ "./src/components/VChip/index.ts");
  99462. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  99463. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  99464. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  99465. var __assign = undefined && undefined.__assign || function () {
  99466. __assign = Object.assign || function (t) {
  99467. for (var s, i = 1, n = arguments.length; i < n; i++) {
  99468. s = arguments[i];
  99469. for (var p in s) {
  99470. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  99471. }
  99472. }
  99473. return t;
  99474. };
  99475. return __assign.apply(this, arguments);
  99476. };
  99477. var __read = undefined && undefined.__read || function (o, n) {
  99478. var m = typeof Symbol === "function" && o[Symbol.iterator];
  99479. if (!m) return o;
  99480. var i = m.call(o),
  99481. r,
  99482. ar = [],
  99483. e;
  99484. try {
  99485. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  99486. ar.push(r.value);
  99487. }
  99488. } catch (error) {
  99489. e = {
  99490. error: error
  99491. };
  99492. } finally {
  99493. try {
  99494. if (r && !r.done && (m = i["return"])) m.call(i);
  99495. } finally {
  99496. if (e) throw e.error;
  99497. }
  99498. }
  99499. return ar;
  99500. };
  99501. var __spread = undefined && undefined.__spread || function () {
  99502. for (var ar = [], i = 0; i < arguments.length; i++) {
  99503. ar = ar.concat(__read(arguments[i]));
  99504. }
  99505. return ar;
  99506. }; // Styles
  99507. // Extensions
  99508. // Components
  99509. // Utilities
  99510. /* harmony default export */ __webpack_exports__["default"] = (_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  99511. name: 'v-file-input',
  99512. model: {
  99513. prop: 'value',
  99514. event: 'change'
  99515. },
  99516. props: {
  99517. chips: Boolean,
  99518. clearable: {
  99519. type: Boolean,
  99520. default: true
  99521. },
  99522. counterSizeString: {
  99523. type: String,
  99524. default: '$vuetify.fileInput.counterSize'
  99525. },
  99526. counterString: {
  99527. type: String,
  99528. default: '$vuetify.fileInput.counter'
  99529. },
  99530. placeholder: String,
  99531. prependIcon: {
  99532. type: String,
  99533. default: '$file'
  99534. },
  99535. readonly: {
  99536. type: Boolean,
  99537. default: false
  99538. },
  99539. showSize: {
  99540. type: [Boolean, Number],
  99541. default: false,
  99542. validator: function validator(v) {
  99543. return typeof v === 'boolean' || [1000, 1024].includes(v);
  99544. }
  99545. },
  99546. smallChips: Boolean,
  99547. truncateLength: {
  99548. type: [Number, String],
  99549. default: 22
  99550. },
  99551. type: {
  99552. type: String,
  99553. default: 'file'
  99554. },
  99555. value: {
  99556. default: undefined,
  99557. validator: function validator(val) {
  99558. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["wrapInArray"])(val).every(function (v) {
  99559. return v != null && _typeof(v) === 'object';
  99560. });
  99561. }
  99562. }
  99563. },
  99564. computed: {
  99565. classes: function classes() {
  99566. return __assign({}, _VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  99567. 'v-file-input': true
  99568. });
  99569. },
  99570. computedCounterValue: function computedCounterValue() {
  99571. var fileCount = this.isMultiple && this.lazyValue ? this.lazyValue.length : this.lazyValue instanceof File ? 1 : 0;
  99572. if (!this.showSize) return this.$vuetify.lang.t(this.counterString, fileCount);
  99573. var bytes = this.internalArrayValue.reduce(function (bytes, _a) {
  99574. var _b = _a.size,
  99575. size = _b === void 0 ? 0 : _b;
  99576. return bytes + size;
  99577. }, 0);
  99578. return this.$vuetify.lang.t(this.counterSizeString, fileCount, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["humanReadableFileSize"])(bytes, this.base === 1024));
  99579. },
  99580. internalArrayValue: function internalArrayValue() {
  99581. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["wrapInArray"])(this.internalValue);
  99582. },
  99583. internalValue: {
  99584. get: function get() {
  99585. return this.lazyValue;
  99586. },
  99587. set: function set(val) {
  99588. this.lazyValue = val;
  99589. this.$emit('change', this.lazyValue);
  99590. }
  99591. },
  99592. isDirty: function isDirty() {
  99593. return this.internalArrayValue.length > 0;
  99594. },
  99595. isLabelActive: function isLabelActive() {
  99596. return this.isDirty;
  99597. },
  99598. isMultiple: function isMultiple() {
  99599. return this.$attrs.hasOwnProperty('multiple');
  99600. },
  99601. text: function text() {
  99602. var _this = this;
  99603. if (!this.isDirty) return [this.placeholder];
  99604. return this.internalArrayValue.map(function (file) {
  99605. var _a = file.name,
  99606. name = _a === void 0 ? '' : _a,
  99607. _b = file.size,
  99608. size = _b === void 0 ? 0 : _b;
  99609. var truncatedText = _this.truncateText(name);
  99610. return !_this.showSize ? truncatedText : truncatedText + " (" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["humanReadableFileSize"])(size, _this.base === 1024) + ")";
  99611. });
  99612. },
  99613. base: function base() {
  99614. return typeof this.showSize !== 'boolean' ? this.showSize : undefined;
  99615. },
  99616. hasChips: function hasChips() {
  99617. return this.chips || this.smallChips;
  99618. }
  99619. },
  99620. watch: {
  99621. readonly: {
  99622. handler: function handler(v) {
  99623. if (v === true) Object(_util_console__WEBPACK_IMPORTED_MODULE_4__["consoleError"])('readonly is not supported on <v-file-input>', this);
  99624. },
  99625. immediate: true
  99626. },
  99627. value: function value(v) {
  99628. var value = this.isMultiple ? v : v ? [v] : [];
  99629. if (!Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["deepEqual"])(value, this.$refs.input.files)) {
  99630. // When the input value is changed programatically, clear the
  99631. // internal input's value so that the `onInput` handler
  99632. // can be triggered again if the user re-selects the exact
  99633. // same file(s). Ideally, `input.files` should be
  99634. // manipulated directly but that property is readonly.
  99635. this.$refs.input.value = '';
  99636. }
  99637. }
  99638. },
  99639. methods: {
  99640. clearableCallback: function clearableCallback() {
  99641. this.internalValue = this.isMultiple ? [] : undefined;
  99642. this.$refs.input.value = '';
  99643. },
  99644. genChips: function genChips() {
  99645. var _this = this;
  99646. if (!this.isDirty) return [];
  99647. return this.text.map(function (text, index) {
  99648. return _this.$createElement(_VChip__WEBPACK_IMPORTED_MODULE_2__["VChip"], {
  99649. props: {
  99650. small: _this.smallChips
  99651. },
  99652. on: {
  99653. 'click:close': function clickClose() {
  99654. var internalValue = _this.internalValue;
  99655. internalValue.splice(index, 1);
  99656. _this.internalValue = internalValue; // Trigger the watcher
  99657. }
  99658. }
  99659. }, [text]);
  99660. });
  99661. },
  99662. genInput: function genInput() {
  99663. var input = _VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genInput.call(this); // We should not be setting value
  99664. // programmatically on the input
  99665. // when it is using type="file"
  99666. delete input.data.domProps.value; // This solves an issue in Safari where
  99667. // nothing happens when adding a file
  99668. // do to the input event not firing
  99669. // https://github.com/vuetifyjs/vuetify/issues/7941
  99670. delete input.data.on.input;
  99671. input.data.on.change = this.onInput;
  99672. return [this.genSelections(), input];
  99673. },
  99674. genPrependSlot: function genPrependSlot() {
  99675. var _this = this;
  99676. if (!this.prependIcon) return null;
  99677. var icon = this.genIcon('prepend', function () {
  99678. _this.$refs.input.click();
  99679. });
  99680. return this.genSlot('prepend', 'outer', [icon]);
  99681. },
  99682. genSelectionText: function genSelectionText() {
  99683. var length = this.text.length;
  99684. if (length < 2) return this.text;
  99685. if (this.showSize && !this.counter) return [this.computedCounterValue];
  99686. return [this.$vuetify.lang.t(this.counterString, length)];
  99687. },
  99688. genSelections: function genSelections() {
  99689. var _this = this;
  99690. var children = [];
  99691. if (this.isDirty && this.$scopedSlots.selection) {
  99692. this.internalArrayValue.forEach(function (file, index) {
  99693. if (!_this.$scopedSlots.selection) return;
  99694. children.push(_this.$scopedSlots.selection({
  99695. text: _this.text[index],
  99696. file: file,
  99697. index: index
  99698. }));
  99699. });
  99700. } else {
  99701. children.push(this.hasChips && this.isDirty ? this.genChips() : this.genSelectionText());
  99702. }
  99703. return this.$createElement('div', {
  99704. staticClass: 'v-file-input__text',
  99705. class: {
  99706. 'v-file-input__text--placeholder': this.placeholder && !this.isDirty,
  99707. 'v-file-input__text--chips': this.hasChips && !this.$scopedSlots.selection
  99708. }
  99709. }, children);
  99710. },
  99711. genTextFieldSlot: function genTextFieldSlot() {
  99712. var _this = this;
  99713. var node = _VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genTextFieldSlot.call(this);
  99714. node.data.on = __assign({}, node.data.on || {}, {
  99715. click: function click() {
  99716. return _this.$refs.input.click();
  99717. }
  99718. });
  99719. return node;
  99720. },
  99721. onInput: function onInput(e) {
  99722. var files = __spread(e.target.files || []);
  99723. this.internalValue = this.isMultiple ? files : files[0]; // Set initialValue here otherwise isFocused
  99724. // watcher in VTextField will emit a change
  99725. // event whenever the component is blurred
  99726. this.initialValue = this.internalValue;
  99727. },
  99728. onKeyDown: function onKeyDown(e) {
  99729. this.$emit('keydown', e);
  99730. },
  99731. truncateText: function truncateText(str) {
  99732. if (str.length < Number(this.truncateLength)) return str;
  99733. var charsKeepOneSide = Math.floor((Number(this.truncateLength) - 1) / 2);
  99734. return str.slice(0, charsKeepOneSide) + "\u2026" + str.slice(str.length - charsKeepOneSide);
  99735. }
  99736. }
  99737. }));
  99738. /***/ }),
  99739. /***/ "./src/components/VFileInput/index.ts":
  99740. /*!********************************************!*\
  99741. !*** ./src/components/VFileInput/index.ts ***!
  99742. \********************************************/
  99743. /*! exports provided: VFileInput, default */
  99744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99745. "use strict";
  99746. __webpack_require__.r(__webpack_exports__);
  99747. /* harmony import */ var _VFileInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VFileInput */ "./src/components/VFileInput/VFileInput.ts");
  99748. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFileInput", function() { return _VFileInput__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  99749. /* harmony default export */ __webpack_exports__["default"] = (_VFileInput__WEBPACK_IMPORTED_MODULE_0__["default"]);
  99750. /***/ }),
  99751. /***/ "./src/components/VFooter/VFooter.sass":
  99752. /*!*********************************************!*\
  99753. !*** ./src/components/VFooter/VFooter.sass ***!
  99754. \*********************************************/
  99755. /*! no static exports found */
  99756. /***/ (function(module, exports, __webpack_require__) {
  99757. // extracted by mini-css-extract-plugin
  99758. /***/ }),
  99759. /***/ "./src/components/VFooter/VFooter.ts":
  99760. /*!*******************************************!*\
  99761. !*** ./src/components/VFooter/VFooter.ts ***!
  99762. \*******************************************/
  99763. /*! exports provided: default */
  99764. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99765. "use strict";
  99766. __webpack_require__.r(__webpack_exports__);
  99767. /* harmony import */ var _VFooter_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VFooter.sass */ "./src/components/VFooter/VFooter.sass");
  99768. /* harmony import */ var _VFooter_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VFooter_sass__WEBPACK_IMPORTED_MODULE_0__);
  99769. /* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable/index.ts");
  99770. /* harmony import */ var _VSheet_VSheet__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VSheet/VSheet */ "./src/components/VSheet/VSheet.ts");
  99771. /* harmony import */ var _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/ssr-bootable */ "./src/mixins/ssr-bootable/index.ts");
  99772. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  99773. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  99774. var __assign = undefined && undefined.__assign || function () {
  99775. __assign = Object.assign || function (t) {
  99776. for (var s, i = 1, n = arguments.length; i < n; i++) {
  99777. s = arguments[i];
  99778. for (var p in s) {
  99779. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  99780. }
  99781. }
  99782. return t;
  99783. };
  99784. return __assign.apply(this, arguments);
  99785. }; // Styles
  99786. // Mixins
  99787. // Utilities
  99788. /* @vue/component */
  99789. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_VSheet_VSheet__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__["default"])('footer', ['height', 'inset']), _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_3__["default"]).extend({
  99790. name: 'v-footer',
  99791. props: {
  99792. height: {
  99793. default: 'auto',
  99794. type: [Number, String]
  99795. },
  99796. inset: Boolean,
  99797. padless: Boolean,
  99798. tile: {
  99799. type: Boolean,
  99800. default: true
  99801. }
  99802. },
  99803. computed: {
  99804. applicationProperty: function applicationProperty() {
  99805. return this.inset ? 'insetFooter' : 'footer';
  99806. },
  99807. classes: function classes() {
  99808. return __assign({}, _VSheet_VSheet__WEBPACK_IMPORTED_MODULE_2__["default"].options.computed.classes.call(this), {
  99809. 'v-footer--absolute': this.absolute,
  99810. 'v-footer--fixed': !this.absolute && (this.app || this.fixed),
  99811. 'v-footer--padless': this.padless,
  99812. 'v-footer--inset': this.inset
  99813. });
  99814. },
  99815. computedBottom: function computedBottom() {
  99816. if (!this.isPositioned) return undefined;
  99817. return this.app ? this.$vuetify.application.bottom : 0;
  99818. },
  99819. computedLeft: function computedLeft() {
  99820. if (!this.isPositioned) return undefined;
  99821. return this.app && this.inset ? this.$vuetify.application.left : 0;
  99822. },
  99823. computedRight: function computedRight() {
  99824. if (!this.isPositioned) return undefined;
  99825. return this.app && this.inset ? this.$vuetify.application.right : 0;
  99826. },
  99827. isPositioned: function isPositioned() {
  99828. return Boolean(this.absolute || this.fixed || this.app);
  99829. },
  99830. styles: function styles() {
  99831. var height = parseInt(this.height);
  99832. return __assign({}, _VSheet_VSheet__WEBPACK_IMPORTED_MODULE_2__["default"].options.computed.styles.call(this), {
  99833. height: isNaN(height) ? height : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["convertToUnit"])(height),
  99834. left: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["convertToUnit"])(this.computedLeft),
  99835. right: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["convertToUnit"])(this.computedRight),
  99836. bottom: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["convertToUnit"])(this.computedBottom)
  99837. });
  99838. }
  99839. },
  99840. methods: {
  99841. updateApplication: function updateApplication() {
  99842. var height = parseInt(this.height);
  99843. return isNaN(height) ? this.$el ? this.$el.clientHeight : 0 : height;
  99844. }
  99845. },
  99846. render: function render(h) {
  99847. var data = this.setBackgroundColor(this.color, {
  99848. staticClass: 'v-footer',
  99849. class: this.classes,
  99850. style: this.styles
  99851. });
  99852. return h('footer', data, this.$slots.default);
  99853. }
  99854. }));
  99855. /***/ }),
  99856. /***/ "./src/components/VFooter/index.ts":
  99857. /*!*****************************************!*\
  99858. !*** ./src/components/VFooter/index.ts ***!
  99859. \*****************************************/
  99860. /*! exports provided: VFooter, default */
  99861. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99862. "use strict";
  99863. __webpack_require__.r(__webpack_exports__);
  99864. /* harmony import */ var _VFooter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VFooter */ "./src/components/VFooter/VFooter.ts");
  99865. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFooter", function() { return _VFooter__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  99866. /* harmony default export */ __webpack_exports__["default"] = (_VFooter__WEBPACK_IMPORTED_MODULE_0__["default"]);
  99867. /***/ }),
  99868. /***/ "./src/components/VForm/VForm.ts":
  99869. /*!***************************************!*\
  99870. !*** ./src/components/VForm/VForm.ts ***!
  99871. \***************************************/
  99872. /*! exports provided: default */
  99873. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99874. "use strict";
  99875. __webpack_require__.r(__webpack_exports__);
  99876. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  99877. /* harmony import */ var _mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/binds-attrs */ "./src/mixins/binds-attrs/index.ts");
  99878. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  99879. var __assign = undefined && undefined.__assign || function () {
  99880. __assign = Object.assign || function (t) {
  99881. for (var s, i = 1, n = arguments.length; i < n; i++) {
  99882. s = arguments[i];
  99883. for (var p in s) {
  99884. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  99885. }
  99886. }
  99887. return t;
  99888. };
  99889. return __assign.apply(this, arguments);
  99890. }; // Mixins
  99891. /* @vue/component */
  99892. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_0__["default"])(_mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_2__["provide"])('form')
  99893. /* @vue/component */
  99894. ).extend({
  99895. name: 'v-form',
  99896. inheritAttrs: false,
  99897. props: {
  99898. lazyValidation: Boolean,
  99899. value: Boolean
  99900. },
  99901. data: function data() {
  99902. return {
  99903. inputs: [],
  99904. watchers: [],
  99905. errorBag: {}
  99906. };
  99907. },
  99908. watch: {
  99909. errorBag: {
  99910. handler: function handler(val) {
  99911. var errors = Object.values(val).includes(true);
  99912. this.$emit('input', !errors);
  99913. },
  99914. deep: true,
  99915. immediate: true
  99916. }
  99917. },
  99918. methods: {
  99919. watchInput: function watchInput(input) {
  99920. var _this = this;
  99921. var watcher = function watcher(input) {
  99922. return input.$watch('hasError', function (val) {
  99923. _this.$set(_this.errorBag, input._uid, val);
  99924. }, {
  99925. immediate: true
  99926. });
  99927. };
  99928. var watchers = {
  99929. _uid: input._uid,
  99930. valid: function valid() {},
  99931. shouldValidate: function shouldValidate() {}
  99932. };
  99933. if (this.lazyValidation) {
  99934. // Only start watching inputs if we need to
  99935. watchers.shouldValidate = input.$watch('shouldValidate', function (val) {
  99936. if (!val) return; // Only watch if we're not already doing it
  99937. if (_this.errorBag.hasOwnProperty(input._uid)) return;
  99938. watchers.valid = watcher(input);
  99939. });
  99940. } else {
  99941. watchers.valid = watcher(input);
  99942. }
  99943. return watchers;
  99944. },
  99945. /** @public */
  99946. validate: function validate() {
  99947. return this.inputs.filter(function (input) {
  99948. return !input.validate(true);
  99949. }).length === 0;
  99950. },
  99951. /** @public */
  99952. reset: function reset() {
  99953. this.inputs.forEach(function (input) {
  99954. return input.reset();
  99955. });
  99956. this.resetErrorBag();
  99957. },
  99958. resetErrorBag: function resetErrorBag() {
  99959. var _this = this;
  99960. if (this.lazyValidation) {
  99961. // Account for timeout in validatable
  99962. setTimeout(function () {
  99963. _this.errorBag = {};
  99964. }, 0);
  99965. }
  99966. },
  99967. /** @public */
  99968. resetValidation: function resetValidation() {
  99969. this.inputs.forEach(function (input) {
  99970. return input.resetValidation();
  99971. });
  99972. this.resetErrorBag();
  99973. },
  99974. register: function register(input) {
  99975. this.inputs.push(input);
  99976. this.watchers.push(this.watchInput(input));
  99977. },
  99978. unregister: function unregister(input) {
  99979. var found = this.inputs.find(function (i) {
  99980. return i._uid === input._uid;
  99981. });
  99982. if (!found) return;
  99983. var unwatch = this.watchers.find(function (i) {
  99984. return i._uid === found._uid;
  99985. });
  99986. if (unwatch) {
  99987. unwatch.valid();
  99988. unwatch.shouldValidate();
  99989. }
  99990. this.watchers = this.watchers.filter(function (i) {
  99991. return i._uid !== found._uid;
  99992. });
  99993. this.inputs = this.inputs.filter(function (i) {
  99994. return i._uid !== found._uid;
  99995. });
  99996. this.$delete(this.errorBag, found._uid);
  99997. }
  99998. },
  99999. render: function render(h) {
  100000. var _this = this;
  100001. return h('form', {
  100002. staticClass: 'v-form',
  100003. attrs: __assign({
  100004. novalidate: true
  100005. }, this.attrs$),
  100006. on: {
  100007. submit: function submit(e) {
  100008. return _this.$emit('submit', e);
  100009. }
  100010. }
  100011. }, this.$slots.default);
  100012. }
  100013. }));
  100014. /***/ }),
  100015. /***/ "./src/components/VForm/index.ts":
  100016. /*!***************************************!*\
  100017. !*** ./src/components/VForm/index.ts ***!
  100018. \***************************************/
  100019. /*! exports provided: VForm, default */
  100020. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100021. "use strict";
  100022. __webpack_require__.r(__webpack_exports__);
  100023. /* harmony import */ var _VForm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VForm */ "./src/components/VForm/VForm.ts");
  100024. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VForm", function() { return _VForm__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  100025. /* harmony default export */ __webpack_exports__["default"] = (_VForm__WEBPACK_IMPORTED_MODULE_0__["default"]);
  100026. /***/ }),
  100027. /***/ "./src/components/VGrid/VCol.ts":
  100028. /*!**************************************!*\
  100029. !*** ./src/components/VGrid/VCol.ts ***!
  100030. \**************************************/
  100031. /*! exports provided: default */
  100032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100033. "use strict";
  100034. __webpack_require__.r(__webpack_exports__);
  100035. /* harmony import */ var _VGrid_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VGrid.sass */ "./src/components/VGrid/VGrid.sass");
  100036. /* harmony import */ var _VGrid_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VGrid_sass__WEBPACK_IMPORTED_MODULE_0__);
  100037. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "vue");
  100038. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
  100039. /* harmony import */ var _util_mergeData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mergeData */ "./src/util/mergeData.ts");
  100040. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  100041. var __assign = undefined && undefined.__assign || function () {
  100042. __assign = Object.assign || function (t) {
  100043. for (var s, i = 1, n = arguments.length; i < n; i++) {
  100044. s = arguments[i];
  100045. for (var p in s) {
  100046. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  100047. }
  100048. }
  100049. return t;
  100050. };
  100051. return __assign.apply(this, arguments);
  100052. };
  100053. // no xs
  100054. var breakpoints = ['sm', 'md', 'lg', 'xl'];
  100055. var breakpointProps = function () {
  100056. return breakpoints.reduce(function (props, val) {
  100057. props[val] = {
  100058. type: [Boolean, String, Number],
  100059. default: false
  100060. };
  100061. return props;
  100062. }, {});
  100063. }();
  100064. var offsetProps = function () {
  100065. return breakpoints.reduce(function (props, val) {
  100066. props['offset' + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["upperFirst"])(val)] = {
  100067. type: [String, Number],
  100068. default: null
  100069. };
  100070. return props;
  100071. }, {});
  100072. }();
  100073. var orderProps = function () {
  100074. return breakpoints.reduce(function (props, val) {
  100075. props['order' + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["upperFirst"])(val)] = {
  100076. type: [String, Number],
  100077. default: null
  100078. };
  100079. return props;
  100080. }, {});
  100081. }();
  100082. var propMap = {
  100083. col: Object.keys(breakpointProps),
  100084. offset: Object.keys(offsetProps),
  100085. order: Object.keys(orderProps)
  100086. };
  100087. function breakpointClass(type, prop, val) {
  100088. var className = type;
  100089. if (val == null || val === false) {
  100090. return undefined;
  100091. }
  100092. if (prop) {
  100093. var breakpoint = prop.replace(type, '');
  100094. className += "-" + breakpoint;
  100095. } // Handling the boolean style prop when accepting [Boolean, String, Number]
  100096. // means Vue will not convert <v-col sm></v-col> to sm: true for us.
  100097. // Since the default is false, an empty string indicates the prop's presence.
  100098. if (type === 'col' && (val === '' || val === true)) {
  100099. // .col-md
  100100. return className.toLowerCase();
  100101. } // .order-md-6
  100102. className += "-" + val;
  100103. return className.toLowerCase();
  100104. }
  100105. var cache = new Map();
  100106. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_1___default.a.extend({
  100107. name: 'v-col',
  100108. functional: true,
  100109. props: __assign({
  100110. cols: {
  100111. type: [Boolean, String, Number],
  100112. default: false
  100113. }
  100114. }, breakpointProps, {
  100115. offset: {
  100116. type: [String, Number],
  100117. default: null
  100118. }
  100119. }, offsetProps, {
  100120. order: {
  100121. type: [String, Number],
  100122. default: null
  100123. }
  100124. }, orderProps, {
  100125. alignSelf: {
  100126. type: String,
  100127. default: null,
  100128. validator: function validator(str) {
  100129. return ['auto', 'start', 'end', 'center', 'baseline', 'stretch'].includes(str);
  100130. }
  100131. },
  100132. tag: {
  100133. type: String,
  100134. default: 'div'
  100135. }
  100136. }),
  100137. render: function render(h, _a) {
  100138. var _b;
  100139. var props = _a.props,
  100140. data = _a.data,
  100141. children = _a.children,
  100142. parent = _a.parent; // Super-fast memoization based on props, 5x faster than JSON.stringify
  100143. var cacheKey = '';
  100144. for (var prop in props) {
  100145. cacheKey += String(props[prop]);
  100146. }
  100147. var classList = cache.get(cacheKey);
  100148. if (!classList) {
  100149. classList = []; // Loop through `col`, `offset`, `order` breakpoint props
  100150. var type_1;
  100151. for (type_1 in propMap) {
  100152. propMap[type_1].forEach(function (prop) {
  100153. var value = props[prop];
  100154. var className = breakpointClass(type_1, prop, value);
  100155. if (className) classList.push(className);
  100156. });
  100157. }
  100158. var hasColClasses = classList.some(function (className) {
  100159. return className.startsWith('col-');
  100160. });
  100161. classList.push((_b = {
  100162. // Default to .col if no other col-{bp}-* classes generated nor `cols` specified.
  100163. col: !hasColClasses || !props.cols
  100164. }, _b["col-" + props.cols] = props.cols, _b["offset-" + props.offset] = props.offset, _b["order-" + props.order] = props.order, _b["align-self-" + props.alignSelf] = props.alignSelf, _b));
  100165. cache.set(cacheKey, classList);
  100166. }
  100167. return h(props.tag, Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_2__["default"])(data, {
  100168. class: classList
  100169. }), children);
  100170. }
  100171. }));
  100172. /***/ }),
  100173. /***/ "./src/components/VGrid/VContainer.ts":
  100174. /*!********************************************!*\
  100175. !*** ./src/components/VGrid/VContainer.ts ***!
  100176. \********************************************/
  100177. /*! exports provided: default */
  100178. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100179. "use strict";
  100180. __webpack_require__.r(__webpack_exports__);
  100181. /* harmony import */ var _grid_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_grid.sass */ "./src/components/VGrid/_grid.sass");
  100182. /* harmony import */ var _grid_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_grid_sass__WEBPACK_IMPORTED_MODULE_0__);
  100183. /* harmony import */ var _VGrid_sass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VGrid.sass */ "./src/components/VGrid/VGrid.sass");
  100184. /* harmony import */ var _VGrid_sass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_VGrid_sass__WEBPACK_IMPORTED_MODULE_1__);
  100185. /* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./grid */ "./src/components/VGrid/grid.ts");
  100186. /* harmony import */ var _util_mergeData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mergeData */ "./src/util/mergeData.ts");
  100187. /* @vue/component */
  100188. /* harmony default export */ __webpack_exports__["default"] = (Object(_grid__WEBPACK_IMPORTED_MODULE_2__["default"])('container').extend({
  100189. name: 'v-container',
  100190. functional: true,
  100191. props: {
  100192. id: String,
  100193. tag: {
  100194. type: String,
  100195. default: 'div'
  100196. },
  100197. fluid: {
  100198. type: Boolean,
  100199. default: false
  100200. }
  100201. },
  100202. render: function render(h, _a) {
  100203. var props = _a.props,
  100204. data = _a.data,
  100205. children = _a.children;
  100206. var classes;
  100207. var attrs = data.attrs;
  100208. if (attrs) {
  100209. // reset attrs to extract utility clases like pa-3
  100210. data.attrs = {};
  100211. classes = Object.keys(attrs).filter(function (key) {
  100212. // TODO: Remove once resolved
  100213. // https://github.com/vuejs/vue/issues/7841
  100214. if (key === 'slot') return false;
  100215. var value = attrs[key]; // add back data attributes like data-test="foo" but do not
  100216. // add them as classes
  100217. if (key.startsWith('data-')) {
  100218. data.attrs[key] = value;
  100219. return false;
  100220. }
  100221. return value || typeof value === 'string';
  100222. });
  100223. }
  100224. if (props.id) {
  100225. data.domProps = data.domProps || {};
  100226. data.domProps.id = props.id;
  100227. }
  100228. return h(props.tag, Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_3__["default"])(data, {
  100229. staticClass: 'container',
  100230. class: Array({
  100231. 'container--fluid': props.fluid
  100232. }).concat(classes || [])
  100233. }), children);
  100234. }
  100235. }));
  100236. /***/ }),
  100237. /***/ "./src/components/VGrid/VFlex.ts":
  100238. /*!***************************************!*\
  100239. !*** ./src/components/VGrid/VFlex.ts ***!
  100240. \***************************************/
  100241. /*! exports provided: default */
  100242. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100243. "use strict";
  100244. __webpack_require__.r(__webpack_exports__);
  100245. /* harmony import */ var _grid_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_grid.sass */ "./src/components/VGrid/_grid.sass");
  100246. /* harmony import */ var _grid_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_grid_sass__WEBPACK_IMPORTED_MODULE_0__);
  100247. /* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./grid */ "./src/components/VGrid/grid.ts");
  100248. /* harmony default export */ __webpack_exports__["default"] = (Object(_grid__WEBPACK_IMPORTED_MODULE_1__["default"])('flex'));
  100249. /***/ }),
  100250. /***/ "./src/components/VGrid/VGrid.sass":
  100251. /*!*****************************************!*\
  100252. !*** ./src/components/VGrid/VGrid.sass ***!
  100253. \*****************************************/
  100254. /*! no static exports found */
  100255. /***/ (function(module, exports, __webpack_require__) {
  100256. // extracted by mini-css-extract-plugin
  100257. /***/ }),
  100258. /***/ "./src/components/VGrid/VLayout.ts":
  100259. /*!*****************************************!*\
  100260. !*** ./src/components/VGrid/VLayout.ts ***!
  100261. \*****************************************/
  100262. /*! exports provided: default */
  100263. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100264. "use strict";
  100265. __webpack_require__.r(__webpack_exports__);
  100266. /* harmony import */ var _grid_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_grid.sass */ "./src/components/VGrid/_grid.sass");
  100267. /* harmony import */ var _grid_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_grid_sass__WEBPACK_IMPORTED_MODULE_0__);
  100268. /* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./grid */ "./src/components/VGrid/grid.ts");
  100269. /* harmony default export */ __webpack_exports__["default"] = (Object(_grid__WEBPACK_IMPORTED_MODULE_1__["default"])('layout'));
  100270. /***/ }),
  100271. /***/ "./src/components/VGrid/VRow.ts":
  100272. /*!**************************************!*\
  100273. !*** ./src/components/VGrid/VRow.ts ***!
  100274. \**************************************/
  100275. /*! exports provided: default */
  100276. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100277. "use strict";
  100278. __webpack_require__.r(__webpack_exports__);
  100279. /* harmony import */ var _VGrid_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VGrid.sass */ "./src/components/VGrid/VGrid.sass");
  100280. /* harmony import */ var _VGrid_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VGrid_sass__WEBPACK_IMPORTED_MODULE_0__);
  100281. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "vue");
  100282. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
  100283. /* harmony import */ var _util_mergeData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mergeData */ "./src/util/mergeData.ts");
  100284. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  100285. var __assign = undefined && undefined.__assign || function () {
  100286. __assign = Object.assign || function (t) {
  100287. for (var s, i = 1, n = arguments.length; i < n; i++) {
  100288. s = arguments[i];
  100289. for (var p in s) {
  100290. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  100291. }
  100292. }
  100293. return t;
  100294. };
  100295. return __assign.apply(this, arguments);
  100296. };
  100297. var __read = undefined && undefined.__read || function (o, n) {
  100298. var m = typeof Symbol === "function" && o[Symbol.iterator];
  100299. if (!m) return o;
  100300. var i = m.call(o),
  100301. r,
  100302. ar = [],
  100303. e;
  100304. try {
  100305. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  100306. ar.push(r.value);
  100307. }
  100308. } catch (error) {
  100309. e = {
  100310. error: error
  100311. };
  100312. } finally {
  100313. try {
  100314. if (r && !r.done && (m = i["return"])) m.call(i);
  100315. } finally {
  100316. if (e) throw e.error;
  100317. }
  100318. }
  100319. return ar;
  100320. };
  100321. var __spread = undefined && undefined.__spread || function () {
  100322. for (var ar = [], i = 0; i < arguments.length; i++) {
  100323. ar = ar.concat(__read(arguments[i]));
  100324. }
  100325. return ar;
  100326. };
  100327. // no xs
  100328. var breakpoints = ['sm', 'md', 'lg', 'xl'];
  100329. var ALIGNMENT = ['start', 'end', 'center'];
  100330. function makeProps(prefix, def) {
  100331. return breakpoints.reduce(function (props, val) {
  100332. props[prefix + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["upperFirst"])(val)] = def();
  100333. return props;
  100334. }, {});
  100335. }
  100336. var alignValidator = function alignValidator(str) {
  100337. return __spread(ALIGNMENT, ['baseline', 'stretch']).includes(str);
  100338. };
  100339. var alignProps = makeProps('align', function () {
  100340. return {
  100341. type: String,
  100342. default: null,
  100343. validator: alignValidator
  100344. };
  100345. });
  100346. var justifyValidator = function justifyValidator(str) {
  100347. return __spread(ALIGNMENT, ['space-between', 'space-around']).includes(str);
  100348. };
  100349. var justifyProps = makeProps('justify', function () {
  100350. return {
  100351. type: String,
  100352. default: null,
  100353. validator: justifyValidator
  100354. };
  100355. });
  100356. var alignContentValidator = function alignContentValidator(str) {
  100357. return __spread(ALIGNMENT, ['space-between', 'space-around', 'stretch']).includes(str);
  100358. };
  100359. var alignContentProps = makeProps('alignContent', function () {
  100360. return {
  100361. type: String,
  100362. default: null,
  100363. validator: alignContentValidator
  100364. };
  100365. });
  100366. var propMap = {
  100367. align: Object.keys(alignProps),
  100368. justify: Object.keys(justifyProps),
  100369. alignContent: Object.keys(alignContentProps)
  100370. };
  100371. var classMap = {
  100372. align: 'align',
  100373. justify: 'justify',
  100374. alignContent: 'align-content'
  100375. };
  100376. function breakpointClass(type, prop, val) {
  100377. var className = classMap[type];
  100378. if (val == null) {
  100379. return undefined;
  100380. }
  100381. if (prop) {
  100382. // alignSm -> Sm
  100383. var breakpoint = prop.replace(type, '');
  100384. className += "-" + breakpoint;
  100385. } // .align-items-sm-center
  100386. className += "-" + val;
  100387. return className.toLowerCase();
  100388. }
  100389. var cache = new Map();
  100390. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_1___default.a.extend({
  100391. name: 'v-row',
  100392. functional: true,
  100393. props: __assign({
  100394. tag: {
  100395. type: String,
  100396. default: 'div'
  100397. },
  100398. dense: Boolean,
  100399. noGutters: Boolean,
  100400. align: {
  100401. type: String,
  100402. default: null,
  100403. validator: alignValidator
  100404. }
  100405. }, alignProps, {
  100406. justify: {
  100407. type: String,
  100408. default: null,
  100409. validator: justifyValidator
  100410. }
  100411. }, justifyProps, {
  100412. alignContent: {
  100413. type: String,
  100414. default: null,
  100415. validator: alignContentValidator
  100416. }
  100417. }, alignContentProps),
  100418. render: function render(h, _a) {
  100419. var _b;
  100420. var props = _a.props,
  100421. data = _a.data,
  100422. children = _a.children; // Super-fast memoization based on props, 5x faster than JSON.stringify
  100423. var cacheKey = '';
  100424. for (var prop in props) {
  100425. cacheKey += String(props[prop]);
  100426. }
  100427. var classList = cache.get(cacheKey);
  100428. if (!classList) {
  100429. classList = []; // Loop through `align`, `justify`, `alignContent` breakpoint props
  100430. var type_1;
  100431. for (type_1 in propMap) {
  100432. propMap[type_1].forEach(function (prop) {
  100433. var value = props[prop];
  100434. var className = breakpointClass(type_1, prop, value);
  100435. if (className) classList.push(className);
  100436. });
  100437. }
  100438. classList.push((_b = {
  100439. 'no-gutters': props.noGutters,
  100440. 'row--dense': props.dense
  100441. }, _b["align-" + props.align] = props.align, _b["justify-" + props.justify] = props.justify, _b["align-content-" + props.alignContent] = props.alignContent, _b));
  100442. cache.set(cacheKey, classList);
  100443. }
  100444. return h(props.tag, Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_2__["default"])(data, {
  100445. staticClass: 'row',
  100446. class: classList
  100447. }), children);
  100448. }
  100449. }));
  100450. /***/ }),
  100451. /***/ "./src/components/VGrid/VSpacer.ts":
  100452. /*!*****************************************!*\
  100453. !*** ./src/components/VGrid/VSpacer.ts ***!
  100454. \*****************************************/
  100455. /*! exports provided: default */
  100456. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100457. "use strict";
  100458. __webpack_require__.r(__webpack_exports__);
  100459. /* harmony import */ var _grid_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_grid.sass */ "./src/components/VGrid/_grid.sass");
  100460. /* harmony import */ var _grid_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_grid_sass__WEBPACK_IMPORTED_MODULE_0__);
  100461. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  100462. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["createSimpleFunctional"])('spacer', 'div', 'v-spacer'));
  100463. /***/ }),
  100464. /***/ "./src/components/VGrid/_grid.sass":
  100465. /*!*****************************************!*\
  100466. !*** ./src/components/VGrid/_grid.sass ***!
  100467. \*****************************************/
  100468. /*! no static exports found */
  100469. /***/ (function(module, exports, __webpack_require__) {
  100470. // extracted by mini-css-extract-plugin
  100471. /***/ }),
  100472. /***/ "./src/components/VGrid/grid.ts":
  100473. /*!**************************************!*\
  100474. !*** ./src/components/VGrid/grid.ts ***!
  100475. \**************************************/
  100476. /*! exports provided: default */
  100477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100478. "use strict";
  100479. __webpack_require__.r(__webpack_exports__);
  100480. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return VGrid; });
  100481. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  100482. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  100483. // Types
  100484. function VGrid(name) {
  100485. /* @vue/component */
  100486. return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  100487. name: "v-" + name,
  100488. functional: true,
  100489. props: {
  100490. id: String,
  100491. tag: {
  100492. type: String,
  100493. default: 'div'
  100494. }
  100495. },
  100496. render: function render(h, _a) {
  100497. var props = _a.props,
  100498. data = _a.data,
  100499. children = _a.children;
  100500. data.staticClass = (name + " " + (data.staticClass || '')).trim();
  100501. var attrs = data.attrs;
  100502. if (attrs) {
  100503. // reset attrs to extract utility clases like pa-3
  100504. data.attrs = {};
  100505. var classes = Object.keys(attrs).filter(function (key) {
  100506. // TODO: Remove once resolved
  100507. // https://github.com/vuejs/vue/issues/7841
  100508. if (key === 'slot') return false;
  100509. var value = attrs[key]; // add back data attributes like data-test="foo" but do not
  100510. // add them as classes
  100511. if (key.startsWith('data-')) {
  100512. data.attrs[key] = value;
  100513. return false;
  100514. }
  100515. return value || typeof value === 'string';
  100516. });
  100517. if (classes.length) data.staticClass += " " + classes.join(' ');
  100518. }
  100519. if (props.id) {
  100520. data.domProps = data.domProps || {};
  100521. data.domProps.id = props.id;
  100522. }
  100523. return h(props.tag, data, children);
  100524. }
  100525. });
  100526. }
  100527. /***/ }),
  100528. /***/ "./src/components/VGrid/index.ts":
  100529. /*!***************************************!*\
  100530. !*** ./src/components/VGrid/index.ts ***!
  100531. \***************************************/
  100532. /*! exports provided: VContainer, VCol, VRow, VSpacer, VLayout, VFlex, default */
  100533. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100534. "use strict";
  100535. __webpack_require__.r(__webpack_exports__);
  100536. /* harmony import */ var _VContainer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VContainer */ "./src/components/VGrid/VContainer.ts");
  100537. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VContainer", function() { return _VContainer__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  100538. /* harmony import */ var _VCol__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VCol */ "./src/components/VGrid/VCol.ts");
  100539. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCol", function() { return _VCol__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  100540. /* harmony import */ var _VRow__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VRow */ "./src/components/VGrid/VRow.ts");
  100541. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRow", function() { return _VRow__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  100542. /* harmony import */ var _VSpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VSpacer */ "./src/components/VGrid/VSpacer.ts");
  100543. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSpacer", function() { return _VSpacer__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  100544. /* harmony import */ var _VLayout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VLayout */ "./src/components/VGrid/VLayout.ts");
  100545. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VLayout", function() { return _VLayout__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  100546. /* harmony import */ var _VFlex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VFlex */ "./src/components/VGrid/VFlex.ts");
  100547. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFlex", function() { return _VFlex__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  100548. /* harmony default export */ __webpack_exports__["default"] = ({
  100549. $_vuetify_subcomponents: {
  100550. VContainer: _VContainer__WEBPACK_IMPORTED_MODULE_0__["default"],
  100551. VCol: _VCol__WEBPACK_IMPORTED_MODULE_1__["default"],
  100552. VRow: _VRow__WEBPACK_IMPORTED_MODULE_2__["default"],
  100553. VSpacer: _VSpacer__WEBPACK_IMPORTED_MODULE_3__["default"],
  100554. VLayout: _VLayout__WEBPACK_IMPORTED_MODULE_4__["default"],
  100555. VFlex: _VFlex__WEBPACK_IMPORTED_MODULE_5__["default"]
  100556. }
  100557. });
  100558. /***/ }),
  100559. /***/ "./src/components/VHover/VHover.ts":
  100560. /*!*****************************************!*\
  100561. !*** ./src/components/VHover/VHover.ts ***!
  100562. \*****************************************/
  100563. /*! exports provided: default */
  100564. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100565. "use strict";
  100566. __webpack_require__.r(__webpack_exports__);
  100567. /* harmony import */ var _mixins_delayable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/delayable */ "./src/mixins/delayable/index.ts");
  100568. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  100569. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  100570. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  100571. // Mixins
  100572. // Utilities
  100573. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_delayable__WEBPACK_IMPORTED_MODULE_0__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_1__["default"]
  100574. /* @vue/component */
  100575. ).extend({
  100576. name: 'v-hover',
  100577. props: {
  100578. disabled: {
  100579. type: Boolean,
  100580. default: false
  100581. },
  100582. value: {
  100583. type: Boolean,
  100584. default: undefined
  100585. }
  100586. },
  100587. methods: {
  100588. onMouseEnter: function onMouseEnter() {
  100589. this.runDelay('open');
  100590. },
  100591. onMouseLeave: function onMouseLeave() {
  100592. this.runDelay('close');
  100593. }
  100594. },
  100595. render: function render() {
  100596. if (!this.$scopedSlots.default && this.value === undefined) {
  100597. Object(_util_console__WEBPACK_IMPORTED_MODULE_3__["consoleWarn"])('v-hover is missing a default scopedSlot or bound value', this);
  100598. return null;
  100599. }
  100600. var element;
  100601. /* istanbul ignore else */
  100602. if (this.$scopedSlots.default) {
  100603. element = this.$scopedSlots.default({
  100604. hover: this.isActive
  100605. });
  100606. }
  100607. if (Array.isArray(element) && element.length === 1) {
  100608. element = element[0];
  100609. }
  100610. if (!element || Array.isArray(element) || !element.tag) {
  100611. Object(_util_console__WEBPACK_IMPORTED_MODULE_3__["consoleWarn"])('v-hover should only contain a single element', this);
  100612. return element;
  100613. }
  100614. if (!this.disabled) {
  100615. element.data = element.data || {};
  100616. this._g(element.data, {
  100617. mouseenter: this.onMouseEnter,
  100618. mouseleave: this.onMouseLeave
  100619. });
  100620. }
  100621. return element;
  100622. }
  100623. }));
  100624. /***/ }),
  100625. /***/ "./src/components/VHover/index.ts":
  100626. /*!****************************************!*\
  100627. !*** ./src/components/VHover/index.ts ***!
  100628. \****************************************/
  100629. /*! exports provided: VHover, default */
  100630. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100631. "use strict";
  100632. __webpack_require__.r(__webpack_exports__);
  100633. /* harmony import */ var _VHover__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VHover */ "./src/components/VHover/VHover.ts");
  100634. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VHover", function() { return _VHover__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  100635. /* harmony default export */ __webpack_exports__["default"] = (_VHover__WEBPACK_IMPORTED_MODULE_0__["default"]);
  100636. /***/ }),
  100637. /***/ "./src/components/VIcon/VIcon.sass":
  100638. /*!*****************************************!*\
  100639. !*** ./src/components/VIcon/VIcon.sass ***!
  100640. \*****************************************/
  100641. /*! no static exports found */
  100642. /***/ (function(module, exports, __webpack_require__) {
  100643. // extracted by mini-css-extract-plugin
  100644. /***/ }),
  100645. /***/ "./src/components/VIcon/VIcon.ts":
  100646. /*!***************************************!*\
  100647. !*** ./src/components/VIcon/VIcon.ts ***!
  100648. \***************************************/
  100649. /*! exports provided: default */
  100650. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100651. "use strict";
  100652. __webpack_require__.r(__webpack_exports__);
  100653. /* harmony import */ var _VIcon_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VIcon.sass */ "./src/components/VIcon/VIcon.sass");
  100654. /* harmony import */ var _VIcon_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VIcon_sass__WEBPACK_IMPORTED_MODULE_0__);
  100655. /* harmony import */ var _mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/binds-attrs */ "./src/mixins/binds-attrs/index.ts");
  100656. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  100657. /* harmony import */ var _mixins_sizeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/sizeable */ "./src/mixins/sizeable/index.ts");
  100658. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  100659. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  100660. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue */ "vue");
  100661. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_6__);
  100662. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  100663. var __assign = undefined && undefined.__assign || function () {
  100664. __assign = Object.assign || function (t) {
  100665. for (var s, i = 1, n = arguments.length; i < n; i++) {
  100666. s = arguments[i];
  100667. for (var p in s) {
  100668. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  100669. }
  100670. }
  100671. return t;
  100672. };
  100673. return __assign.apply(this, arguments);
  100674. };
  100675. // Mixins
  100676. // Util
  100677. // Types
  100678. var SIZE_MAP;
  100679. (function (SIZE_MAP) {
  100680. SIZE_MAP["xSmall"] = "12px";
  100681. SIZE_MAP["small"] = "16px";
  100682. SIZE_MAP["default"] = "24px";
  100683. SIZE_MAP["medium"] = "28px";
  100684. SIZE_MAP["large"] = "36px";
  100685. SIZE_MAP["xLarge"] = "40px";
  100686. })(SIZE_MAP || (SIZE_MAP = {}));
  100687. function isFontAwesome5(iconType) {
  100688. return ['fas', 'far', 'fal', 'fab', 'fad'].some(function (val) {
  100689. return iconType.includes(val);
  100690. });
  100691. }
  100692. function isSvgPath(icon) {
  100693. return /^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(icon) && /[\dz]$/i.test(icon) && icon.length > 4;
  100694. }
  100695. var VIcon = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_7__["default"])(_mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_sizeable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__["default"]
  100696. /* @vue/component */
  100697. ).extend({
  100698. name: 'v-icon',
  100699. props: {
  100700. dense: Boolean,
  100701. disabled: Boolean,
  100702. left: Boolean,
  100703. right: Boolean,
  100704. size: [Number, String],
  100705. tag: {
  100706. type: String,
  100707. required: false,
  100708. default: 'i'
  100709. }
  100710. },
  100711. computed: {
  100712. medium: function medium() {
  100713. return false;
  100714. },
  100715. hasClickListener: function hasClickListener() {
  100716. return Boolean(this.listeners$.click || this.listeners$['!click']);
  100717. }
  100718. },
  100719. methods: {
  100720. getIcon: function getIcon() {
  100721. var iconName = '';
  100722. if (this.$slots.default) iconName = this.$slots.default[0].text.trim();
  100723. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["remapInternalIcon"])(this, iconName);
  100724. },
  100725. getSize: function getSize() {
  100726. var sizes = {
  100727. xSmall: this.xSmall,
  100728. small: this.small,
  100729. medium: this.medium,
  100730. large: this.large,
  100731. xLarge: this.xLarge
  100732. };
  100733. var explicitSize = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["keys"])(sizes).find(function (key) {
  100734. return sizes[key];
  100735. });
  100736. return explicitSize && SIZE_MAP[explicitSize] || Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["convertToUnit"])(this.size);
  100737. },
  100738. // Component data for both font and svg icon.
  100739. getDefaultData: function getDefaultData() {
  100740. var data = {
  100741. staticClass: 'v-icon notranslate',
  100742. class: {
  100743. 'v-icon--disabled': this.disabled,
  100744. 'v-icon--left': this.left,
  100745. 'v-icon--link': this.hasClickListener,
  100746. 'v-icon--right': this.right,
  100747. 'v-icon--dense': this.dense
  100748. },
  100749. attrs: __assign({
  100750. 'aria-hidden': !this.hasClickListener,
  100751. disabled: this.hasClickListener && this.disabled,
  100752. type: this.hasClickListener ? 'button' : undefined
  100753. }, this.attrs$),
  100754. on: this.listeners$
  100755. };
  100756. return data;
  100757. },
  100758. applyColors: function applyColors(data) {
  100759. data.class = __assign({}, data.class, this.themeClasses);
  100760. this.setTextColor(this.color, data);
  100761. },
  100762. renderFontIcon: function renderFontIcon(icon, h) {
  100763. var newChildren = [];
  100764. var data = this.getDefaultData();
  100765. var iconType = 'material-icons'; // Material Icon delimiter is _
  100766. // https://material.io/icons/
  100767. var delimiterIndex = icon.indexOf('-');
  100768. var isMaterialIcon = delimiterIndex <= -1;
  100769. if (isMaterialIcon) {
  100770. // Material icon uses ligatures.
  100771. newChildren.push(icon);
  100772. } else {
  100773. iconType = icon.slice(0, delimiterIndex);
  100774. if (isFontAwesome5(iconType)) iconType = '';
  100775. }
  100776. data.class[iconType] = true;
  100777. data.class[icon] = !isMaterialIcon;
  100778. var fontSize = this.getSize();
  100779. if (fontSize) data.style = {
  100780. fontSize: fontSize
  100781. };
  100782. this.applyColors(data);
  100783. return h(this.hasClickListener ? 'button' : this.tag, data, newChildren);
  100784. },
  100785. renderSvgIcon: function renderSvgIcon(icon, h) {
  100786. var fontSize = this.getSize();
  100787. var wrapperData = __assign({}, this.getDefaultData(), {
  100788. style: fontSize ? {
  100789. fontSize: fontSize,
  100790. height: fontSize,
  100791. width: fontSize
  100792. } : undefined
  100793. });
  100794. wrapperData.class['v-icon--svg'] = true;
  100795. this.applyColors(wrapperData);
  100796. var svgData = {
  100797. attrs: {
  100798. xmlns: 'http://www.w3.org/2000/svg',
  100799. viewBox: '0 0 24 24',
  100800. height: fontSize || '24',
  100801. width: fontSize || '24',
  100802. role: 'img',
  100803. 'aria-hidden': true
  100804. }
  100805. };
  100806. return h(this.hasClickListener ? 'button' : 'span', wrapperData, [h('svg', svgData, [h('path', {
  100807. attrs: {
  100808. d: icon
  100809. }
  100810. })])]);
  100811. },
  100812. renderSvgIconComponent: function renderSvgIconComponent(icon, h) {
  100813. var data = this.getDefaultData();
  100814. data.class['v-icon--is-component'] = true;
  100815. var size = this.getSize();
  100816. if (size) {
  100817. data.style = {
  100818. fontSize: size,
  100819. height: size,
  100820. width: size
  100821. };
  100822. }
  100823. this.applyColors(data);
  100824. var component = icon.component;
  100825. data.props = icon.props;
  100826. data.nativeOn = data.on;
  100827. return h(component, data);
  100828. }
  100829. },
  100830. render: function render(h) {
  100831. var icon = this.getIcon();
  100832. if (typeof icon === 'string') {
  100833. if (isSvgPath(icon)) {
  100834. return this.renderSvgIcon(icon, h);
  100835. }
  100836. return this.renderFontIcon(icon, h);
  100837. }
  100838. return this.renderSvgIconComponent(icon, h);
  100839. }
  100840. });
  100841. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_6___default.a.extend({
  100842. name: 'v-icon',
  100843. $_wrapperFor: VIcon,
  100844. functional: true,
  100845. render: function render(h, _a) {
  100846. var data = _a.data,
  100847. children = _a.children;
  100848. var iconName = ''; // Support usage of v-text and v-html
  100849. if (data.domProps) {
  100850. iconName = data.domProps.textContent || data.domProps.innerHTML || iconName; // Remove nodes so it doesn't
  100851. // overwrite our changes
  100852. delete data.domProps.textContent;
  100853. delete data.domProps.innerHTML;
  100854. }
  100855. return h(VIcon, data, iconName ? [iconName] : children);
  100856. }
  100857. }));
  100858. /***/ }),
  100859. /***/ "./src/components/VIcon/index.ts":
  100860. /*!***************************************!*\
  100861. !*** ./src/components/VIcon/index.ts ***!
  100862. \***************************************/
  100863. /*! exports provided: VIcon, default */
  100864. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100865. "use strict";
  100866. __webpack_require__.r(__webpack_exports__);
  100867. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VIcon */ "./src/components/VIcon/VIcon.ts");
  100868. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VIcon", function() { return _VIcon__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  100869. /* harmony default export */ __webpack_exports__["default"] = (_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"]);
  100870. /***/ }),
  100871. /***/ "./src/components/VImg/VImg.sass":
  100872. /*!***************************************!*\
  100873. !*** ./src/components/VImg/VImg.sass ***!
  100874. \***************************************/
  100875. /*! no static exports found */
  100876. /***/ (function(module, exports, __webpack_require__) {
  100877. // extracted by mini-css-extract-plugin
  100878. /***/ }),
  100879. /***/ "./src/components/VImg/VImg.ts":
  100880. /*!*************************************!*\
  100881. !*** ./src/components/VImg/VImg.ts ***!
  100882. \*************************************/
  100883. /*! exports provided: default */
  100884. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100885. "use strict";
  100886. __webpack_require__.r(__webpack_exports__);
  100887. /* harmony import */ var _VImg_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VImg.sass */ "./src/components/VImg/VImg.sass");
  100888. /* harmony import */ var _VImg_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VImg_sass__WEBPACK_IMPORTED_MODULE_0__);
  100889. /* harmony import */ var _directives_intersect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../directives/intersect */ "./src/directives/intersect/index.ts");
  100890. /* harmony import */ var _VResponsive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VResponsive */ "./src/components/VResponsive/index.ts");
  100891. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  100892. // Styles
  100893. // Directives
  100894. // Components
  100895. // Utils
  100896. var hasIntersect = typeof window !== 'undefined' && 'IntersectionObserver' in window;
  100897. /* @vue/component */
  100898. /* harmony default export */ __webpack_exports__["default"] = (_VResponsive__WEBPACK_IMPORTED_MODULE_2__["default"].extend({
  100899. name: 'v-img',
  100900. directives: {
  100901. intersect: _directives_intersect__WEBPACK_IMPORTED_MODULE_1__["default"]
  100902. },
  100903. props: {
  100904. alt: String,
  100905. contain: Boolean,
  100906. eager: Boolean,
  100907. gradient: String,
  100908. lazySrc: String,
  100909. options: {
  100910. type: Object,
  100911. // For more information on types, navigate to:
  100912. // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
  100913. default: function _default() {
  100914. return {
  100915. root: undefined,
  100916. rootMargin: undefined,
  100917. threshold: undefined
  100918. };
  100919. }
  100920. },
  100921. position: {
  100922. type: String,
  100923. default: 'center center'
  100924. },
  100925. sizes: String,
  100926. src: {
  100927. type: [String, Object],
  100928. default: ''
  100929. },
  100930. srcset: String,
  100931. transition: {
  100932. type: [Boolean, String],
  100933. default: 'fade-transition'
  100934. }
  100935. },
  100936. data: function data() {
  100937. return {
  100938. currentSrc: '',
  100939. image: null,
  100940. isLoading: true,
  100941. calculatedAspectRatio: undefined,
  100942. naturalWidth: undefined
  100943. };
  100944. },
  100945. computed: {
  100946. computedAspectRatio: function computedAspectRatio() {
  100947. return Number(this.normalisedSrc.aspect || this.calculatedAspectRatio);
  100948. },
  100949. normalisedSrc: function normalisedSrc() {
  100950. return typeof this.src === 'string' ? {
  100951. src: this.src,
  100952. srcset: this.srcset,
  100953. lazySrc: this.lazySrc,
  100954. aspect: Number(this.aspectRatio || 0)
  100955. } : {
  100956. src: this.src.src,
  100957. srcset: this.srcset || this.src.srcset,
  100958. lazySrc: this.lazySrc || this.src.lazySrc,
  100959. aspect: Number(this.aspectRatio || this.src.aspect)
  100960. };
  100961. },
  100962. __cachedImage: function __cachedImage() {
  100963. if (!(this.normalisedSrc.src || this.normalisedSrc.lazySrc)) return [];
  100964. var backgroundImage = [];
  100965. var src = this.isLoading ? this.normalisedSrc.lazySrc : this.currentSrc;
  100966. if (this.gradient) backgroundImage.push("linear-gradient(" + this.gradient + ")");
  100967. if (src) backgroundImage.push("url(\"" + src + "\")");
  100968. var image = this.$createElement('div', {
  100969. staticClass: 'v-image__image',
  100970. class: {
  100971. 'v-image__image--preload': this.isLoading,
  100972. 'v-image__image--contain': this.contain,
  100973. 'v-image__image--cover': !this.contain
  100974. },
  100975. style: {
  100976. backgroundImage: backgroundImage.join(', '),
  100977. backgroundPosition: this.position
  100978. },
  100979. key: +this.isLoading
  100980. });
  100981. /* istanbul ignore if */
  100982. if (!this.transition) return image;
  100983. return this.$createElement('transition', {
  100984. attrs: {
  100985. name: this.transition,
  100986. mode: 'in-out'
  100987. }
  100988. }, [image]);
  100989. }
  100990. },
  100991. watch: {
  100992. src: function src() {
  100993. // Force re-init when src changes
  100994. if (!this.isLoading) this.init(undefined, undefined, true);else this.loadImage();
  100995. },
  100996. '$vuetify.breakpoint.width': 'getSrc'
  100997. },
  100998. mounted: function mounted() {
  100999. this.init();
  101000. },
  101001. methods: {
  101002. init: function init(entries, observer, isIntersecting) {
  101003. // If the current browser supports the intersection
  101004. // observer api, the image is not observable, and
  101005. // the eager prop isn't being used, do not load
  101006. if (hasIntersect && !isIntersecting && !this.eager) return;
  101007. if (this.normalisedSrc.lazySrc) {
  101008. var lazyImg = new Image();
  101009. lazyImg.src = this.normalisedSrc.lazySrc;
  101010. this.pollForSize(lazyImg, null);
  101011. }
  101012. /* istanbul ignore else */
  101013. if (this.normalisedSrc.src) this.loadImage();
  101014. },
  101015. onLoad: function onLoad() {
  101016. this.getSrc();
  101017. this.isLoading = false;
  101018. this.$emit('load', this.src);
  101019. },
  101020. onError: function onError() {
  101021. Object(_util_console__WEBPACK_IMPORTED_MODULE_3__["consoleError"])("Image load failed\n\n" + ("src: " + this.normalisedSrc.src), this);
  101022. this.$emit('error', this.src);
  101023. },
  101024. getSrc: function getSrc() {
  101025. /* istanbul ignore else */
  101026. if (this.image) this.currentSrc = this.image.currentSrc || this.image.src;
  101027. },
  101028. loadImage: function loadImage() {
  101029. var _this = this;
  101030. var image = new Image();
  101031. this.image = image;
  101032. image.onload = function () {
  101033. /* istanbul ignore if */
  101034. if (image.decode) {
  101035. image.decode().catch(function (err) {
  101036. Object(_util_console__WEBPACK_IMPORTED_MODULE_3__["consoleWarn"])("Failed to decode image, trying to render anyway\n\n" + ("src: " + _this.normalisedSrc.src) + (err.message ? "\nOriginal error: " + err.message : ''), _this);
  101037. }).then(_this.onLoad);
  101038. } else {
  101039. _this.onLoad();
  101040. }
  101041. };
  101042. image.onerror = this.onError;
  101043. image.src = this.normalisedSrc.src;
  101044. this.sizes && (image.sizes = this.sizes);
  101045. this.normalisedSrc.srcset && (image.srcset = this.normalisedSrc.srcset);
  101046. this.aspectRatio || this.pollForSize(image);
  101047. this.getSrc();
  101048. },
  101049. pollForSize: function pollForSize(img, timeout) {
  101050. var _this = this;
  101051. if (timeout === void 0) {
  101052. timeout = 100;
  101053. }
  101054. var poll = function poll() {
  101055. var naturalHeight = img.naturalHeight,
  101056. naturalWidth = img.naturalWidth;
  101057. if (naturalHeight || naturalWidth) {
  101058. _this.naturalWidth = naturalWidth;
  101059. _this.calculatedAspectRatio = naturalWidth / naturalHeight;
  101060. } else {
  101061. timeout != null && setTimeout(poll, timeout);
  101062. }
  101063. };
  101064. poll();
  101065. },
  101066. genContent: function genContent() {
  101067. var content = _VResponsive__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genContent.call(this);
  101068. if (this.naturalWidth) {
  101069. this._b(content.data, 'div', {
  101070. style: {
  101071. width: this.naturalWidth + "px"
  101072. }
  101073. });
  101074. }
  101075. return content;
  101076. },
  101077. __genPlaceholder: function __genPlaceholder() {
  101078. if (this.$slots.placeholder) {
  101079. var placeholder = this.isLoading ? [this.$createElement('div', {
  101080. staticClass: 'v-image__placeholder'
  101081. }, this.$slots.placeholder)] : [];
  101082. if (!this.transition) return placeholder[0];
  101083. return this.$createElement('transition', {
  101084. props: {
  101085. appear: true,
  101086. name: this.transition
  101087. }
  101088. }, placeholder);
  101089. }
  101090. }
  101091. },
  101092. render: function render(h) {
  101093. var node = _VResponsive__WEBPACK_IMPORTED_MODULE_2__["default"].options.render.call(this, h);
  101094. node.data.staticClass += ' v-image'; // Only load intersect directive if it
  101095. // will work in the current browser.
  101096. if (hasIntersect) {
  101097. node.data.directives = [{
  101098. name: 'intersect',
  101099. modifiers: {
  101100. once: true
  101101. },
  101102. value: {
  101103. handler: this.init,
  101104. options: this.options
  101105. }
  101106. }];
  101107. }
  101108. node.data.attrs = {
  101109. role: this.alt ? 'img' : undefined,
  101110. 'aria-label': this.alt
  101111. };
  101112. node.children = [this.__cachedSizer, this.__cachedImage, this.__genPlaceholder(), this.genContent()];
  101113. return h(node.tag, node.data, node.children);
  101114. }
  101115. }));
  101116. /***/ }),
  101117. /***/ "./src/components/VImg/index.ts":
  101118. /*!**************************************!*\
  101119. !*** ./src/components/VImg/index.ts ***!
  101120. \**************************************/
  101121. /*! exports provided: VImg, default */
  101122. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101123. "use strict";
  101124. __webpack_require__.r(__webpack_exports__);
  101125. /* harmony import */ var _VImg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VImg */ "./src/components/VImg/VImg.ts");
  101126. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VImg", function() { return _VImg__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  101127. /* harmony default export */ __webpack_exports__["default"] = (_VImg__WEBPACK_IMPORTED_MODULE_0__["default"]);
  101128. /***/ }),
  101129. /***/ "./src/components/VInput/VInput.sass":
  101130. /*!*******************************************!*\
  101131. !*** ./src/components/VInput/VInput.sass ***!
  101132. \*******************************************/
  101133. /*! no static exports found */
  101134. /***/ (function(module, exports, __webpack_require__) {
  101135. // extracted by mini-css-extract-plugin
  101136. /***/ }),
  101137. /***/ "./src/components/VInput/VInput.ts":
  101138. /*!*****************************************!*\
  101139. !*** ./src/components/VInput/VInput.ts ***!
  101140. \*****************************************/
  101141. /*! exports provided: default */
  101142. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101143. "use strict";
  101144. __webpack_require__.r(__webpack_exports__);
  101145. /* harmony import */ var _VInput_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VInput.sass */ "./src/components/VInput/VInput.sass");
  101146. /* harmony import */ var _VInput_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VInput_sass__WEBPACK_IMPORTED_MODULE_0__);
  101147. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  101148. /* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VLabel */ "./src/components/VLabel/index.ts");
  101149. /* harmony import */ var _VMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VMessages */ "./src/components/VMessages/index.ts");
  101150. /* harmony import */ var _mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/binds-attrs */ "./src/mixins/binds-attrs/index.ts");
  101151. /* harmony import */ var _mixins_validatable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/validatable */ "./src/mixins/validatable/index.ts");
  101152. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  101153. /* harmony import */ var _util_mergeData__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/mergeData */ "./src/util/mergeData.ts");
  101154. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  101155. var __assign = undefined && undefined.__assign || function () {
  101156. __assign = Object.assign || function (t) {
  101157. for (var s, i = 1, n = arguments.length; i < n; i++) {
  101158. s = arguments[i];
  101159. for (var p in s) {
  101160. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  101161. }
  101162. }
  101163. return t;
  101164. };
  101165. return __assign.apply(this, arguments);
  101166. }; // Styles
  101167. // Components
  101168. // Mixins
  101169. // Utilities
  101170. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_8__["default"])(_mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_validatable__WEBPACK_IMPORTED_MODULE_5__["default"]);
  101171. /* @vue/component */
  101172. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  101173. name: 'v-input',
  101174. inheritAttrs: false,
  101175. props: {
  101176. appendIcon: String,
  101177. backgroundColor: {
  101178. type: String,
  101179. default: ''
  101180. },
  101181. dense: Boolean,
  101182. height: [Number, String],
  101183. hideDetails: [Boolean, String],
  101184. hint: String,
  101185. id: String,
  101186. label: String,
  101187. loading: Boolean,
  101188. persistentHint: Boolean,
  101189. prependIcon: String,
  101190. value: null
  101191. },
  101192. data: function data() {
  101193. return {
  101194. lazyValue: this.value,
  101195. hasMouseDown: false
  101196. };
  101197. },
  101198. computed: {
  101199. classes: function classes() {
  101200. return __assign({
  101201. 'v-input--has-state': this.hasState,
  101202. 'v-input--hide-details': !this.showDetails,
  101203. 'v-input--is-label-active': this.isLabelActive,
  101204. 'v-input--is-dirty': this.isDirty,
  101205. 'v-input--is-disabled': this.disabled,
  101206. 'v-input--is-focused': this.isFocused,
  101207. // <v-switch loading>.loading === '' so we can't just cast to boolean
  101208. 'v-input--is-loading': this.loading !== false && this.loading != null,
  101209. 'v-input--is-readonly': this.readonly,
  101210. 'v-input--dense': this.dense
  101211. }, this.themeClasses);
  101212. },
  101213. computedId: function computedId() {
  101214. return this.id || "input-" + this._uid;
  101215. },
  101216. hasDetails: function hasDetails() {
  101217. return this.messagesToDisplay.length > 0;
  101218. },
  101219. hasHint: function hasHint() {
  101220. return !this.hasMessages && !!this.hint && (this.persistentHint || this.isFocused);
  101221. },
  101222. hasLabel: function hasLabel() {
  101223. return !!(this.$slots.label || this.label);
  101224. },
  101225. // Proxy for `lazyValue`
  101226. // This allows an input
  101227. // to function without
  101228. // a provided model
  101229. internalValue: {
  101230. get: function get() {
  101231. return this.lazyValue;
  101232. },
  101233. set: function set(val) {
  101234. this.lazyValue = val;
  101235. this.$emit(this.$_modelEvent, val);
  101236. }
  101237. },
  101238. isDirty: function isDirty() {
  101239. return !!this.lazyValue;
  101240. },
  101241. isDisabled: function isDisabled() {
  101242. return this.disabled || this.readonly;
  101243. },
  101244. isLabelActive: function isLabelActive() {
  101245. return this.isDirty;
  101246. },
  101247. messagesToDisplay: function messagesToDisplay() {
  101248. var _this = this;
  101249. if (this.hasHint) return [this.hint];
  101250. if (!this.hasMessages) return [];
  101251. return this.validations.map(function (validation) {
  101252. if (typeof validation === 'string') return validation;
  101253. var validationResult = validation(_this.internalValue);
  101254. return typeof validationResult === 'string' ? validationResult : '';
  101255. }).filter(function (message) {
  101256. return message !== '';
  101257. });
  101258. },
  101259. showDetails: function showDetails() {
  101260. return this.hideDetails === false || this.hideDetails === 'auto' && this.hasDetails;
  101261. }
  101262. },
  101263. watch: {
  101264. value: function value(val) {
  101265. this.lazyValue = val;
  101266. }
  101267. },
  101268. beforeCreate: function beforeCreate() {
  101269. // v-radio-group needs to emit a different event
  101270. // https://github.com/vuetifyjs/vuetify/issues/4752
  101271. this.$_modelEvent = this.$options.model && this.$options.model.event || 'input';
  101272. },
  101273. methods: {
  101274. genContent: function genContent() {
  101275. return [this.genPrependSlot(), this.genControl(), this.genAppendSlot()];
  101276. },
  101277. genControl: function genControl() {
  101278. return this.$createElement('div', {
  101279. staticClass: 'v-input__control'
  101280. }, [this.genInputSlot(), this.genMessages()]);
  101281. },
  101282. genDefaultSlot: function genDefaultSlot() {
  101283. return [this.genLabel(), this.$slots.default];
  101284. },
  101285. genIcon: function genIcon(type, cb, extraData) {
  101286. var _this = this;
  101287. if (extraData === void 0) {
  101288. extraData = {};
  101289. }
  101290. var icon = this[type + "Icon"];
  101291. var eventName = "click:" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["kebabCase"])(type);
  101292. var hasListener = !!(this.listeners$[eventName] || cb);
  101293. var data = Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_7__["default"])({
  101294. attrs: {
  101295. 'aria-label': hasListener ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["kebabCase"])(type).split('-')[0] + ' icon' : undefined,
  101296. color: this.validationState,
  101297. dark: this.dark,
  101298. disabled: this.disabled,
  101299. light: this.light
  101300. },
  101301. on: !hasListener ? undefined : {
  101302. click: function click(e) {
  101303. e.preventDefault();
  101304. e.stopPropagation();
  101305. _this.$emit(eventName, e);
  101306. cb && cb(e);
  101307. },
  101308. // Container has g event that will
  101309. // trigger menu open if enclosed
  101310. mouseup: function mouseup(e) {
  101311. e.preventDefault();
  101312. e.stopPropagation();
  101313. }
  101314. }
  101315. }, extraData);
  101316. return this.$createElement('div', {
  101317. staticClass: "v-input__icon",
  101318. class: type ? "v-input__icon--" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["kebabCase"])(type) : undefined
  101319. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], data, icon)]);
  101320. },
  101321. genInputSlot: function genInputSlot() {
  101322. return this.$createElement('div', this.setBackgroundColor(this.backgroundColor, {
  101323. staticClass: 'v-input__slot',
  101324. style: {
  101325. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["convertToUnit"])(this.height)
  101326. },
  101327. on: {
  101328. click: this.onClick,
  101329. mousedown: this.onMouseDown,
  101330. mouseup: this.onMouseUp
  101331. },
  101332. ref: 'input-slot'
  101333. }), [this.genDefaultSlot()]);
  101334. },
  101335. genLabel: function genLabel() {
  101336. if (!this.hasLabel) return null;
  101337. return this.$createElement(_VLabel__WEBPACK_IMPORTED_MODULE_2__["default"], {
  101338. props: {
  101339. color: this.validationState,
  101340. dark: this.dark,
  101341. disabled: this.disabled,
  101342. focused: this.hasState,
  101343. for: this.computedId,
  101344. light: this.light
  101345. }
  101346. }, this.$slots.label || this.label);
  101347. },
  101348. genMessages: function genMessages() {
  101349. var _this = this;
  101350. if (!this.showDetails) return null;
  101351. return this.$createElement(_VMessages__WEBPACK_IMPORTED_MODULE_3__["default"], {
  101352. props: {
  101353. color: this.hasHint ? '' : this.validationState,
  101354. dark: this.dark,
  101355. light: this.light,
  101356. value: this.messagesToDisplay
  101357. },
  101358. attrs: {
  101359. role: this.hasMessages ? 'alert' : null
  101360. },
  101361. scopedSlots: {
  101362. default: function _default(props) {
  101363. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getSlot"])(_this, 'message', props);
  101364. }
  101365. }
  101366. });
  101367. },
  101368. genSlot: function genSlot(type, location, slot) {
  101369. if (!slot.length) return null;
  101370. var ref = type + "-" + location;
  101371. return this.$createElement('div', {
  101372. staticClass: "v-input__" + ref,
  101373. ref: ref
  101374. }, slot);
  101375. },
  101376. genPrependSlot: function genPrependSlot() {
  101377. var slot = [];
  101378. if (this.$slots.prepend) {
  101379. slot.push(this.$slots.prepend);
  101380. } else if (this.prependIcon) {
  101381. slot.push(this.genIcon('prepend'));
  101382. }
  101383. return this.genSlot('prepend', 'outer', slot);
  101384. },
  101385. genAppendSlot: function genAppendSlot() {
  101386. var slot = []; // Append icon for text field was really
  101387. // an appended inner icon, v-text-field
  101388. // will overwrite this method in order to obtain
  101389. // backwards compat
  101390. if (this.$slots.append) {
  101391. slot.push(this.$slots.append);
  101392. } else if (this.appendIcon) {
  101393. slot.push(this.genIcon('append'));
  101394. }
  101395. return this.genSlot('append', 'outer', slot);
  101396. },
  101397. onClick: function onClick(e) {
  101398. this.$emit('click', e);
  101399. },
  101400. onMouseDown: function onMouseDown(e) {
  101401. this.hasMouseDown = true;
  101402. this.$emit('mousedown', e);
  101403. },
  101404. onMouseUp: function onMouseUp(e) {
  101405. this.hasMouseDown = false;
  101406. this.$emit('mouseup', e);
  101407. }
  101408. },
  101409. render: function render(h) {
  101410. return h('div', this.setTextColor(this.validationState, {
  101411. staticClass: 'v-input',
  101412. class: this.classes
  101413. }), this.genContent());
  101414. }
  101415. }));
  101416. /***/ }),
  101417. /***/ "./src/components/VInput/index.ts":
  101418. /*!****************************************!*\
  101419. !*** ./src/components/VInput/index.ts ***!
  101420. \****************************************/
  101421. /*! exports provided: VInput, default */
  101422. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101423. "use strict";
  101424. __webpack_require__.r(__webpack_exports__);
  101425. /* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VInput */ "./src/components/VInput/VInput.ts");
  101426. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VInput", function() { return _VInput__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  101427. /* harmony default export */ __webpack_exports__["default"] = (_VInput__WEBPACK_IMPORTED_MODULE_0__["default"]);
  101428. /***/ }),
  101429. /***/ "./src/components/VItemGroup/VItem.ts":
  101430. /*!********************************************!*\
  101431. !*** ./src/components/VItemGroup/VItem.ts ***!
  101432. \********************************************/
  101433. /*! exports provided: BaseItem, default */
  101434. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101435. "use strict";
  101436. __webpack_require__.r(__webpack_exports__);
  101437. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseItem", function() { return BaseItem; });
  101438. /* harmony import */ var _mixins_groupable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/groupable */ "./src/mixins/groupable/index.ts");
  101439. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  101440. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  101441. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue */ "vue");
  101442. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_3__);
  101443. // Mixins
  101444. // Utilities
  101445. // Types
  101446. /* @vue/component */
  101447. var BaseItem = vue__WEBPACK_IMPORTED_MODULE_3___default.a.extend({
  101448. props: {
  101449. activeClass: String,
  101450. value: {
  101451. required: false
  101452. }
  101453. },
  101454. data: function data() {
  101455. return {
  101456. isActive: false
  101457. };
  101458. },
  101459. methods: {
  101460. toggle: function toggle() {
  101461. this.isActive = !this.isActive;
  101462. }
  101463. },
  101464. render: function render() {
  101465. var _a;
  101466. if (!this.$scopedSlots.default) {
  101467. Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["consoleWarn"])('v-item is missing a default scopedSlot', this);
  101468. return null;
  101469. }
  101470. var element;
  101471. /* istanbul ignore else */
  101472. if (this.$scopedSlots.default) {
  101473. element = this.$scopedSlots.default({
  101474. active: this.isActive,
  101475. toggle: this.toggle
  101476. });
  101477. }
  101478. if (Array.isArray(element) && element.length === 1) {
  101479. element = element[0];
  101480. }
  101481. if (!element || Array.isArray(element) || !element.tag) {
  101482. Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["consoleWarn"])('v-item should only contain a single element', this);
  101483. return element;
  101484. }
  101485. element.data = this._b(element.data || {}, element.tag, {
  101486. class: (_a = {}, _a[this.activeClass] = this.isActive, _a)
  101487. });
  101488. return element;
  101489. }
  101490. });
  101491. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(BaseItem, Object(_mixins_groupable__WEBPACK_IMPORTED_MODULE_0__["factory"])('itemGroup', 'v-item', 'v-item-group')).extend({
  101492. name: 'v-item'
  101493. }));
  101494. /***/ }),
  101495. /***/ "./src/components/VItemGroup/VItemGroup.sass":
  101496. /*!***************************************************!*\
  101497. !*** ./src/components/VItemGroup/VItemGroup.sass ***!
  101498. \***************************************************/
  101499. /*! no static exports found */
  101500. /***/ (function(module, exports, __webpack_require__) {
  101501. // extracted by mini-css-extract-plugin
  101502. /***/ }),
  101503. /***/ "./src/components/VItemGroup/VItemGroup.ts":
  101504. /*!*************************************************!*\
  101505. !*** ./src/components/VItemGroup/VItemGroup.ts ***!
  101506. \*************************************************/
  101507. /*! exports provided: BaseItemGroup, default */
  101508. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101509. "use strict";
  101510. __webpack_require__.r(__webpack_exports__);
  101511. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseItemGroup", function() { return BaseItemGroup; });
  101512. /* harmony import */ var _VItemGroup_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VItemGroup.sass */ "./src/components/VItemGroup/VItemGroup.sass");
  101513. /* harmony import */ var _VItemGroup_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VItemGroup_sass__WEBPACK_IMPORTED_MODULE_0__);
  101514. /* harmony import */ var _mixins_proxyable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/proxyable */ "./src/mixins/proxyable/index.ts");
  101515. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  101516. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  101517. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  101518. var __assign = undefined && undefined.__assign || function () {
  101519. __assign = Object.assign || function (t) {
  101520. for (var s, i = 1, n = arguments.length; i < n; i++) {
  101521. s = arguments[i];
  101522. for (var p in s) {
  101523. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  101524. }
  101525. }
  101526. return t;
  101527. };
  101528. return __assign.apply(this, arguments);
  101529. }; // Styles
  101530. // Utilities
  101531. var BaseItemGroup = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_proxyable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]).extend({
  101532. name: 'base-item-group',
  101533. props: {
  101534. activeClass: {
  101535. type: String,
  101536. default: 'v-item--active'
  101537. },
  101538. mandatory: Boolean,
  101539. max: {
  101540. type: [Number, String],
  101541. default: null
  101542. },
  101543. multiple: Boolean
  101544. },
  101545. data: function data() {
  101546. return {
  101547. // As long as a value is defined, show it
  101548. // Otherwise, check if multiple
  101549. // to determine which default to provide
  101550. internalLazyValue: this.value !== undefined ? this.value : this.multiple ? [] : undefined,
  101551. items: []
  101552. };
  101553. },
  101554. computed: {
  101555. classes: function classes() {
  101556. return __assign({
  101557. 'v-item-group': true
  101558. }, this.themeClasses);
  101559. },
  101560. selectedIndex: function selectedIndex() {
  101561. return this.selectedItem && this.items.indexOf(this.selectedItem) || -1;
  101562. },
  101563. selectedItem: function selectedItem() {
  101564. if (this.multiple) return undefined;
  101565. return this.selectedItems[0];
  101566. },
  101567. selectedItems: function selectedItems() {
  101568. var _this = this;
  101569. return this.items.filter(function (item, index) {
  101570. return _this.toggleMethod(_this.getValue(item, index));
  101571. });
  101572. },
  101573. selectedValues: function selectedValues() {
  101574. if (this.internalValue == null) return [];
  101575. return Array.isArray(this.internalValue) ? this.internalValue : [this.internalValue];
  101576. },
  101577. toggleMethod: function toggleMethod() {
  101578. var _this = this;
  101579. if (!this.multiple) {
  101580. return function (v) {
  101581. return _this.internalValue === v;
  101582. };
  101583. }
  101584. var internalValue = this.internalValue;
  101585. if (Array.isArray(internalValue)) {
  101586. return function (v) {
  101587. return internalValue.includes(v);
  101588. };
  101589. }
  101590. return function () {
  101591. return false;
  101592. };
  101593. }
  101594. },
  101595. watch: {
  101596. internalValue: 'updateItemsState',
  101597. items: 'updateItemsState'
  101598. },
  101599. created: function created() {
  101600. if (this.multiple && !Array.isArray(this.internalValue)) {
  101601. Object(_util_console__WEBPACK_IMPORTED_MODULE_4__["consoleWarn"])('Model must be bound to an array if the multiple property is true.', this);
  101602. }
  101603. },
  101604. methods: {
  101605. genData: function genData() {
  101606. return {
  101607. class: this.classes
  101608. };
  101609. },
  101610. getValue: function getValue(item, i) {
  101611. return item.value == null || item.value === '' ? i : item.value;
  101612. },
  101613. onClick: function onClick(item) {
  101614. this.updateInternalValue(this.getValue(item, this.items.indexOf(item)));
  101615. },
  101616. register: function register(item) {
  101617. var _this = this;
  101618. var index = this.items.push(item) - 1;
  101619. item.$on('change', function () {
  101620. return _this.onClick(item);
  101621. }); // If no value provided and mandatory,
  101622. // assign first registered item
  101623. if (this.mandatory && !this.selectedValues.length) {
  101624. this.updateMandatory();
  101625. }
  101626. this.updateItem(item, index);
  101627. },
  101628. unregister: function unregister(item) {
  101629. if (this._isDestroyed) return;
  101630. var index = this.items.indexOf(item);
  101631. var value = this.getValue(item, index);
  101632. this.items.splice(index, 1);
  101633. var valueIndex = this.selectedValues.indexOf(value); // Items is not selected, do nothing
  101634. if (valueIndex < 0) return; // If not mandatory, use regular update process
  101635. if (!this.mandatory) {
  101636. return this.updateInternalValue(value);
  101637. } // Remove the value
  101638. if (this.multiple && Array.isArray(this.internalValue)) {
  101639. this.internalValue = this.internalValue.filter(function (v) {
  101640. return v !== value;
  101641. });
  101642. } else {
  101643. this.internalValue = undefined;
  101644. } // If mandatory and we have no selection
  101645. // add the last item as value
  101646. /* istanbul ignore else */
  101647. if (!this.selectedItems.length) {
  101648. this.updateMandatory(true);
  101649. }
  101650. },
  101651. updateItem: function updateItem(item, index) {
  101652. var value = this.getValue(item, index);
  101653. item.isActive = this.toggleMethod(value);
  101654. },
  101655. // https://github.com/vuetifyjs/vuetify/issues/5352
  101656. updateItemsState: function updateItemsState() {
  101657. var _this = this;
  101658. this.$nextTick(function () {
  101659. if (_this.mandatory && !_this.selectedItems.length) {
  101660. return _this.updateMandatory();
  101661. } // TODO: Make this smarter so it
  101662. // doesn't have to iterate every
  101663. // child in an update
  101664. _this.items.forEach(_this.updateItem);
  101665. });
  101666. },
  101667. updateInternalValue: function updateInternalValue(value) {
  101668. this.multiple ? this.updateMultiple(value) : this.updateSingle(value);
  101669. },
  101670. updateMandatory: function updateMandatory(last) {
  101671. if (!this.items.length) return;
  101672. var items = this.items.slice();
  101673. if (last) items.reverse();
  101674. var item = items.find(function (item) {
  101675. return !item.disabled;
  101676. }); // If no tabs are available
  101677. // aborts mandatory value
  101678. if (!item) return;
  101679. var index = this.items.indexOf(item);
  101680. this.updateInternalValue(this.getValue(item, index));
  101681. },
  101682. updateMultiple: function updateMultiple(value) {
  101683. var defaultValue = Array.isArray(this.internalValue) ? this.internalValue : [];
  101684. var internalValue = defaultValue.slice();
  101685. var index = internalValue.findIndex(function (val) {
  101686. return val === value;
  101687. });
  101688. if (this.mandatory && // Item already exists
  101689. index > -1 && // value would be reduced below min
  101690. internalValue.length - 1 < 1) return;
  101691. if ( // Max is set
  101692. this.max != null && // Item doesn't exist
  101693. index < 0 && // value would be increased above max
  101694. internalValue.length + 1 > this.max) return;
  101695. index > -1 ? internalValue.splice(index, 1) : internalValue.push(value);
  101696. this.internalValue = internalValue;
  101697. },
  101698. updateSingle: function updateSingle(value) {
  101699. var isSame = value === this.internalValue;
  101700. if (this.mandatory && isSame) return;
  101701. this.internalValue = isSame ? undefined : value;
  101702. }
  101703. },
  101704. render: function render(h) {
  101705. return h('div', this.genData(), this.$slots.default);
  101706. }
  101707. });
  101708. /* harmony default export */ __webpack_exports__["default"] = (BaseItemGroup.extend({
  101709. name: 'v-item-group',
  101710. provide: function provide() {
  101711. return {
  101712. itemGroup: this
  101713. };
  101714. }
  101715. }));
  101716. /***/ }),
  101717. /***/ "./src/components/VItemGroup/index.ts":
  101718. /*!********************************************!*\
  101719. !*** ./src/components/VItemGroup/index.ts ***!
  101720. \********************************************/
  101721. /*! exports provided: VItem, VItemGroup, default */
  101722. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101723. "use strict";
  101724. __webpack_require__.r(__webpack_exports__);
  101725. /* harmony import */ var _VItem__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VItem */ "./src/components/VItemGroup/VItem.ts");
  101726. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VItem", function() { return _VItem__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  101727. /* harmony import */ var _VItemGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VItemGroup */ "./src/components/VItemGroup/VItemGroup.ts");
  101728. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VItemGroup", function() { return _VItemGroup__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  101729. /* harmony default export */ __webpack_exports__["default"] = ({
  101730. $_vuetify_subcomponents: {
  101731. VItem: _VItem__WEBPACK_IMPORTED_MODULE_0__["default"],
  101732. VItemGroup: _VItemGroup__WEBPACK_IMPORTED_MODULE_1__["default"]
  101733. }
  101734. });
  101735. /***/ }),
  101736. /***/ "./src/components/VLabel/VLabel.sass":
  101737. /*!*******************************************!*\
  101738. !*** ./src/components/VLabel/VLabel.sass ***!
  101739. \*******************************************/
  101740. /*! no static exports found */
  101741. /***/ (function(module, exports, __webpack_require__) {
  101742. // extracted by mini-css-extract-plugin
  101743. /***/ }),
  101744. /***/ "./src/components/VLabel/VLabel.ts":
  101745. /*!*****************************************!*\
  101746. !*** ./src/components/VLabel/VLabel.ts ***!
  101747. \*****************************************/
  101748. /*! exports provided: default */
  101749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101750. "use strict";
  101751. __webpack_require__.r(__webpack_exports__);
  101752. /* harmony import */ var _VLabel_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VLabel.sass */ "./src/components/VLabel/VLabel.sass");
  101753. /* harmony import */ var _VLabel_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VLabel_sass__WEBPACK_IMPORTED_MODULE_0__);
  101754. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  101755. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  101756. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  101757. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  101758. var __assign = undefined && undefined.__assign || function () {
  101759. __assign = Object.assign || function (t) {
  101760. for (var s, i = 1, n = arguments.length; i < n; i++) {
  101761. s = arguments[i];
  101762. for (var p in s) {
  101763. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  101764. }
  101765. }
  101766. return t;
  101767. };
  101768. return __assign.apply(this, arguments);
  101769. }; // Styles
  101770. // Mixins
  101771. // Helpers
  101772. /* @vue/component */
  101773. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]).extend({
  101774. name: 'v-label',
  101775. functional: true,
  101776. props: {
  101777. absolute: Boolean,
  101778. color: {
  101779. type: String,
  101780. default: 'primary'
  101781. },
  101782. disabled: Boolean,
  101783. focused: Boolean,
  101784. for: String,
  101785. left: {
  101786. type: [Number, String],
  101787. default: 0
  101788. },
  101789. right: {
  101790. type: [Number, String],
  101791. default: 'auto'
  101792. },
  101793. value: Boolean
  101794. },
  101795. render: function render(h, ctx) {
  101796. var children = ctx.children,
  101797. listeners = ctx.listeners,
  101798. props = ctx.props;
  101799. var data = {
  101800. staticClass: 'v-label',
  101801. class: __assign({
  101802. 'v-label--active': props.value,
  101803. 'v-label--is-disabled': props.disabled
  101804. }, Object(_mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["functionalThemeClasses"])(ctx)),
  101805. attrs: {
  101806. for: props.for,
  101807. 'aria-hidden': !props.for
  101808. },
  101809. on: listeners,
  101810. style: {
  101811. left: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(props.left),
  101812. right: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(props.right),
  101813. position: props.absolute ? 'absolute' : 'relative'
  101814. },
  101815. ref: 'label'
  101816. };
  101817. return h('label', _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.setTextColor(props.focused && props.color, data), children);
  101818. }
  101819. }));
  101820. /***/ }),
  101821. /***/ "./src/components/VLabel/index.ts":
  101822. /*!****************************************!*\
  101823. !*** ./src/components/VLabel/index.ts ***!
  101824. \****************************************/
  101825. /*! exports provided: VLabel, default */
  101826. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101827. "use strict";
  101828. __webpack_require__.r(__webpack_exports__);
  101829. /* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VLabel */ "./src/components/VLabel/VLabel.ts");
  101830. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VLabel", function() { return _VLabel__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  101831. /* harmony default export */ __webpack_exports__["default"] = (_VLabel__WEBPACK_IMPORTED_MODULE_0__["default"]);
  101832. /***/ }),
  101833. /***/ "./src/components/VLazy/VLazy.ts":
  101834. /*!***************************************!*\
  101835. !*** ./src/components/VLazy/VLazy.ts ***!
  101836. \***************************************/
  101837. /*! exports provided: default */
  101838. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101839. "use strict";
  101840. __webpack_require__.r(__webpack_exports__);
  101841. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  101842. /* harmony import */ var _directives_intersect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../directives/intersect */ "./src/directives/intersect/index.ts");
  101843. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  101844. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  101845. // Mixins
  101846. // Directives
  101847. // Utilities
  101848. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_toggleable__WEBPACK_IMPORTED_MODULE_0__["default"]).extend({
  101849. name: 'VLazy',
  101850. directives: {
  101851. intersect: _directives_intersect__WEBPACK_IMPORTED_MODULE_1__["default"]
  101852. },
  101853. props: {
  101854. minHeight: [Number, String],
  101855. options: {
  101856. type: Object,
  101857. // For more information on types, navigate to:
  101858. // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
  101859. default: function _default() {
  101860. return {
  101861. root: undefined,
  101862. rootMargin: undefined,
  101863. threshold: undefined
  101864. };
  101865. }
  101866. },
  101867. tag: {
  101868. type: String,
  101869. default: 'div'
  101870. },
  101871. transition: {
  101872. type: String,
  101873. default: 'fade-transition'
  101874. }
  101875. },
  101876. computed: {
  101877. styles: function styles() {
  101878. return {
  101879. minHeight: parseInt(this.minHeight) ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.minHeight) : this.minHeight
  101880. };
  101881. }
  101882. },
  101883. methods: {
  101884. genContent: function genContent() {
  101885. var slot = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this);
  101886. /* istanbul ignore if */
  101887. if (!this.transition) return slot;
  101888. var children = [];
  101889. if (this.isActive) children.push(slot);
  101890. return this.$createElement('transition', {
  101891. props: {
  101892. name: this.transition
  101893. }
  101894. }, children);
  101895. },
  101896. onObserve: function onObserve(entries, observer, isIntersecting) {
  101897. if (this.isActive) return;
  101898. this.isActive = isIntersecting;
  101899. }
  101900. },
  101901. render: function render(h) {
  101902. return h(this.tag, {
  101903. staticClass: 'v-lazy',
  101904. attrs: this.$attrs,
  101905. directives: [{
  101906. name: 'intersect',
  101907. value: {
  101908. handler: this.onObserve,
  101909. options: this.options
  101910. }
  101911. }],
  101912. on: this.$listeners,
  101913. style: this.styles
  101914. }, [this.genContent()]);
  101915. }
  101916. }));
  101917. /***/ }),
  101918. /***/ "./src/components/VLazy/index.ts":
  101919. /*!***************************************!*\
  101920. !*** ./src/components/VLazy/index.ts ***!
  101921. \***************************************/
  101922. /*! exports provided: VLazy, default */
  101923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101924. "use strict";
  101925. __webpack_require__.r(__webpack_exports__);
  101926. /* harmony import */ var _VLazy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VLazy */ "./src/components/VLazy/VLazy.ts");
  101927. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VLazy", function() { return _VLazy__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  101928. /* harmony default export */ __webpack_exports__["default"] = (_VLazy__WEBPACK_IMPORTED_MODULE_0__["default"]);
  101929. /***/ }),
  101930. /***/ "./src/components/VList/VList.sass":
  101931. /*!*****************************************!*\
  101932. !*** ./src/components/VList/VList.sass ***!
  101933. \*****************************************/
  101934. /*! no static exports found */
  101935. /***/ (function(module, exports, __webpack_require__) {
  101936. // extracted by mini-css-extract-plugin
  101937. /***/ }),
  101938. /***/ "./src/components/VList/VList.ts":
  101939. /*!***************************************!*\
  101940. !*** ./src/components/VList/VList.ts ***!
  101941. \***************************************/
  101942. /*! exports provided: default */
  101943. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101944. "use strict";
  101945. __webpack_require__.r(__webpack_exports__);
  101946. /* harmony import */ var _VList_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VList.sass */ "./src/components/VList/VList.sass");
  101947. /* harmony import */ var _VList_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VList_sass__WEBPACK_IMPORTED_MODULE_0__);
  101948. /* harmony import */ var _VSheet_VSheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSheet/VSheet */ "./src/components/VSheet/VSheet.ts");
  101949. var __assign = undefined && undefined.__assign || function () {
  101950. __assign = Object.assign || function (t) {
  101951. for (var s, i = 1, n = arguments.length; i < n; i++) {
  101952. s = arguments[i];
  101953. for (var p in s) {
  101954. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  101955. }
  101956. }
  101957. return t;
  101958. };
  101959. return __assign.apply(this, arguments);
  101960. };
  101961. var __values = undefined && undefined.__values || function (o) {
  101962. var m = typeof Symbol === "function" && o[Symbol.iterator],
  101963. i = 0;
  101964. if (m) return m.call(o);
  101965. return {
  101966. next: function next() {
  101967. if (o && i >= o.length) o = void 0;
  101968. return {
  101969. value: o && o[i++],
  101970. done: !o
  101971. };
  101972. }
  101973. };
  101974. }; // Styles
  101975. // Components
  101976. /* @vue/component */
  101977. /* harmony default export */ __webpack_exports__["default"] = (_VSheet_VSheet__WEBPACK_IMPORTED_MODULE_1__["default"].extend().extend({
  101978. name: 'v-list',
  101979. provide: function provide() {
  101980. return {
  101981. isInList: true,
  101982. list: this
  101983. };
  101984. },
  101985. inject: {
  101986. isInMenu: {
  101987. default: false
  101988. },
  101989. isInNav: {
  101990. default: false
  101991. }
  101992. },
  101993. props: {
  101994. dense: Boolean,
  101995. disabled: Boolean,
  101996. expand: Boolean,
  101997. flat: Boolean,
  101998. nav: Boolean,
  101999. rounded: Boolean,
  102000. shaped: Boolean,
  102001. subheader: Boolean,
  102002. threeLine: Boolean,
  102003. tile: {
  102004. type: Boolean,
  102005. default: true
  102006. },
  102007. twoLine: Boolean
  102008. },
  102009. data: function data() {
  102010. return {
  102011. groups: []
  102012. };
  102013. },
  102014. computed: {
  102015. classes: function classes() {
  102016. return __assign({}, _VSheet_VSheet__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  102017. 'v-list--dense': this.dense,
  102018. 'v-list--disabled': this.disabled,
  102019. 'v-list--flat': this.flat,
  102020. 'v-list--nav': this.nav,
  102021. 'v-list--rounded': this.rounded,
  102022. 'v-list--shaped': this.shaped,
  102023. 'v-list--subheader': this.subheader,
  102024. 'v-list--two-line': this.twoLine,
  102025. 'v-list--three-line': this.threeLine
  102026. });
  102027. }
  102028. },
  102029. methods: {
  102030. register: function register(content) {
  102031. this.groups.push(content);
  102032. },
  102033. unregister: function unregister(content) {
  102034. var index = this.groups.findIndex(function (g) {
  102035. return g._uid === content._uid;
  102036. });
  102037. if (index > -1) this.groups.splice(index, 1);
  102038. },
  102039. listClick: function listClick(uid) {
  102040. var e_1, _a;
  102041. if (this.expand) return;
  102042. try {
  102043. for (var _b = __values(this.groups), _c = _b.next(); !_c.done; _c = _b.next()) {
  102044. var group = _c.value;
  102045. group.toggle(uid);
  102046. }
  102047. } catch (e_1_1) {
  102048. e_1 = {
  102049. error: e_1_1
  102050. };
  102051. } finally {
  102052. try {
  102053. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  102054. } finally {
  102055. if (e_1) throw e_1.error;
  102056. }
  102057. }
  102058. }
  102059. },
  102060. render: function render(h) {
  102061. var data = {
  102062. staticClass: 'v-list',
  102063. class: this.classes,
  102064. style: this.styles,
  102065. attrs: __assign({
  102066. role: this.isInNav || this.isInMenu ? undefined : 'list'
  102067. }, this.attrs$)
  102068. };
  102069. return h(this.tag, this.setBackgroundColor(this.color, data), [this.$slots.default]);
  102070. }
  102071. }));
  102072. /***/ }),
  102073. /***/ "./src/components/VList/VListGroup.sass":
  102074. /*!**********************************************!*\
  102075. !*** ./src/components/VList/VListGroup.sass ***!
  102076. \**********************************************/
  102077. /*! no static exports found */
  102078. /***/ (function(module, exports, __webpack_require__) {
  102079. // extracted by mini-css-extract-plugin
  102080. /***/ }),
  102081. /***/ "./src/components/VList/VListGroup.ts":
  102082. /*!********************************************!*\
  102083. !*** ./src/components/VList/VListGroup.ts ***!
  102084. \********************************************/
  102085. /*! exports provided: default */
  102086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102087. "use strict";
  102088. __webpack_require__.r(__webpack_exports__);
  102089. /* harmony import */ var _VListGroup_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VListGroup.sass */ "./src/components/VList/VListGroup.sass");
  102090. /* harmony import */ var _VListGroup_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VListGroup_sass__WEBPACK_IMPORTED_MODULE_0__);
  102091. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  102092. /* harmony import */ var _VListItem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VListItem */ "./src/components/VList/VListItem.ts");
  102093. /* harmony import */ var _VListItemIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VListItemIcon */ "./src/components/VList/VListItemIcon.ts");
  102094. /* harmony import */ var _mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/binds-attrs */ "./src/mixins/binds-attrs/index.ts");
  102095. /* harmony import */ var _mixins_bootable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/bootable */ "./src/mixins/bootable/index.ts");
  102096. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  102097. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  102098. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  102099. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  102100. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  102101. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  102102. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  102103. var __assign = undefined && undefined.__assign || function () {
  102104. __assign = Object.assign || function (t) {
  102105. for (var s, i = 1, n = arguments.length; i < n; i++) {
  102106. s = arguments[i];
  102107. for (var p in s) {
  102108. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  102109. }
  102110. }
  102111. return t;
  102112. };
  102113. return __assign.apply(this, arguments);
  102114. }; // Styles
  102115. // Components
  102116. // Mixins
  102117. // Directives
  102118. // Transitions
  102119. // Utils
  102120. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_11__["default"])(_mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_bootable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_8__["inject"])('list'), _mixins_toggleable__WEBPACK_IMPORTED_MODULE_7__["default"]);
  102121. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  102122. name: 'v-list-group',
  102123. directives: {
  102124. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_9__["default"]
  102125. },
  102126. props: {
  102127. activeClass: {
  102128. type: String,
  102129. default: ''
  102130. },
  102131. appendIcon: {
  102132. type: String,
  102133. default: '$expand'
  102134. },
  102135. color: {
  102136. type: String,
  102137. default: 'primary'
  102138. },
  102139. disabled: Boolean,
  102140. group: String,
  102141. noAction: Boolean,
  102142. prependIcon: String,
  102143. ripple: {
  102144. type: [Boolean, Object],
  102145. default: true
  102146. },
  102147. subGroup: Boolean
  102148. },
  102149. computed: {
  102150. classes: function classes() {
  102151. return {
  102152. 'v-list-group--active': this.isActive,
  102153. 'v-list-group--disabled': this.disabled,
  102154. 'v-list-group--no-action': this.noAction,
  102155. 'v-list-group--sub-group': this.subGroup
  102156. };
  102157. }
  102158. },
  102159. watch: {
  102160. isActive: function isActive(val) {
  102161. /* istanbul ignore else */
  102162. if (!this.subGroup && val) {
  102163. this.list && this.list.listClick(this._uid);
  102164. }
  102165. },
  102166. $route: 'onRouteChange'
  102167. },
  102168. created: function created() {
  102169. this.list && this.list.register(this);
  102170. if (this.group && this.$route && this.value == null) {
  102171. this.isActive = this.matchRoute(this.$route.path);
  102172. }
  102173. },
  102174. beforeDestroy: function beforeDestroy() {
  102175. this.list && this.list.unregister(this);
  102176. },
  102177. methods: {
  102178. click: function click(e) {
  102179. var _this = this;
  102180. if (this.disabled) return;
  102181. this.isBooted = true;
  102182. this.$emit('click', e);
  102183. this.$nextTick(function () {
  102184. return _this.isActive = !_this.isActive;
  102185. });
  102186. },
  102187. genIcon: function genIcon(icon) {
  102188. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], icon);
  102189. },
  102190. genAppendIcon: function genAppendIcon() {
  102191. var icon = !this.subGroup ? this.appendIcon : false;
  102192. if (!icon && !this.$slots.appendIcon) return null;
  102193. return this.$createElement(_VListItemIcon__WEBPACK_IMPORTED_MODULE_3__["default"], {
  102194. staticClass: 'v-list-group__header__append-icon'
  102195. }, [this.$slots.appendIcon || this.genIcon(icon)]);
  102196. },
  102197. genHeader: function genHeader() {
  102198. var _a;
  102199. return this.$createElement(_VListItem__WEBPACK_IMPORTED_MODULE_2__["default"], {
  102200. staticClass: 'v-list-group__header',
  102201. attrs: {
  102202. 'aria-expanded': String(this.isActive),
  102203. role: 'button'
  102204. },
  102205. class: (_a = {}, _a[this.activeClass] = this.isActive, _a),
  102206. props: {
  102207. inputValue: this.isActive
  102208. },
  102209. directives: [{
  102210. name: 'ripple',
  102211. value: this.ripple
  102212. }],
  102213. on: __assign({}, this.listeners$, {
  102214. click: this.click
  102215. })
  102216. }, [this.genPrependIcon(), this.$slots.activator, this.genAppendIcon()]);
  102217. },
  102218. genItems: function genItems() {
  102219. var _this = this;
  102220. return this.showLazyContent(function () {
  102221. return [_this.$createElement('div', {
  102222. staticClass: 'v-list-group__items',
  102223. directives: [{
  102224. name: 'show',
  102225. value: _this.isActive
  102226. }]
  102227. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_12__["getSlot"])(_this))];
  102228. });
  102229. },
  102230. genPrependIcon: function genPrependIcon() {
  102231. var icon = this.subGroup && this.prependIcon == null ? '$subgroup' : this.prependIcon;
  102232. if (!icon && !this.$slots.prependIcon) return null;
  102233. return this.$createElement(_VListItemIcon__WEBPACK_IMPORTED_MODULE_3__["default"], {
  102234. staticClass: 'v-list-group__header__prepend-icon'
  102235. }, [this.$slots.prependIcon || this.genIcon(icon)]);
  102236. },
  102237. onRouteChange: function onRouteChange(to) {
  102238. /* istanbul ignore if */
  102239. if (!this.group) return;
  102240. var isActive = this.matchRoute(to.path);
  102241. /* istanbul ignore else */
  102242. if (isActive && this.isActive !== isActive) {
  102243. this.list && this.list.listClick(this._uid);
  102244. }
  102245. this.isActive = isActive;
  102246. },
  102247. toggle: function toggle(uid) {
  102248. var _this = this;
  102249. var isActive = this._uid === uid;
  102250. if (isActive) this.isBooted = true;
  102251. this.$nextTick(function () {
  102252. return _this.isActive = isActive;
  102253. });
  102254. },
  102255. matchRoute: function matchRoute(to) {
  102256. return to.match(this.group) !== null;
  102257. }
  102258. },
  102259. render: function render(h) {
  102260. return h('div', this.setTextColor(this.isActive && this.color, {
  102261. staticClass: 'v-list-group',
  102262. class: this.classes
  102263. }), [this.genHeader(), h(_transitions__WEBPACK_IMPORTED_MODULE_10__["VExpandTransition"], this.genItems())]);
  102264. }
  102265. }));
  102266. /***/ }),
  102267. /***/ "./src/components/VList/VListItem.sass":
  102268. /*!*********************************************!*\
  102269. !*** ./src/components/VList/VListItem.sass ***!
  102270. \*********************************************/
  102271. /*! no static exports found */
  102272. /***/ (function(module, exports, __webpack_require__) {
  102273. // extracted by mini-css-extract-plugin
  102274. /***/ }),
  102275. /***/ "./src/components/VList/VListItem.ts":
  102276. /*!*******************************************!*\
  102277. !*** ./src/components/VList/VListItem.ts ***!
  102278. \*******************************************/
  102279. /*! exports provided: default */
  102280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102281. "use strict";
  102282. __webpack_require__.r(__webpack_exports__);
  102283. /* harmony import */ var _VListItem_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VListItem.sass */ "./src/components/VList/VListItem.sass");
  102284. /* harmony import */ var _VListItem_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VListItem_sass__WEBPACK_IMPORTED_MODULE_0__);
  102285. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  102286. /* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable/index.ts");
  102287. /* harmony import */ var _mixins_groupable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/groupable */ "./src/mixins/groupable/index.ts");
  102288. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  102289. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  102290. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  102291. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../util/helpers */ "./src/util/helpers.ts");
  102292. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  102293. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  102294. var __assign = undefined && undefined.__assign || function () {
  102295. __assign = Object.assign || function (t) {
  102296. for (var s, i = 1, n = arguments.length; i < n; i++) {
  102297. s = arguments[i];
  102298. for (var p in s) {
  102299. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  102300. }
  102301. }
  102302. return t;
  102303. };
  102304. return __assign.apply(this, arguments);
  102305. }; // Styles
  102306. // Mixins
  102307. // Directives
  102308. // Utilities
  102309. // Types
  102310. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_9__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_routable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_mixins_groupable__WEBPACK_IMPORTED_MODULE_3__["factory"])('listItemGroup'), Object(_mixins_toggleable__WEBPACK_IMPORTED_MODULE_5__["factory"])('inputValue'));
  102311. /* @vue/component */
  102312. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  102313. name: 'v-list-item',
  102314. directives: {
  102315. Ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_6__["default"]
  102316. },
  102317. inheritAttrs: false,
  102318. inject: {
  102319. isInGroup: {
  102320. default: false
  102321. },
  102322. isInList: {
  102323. default: false
  102324. },
  102325. isInMenu: {
  102326. default: false
  102327. },
  102328. isInNav: {
  102329. default: false
  102330. }
  102331. },
  102332. props: {
  102333. activeClass: {
  102334. type: String,
  102335. default: function _default() {
  102336. if (!this.listItemGroup) return '';
  102337. return this.listItemGroup.activeClass;
  102338. }
  102339. },
  102340. dense: Boolean,
  102341. inactive: Boolean,
  102342. link: Boolean,
  102343. selectable: {
  102344. type: Boolean
  102345. },
  102346. tag: {
  102347. type: String,
  102348. default: 'div'
  102349. },
  102350. threeLine: Boolean,
  102351. twoLine: Boolean,
  102352. value: null
  102353. },
  102354. data: function data() {
  102355. return {
  102356. proxyClass: 'v-list-item--active'
  102357. };
  102358. },
  102359. computed: {
  102360. classes: function classes() {
  102361. return __assign({
  102362. 'v-list-item': true
  102363. }, _mixins_routable__WEBPACK_IMPORTED_MODULE_2__["default"].options.computed.classes.call(this), {
  102364. 'v-list-item--dense': this.dense,
  102365. 'v-list-item--disabled': this.disabled,
  102366. 'v-list-item--link': this.isClickable && !this.inactive,
  102367. 'v-list-item--selectable': this.selectable,
  102368. 'v-list-item--three-line': this.threeLine,
  102369. 'v-list-item--two-line': this.twoLine
  102370. }, this.themeClasses);
  102371. },
  102372. isClickable: function isClickable() {
  102373. return Boolean(_mixins_routable__WEBPACK_IMPORTED_MODULE_2__["default"].options.computed.isClickable.call(this) || this.listItemGroup);
  102374. }
  102375. },
  102376. created: function created() {
  102377. /* istanbul ignore next */
  102378. if (this.$attrs.hasOwnProperty('avatar')) {
  102379. Object(_util_console__WEBPACK_IMPORTED_MODULE_8__["removed"])('avatar', this);
  102380. }
  102381. },
  102382. methods: {
  102383. click: function click(e) {
  102384. if (e.detail) this.$el.blur();
  102385. this.$emit('click', e);
  102386. this.to || this.toggle();
  102387. },
  102388. genAttrs: function genAttrs() {
  102389. var attrs = __assign({
  102390. 'aria-disabled': this.disabled ? true : undefined,
  102391. tabindex: this.isClickable && !this.disabled ? 0 : -1
  102392. }, this.$attrs);
  102393. if (this.$attrs.hasOwnProperty('role')) {// do nothing, role already provided
  102394. } else if (this.isInNav) {// do nothing, role is inherit
  102395. } else if (this.isInGroup) {
  102396. attrs.role = 'listitem';
  102397. attrs['aria-selected'] = String(this.isActive);
  102398. } else if (this.isInMenu) {
  102399. attrs.role = this.isClickable ? 'menuitem' : undefined;
  102400. attrs.id = attrs.id || "list-item-" + this._uid;
  102401. } else if (this.isInList) {
  102402. attrs.role = 'listitem';
  102403. }
  102404. return attrs;
  102405. }
  102406. },
  102407. render: function render(h) {
  102408. var _this = this;
  102409. var _a = this.generateRouteLink(),
  102410. tag = _a.tag,
  102411. data = _a.data;
  102412. data.attrs = __assign({}, data.attrs, this.genAttrs());
  102413. data.on = __assign({}, data.on, {
  102414. click: this.click,
  102415. keydown: function keydown(e) {
  102416. /* istanbul ignore else */
  102417. if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_7__["keyCodes"].enter) _this.click(e);
  102418. _this.$emit('keydown', e);
  102419. }
  102420. });
  102421. var children = this.$scopedSlots.default ? this.$scopedSlots.default({
  102422. active: this.isActive,
  102423. toggle: this.toggle
  102424. }) : this.$slots.default;
  102425. tag = this.inactive ? 'div' : tag;
  102426. return h(tag, this.setTextColor(this.color, data), children);
  102427. }
  102428. }));
  102429. /***/ }),
  102430. /***/ "./src/components/VList/VListItemAction.ts":
  102431. /*!*************************************************!*\
  102432. !*** ./src/components/VList/VListItemAction.ts ***!
  102433. \*************************************************/
  102434. /*! exports provided: default */
  102435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102436. "use strict";
  102437. __webpack_require__.r(__webpack_exports__);
  102438. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  102439. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  102440. // Types
  102441. /* @vue/component */
  102442. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  102443. name: 'v-list-item-action',
  102444. functional: true,
  102445. render: function render(h, _a) {
  102446. var data = _a.data,
  102447. _b = _a.children,
  102448. children = _b === void 0 ? [] : _b;
  102449. data.staticClass = data.staticClass ? "v-list-item__action " + data.staticClass : 'v-list-item__action';
  102450. var filteredChild = children.filter(function (VNode) {
  102451. return VNode.isComment === false && VNode.text !== ' ';
  102452. });
  102453. if (filteredChild.length > 1) data.staticClass += ' v-list-item__action--stack';
  102454. return h('div', data, children);
  102455. }
  102456. }));
  102457. /***/ }),
  102458. /***/ "./src/components/VList/VListItemAvatar.ts":
  102459. /*!*************************************************!*\
  102460. !*** ./src/components/VList/VListItemAvatar.ts ***!
  102461. \*************************************************/
  102462. /*! exports provided: default */
  102463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102464. "use strict";
  102465. __webpack_require__.r(__webpack_exports__);
  102466. /* harmony import */ var _VAvatar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VAvatar */ "./src/components/VAvatar/index.ts");
  102467. var __assign = undefined && undefined.__assign || function () {
  102468. __assign = Object.assign || function (t) {
  102469. for (var s, i = 1, n = arguments.length; i < n; i++) {
  102470. s = arguments[i];
  102471. for (var p in s) {
  102472. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  102473. }
  102474. }
  102475. return t;
  102476. };
  102477. return __assign.apply(this, arguments);
  102478. }; // Components
  102479. /* @vue/component */
  102480. /* harmony default export */ __webpack_exports__["default"] = (_VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"].extend({
  102481. name: 'v-list-item-avatar',
  102482. props: {
  102483. horizontal: Boolean,
  102484. size: {
  102485. type: [Number, String],
  102486. default: 40
  102487. }
  102488. },
  102489. computed: {
  102490. classes: function classes() {
  102491. return __assign({
  102492. 'v-list-item__avatar--horizontal': this.horizontal
  102493. }, _VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"].options.computed.classes.call(this), {
  102494. 'v-avatar--tile': this.tile || this.horizontal
  102495. });
  102496. }
  102497. },
  102498. render: function render(h) {
  102499. var render = _VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"].options.render.call(this, h);
  102500. render.data = render.data || {};
  102501. render.data.staticClass += ' v-list-item__avatar';
  102502. return render;
  102503. }
  102504. }));
  102505. /***/ }),
  102506. /***/ "./src/components/VList/VListItemGroup.sass":
  102507. /*!**************************************************!*\
  102508. !*** ./src/components/VList/VListItemGroup.sass ***!
  102509. \**************************************************/
  102510. /*! no static exports found */
  102511. /***/ (function(module, exports, __webpack_require__) {
  102512. // extracted by mini-css-extract-plugin
  102513. /***/ }),
  102514. /***/ "./src/components/VList/VListItemGroup.ts":
  102515. /*!************************************************!*\
  102516. !*** ./src/components/VList/VListItemGroup.ts ***!
  102517. \************************************************/
  102518. /*! exports provided: default */
  102519. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102520. "use strict";
  102521. __webpack_require__.r(__webpack_exports__);
  102522. /* harmony import */ var _VListItemGroup_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VListItemGroup.sass */ "./src/components/VList/VListItemGroup.sass");
  102523. /* harmony import */ var _VListItemGroup_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VListItemGroup_sass__WEBPACK_IMPORTED_MODULE_0__);
  102524. /* harmony import */ var _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VItemGroup/VItemGroup */ "./src/components/VItemGroup/VItemGroup.ts");
  102525. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  102526. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  102527. var __assign = undefined && undefined.__assign || function () {
  102528. __assign = Object.assign || function (t) {
  102529. for (var s, i = 1, n = arguments.length; i < n; i++) {
  102530. s = arguments[i];
  102531. for (var p in s) {
  102532. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  102533. }
  102534. }
  102535. return t;
  102536. };
  102537. return __assign.apply(this, arguments);
  102538. }; // Styles
  102539. // Extensions
  102540. // Mixins
  102541. // Utilities
  102542. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_1__["BaseItemGroup"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"]).extend({
  102543. name: 'v-list-item-group',
  102544. provide: function provide() {
  102545. return {
  102546. isInGroup: true,
  102547. listItemGroup: this
  102548. };
  102549. },
  102550. computed: {
  102551. classes: function classes() {
  102552. return __assign({}, _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_1__["BaseItemGroup"].options.computed.classes.call(this), {
  102553. 'v-list-item-group': true
  102554. });
  102555. }
  102556. },
  102557. methods: {
  102558. genData: function genData() {
  102559. return this.setTextColor(this.color, __assign({}, _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_1__["BaseItemGroup"].options.methods.genData.call(this), {
  102560. attrs: {
  102561. role: 'listbox'
  102562. }
  102563. }));
  102564. }
  102565. }
  102566. }));
  102567. /***/ }),
  102568. /***/ "./src/components/VList/VListItemIcon.ts":
  102569. /*!***********************************************!*\
  102570. !*** ./src/components/VList/VListItemIcon.ts ***!
  102571. \***********************************************/
  102572. /*! exports provided: default */
  102573. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102574. "use strict";
  102575. __webpack_require__.r(__webpack_exports__);
  102576. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  102577. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  102578. // Types
  102579. /* @vue/component */
  102580. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  102581. name: 'v-list-item-icon',
  102582. functional: true,
  102583. render: function render(h, _a) {
  102584. var data = _a.data,
  102585. children = _a.children;
  102586. data.staticClass = ("v-list-item__icon " + (data.staticClass || '')).trim();
  102587. return h('div', data, children);
  102588. }
  102589. }));
  102590. /***/ }),
  102591. /***/ "./src/components/VList/index.ts":
  102592. /*!***************************************!*\
  102593. !*** ./src/components/VList/index.ts ***!
  102594. \***************************************/
  102595. /*! exports provided: VListItemActionText, VListItemContent, VListItemTitle, VListItemSubtitle, VList, VListGroup, VListItem, VListItemAction, VListItemAvatar, VListItemIcon, VListItemGroup, default */
  102596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102597. "use strict";
  102598. __webpack_require__.r(__webpack_exports__);
  102599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VListItemActionText", function() { return VListItemActionText; });
  102600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VListItemContent", function() { return VListItemContent; });
  102601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VListItemTitle", function() { return VListItemTitle; });
  102602. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VListItemSubtitle", function() { return VListItemSubtitle; });
  102603. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  102604. /* harmony import */ var _VList__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VList */ "./src/components/VList/VList.ts");
  102605. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VList", function() { return _VList__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  102606. /* harmony import */ var _VListGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VListGroup */ "./src/components/VList/VListGroup.ts");
  102607. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListGroup", function() { return _VListGroup__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  102608. /* harmony import */ var _VListItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VListItem */ "./src/components/VList/VListItem.ts");
  102609. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItem", function() { return _VListItem__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  102610. /* harmony import */ var _VListItemGroup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VListItemGroup */ "./src/components/VList/VListItemGroup.ts");
  102611. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemGroup", function() { return _VListItemGroup__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  102612. /* harmony import */ var _VListItemAction__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VListItemAction */ "./src/components/VList/VListItemAction.ts");
  102613. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemAction", function() { return _VListItemAction__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  102614. /* harmony import */ var _VListItemAvatar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./VListItemAvatar */ "./src/components/VList/VListItemAvatar.ts");
  102615. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemAvatar", function() { return _VListItemAvatar__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  102616. /* harmony import */ var _VListItemIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./VListItemIcon */ "./src/components/VList/VListItemIcon.ts");
  102617. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemIcon", function() { return _VListItemIcon__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  102618. var VListItemActionText = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-list-item__action-text', 'span');
  102619. var VListItemContent = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-list-item__content', 'div');
  102620. var VListItemTitle = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-list-item__title', 'div');
  102621. var VListItemSubtitle = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-list-item__subtitle', 'div');
  102622. /* harmony default export */ __webpack_exports__["default"] = ({
  102623. $_vuetify_subcomponents: {
  102624. VList: _VList__WEBPACK_IMPORTED_MODULE_1__["default"],
  102625. VListGroup: _VListGroup__WEBPACK_IMPORTED_MODULE_2__["default"],
  102626. VListItem: _VListItem__WEBPACK_IMPORTED_MODULE_3__["default"],
  102627. VListItemAction: _VListItemAction__WEBPACK_IMPORTED_MODULE_5__["default"],
  102628. VListItemActionText: VListItemActionText,
  102629. VListItemAvatar: _VListItemAvatar__WEBPACK_IMPORTED_MODULE_6__["default"],
  102630. VListItemContent: VListItemContent,
  102631. VListItemGroup: _VListItemGroup__WEBPACK_IMPORTED_MODULE_4__["default"],
  102632. VListItemIcon: _VListItemIcon__WEBPACK_IMPORTED_MODULE_7__["default"],
  102633. VListItemSubtitle: VListItemSubtitle,
  102634. VListItemTitle: VListItemTitle
  102635. }
  102636. });
  102637. /***/ }),
  102638. /***/ "./src/components/VMenu/VMenu.sass":
  102639. /*!*****************************************!*\
  102640. !*** ./src/components/VMenu/VMenu.sass ***!
  102641. \*****************************************/
  102642. /*! no static exports found */
  102643. /***/ (function(module, exports, __webpack_require__) {
  102644. // extracted by mini-css-extract-plugin
  102645. /***/ }),
  102646. /***/ "./src/components/VMenu/VMenu.ts":
  102647. /*!***************************************!*\
  102648. !*** ./src/components/VMenu/VMenu.ts ***!
  102649. \***************************************/
  102650. /*! exports provided: default */
  102651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102652. "use strict";
  102653. __webpack_require__.r(__webpack_exports__);
  102654. /* harmony import */ var _VMenu_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VMenu.sass */ "./src/components/VMenu/VMenu.sass");
  102655. /* harmony import */ var _VMenu_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VMenu_sass__WEBPACK_IMPORTED_MODULE_0__);
  102656. /* harmony import */ var _VThemeProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VThemeProvider */ "./src/components/VThemeProvider/index.ts");
  102657. /* harmony import */ var _mixins_activatable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/activatable */ "./src/mixins/activatable/index.ts");
  102658. /* harmony import */ var _mixins_delayable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/delayable */ "./src/mixins/delayable/index.ts");
  102659. /* harmony import */ var _mixins_dependent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/dependent */ "./src/mixins/dependent/index.ts");
  102660. /* harmony import */ var _mixins_detachable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/detachable */ "./src/mixins/detachable/index.ts");
  102661. /* harmony import */ var _mixins_menuable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/menuable */ "./src/mixins/menuable/index.ts");
  102662. /* harmony import */ var _mixins_returnable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/returnable */ "./src/mixins/returnable/index.ts");
  102663. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  102664. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  102665. /* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside/index.ts");
  102666. /* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize/index.ts");
  102667. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  102668. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  102669. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  102670. var __assign = undefined && undefined.__assign || function () {
  102671. __assign = Object.assign || function (t) {
  102672. for (var s, i = 1, n = arguments.length; i < n; i++) {
  102673. s = arguments[i];
  102674. for (var p in s) {
  102675. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  102676. }
  102677. }
  102678. return t;
  102679. };
  102680. return __assign.apply(this, arguments);
  102681. };
  102682. var __read = undefined && undefined.__read || function (o, n) {
  102683. var m = typeof Symbol === "function" && o[Symbol.iterator];
  102684. if (!m) return o;
  102685. var i = m.call(o),
  102686. r,
  102687. ar = [],
  102688. e;
  102689. try {
  102690. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  102691. ar.push(r.value);
  102692. }
  102693. } catch (error) {
  102694. e = {
  102695. error: error
  102696. };
  102697. } finally {
  102698. try {
  102699. if (r && !r.done && (m = i["return"])) m.call(i);
  102700. } finally {
  102701. if (e) throw e.error;
  102702. }
  102703. }
  102704. return ar;
  102705. };
  102706. var __spread = undefined && undefined.__spread || function () {
  102707. for (var ar = [], i = 0; i < arguments.length; i++) {
  102708. ar = ar.concat(__read(arguments[i]));
  102709. }
  102710. return ar;
  102711. }; // Styles
  102712. // Components
  102713. // Mixins
  102714. // Directives
  102715. // Utilities
  102716. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_12__["default"])(_mixins_dependent__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_delayable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_detachable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_menuable__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_returnable__WEBPACK_IMPORTED_MODULE_7__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_8__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_9__["default"]);
  102717. /* @vue/component */
  102718. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  102719. name: 'v-menu',
  102720. provide: function provide() {
  102721. return {
  102722. isInMenu: true,
  102723. // Pass theme through to default slot
  102724. theme: this.theme
  102725. };
  102726. },
  102727. directives: {
  102728. ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_10__["default"],
  102729. Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_11__["default"]
  102730. },
  102731. props: {
  102732. auto: Boolean,
  102733. closeOnClick: {
  102734. type: Boolean,
  102735. default: true
  102736. },
  102737. closeOnContentClick: {
  102738. type: Boolean,
  102739. default: true
  102740. },
  102741. disabled: Boolean,
  102742. disableKeys: Boolean,
  102743. maxHeight: {
  102744. type: [Number, String],
  102745. default: 'auto'
  102746. },
  102747. offsetX: Boolean,
  102748. offsetY: Boolean,
  102749. openOnClick: {
  102750. type: Boolean,
  102751. default: true
  102752. },
  102753. openOnHover: Boolean,
  102754. origin: {
  102755. type: String,
  102756. default: 'top left'
  102757. },
  102758. transition: {
  102759. type: [Boolean, String],
  102760. default: 'v-menu-transition'
  102761. }
  102762. },
  102763. data: function data() {
  102764. return {
  102765. calculatedTopAuto: 0,
  102766. defaultOffset: 8,
  102767. hasJustFocused: false,
  102768. listIndex: -1,
  102769. resizeTimeout: 0,
  102770. selectedIndex: null,
  102771. tiles: []
  102772. };
  102773. },
  102774. computed: {
  102775. activeTile: function activeTile() {
  102776. return this.tiles[this.listIndex];
  102777. },
  102778. calculatedLeft: function calculatedLeft() {
  102779. var menuWidth = Math.max(this.dimensions.content.width, parseFloat(this.calculatedMinWidth));
  102780. if (!this.auto) return this.calcLeft(menuWidth) || '0';
  102781. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_14__["convertToUnit"])(this.calcXOverflow(this.calcLeftAuto(), menuWidth)) || '0';
  102782. },
  102783. calculatedMaxHeight: function calculatedMaxHeight() {
  102784. var height = this.auto ? '200px' : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_14__["convertToUnit"])(this.maxHeight);
  102785. return height || '0';
  102786. },
  102787. calculatedMaxWidth: function calculatedMaxWidth() {
  102788. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_14__["convertToUnit"])(this.maxWidth) || '0';
  102789. },
  102790. calculatedMinWidth: function calculatedMinWidth() {
  102791. if (this.minWidth) {
  102792. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_14__["convertToUnit"])(this.minWidth) || '0';
  102793. }
  102794. var minWidth = Math.min(this.dimensions.activator.width + Number(this.nudgeWidth) + (this.auto ? 16 : 0), Math.max(this.pageWidth - 24, 0));
  102795. var calculatedMaxWidth = isNaN(parseInt(this.calculatedMaxWidth)) ? minWidth : parseInt(this.calculatedMaxWidth);
  102796. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_14__["convertToUnit"])(Math.min(calculatedMaxWidth, minWidth)) || '0';
  102797. },
  102798. calculatedTop: function calculatedTop() {
  102799. var top = !this.auto ? this.calcTop() : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_14__["convertToUnit"])(this.calcYOverflow(this.calculatedTopAuto));
  102800. return top || '0';
  102801. },
  102802. hasClickableTiles: function hasClickableTiles() {
  102803. return Boolean(this.tiles.find(function (tile) {
  102804. return tile.tabIndex > -1;
  102805. }));
  102806. },
  102807. styles: function styles() {
  102808. return {
  102809. maxHeight: this.calculatedMaxHeight,
  102810. minWidth: this.calculatedMinWidth,
  102811. maxWidth: this.calculatedMaxWidth,
  102812. top: this.calculatedTop,
  102813. left: this.calculatedLeft,
  102814. transformOrigin: this.origin,
  102815. zIndex: this.zIndex || this.activeZIndex
  102816. };
  102817. }
  102818. },
  102819. watch: {
  102820. isActive: function isActive(val) {
  102821. if (!val) this.listIndex = -1;
  102822. },
  102823. isContentActive: function isContentActive(val) {
  102824. this.hasJustFocused = val;
  102825. },
  102826. listIndex: function listIndex(next, prev) {
  102827. if (next in this.tiles) {
  102828. var tile = this.tiles[next];
  102829. tile.classList.add('v-list-item--highlighted');
  102830. this.$refs.content.scrollTop = tile.offsetTop - tile.clientHeight;
  102831. }
  102832. prev in this.tiles && this.tiles[prev].classList.remove('v-list-item--highlighted');
  102833. }
  102834. },
  102835. created: function created() {
  102836. /* istanbul ignore next */
  102837. if (this.$attrs.hasOwnProperty('full-width')) {
  102838. Object(_util_console__WEBPACK_IMPORTED_MODULE_13__["removed"])('full-width', this);
  102839. }
  102840. },
  102841. mounted: function mounted() {
  102842. this.isActive && this.callActivate();
  102843. },
  102844. methods: {
  102845. activate: function activate() {
  102846. var _this = this; // Update coordinates and dimensions of menu
  102847. // and its activator
  102848. this.updateDimensions(); // Start the transition
  102849. requestAnimationFrame(function () {
  102850. // Once transitioning, calculate scroll and top position
  102851. _this.startTransition().then(function () {
  102852. if (_this.$refs.content) {
  102853. _this.calculatedTopAuto = _this.calcTopAuto();
  102854. _this.auto && (_this.$refs.content.scrollTop = _this.calcScrollPosition());
  102855. }
  102856. });
  102857. });
  102858. },
  102859. calcScrollPosition: function calcScrollPosition() {
  102860. var $el = this.$refs.content;
  102861. var activeTile = $el.querySelector('.v-list-item--active');
  102862. var maxScrollTop = $el.scrollHeight - $el.offsetHeight;
  102863. return activeTile ? Math.min(maxScrollTop, Math.max(0, activeTile.offsetTop - $el.offsetHeight / 2 + activeTile.offsetHeight / 2)) : $el.scrollTop;
  102864. },
  102865. calcLeftAuto: function calcLeftAuto() {
  102866. return parseInt(this.dimensions.activator.left - this.defaultOffset * 2);
  102867. },
  102868. calcTopAuto: function calcTopAuto() {
  102869. var $el = this.$refs.content;
  102870. var activeTile = $el.querySelector('.v-list-item--active');
  102871. if (!activeTile) {
  102872. this.selectedIndex = null;
  102873. }
  102874. if (this.offsetY || !activeTile) {
  102875. return this.computedTop;
  102876. }
  102877. this.selectedIndex = Array.from(this.tiles).indexOf(activeTile);
  102878. var tileDistanceFromMenuTop = activeTile.offsetTop - this.calcScrollPosition();
  102879. var firstTileOffsetTop = $el.querySelector('.v-list-item').offsetTop;
  102880. return this.computedTop - tileDistanceFromMenuTop - firstTileOffsetTop - 1;
  102881. },
  102882. changeListIndex: function changeListIndex(e) {
  102883. // For infinite scroll and autocomplete, re-evaluate children
  102884. this.getTiles();
  102885. if (!this.isActive || !this.hasClickableTiles) {
  102886. return;
  102887. } else if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_14__["keyCodes"].tab) {
  102888. this.isActive = false;
  102889. return;
  102890. } else if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_14__["keyCodes"].down) {
  102891. this.nextTile();
  102892. } else if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_14__["keyCodes"].up) {
  102893. this.prevTile();
  102894. } else if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_14__["keyCodes"].enter && this.listIndex !== -1) {
  102895. this.tiles[this.listIndex].click();
  102896. } else {
  102897. return;
  102898. } // One of the conditions was met, prevent default action (#2988)
  102899. e.preventDefault();
  102900. },
  102901. closeConditional: function closeConditional(e) {
  102902. var target = e.target;
  102903. return this.isActive && !this._isDestroyed && this.closeOnClick && !this.$refs.content.contains(target);
  102904. },
  102905. genActivatorAttributes: function genActivatorAttributes() {
  102906. var attributes = _mixins_activatable__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genActivatorAttributes.call(this);
  102907. if (this.activeTile && this.activeTile.id) {
  102908. return __assign({}, attributes, {
  102909. 'aria-activedescendant': this.activeTile.id
  102910. });
  102911. }
  102912. return attributes;
  102913. },
  102914. genActivatorListeners: function genActivatorListeners() {
  102915. var listeners = _mixins_menuable__WEBPACK_IMPORTED_MODULE_6__["default"].options.methods.genActivatorListeners.call(this);
  102916. if (!this.disableKeys) {
  102917. listeners.keydown = this.onKeyDown;
  102918. }
  102919. return listeners;
  102920. },
  102921. genTransition: function genTransition() {
  102922. var content = this.genContent();
  102923. if (!this.transition) return content;
  102924. return this.$createElement('transition', {
  102925. props: {
  102926. name: this.transition
  102927. }
  102928. }, [content]);
  102929. },
  102930. genDirectives: function genDirectives() {
  102931. var _this = this;
  102932. var directives = [{
  102933. name: 'show',
  102934. value: this.isContentActive
  102935. }]; // Do not add click outside for hover menu
  102936. if (!this.openOnHover && this.closeOnClick) {
  102937. directives.push({
  102938. name: 'click-outside',
  102939. value: function value() {
  102940. _this.isActive = false;
  102941. },
  102942. args: {
  102943. closeConditional: this.closeConditional,
  102944. include: function include() {
  102945. return __spread([_this.$el], _this.getOpenDependentElements());
  102946. }
  102947. }
  102948. });
  102949. }
  102950. return directives;
  102951. },
  102952. genContent: function genContent() {
  102953. var _a;
  102954. var _this = this;
  102955. var options = {
  102956. attrs: __assign({}, this.getScopeIdAttrs(), {
  102957. role: 'role' in this.$attrs ? this.$attrs.role : 'menu'
  102958. }),
  102959. staticClass: 'v-menu__content',
  102960. class: __assign({}, this.rootThemeClasses, (_a = {
  102961. 'v-menu__content--auto': this.auto,
  102962. 'v-menu__content--fixed': this.activatorFixed,
  102963. menuable__content__active: this.isActive
  102964. }, _a[this.contentClass.trim()] = true, _a)),
  102965. style: this.styles,
  102966. directives: this.genDirectives(),
  102967. ref: 'content',
  102968. on: {
  102969. click: function click(e) {
  102970. var target = e.target;
  102971. if (target.getAttribute('disabled')) return;
  102972. if (_this.closeOnContentClick) _this.isActive = false;
  102973. },
  102974. keydown: this.onKeyDown
  102975. }
  102976. };
  102977. if (!this.disabled && this.openOnHover) {
  102978. options.on = options.on || {};
  102979. options.on.mouseenter = this.mouseEnterHandler;
  102980. }
  102981. if (this.openOnHover) {
  102982. options.on = options.on || {};
  102983. options.on.mouseleave = this.mouseLeaveHandler;
  102984. }
  102985. return this.$createElement('div', options, this.getContentSlot());
  102986. },
  102987. getTiles: function getTiles() {
  102988. if (!this.$refs.content) return;
  102989. this.tiles = Array.from(this.$refs.content.querySelectorAll('.v-list-item'));
  102990. },
  102991. mouseEnterHandler: function mouseEnterHandler() {
  102992. var _this = this;
  102993. this.runDelay('open', function () {
  102994. if (_this.hasJustFocused) return;
  102995. _this.hasJustFocused = true;
  102996. _this.isActive = true;
  102997. });
  102998. },
  102999. mouseLeaveHandler: function mouseLeaveHandler(e) {
  103000. var _this = this; // Prevent accidental re-activation
  103001. this.runDelay('close', function () {
  103002. if (_this.$refs.content.contains(e.relatedTarget)) return;
  103003. requestAnimationFrame(function () {
  103004. _this.isActive = false;
  103005. _this.callDeactivate();
  103006. });
  103007. });
  103008. },
  103009. nextTile: function nextTile() {
  103010. var tile = this.tiles[this.listIndex + 1];
  103011. if (!tile) {
  103012. if (!this.tiles.length) return;
  103013. this.listIndex = -1;
  103014. this.nextTile();
  103015. return;
  103016. }
  103017. this.listIndex++;
  103018. if (tile.tabIndex === -1) this.nextTile();
  103019. },
  103020. prevTile: function prevTile() {
  103021. var tile = this.tiles[this.listIndex - 1];
  103022. if (!tile) {
  103023. if (!this.tiles.length) return;
  103024. this.listIndex = this.tiles.length;
  103025. this.prevTile();
  103026. return;
  103027. }
  103028. this.listIndex--;
  103029. if (tile.tabIndex === -1) this.prevTile();
  103030. },
  103031. onKeyDown: function onKeyDown(e) {
  103032. var _this = this;
  103033. if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_14__["keyCodes"].esc) {
  103034. // Wait for dependent elements to close first
  103035. setTimeout(function () {
  103036. _this.isActive = false;
  103037. });
  103038. var activator_1 = this.getActivator();
  103039. this.$nextTick(function () {
  103040. return activator_1 && activator_1.focus();
  103041. });
  103042. } else if (!this.isActive && [_util_helpers__WEBPACK_IMPORTED_MODULE_14__["keyCodes"].up, _util_helpers__WEBPACK_IMPORTED_MODULE_14__["keyCodes"].down].includes(e.keyCode)) {
  103043. this.isActive = true;
  103044. } // Allow for isActive watcher to generate tile list
  103045. this.$nextTick(function () {
  103046. return _this.changeListIndex(e);
  103047. });
  103048. },
  103049. onResize: function onResize() {
  103050. if (!this.isActive) return; // Account for screen resize
  103051. // and orientation change
  103052. // eslint-disable-next-line no-unused-expressions
  103053. this.$refs.content.offsetWidth;
  103054. this.updateDimensions(); // When resizing to a smaller width
  103055. // content width is evaluated before
  103056. // the new activator width has been
  103057. // set, causing it to not size properly
  103058. // hacky but will revisit in the future
  103059. clearTimeout(this.resizeTimeout);
  103060. this.resizeTimeout = window.setTimeout(this.updateDimensions, 100);
  103061. }
  103062. },
  103063. render: function render(h) {
  103064. var _this = this;
  103065. var data = {
  103066. staticClass: 'v-menu',
  103067. class: {
  103068. 'v-menu--attached': this.attach === '' || this.attach === true || this.attach === 'attach'
  103069. },
  103070. directives: [{
  103071. arg: '500',
  103072. name: 'resize',
  103073. value: this.onResize
  103074. }]
  103075. };
  103076. return h('div', data, [!this.activator && this.genActivator(), this.showLazyContent(function () {
  103077. return [_this.$createElement(_VThemeProvider__WEBPACK_IMPORTED_MODULE_1__["VThemeProvider"], {
  103078. props: {
  103079. root: true,
  103080. light: _this.light,
  103081. dark: _this.dark
  103082. }
  103083. }, [_this.genTransition()])];
  103084. })]);
  103085. }
  103086. }));
  103087. /***/ }),
  103088. /***/ "./src/components/VMenu/index.ts":
  103089. /*!***************************************!*\
  103090. !*** ./src/components/VMenu/index.ts ***!
  103091. \***************************************/
  103092. /*! exports provided: VMenu, default */
  103093. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103094. "use strict";
  103095. __webpack_require__.r(__webpack_exports__);
  103096. /* harmony import */ var _VMenu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VMenu */ "./src/components/VMenu/VMenu.ts");
  103097. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VMenu", function() { return _VMenu__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103098. /* harmony default export */ __webpack_exports__["default"] = (_VMenu__WEBPACK_IMPORTED_MODULE_0__["default"]);
  103099. /***/ }),
  103100. /***/ "./src/components/VMessages/VMessages.sass":
  103101. /*!*************************************************!*\
  103102. !*** ./src/components/VMessages/VMessages.sass ***!
  103103. \*************************************************/
  103104. /*! no static exports found */
  103105. /***/ (function(module, exports, __webpack_require__) {
  103106. // extracted by mini-css-extract-plugin
  103107. /***/ }),
  103108. /***/ "./src/components/VMessages/VMessages.ts":
  103109. /*!***********************************************!*\
  103110. !*** ./src/components/VMessages/VMessages.ts ***!
  103111. \***********************************************/
  103112. /*! exports provided: default */
  103113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103114. "use strict";
  103115. __webpack_require__.r(__webpack_exports__);
  103116. /* harmony import */ var _VMessages_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VMessages.sass */ "./src/components/VMessages/VMessages.sass");
  103117. /* harmony import */ var _VMessages_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VMessages_sass__WEBPACK_IMPORTED_MODULE_0__);
  103118. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  103119. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  103120. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  103121. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  103122. // Styles
  103123. // Mixins
  103124. // Utilities
  103125. /* @vue/component */
  103126. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]).extend({
  103127. name: 'v-messages',
  103128. props: {
  103129. value: {
  103130. type: Array,
  103131. default: function _default() {
  103132. return [];
  103133. }
  103134. }
  103135. },
  103136. methods: {
  103137. genChildren: function genChildren() {
  103138. return this.$createElement('transition-group', {
  103139. staticClass: 'v-messages__wrapper',
  103140. attrs: {
  103141. name: 'message-transition',
  103142. tag: 'div'
  103143. }
  103144. }, this.value.map(this.genMessage));
  103145. },
  103146. genMessage: function genMessage(message, key) {
  103147. return this.$createElement('div', {
  103148. staticClass: 'v-messages__message',
  103149. key: key
  103150. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getSlot"])(this, 'default', {
  103151. message: message,
  103152. key: key
  103153. }) || [message]);
  103154. }
  103155. },
  103156. render: function render(h) {
  103157. return h('div', this.setTextColor(this.color, {
  103158. staticClass: 'v-messages',
  103159. class: this.themeClasses
  103160. }), [this.genChildren()]);
  103161. }
  103162. }));
  103163. /***/ }),
  103164. /***/ "./src/components/VMessages/index.ts":
  103165. /*!*******************************************!*\
  103166. !*** ./src/components/VMessages/index.ts ***!
  103167. \*******************************************/
  103168. /*! exports provided: VMessages, default */
  103169. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103170. "use strict";
  103171. __webpack_require__.r(__webpack_exports__);
  103172. /* harmony import */ var _VMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VMessages */ "./src/components/VMessages/VMessages.ts");
  103173. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VMessages", function() { return _VMessages__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103174. /* harmony default export */ __webpack_exports__["default"] = (_VMessages__WEBPACK_IMPORTED_MODULE_0__["default"]);
  103175. /***/ }),
  103176. /***/ "./src/components/VNavigationDrawer/VNavigationDrawer.sass":
  103177. /*!*****************************************************************!*\
  103178. !*** ./src/components/VNavigationDrawer/VNavigationDrawer.sass ***!
  103179. \*****************************************************************/
  103180. /*! no static exports found */
  103181. /***/ (function(module, exports, __webpack_require__) {
  103182. // extracted by mini-css-extract-plugin
  103183. /***/ }),
  103184. /***/ "./src/components/VNavigationDrawer/VNavigationDrawer.ts":
  103185. /*!***************************************************************!*\
  103186. !*** ./src/components/VNavigationDrawer/VNavigationDrawer.ts ***!
  103187. \***************************************************************/
  103188. /*! exports provided: default */
  103189. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103190. "use strict";
  103191. __webpack_require__.r(__webpack_exports__);
  103192. /* harmony import */ var _VNavigationDrawer_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VNavigationDrawer.sass */ "./src/components/VNavigationDrawer/VNavigationDrawer.sass");
  103193. /* harmony import */ var _VNavigationDrawer_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VNavigationDrawer_sass__WEBPACK_IMPORTED_MODULE_0__);
  103194. /* harmony import */ var _VImg_VImg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VImg/VImg */ "./src/components/VImg/VImg.ts");
  103195. /* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable/index.ts");
  103196. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  103197. /* harmony import */ var _mixins_dependent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/dependent */ "./src/mixins/dependent/index.ts");
  103198. /* harmony import */ var _mixins_overlayable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/overlayable */ "./src/mixins/overlayable/index.ts");
  103199. /* harmony import */ var _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/ssr-bootable */ "./src/mixins/ssr-bootable/index.ts");
  103200. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  103201. /* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside/index.ts");
  103202. /* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize/index.ts");
  103203. /* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch/index.ts");
  103204. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  103205. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  103206. var __assign = undefined && undefined.__assign || function () {
  103207. __assign = Object.assign || function (t) {
  103208. for (var s, i = 1, n = arguments.length; i < n; i++) {
  103209. s = arguments[i];
  103210. for (var p in s) {
  103211. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  103212. }
  103213. }
  103214. return t;
  103215. };
  103216. return __assign.apply(this, arguments);
  103217. }; // Styles
  103218. // Components
  103219. // Mixins
  103220. // Directives
  103221. // Utilities
  103222. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_12__["default"])(Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_2__["default"])('left', ['isActive', 'isMobile', 'miniVariant', 'expandOnHover', 'permanent', 'right', 'temporary', 'width']), _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_dependent__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_overlayable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_7__["default"]);
  103223. /* @vue/component */
  103224. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  103225. name: 'v-navigation-drawer',
  103226. provide: function provide() {
  103227. return {
  103228. isInNav: this.tag === 'nav'
  103229. };
  103230. },
  103231. directives: {
  103232. ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_8__["default"],
  103233. Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_9__["default"],
  103234. Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_10__["default"]
  103235. },
  103236. props: {
  103237. bottom: Boolean,
  103238. clipped: Boolean,
  103239. disableResizeWatcher: Boolean,
  103240. disableRouteWatcher: Boolean,
  103241. expandOnHover: Boolean,
  103242. floating: Boolean,
  103243. height: {
  103244. type: [Number, String],
  103245. default: function _default() {
  103246. return this.app ? '100vh' : '100%';
  103247. }
  103248. },
  103249. miniVariant: Boolean,
  103250. miniVariantWidth: {
  103251. type: [Number, String],
  103252. default: 56
  103253. },
  103254. mobileBreakPoint: {
  103255. type: [Number, String],
  103256. default: 1264
  103257. },
  103258. permanent: Boolean,
  103259. right: Boolean,
  103260. src: {
  103261. type: [String, Object],
  103262. default: ''
  103263. },
  103264. stateless: Boolean,
  103265. tag: {
  103266. type: String,
  103267. default: function _default() {
  103268. return this.app ? 'nav' : 'aside';
  103269. }
  103270. },
  103271. temporary: Boolean,
  103272. touchless: Boolean,
  103273. width: {
  103274. type: [Number, String],
  103275. default: 256
  103276. },
  103277. value: null
  103278. },
  103279. data: function data() {
  103280. return {
  103281. isMouseover: false,
  103282. touchArea: {
  103283. left: 0,
  103284. right: 0
  103285. },
  103286. stackMinZIndex: 6
  103287. };
  103288. },
  103289. computed: {
  103290. /**
  103291. * Used for setting an app value from a dynamic
  103292. * property. Called from applicationable.js
  103293. */
  103294. applicationProperty: function applicationProperty() {
  103295. return this.right ? 'right' : 'left';
  103296. },
  103297. classes: function classes() {
  103298. return __assign({
  103299. 'v-navigation-drawer': true,
  103300. 'v-navigation-drawer--absolute': this.absolute,
  103301. 'v-navigation-drawer--bottom': this.bottom,
  103302. 'v-navigation-drawer--clipped': this.clipped,
  103303. 'v-navigation-drawer--close': !this.isActive,
  103304. 'v-navigation-drawer--fixed': !this.absolute && (this.app || this.fixed),
  103305. 'v-navigation-drawer--floating': this.floating,
  103306. 'v-navigation-drawer--is-mobile': this.isMobile,
  103307. 'v-navigation-drawer--is-mouseover': this.isMouseover,
  103308. 'v-navigation-drawer--mini-variant': this.isMiniVariant,
  103309. 'v-navigation-drawer--custom-mini-variant': Number(this.miniVariantWidth) !== 56,
  103310. 'v-navigation-drawer--open': this.isActive,
  103311. 'v-navigation-drawer--open-on-hover': this.expandOnHover,
  103312. 'v-navigation-drawer--right': this.right,
  103313. 'v-navigation-drawer--temporary': this.temporary
  103314. }, this.themeClasses);
  103315. },
  103316. computedMaxHeight: function computedMaxHeight() {
  103317. if (!this.hasApp) return null;
  103318. var computedMaxHeight = this.$vuetify.application.bottom + this.$vuetify.application.footer + this.$vuetify.application.bar;
  103319. if (!this.clipped) return computedMaxHeight;
  103320. return computedMaxHeight + this.$vuetify.application.top;
  103321. },
  103322. computedTop: function computedTop() {
  103323. if (!this.hasApp) return 0;
  103324. var computedTop = this.$vuetify.application.bar;
  103325. computedTop += this.clipped ? this.$vuetify.application.top : 0;
  103326. return computedTop;
  103327. },
  103328. computedTransform: function computedTransform() {
  103329. if (this.isActive) return 0;
  103330. if (this.isBottom) return 100;
  103331. return this.right ? 100 : -100;
  103332. },
  103333. computedWidth: function computedWidth() {
  103334. return this.isMiniVariant ? this.miniVariantWidth : this.width;
  103335. },
  103336. hasApp: function hasApp() {
  103337. return this.app && !this.isMobile && !this.temporary;
  103338. },
  103339. isBottom: function isBottom() {
  103340. return this.bottom && this.isMobile;
  103341. },
  103342. isMiniVariant: function isMiniVariant() {
  103343. return !this.expandOnHover && this.miniVariant || this.expandOnHover && !this.isMouseover;
  103344. },
  103345. isMobile: function isMobile() {
  103346. return !this.stateless && !this.permanent && this.$vuetify.breakpoint.width < parseInt(this.mobileBreakPoint, 10);
  103347. },
  103348. reactsToClick: function reactsToClick() {
  103349. return !this.stateless && !this.permanent && (this.isMobile || this.temporary);
  103350. },
  103351. reactsToMobile: function reactsToMobile() {
  103352. return this.app && !this.disableResizeWatcher && !this.permanent && !this.stateless && !this.temporary;
  103353. },
  103354. reactsToResize: function reactsToResize() {
  103355. return !this.disableResizeWatcher && !this.stateless;
  103356. },
  103357. reactsToRoute: function reactsToRoute() {
  103358. return !this.disableRouteWatcher && !this.stateless && (this.temporary || this.isMobile);
  103359. },
  103360. showOverlay: function showOverlay() {
  103361. return !this.hideOverlay && this.isActive && (this.isMobile || this.temporary);
  103362. },
  103363. styles: function styles() {
  103364. var translate = this.isBottom ? 'translateY' : 'translateX';
  103365. var styles = {
  103366. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["convertToUnit"])(this.height),
  103367. top: !this.isBottom ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["convertToUnit"])(this.computedTop) : 'auto',
  103368. maxHeight: this.computedMaxHeight != null ? "calc(100% - " + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["convertToUnit"])(this.computedMaxHeight) + ")" : undefined,
  103369. transform: translate + "(" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["convertToUnit"])(this.computedTransform, '%') + ")",
  103370. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["convertToUnit"])(this.computedWidth)
  103371. };
  103372. return styles;
  103373. }
  103374. },
  103375. watch: {
  103376. $route: 'onRouteChange',
  103377. isActive: function isActive(val) {
  103378. this.$emit('input', val);
  103379. },
  103380. /**
  103381. * When mobile changes, adjust the active state
  103382. * only when there has been a previous value
  103383. */
  103384. isMobile: function isMobile(val, prev) {
  103385. !val && this.isActive && !this.temporary && this.removeOverlay();
  103386. if (prev == null || !this.reactsToResize || !this.reactsToMobile) return;
  103387. this.isActive = !val;
  103388. },
  103389. permanent: function permanent(val) {
  103390. // If enabling prop enable the drawer
  103391. if (val) this.isActive = true;
  103392. },
  103393. showOverlay: function showOverlay(val) {
  103394. if (val) this.genOverlay();else this.removeOverlay();
  103395. },
  103396. value: function value(val) {
  103397. if (this.permanent) return;
  103398. if (val == null) {
  103399. this.init();
  103400. return;
  103401. }
  103402. if (val !== this.isActive) this.isActive = val;
  103403. },
  103404. expandOnHover: 'updateMiniVariant',
  103405. isMouseover: function isMouseover(val) {
  103406. this.updateMiniVariant(!val);
  103407. }
  103408. },
  103409. beforeMount: function beforeMount() {
  103410. this.init();
  103411. },
  103412. methods: {
  103413. calculateTouchArea: function calculateTouchArea() {
  103414. var parent = this.$el.parentNode;
  103415. if (!parent) return;
  103416. var parentRect = parent.getBoundingClientRect();
  103417. this.touchArea = {
  103418. left: parentRect.left + 50,
  103419. right: parentRect.right - 50
  103420. };
  103421. },
  103422. closeConditional: function closeConditional() {
  103423. return this.isActive && !this._isDestroyed && this.reactsToClick;
  103424. },
  103425. genAppend: function genAppend() {
  103426. return this.genPosition('append');
  103427. },
  103428. genBackground: function genBackground() {
  103429. var props = {
  103430. height: '100%',
  103431. width: '100%',
  103432. src: this.src
  103433. };
  103434. var image = this.$scopedSlots.img ? this.$scopedSlots.img(props) : this.$createElement(_VImg_VImg__WEBPACK_IMPORTED_MODULE_1__["default"], {
  103435. props: props
  103436. });
  103437. return this.$createElement('div', {
  103438. staticClass: 'v-navigation-drawer__image'
  103439. }, [image]);
  103440. },
  103441. genDirectives: function genDirectives() {
  103442. var _this = this;
  103443. var directives = [{
  103444. name: 'click-outside',
  103445. value: function value() {
  103446. return _this.isActive = false;
  103447. },
  103448. args: {
  103449. closeConditional: this.closeConditional,
  103450. include: this.getOpenDependentElements
  103451. }
  103452. }];
  103453. if (!this.touchless && !this.stateless) {
  103454. directives.push({
  103455. name: 'touch',
  103456. value: {
  103457. parent: true,
  103458. left: this.swipeLeft,
  103459. right: this.swipeRight
  103460. }
  103461. });
  103462. }
  103463. return directives;
  103464. },
  103465. genListeners: function genListeners() {
  103466. var _this = this;
  103467. var on = {
  103468. transitionend: function transitionend(e) {
  103469. if (e.target !== e.currentTarget) return;
  103470. _this.$emit('transitionend', e); // IE11 does not support new Event('resize')
  103471. var resizeEvent = document.createEvent('UIEvents');
  103472. resizeEvent.initUIEvent('resize', true, false, window, 0);
  103473. window.dispatchEvent(resizeEvent);
  103474. }
  103475. };
  103476. if (this.miniVariant) {
  103477. on.click = function () {
  103478. return _this.$emit('update:mini-variant', false);
  103479. };
  103480. }
  103481. if (this.expandOnHover) {
  103482. on.mouseenter = function () {
  103483. return _this.isMouseover = true;
  103484. };
  103485. on.mouseleave = function () {
  103486. return _this.isMouseover = false;
  103487. };
  103488. }
  103489. return on;
  103490. },
  103491. genPosition: function genPosition(name) {
  103492. var slot = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["getSlot"])(this, name);
  103493. if (!slot) return slot;
  103494. return this.$createElement('div', {
  103495. staticClass: "v-navigation-drawer__" + name
  103496. }, slot);
  103497. },
  103498. genPrepend: function genPrepend() {
  103499. return this.genPosition('prepend');
  103500. },
  103501. genContent: function genContent() {
  103502. return this.$createElement('div', {
  103503. staticClass: 'v-navigation-drawer__content'
  103504. }, this.$slots.default);
  103505. },
  103506. genBorder: function genBorder() {
  103507. return this.$createElement('div', {
  103508. staticClass: 'v-navigation-drawer__border'
  103509. });
  103510. },
  103511. init: function init() {
  103512. if (this.permanent) {
  103513. this.isActive = true;
  103514. } else if (this.stateless || this.value != null) {
  103515. this.isActive = this.value;
  103516. } else if (!this.temporary) {
  103517. this.isActive = !this.isMobile;
  103518. }
  103519. },
  103520. onRouteChange: function onRouteChange() {
  103521. if (this.reactsToRoute && this.closeConditional()) {
  103522. this.isActive = false;
  103523. }
  103524. },
  103525. swipeLeft: function swipeLeft(e) {
  103526. if (this.isActive && this.right) return;
  103527. this.calculateTouchArea();
  103528. if (Math.abs(e.touchendX - e.touchstartX) < 100) return;
  103529. if (this.right && e.touchstartX >= this.touchArea.right) this.isActive = true;else if (!this.right && this.isActive) this.isActive = false;
  103530. },
  103531. swipeRight: function swipeRight(e) {
  103532. if (this.isActive && !this.right) return;
  103533. this.calculateTouchArea();
  103534. if (Math.abs(e.touchendX - e.touchstartX) < 100) return;
  103535. if (!this.right && e.touchstartX <= this.touchArea.left) this.isActive = true;else if (this.right && this.isActive) this.isActive = false;
  103536. },
  103537. /**
  103538. * Update the application layout
  103539. */
  103540. updateApplication: function updateApplication() {
  103541. if (!this.isActive || this.isMobile || this.temporary || !this.$el) return 0;
  103542. var width = Number(this.computedWidth);
  103543. return isNaN(width) ? this.$el.clientWidth : width;
  103544. },
  103545. updateMiniVariant: function updateMiniVariant(val) {
  103546. if (this.miniVariant !== val) this.$emit('update:mini-variant', val);
  103547. }
  103548. },
  103549. render: function render(h) {
  103550. var children = [this.genPrepend(), this.genContent(), this.genAppend(), this.genBorder()];
  103551. if (this.src || Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["getSlot"])(this, 'img')) children.unshift(this.genBackground());
  103552. return h(this.tag, this.setBackgroundColor(this.color, {
  103553. class: this.classes,
  103554. style: this.styles,
  103555. directives: this.genDirectives(),
  103556. on: this.genListeners()
  103557. }), children);
  103558. }
  103559. }));
  103560. /***/ }),
  103561. /***/ "./src/components/VNavigationDrawer/index.ts":
  103562. /*!***************************************************!*\
  103563. !*** ./src/components/VNavigationDrawer/index.ts ***!
  103564. \***************************************************/
  103565. /*! exports provided: VNavigationDrawer, default */
  103566. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103567. "use strict";
  103568. __webpack_require__.r(__webpack_exports__);
  103569. /* harmony import */ var _VNavigationDrawer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VNavigationDrawer */ "./src/components/VNavigationDrawer/VNavigationDrawer.ts");
  103570. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VNavigationDrawer", function() { return _VNavigationDrawer__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103571. /* harmony default export */ __webpack_exports__["default"] = (_VNavigationDrawer__WEBPACK_IMPORTED_MODULE_0__["default"]);
  103572. /***/ }),
  103573. /***/ "./src/components/VOverflowBtn/VOverflowBtn.sass":
  103574. /*!*******************************************************!*\
  103575. !*** ./src/components/VOverflowBtn/VOverflowBtn.sass ***!
  103576. \*******************************************************/
  103577. /*! no static exports found */
  103578. /***/ (function(module, exports, __webpack_require__) {
  103579. // extracted by mini-css-extract-plugin
  103580. /***/ }),
  103581. /***/ "./src/components/VOverflowBtn/VOverflowBtn.ts":
  103582. /*!*****************************************************!*\
  103583. !*** ./src/components/VOverflowBtn/VOverflowBtn.ts ***!
  103584. \*****************************************************/
  103585. /*! exports provided: default */
  103586. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103587. "use strict";
  103588. __webpack_require__.r(__webpack_exports__);
  103589. /* harmony import */ var _VOverflowBtn_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VOverflowBtn.sass */ "./src/components/VOverflowBtn/VOverflowBtn.sass");
  103590. /* harmony import */ var _VOverflowBtn_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VOverflowBtn_sass__WEBPACK_IMPORTED_MODULE_0__);
  103591. /* harmony import */ var _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSelect/VSelect */ "./src/components/VSelect/VSelect.ts");
  103592. /* harmony import */ var _VAutocomplete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VAutocomplete */ "./src/components/VAutocomplete/index.ts");
  103593. /* harmony import */ var _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VTextField/VTextField */ "./src/components/VTextField/VTextField.ts");
  103594. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  103595. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  103596. var __assign = undefined && undefined.__assign || function () {
  103597. __assign = Object.assign || function (t) {
  103598. for (var s, i = 1, n = arguments.length; i < n; i++) {
  103599. s = arguments[i];
  103600. for (var p in s) {
  103601. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  103602. }
  103603. }
  103604. return t;
  103605. };
  103606. return __assign.apply(this, arguments);
  103607. }; // Styles
  103608. // Extensions
  103609. // Components
  103610. // Utilities
  103611. /* @vue/component */
  103612. /* harmony default export */ __webpack_exports__["default"] = (_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].extend({
  103613. name: 'v-overflow-btn',
  103614. props: {
  103615. editable: Boolean,
  103616. segmented: Boolean
  103617. },
  103618. computed: {
  103619. classes: function classes() {
  103620. return __assign({}, _VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].options.computed.classes.call(this), {
  103621. 'v-overflow-btn': true,
  103622. 'v-overflow-btn--segmented': this.segmented,
  103623. 'v-overflow-btn--editable': this.editable
  103624. });
  103625. },
  103626. isAnyValueAllowed: function isAnyValueAllowed() {
  103627. return this.editable || _VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].options.computed.isAnyValueAllowed.call(this);
  103628. },
  103629. isSingle: function isSingle() {
  103630. return true;
  103631. },
  103632. computedItems: function computedItems() {
  103633. return this.segmented ? this.allItems : this.filteredItems;
  103634. }
  103635. },
  103636. methods: {
  103637. genSelections: function genSelections() {
  103638. return this.editable ? _VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genSelections.call(this) : _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genSelections.call(this); // Override v-autocomplete's override
  103639. },
  103640. genCommaSelection: function genCommaSelection(item, index, last) {
  103641. return this.segmented ? this.genSegmentedBtn(item) : _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genCommaSelection.call(this, item, index, last);
  103642. },
  103643. genInput: function genInput() {
  103644. var input = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_3__["default"].options.methods.genInput.call(this);
  103645. input.data = input.data || {};
  103646. input.data.domProps.value = this.editable ? this.internalSearch : '';
  103647. input.data.attrs.readonly = !this.isAnyValueAllowed;
  103648. return input;
  103649. },
  103650. genLabel: function genLabel() {
  103651. if (this.editable && this.isFocused) return null;
  103652. var label = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_3__["default"].options.methods.genLabel.call(this);
  103653. if (!label) return label;
  103654. label.data = label.data || {}; // Reset previously set styles from parent
  103655. label.data.style = {};
  103656. return label;
  103657. },
  103658. genSegmentedBtn: function genSegmentedBtn(item) {
  103659. var _this = this;
  103660. var itemValue = this.getValue(item);
  103661. var itemObj = this.computedItems.find(function (i) {
  103662. return _this.getValue(i) === itemValue;
  103663. }) || item;
  103664. if (!itemObj.text || !itemObj.callback) {
  103665. Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["consoleWarn"])('When using \'segmented\' prop without a selection slot, items must contain both a text and callback property', this);
  103666. return null;
  103667. }
  103668. return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_4__["default"], {
  103669. props: {
  103670. text: true
  103671. },
  103672. on: {
  103673. click: function click(e) {
  103674. e.stopPropagation();
  103675. itemObj.callback(e);
  103676. }
  103677. }
  103678. }, [itemObj.text]);
  103679. },
  103680. updateValue: function updateValue(val) {
  103681. if (val) {
  103682. this.initialValue = this.lazyValue;
  103683. } else if (this.initialValue !== this.lazyValue) {
  103684. this.$emit('change', this.lazyValue);
  103685. }
  103686. }
  103687. }
  103688. }));
  103689. /***/ }),
  103690. /***/ "./src/components/VOverflowBtn/index.ts":
  103691. /*!**********************************************!*\
  103692. !*** ./src/components/VOverflowBtn/index.ts ***!
  103693. \**********************************************/
  103694. /*! exports provided: VOverflowBtn, default */
  103695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103696. "use strict";
  103697. __webpack_require__.r(__webpack_exports__);
  103698. /* harmony import */ var _VOverflowBtn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VOverflowBtn */ "./src/components/VOverflowBtn/VOverflowBtn.ts");
  103699. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VOverflowBtn", function() { return _VOverflowBtn__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103700. /* harmony default export */ __webpack_exports__["default"] = (_VOverflowBtn__WEBPACK_IMPORTED_MODULE_0__["default"]);
  103701. /***/ }),
  103702. /***/ "./src/components/VOverlay/VOverlay.sass":
  103703. /*!***********************************************!*\
  103704. !*** ./src/components/VOverlay/VOverlay.sass ***!
  103705. \***********************************************/
  103706. /*! no static exports found */
  103707. /***/ (function(module, exports, __webpack_require__) {
  103708. // extracted by mini-css-extract-plugin
  103709. /***/ }),
  103710. /***/ "./src/components/VOverlay/VOverlay.ts":
  103711. /*!*********************************************!*\
  103712. !*** ./src/components/VOverlay/VOverlay.ts ***!
  103713. \*********************************************/
  103714. /*! exports provided: default */
  103715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103716. "use strict";
  103717. __webpack_require__.r(__webpack_exports__);
  103718. /* harmony import */ var _VOverlay_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VOverlay.sass */ "./src/components/VOverlay/VOverlay.sass");
  103719. /* harmony import */ var _VOverlay_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VOverlay_sass__WEBPACK_IMPORTED_MODULE_0__);
  103720. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  103721. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  103722. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  103723. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  103724. var __assign = undefined && undefined.__assign || function () {
  103725. __assign = Object.assign || function (t) {
  103726. for (var s, i = 1, n = arguments.length; i < n; i++) {
  103727. s = arguments[i];
  103728. for (var p in s) {
  103729. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  103730. }
  103731. }
  103732. return t;
  103733. };
  103734. return __assign.apply(this, arguments);
  103735. }; // Styles
  103736. // Mixins
  103737. // Utilities
  103738. /* @vue/component */
  103739. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_3__["default"]).extend({
  103740. name: 'v-overlay',
  103741. props: {
  103742. absolute: Boolean,
  103743. color: {
  103744. type: String,
  103745. default: '#212121'
  103746. },
  103747. dark: {
  103748. type: Boolean,
  103749. default: true
  103750. },
  103751. opacity: {
  103752. type: [Number, String],
  103753. default: 0.46
  103754. },
  103755. value: {
  103756. default: true
  103757. },
  103758. zIndex: {
  103759. type: [Number, String],
  103760. default: 5
  103761. }
  103762. },
  103763. computed: {
  103764. __scrim: function __scrim() {
  103765. var data = this.setBackgroundColor(this.color, {
  103766. staticClass: 'v-overlay__scrim',
  103767. style: {
  103768. opacity: this.computedOpacity
  103769. }
  103770. });
  103771. return this.$createElement('div', data);
  103772. },
  103773. classes: function classes() {
  103774. return __assign({
  103775. 'v-overlay--absolute': this.absolute,
  103776. 'v-overlay--active': this.isActive
  103777. }, this.themeClasses);
  103778. },
  103779. computedOpacity: function computedOpacity() {
  103780. return Number(this.isActive ? this.opacity : 0);
  103781. },
  103782. styles: function styles() {
  103783. return {
  103784. zIndex: this.zIndex
  103785. };
  103786. }
  103787. },
  103788. methods: {
  103789. genContent: function genContent() {
  103790. return this.$createElement('div', {
  103791. staticClass: 'v-overlay__content'
  103792. }, this.$slots.default);
  103793. }
  103794. },
  103795. render: function render(h) {
  103796. var children = [this.__scrim];
  103797. if (this.isActive) children.push(this.genContent());
  103798. return h('div', {
  103799. staticClass: 'v-overlay',
  103800. class: this.classes,
  103801. style: this.styles
  103802. }, children);
  103803. }
  103804. }));
  103805. /***/ }),
  103806. /***/ "./src/components/VOverlay/index.ts":
  103807. /*!******************************************!*\
  103808. !*** ./src/components/VOverlay/index.ts ***!
  103809. \******************************************/
  103810. /*! exports provided: VOverlay, default */
  103811. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103812. "use strict";
  103813. __webpack_require__.r(__webpack_exports__);
  103814. /* harmony import */ var _VOverlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VOverlay */ "./src/components/VOverlay/VOverlay.ts");
  103815. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VOverlay", function() { return _VOverlay__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103816. /* harmony default export */ __webpack_exports__["default"] = (_VOverlay__WEBPACK_IMPORTED_MODULE_0__["default"]);
  103817. /***/ }),
  103818. /***/ "./src/components/VPagination/VPagination.sass":
  103819. /*!*****************************************************!*\
  103820. !*** ./src/components/VPagination/VPagination.sass ***!
  103821. \*****************************************************/
  103822. /*! no static exports found */
  103823. /***/ (function(module, exports, __webpack_require__) {
  103824. // extracted by mini-css-extract-plugin
  103825. /***/ }),
  103826. /***/ "./src/components/VPagination/VPagination.ts":
  103827. /*!***************************************************!*\
  103828. !*** ./src/components/VPagination/VPagination.ts ***!
  103829. \***************************************************/
  103830. /*! exports provided: default */
  103831. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103832. "use strict";
  103833. __webpack_require__.r(__webpack_exports__);
  103834. /* harmony import */ var _VPagination_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VPagination.sass */ "./src/components/VPagination/VPagination.sass");
  103835. /* harmony import */ var _VPagination_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VPagination_sass__WEBPACK_IMPORTED_MODULE_0__);
  103836. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  103837. /* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize/index.ts");
  103838. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  103839. /* harmony import */ var _mixins_intersectable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/intersectable */ "./src/mixins/intersectable/index.ts");
  103840. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  103841. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  103842. var __assign = undefined && undefined.__assign || function () {
  103843. __assign = Object.assign || function (t) {
  103844. for (var s, i = 1, n = arguments.length; i < n; i++) {
  103845. s = arguments[i];
  103846. for (var p in s) {
  103847. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  103848. }
  103849. }
  103850. return t;
  103851. };
  103852. return __assign.apply(this, arguments);
  103853. };
  103854. var __read = undefined && undefined.__read || function (o, n) {
  103855. var m = typeof Symbol === "function" && o[Symbol.iterator];
  103856. if (!m) return o;
  103857. var i = m.call(o),
  103858. r,
  103859. ar = [],
  103860. e;
  103861. try {
  103862. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  103863. ar.push(r.value);
  103864. }
  103865. } catch (error) {
  103866. e = {
  103867. error: error
  103868. };
  103869. } finally {
  103870. try {
  103871. if (r && !r.done && (m = i["return"])) m.call(i);
  103872. } finally {
  103873. if (e) throw e.error;
  103874. }
  103875. }
  103876. return ar;
  103877. };
  103878. var __spread = undefined && undefined.__spread || function () {
  103879. for (var ar = [], i = 0; i < arguments.length; i++) {
  103880. ar = ar.concat(__read(arguments[i]));
  103881. }
  103882. return ar;
  103883. };
  103884. // Directives
  103885. // Mixins
  103886. // Utilities
  103887. /* @vue/component */
  103888. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_6__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_mixins_intersectable__WEBPACK_IMPORTED_MODULE_4__["default"])({
  103889. onVisible: ['init']
  103890. }), _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__["default"]).extend({
  103891. name: 'v-pagination',
  103892. directives: {
  103893. Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_2__["default"]
  103894. },
  103895. props: {
  103896. circle: Boolean,
  103897. disabled: Boolean,
  103898. length: {
  103899. type: Number,
  103900. default: 0,
  103901. validator: function validator(val) {
  103902. return val % 1 === 0;
  103903. }
  103904. },
  103905. nextIcon: {
  103906. type: String,
  103907. default: '$next'
  103908. },
  103909. prevIcon: {
  103910. type: String,
  103911. default: '$prev'
  103912. },
  103913. totalVisible: [Number, String],
  103914. value: {
  103915. type: Number,
  103916. default: 0
  103917. }
  103918. },
  103919. data: function data() {
  103920. return {
  103921. maxButtons: 0,
  103922. selected: null
  103923. };
  103924. },
  103925. computed: {
  103926. classes: function classes() {
  103927. return __assign({
  103928. 'v-pagination': true,
  103929. 'v-pagination--circle': this.circle,
  103930. 'v-pagination--disabled': this.disabled
  103931. }, this.themeClasses);
  103932. },
  103933. items: function items() {
  103934. var totalVisible = parseInt(this.totalVisible, 10);
  103935. var maxLength = Math.min(Math.max(0, totalVisible) || this.length, Math.max(0, this.maxButtons) || this.length, this.length);
  103936. if (this.length <= maxLength) {
  103937. return this.range(1, this.length);
  103938. }
  103939. var even = maxLength % 2 === 0 ? 1 : 0;
  103940. var left = Math.floor(maxLength / 2);
  103941. var right = this.length - left + 1 + even;
  103942. if (this.value > left && this.value < right) {
  103943. var start = this.value - left + 2;
  103944. var end = this.value + left - 2 - even;
  103945. return __spread([1, '...'], this.range(start, end), ['...', this.length]);
  103946. } else if (this.value === left) {
  103947. var end = this.value + left - 1 - even;
  103948. return __spread(this.range(1, end), ['...', this.length]);
  103949. } else if (this.value === right) {
  103950. var start = this.value - left + 1;
  103951. return __spread([1, '...'], this.range(start, this.length));
  103952. } else {
  103953. return __spread(this.range(1, left), ['...'], this.range(right, this.length));
  103954. }
  103955. }
  103956. },
  103957. watch: {
  103958. value: function value() {
  103959. this.init();
  103960. }
  103961. },
  103962. mounted: function mounted() {
  103963. this.init();
  103964. },
  103965. methods: {
  103966. init: function init() {
  103967. var _this = this;
  103968. this.selected = null;
  103969. this.$nextTick(this.onResize); // TODO: Change this (f75dee3a, cbdf7caa)
  103970. setTimeout(function () {
  103971. return _this.selected = _this.value;
  103972. }, 100);
  103973. },
  103974. onResize: function onResize() {
  103975. var width = this.$el && this.$el.parentElement ? this.$el.parentElement.clientWidth : window.innerWidth;
  103976. this.maxButtons = Math.floor((width - 96) / 42);
  103977. },
  103978. next: function next(e) {
  103979. e.preventDefault();
  103980. this.$emit('input', this.value + 1);
  103981. this.$emit('next');
  103982. },
  103983. previous: function previous(e) {
  103984. e.preventDefault();
  103985. this.$emit('input', this.value - 1);
  103986. this.$emit('previous');
  103987. },
  103988. range: function range(from, to) {
  103989. var range = [];
  103990. from = from > 0 ? from : 1;
  103991. for (var i = from; i <= to; i++) {
  103992. range.push(i);
  103993. }
  103994. return range;
  103995. },
  103996. genIcon: function genIcon(h, icon, disabled, fn) {
  103997. return h('li', [h('button', {
  103998. staticClass: 'v-pagination__navigation',
  103999. class: {
  104000. 'v-pagination__navigation--disabled': disabled
  104001. },
  104002. attrs: {
  104003. type: 'button'
  104004. },
  104005. on: disabled ? {} : {
  104006. click: fn
  104007. }
  104008. }, [h(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], [icon])])]);
  104009. },
  104010. genItem: function genItem(h, i) {
  104011. var _this = this;
  104012. var color = i === this.value && (this.color || 'primary');
  104013. return h('button', this.setBackgroundColor(color, {
  104014. staticClass: 'v-pagination__item',
  104015. class: {
  104016. 'v-pagination__item--active': i === this.value
  104017. },
  104018. attrs: {
  104019. type: 'button'
  104020. },
  104021. on: {
  104022. click: function click() {
  104023. return _this.$emit('input', i);
  104024. }
  104025. }
  104026. }), [i.toString()]);
  104027. },
  104028. genItems: function genItems(h) {
  104029. var _this = this;
  104030. return this.items.map(function (i, index) {
  104031. return h('li', {
  104032. key: index
  104033. }, [isNaN(Number(i)) ? h('span', {
  104034. class: 'v-pagination__more'
  104035. }, [i.toString()]) : _this.genItem(h, i)]);
  104036. });
  104037. }
  104038. },
  104039. render: function render(h) {
  104040. var children = [this.genIcon(h, this.$vuetify.rtl ? this.nextIcon : this.prevIcon, this.value <= 1, this.previous), this.genItems(h), this.genIcon(h, this.$vuetify.rtl ? this.prevIcon : this.nextIcon, this.value >= this.length, this.next)];
  104041. return h('ul', {
  104042. directives: [{
  104043. modifiers: {
  104044. quiet: true
  104045. },
  104046. name: 'resize',
  104047. value: this.onResize
  104048. }],
  104049. class: this.classes
  104050. }, children);
  104051. }
  104052. }));
  104053. /***/ }),
  104054. /***/ "./src/components/VPagination/index.ts":
  104055. /*!*********************************************!*\
  104056. !*** ./src/components/VPagination/index.ts ***!
  104057. \*********************************************/
  104058. /*! exports provided: VPagination, default */
  104059. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104060. "use strict";
  104061. __webpack_require__.r(__webpack_exports__);
  104062. /* harmony import */ var _VPagination__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VPagination */ "./src/components/VPagination/VPagination.ts");
  104063. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VPagination", function() { return _VPagination__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  104064. /* harmony default export */ __webpack_exports__["default"] = (_VPagination__WEBPACK_IMPORTED_MODULE_0__["default"]);
  104065. /***/ }),
  104066. /***/ "./src/components/VParallax/VParallax.sass":
  104067. /*!*************************************************!*\
  104068. !*** ./src/components/VParallax/VParallax.sass ***!
  104069. \*************************************************/
  104070. /*! no static exports found */
  104071. /***/ (function(module, exports, __webpack_require__) {
  104072. // extracted by mini-css-extract-plugin
  104073. /***/ }),
  104074. /***/ "./src/components/VParallax/VParallax.ts":
  104075. /*!***********************************************!*\
  104076. !*** ./src/components/VParallax/VParallax.ts ***!
  104077. \***********************************************/
  104078. /*! exports provided: default */
  104079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104080. "use strict";
  104081. __webpack_require__.r(__webpack_exports__);
  104082. /* harmony import */ var _VParallax_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VParallax.sass */ "./src/components/VParallax/VParallax.sass");
  104083. /* harmony import */ var _VParallax_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VParallax_sass__WEBPACK_IMPORTED_MODULE_0__);
  104084. /* harmony import */ var _mixins_translatable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/translatable */ "./src/mixins/translatable/index.ts");
  104085. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  104086. // Style
  104087. // Mixins
  104088. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_translatable__WEBPACK_IMPORTED_MODULE_1__["default"]);
  104089. /* @vue/component */
  104090. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  104091. name: 'v-parallax',
  104092. props: {
  104093. alt: {
  104094. type: String,
  104095. default: ''
  104096. },
  104097. height: {
  104098. type: [String, Number],
  104099. default: 500
  104100. },
  104101. src: String
  104102. },
  104103. data: function data() {
  104104. return {
  104105. isBooted: false
  104106. };
  104107. },
  104108. computed: {
  104109. styles: function styles() {
  104110. return {
  104111. display: 'block',
  104112. opacity: this.isBooted ? 1 : 0,
  104113. transform: "translate(-50%, " + this.parallax + "px)"
  104114. };
  104115. }
  104116. },
  104117. mounted: function mounted() {
  104118. this.init();
  104119. },
  104120. methods: {
  104121. init: function init() {
  104122. var _this = this;
  104123. var img = this.$refs.img;
  104124. if (!img) return;
  104125. if (img.complete) {
  104126. this.translate();
  104127. this.listeners();
  104128. } else {
  104129. img.addEventListener('load', function () {
  104130. _this.translate();
  104131. _this.listeners();
  104132. }, false);
  104133. }
  104134. this.isBooted = true;
  104135. },
  104136. objHeight: function objHeight() {
  104137. return this.$refs.img.naturalHeight;
  104138. }
  104139. },
  104140. render: function render(h) {
  104141. var imgData = {
  104142. staticClass: 'v-parallax__image',
  104143. style: this.styles,
  104144. attrs: {
  104145. src: this.src,
  104146. alt: this.alt
  104147. },
  104148. ref: 'img'
  104149. };
  104150. var container = h('div', {
  104151. staticClass: 'v-parallax__image-container'
  104152. }, [h('img', imgData)]);
  104153. var content = h('div', {
  104154. staticClass: 'v-parallax__content'
  104155. }, this.$slots.default);
  104156. return h('div', {
  104157. staticClass: 'v-parallax',
  104158. style: {
  104159. height: this.height + "px"
  104160. },
  104161. on: this.$listeners
  104162. }, [container, content]);
  104163. }
  104164. }));
  104165. /***/ }),
  104166. /***/ "./src/components/VParallax/index.ts":
  104167. /*!*******************************************!*\
  104168. !*** ./src/components/VParallax/index.ts ***!
  104169. \*******************************************/
  104170. /*! exports provided: VParallax, default */
  104171. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104172. "use strict";
  104173. __webpack_require__.r(__webpack_exports__);
  104174. /* harmony import */ var _VParallax__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VParallax */ "./src/components/VParallax/VParallax.ts");
  104175. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VParallax", function() { return _VParallax__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  104176. /* harmony default export */ __webpack_exports__["default"] = (_VParallax__WEBPACK_IMPORTED_MODULE_0__["default"]);
  104177. /***/ }),
  104178. /***/ "./src/components/VPicker/VPicker.sass":
  104179. /*!*********************************************!*\
  104180. !*** ./src/components/VPicker/VPicker.sass ***!
  104181. \*********************************************/
  104182. /*! no static exports found */
  104183. /***/ (function(module, exports, __webpack_require__) {
  104184. // extracted by mini-css-extract-plugin
  104185. /***/ }),
  104186. /***/ "./src/components/VPicker/VPicker.ts":
  104187. /*!*******************************************!*\
  104188. !*** ./src/components/VPicker/VPicker.ts ***!
  104189. \*******************************************/
  104190. /*! exports provided: default */
  104191. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104192. "use strict";
  104193. __webpack_require__.r(__webpack_exports__);
  104194. /* harmony import */ var _VPicker_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VPicker.sass */ "./src/components/VPicker/VPicker.sass");
  104195. /* harmony import */ var _VPicker_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VPicker_sass__WEBPACK_IMPORTED_MODULE_0__);
  104196. /* harmony import */ var _VCard_VCard_sass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VCard/VCard.sass */ "./src/components/VCard/VCard.sass");
  104197. /* harmony import */ var _VCard_VCard_sass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_VCard_VCard_sass__WEBPACK_IMPORTED_MODULE_1__);
  104198. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  104199. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  104200. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  104201. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  104202. var __assign = undefined && undefined.__assign || function () {
  104203. __assign = Object.assign || function (t) {
  104204. for (var s, i = 1, n = arguments.length; i < n; i++) {
  104205. s = arguments[i];
  104206. for (var p in s) {
  104207. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  104208. }
  104209. }
  104210. return t;
  104211. };
  104212. return __assign.apply(this, arguments);
  104213. };
  104214. // Mixins
  104215. // Helpers
  104216. /* @vue/component */
  104217. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]).extend({
  104218. name: 'v-picker',
  104219. props: {
  104220. fullWidth: Boolean,
  104221. landscape: Boolean,
  104222. noTitle: Boolean,
  104223. transition: {
  104224. type: String,
  104225. default: 'fade-transition'
  104226. },
  104227. width: {
  104228. type: [Number, String],
  104229. default: 290
  104230. }
  104231. },
  104232. computed: {
  104233. computedTitleColor: function computedTitleColor() {
  104234. var defaultTitleColor = this.isDark ? false : this.color || 'primary';
  104235. return this.color || defaultTitleColor;
  104236. }
  104237. },
  104238. methods: {
  104239. genTitle: function genTitle() {
  104240. return this.$createElement('div', this.setBackgroundColor(this.computedTitleColor, {
  104241. staticClass: 'v-picker__title',
  104242. class: {
  104243. 'v-picker__title--landscape': this.landscape
  104244. }
  104245. }), this.$slots.title);
  104246. },
  104247. genBodyTransition: function genBodyTransition() {
  104248. return this.$createElement('transition', {
  104249. props: {
  104250. name: this.transition
  104251. }
  104252. }, this.$slots.default);
  104253. },
  104254. genBody: function genBody() {
  104255. return this.$createElement('div', {
  104256. staticClass: 'v-picker__body',
  104257. class: __assign({
  104258. 'v-picker__body--no-title': this.noTitle
  104259. }, this.themeClasses),
  104260. style: this.fullWidth ? undefined : {
  104261. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.width)
  104262. }
  104263. }, [this.genBodyTransition()]);
  104264. },
  104265. genActions: function genActions() {
  104266. return this.$createElement('div', {
  104267. staticClass: 'v-picker__actions v-card__actions',
  104268. class: {
  104269. 'v-picker__actions--no-title': this.noTitle
  104270. }
  104271. }, this.$slots.actions);
  104272. }
  104273. },
  104274. render: function render(h) {
  104275. return h('div', {
  104276. staticClass: 'v-picker v-card',
  104277. class: __assign({
  104278. 'v-picker--landscape': this.landscape,
  104279. 'v-picker--full-width': this.fullWidth
  104280. }, this.themeClasses)
  104281. }, [this.$slots.title ? this.genTitle() : null, this.genBody(), this.$slots.actions ? this.genActions() : null]);
  104282. }
  104283. }));
  104284. /***/ }),
  104285. /***/ "./src/components/VPicker/index.ts":
  104286. /*!*****************************************!*\
  104287. !*** ./src/components/VPicker/index.ts ***!
  104288. \*****************************************/
  104289. /*! exports provided: VPicker, default */
  104290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104291. "use strict";
  104292. __webpack_require__.r(__webpack_exports__);
  104293. /* harmony import */ var _VPicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VPicker */ "./src/components/VPicker/VPicker.ts");
  104294. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VPicker", function() { return _VPicker__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  104295. /* harmony default export */ __webpack_exports__["default"] = (_VPicker__WEBPACK_IMPORTED_MODULE_0__["default"]);
  104296. /***/ }),
  104297. /***/ "./src/components/VProgressCircular/VProgressCircular.sass":
  104298. /*!*****************************************************************!*\
  104299. !*** ./src/components/VProgressCircular/VProgressCircular.sass ***!
  104300. \*****************************************************************/
  104301. /*! no static exports found */
  104302. /***/ (function(module, exports, __webpack_require__) {
  104303. // extracted by mini-css-extract-plugin
  104304. /***/ }),
  104305. /***/ "./src/components/VProgressCircular/VProgressCircular.ts":
  104306. /*!***************************************************************!*\
  104307. !*** ./src/components/VProgressCircular/VProgressCircular.ts ***!
  104308. \***************************************************************/
  104309. /*! exports provided: default */
  104310. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104311. "use strict";
  104312. __webpack_require__.r(__webpack_exports__);
  104313. /* harmony import */ var _VProgressCircular_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VProgressCircular.sass */ "./src/components/VProgressCircular/VProgressCircular.sass");
  104314. /* harmony import */ var _VProgressCircular_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VProgressCircular_sass__WEBPACK_IMPORTED_MODULE_0__);
  104315. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  104316. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  104317. // Styles
  104318. // Mixins
  104319. // Utils
  104320. /* @vue/component */
  104321. /* harmony default export */ __webpack_exports__["default"] = (_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  104322. name: 'v-progress-circular',
  104323. props: {
  104324. button: Boolean,
  104325. indeterminate: Boolean,
  104326. rotate: {
  104327. type: [Number, String],
  104328. default: 0
  104329. },
  104330. size: {
  104331. type: [Number, String],
  104332. default: 32
  104333. },
  104334. width: {
  104335. type: [Number, String],
  104336. default: 4
  104337. },
  104338. value: {
  104339. type: [Number, String],
  104340. default: 0
  104341. }
  104342. },
  104343. data: function data() {
  104344. return {
  104345. radius: 20
  104346. };
  104347. },
  104348. computed: {
  104349. calculatedSize: function calculatedSize() {
  104350. return Number(this.size) + (this.button ? 8 : 0);
  104351. },
  104352. circumference: function circumference() {
  104353. return 2 * Math.PI * this.radius;
  104354. },
  104355. classes: function classes() {
  104356. return {
  104357. 'v-progress-circular--indeterminate': this.indeterminate,
  104358. 'v-progress-circular--button': this.button
  104359. };
  104360. },
  104361. normalizedValue: function normalizedValue() {
  104362. if (this.value < 0) {
  104363. return 0;
  104364. }
  104365. if (this.value > 100) {
  104366. return 100;
  104367. }
  104368. return parseFloat(this.value);
  104369. },
  104370. strokeDashArray: function strokeDashArray() {
  104371. return Math.round(this.circumference * 1000) / 1000;
  104372. },
  104373. strokeDashOffset: function strokeDashOffset() {
  104374. return (100 - this.normalizedValue) / 100 * this.circumference + 'px';
  104375. },
  104376. strokeWidth: function strokeWidth() {
  104377. return Number(this.width) / +this.size * this.viewBoxSize * 2;
  104378. },
  104379. styles: function styles() {
  104380. return {
  104381. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["convertToUnit"])(this.calculatedSize),
  104382. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["convertToUnit"])(this.calculatedSize)
  104383. };
  104384. },
  104385. svgStyles: function svgStyles() {
  104386. return {
  104387. transform: "rotate(" + Number(this.rotate) + "deg)"
  104388. };
  104389. },
  104390. viewBoxSize: function viewBoxSize() {
  104391. return this.radius / (1 - Number(this.width) / +this.size);
  104392. }
  104393. },
  104394. methods: {
  104395. genCircle: function genCircle(name, offset) {
  104396. return this.$createElement('circle', {
  104397. class: "v-progress-circular__" + name,
  104398. attrs: {
  104399. fill: 'transparent',
  104400. cx: 2 * this.viewBoxSize,
  104401. cy: 2 * this.viewBoxSize,
  104402. r: this.radius,
  104403. 'stroke-width': this.strokeWidth,
  104404. 'stroke-dasharray': this.strokeDashArray,
  104405. 'stroke-dashoffset': offset
  104406. }
  104407. });
  104408. },
  104409. genSvg: function genSvg() {
  104410. var children = [this.indeterminate || this.genCircle('underlay', 0), this.genCircle('overlay', this.strokeDashOffset)];
  104411. return this.$createElement('svg', {
  104412. style: this.svgStyles,
  104413. attrs: {
  104414. xmlns: 'http://www.w3.org/2000/svg',
  104415. viewBox: this.viewBoxSize + " " + this.viewBoxSize + " " + 2 * this.viewBoxSize + " " + 2 * this.viewBoxSize
  104416. }
  104417. }, children);
  104418. },
  104419. genInfo: function genInfo() {
  104420. return this.$createElement('div', {
  104421. staticClass: 'v-progress-circular__info'
  104422. }, this.$slots.default);
  104423. }
  104424. },
  104425. render: function render(h) {
  104426. return h('div', this.setTextColor(this.color, {
  104427. staticClass: 'v-progress-circular',
  104428. attrs: {
  104429. role: 'progressbar',
  104430. 'aria-valuemin': 0,
  104431. 'aria-valuemax': 100,
  104432. 'aria-valuenow': this.indeterminate ? undefined : this.normalizedValue
  104433. },
  104434. class: this.classes,
  104435. style: this.styles,
  104436. on: this.$listeners
  104437. }), [this.genSvg(), this.genInfo()]);
  104438. }
  104439. }));
  104440. /***/ }),
  104441. /***/ "./src/components/VProgressCircular/index.ts":
  104442. /*!***************************************************!*\
  104443. !*** ./src/components/VProgressCircular/index.ts ***!
  104444. \***************************************************/
  104445. /*! exports provided: VProgressCircular, default */
  104446. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104447. "use strict";
  104448. __webpack_require__.r(__webpack_exports__);
  104449. /* harmony import */ var _VProgressCircular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VProgressCircular */ "./src/components/VProgressCircular/VProgressCircular.ts");
  104450. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VProgressCircular", function() { return _VProgressCircular__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  104451. /* harmony default export */ __webpack_exports__["default"] = (_VProgressCircular__WEBPACK_IMPORTED_MODULE_0__["default"]);
  104452. /***/ }),
  104453. /***/ "./src/components/VProgressLinear/VProgressLinear.sass":
  104454. /*!*************************************************************!*\
  104455. !*** ./src/components/VProgressLinear/VProgressLinear.sass ***!
  104456. \*************************************************************/
  104457. /*! no static exports found */
  104458. /***/ (function(module, exports, __webpack_require__) {
  104459. // extracted by mini-css-extract-plugin
  104460. /***/ }),
  104461. /***/ "./src/components/VProgressLinear/VProgressLinear.ts":
  104462. /*!***********************************************************!*\
  104463. !*** ./src/components/VProgressLinear/VProgressLinear.ts ***!
  104464. \***********************************************************/
  104465. /*! exports provided: default */
  104466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104467. "use strict";
  104468. __webpack_require__.r(__webpack_exports__);
  104469. /* harmony import */ var _VProgressLinear_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VProgressLinear.sass */ "./src/components/VProgressLinear/VProgressLinear.sass");
  104470. /* harmony import */ var _VProgressLinear_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VProgressLinear_sass__WEBPACK_IMPORTED_MODULE_0__);
  104471. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  104472. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  104473. /* harmony import */ var _mixins_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/positionable */ "./src/mixins/positionable/index.ts");
  104474. /* harmony import */ var _mixins_proxyable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/proxyable */ "./src/mixins/proxyable/index.ts");
  104475. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  104476. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  104477. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  104478. var __assign = undefined && undefined.__assign || function () {
  104479. __assign = Object.assign || function (t) {
  104480. for (var s, i = 1, n = arguments.length; i < n; i++) {
  104481. s = arguments[i];
  104482. for (var p in s) {
  104483. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  104484. }
  104485. }
  104486. return t;
  104487. };
  104488. return __assign.apply(this, arguments);
  104489. };
  104490. // Components
  104491. // Mixins
  104492. // Utilities
  104493. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_7__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_mixins_positionable__WEBPACK_IMPORTED_MODULE_3__["factory"])(['absolute', 'fixed', 'top', 'bottom']), _mixins_proxyable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__["default"]);
  104494. /* @vue/component */
  104495. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  104496. name: 'v-progress-linear',
  104497. props: {
  104498. active: {
  104499. type: Boolean,
  104500. default: true
  104501. },
  104502. backgroundColor: {
  104503. type: String,
  104504. default: null
  104505. },
  104506. backgroundOpacity: {
  104507. type: [Number, String],
  104508. default: null
  104509. },
  104510. bufferValue: {
  104511. type: [Number, String],
  104512. default: 100
  104513. },
  104514. color: {
  104515. type: String,
  104516. default: 'primary'
  104517. },
  104518. height: {
  104519. type: [Number, String],
  104520. default: 4
  104521. },
  104522. indeterminate: Boolean,
  104523. query: Boolean,
  104524. rounded: Boolean,
  104525. stream: Boolean,
  104526. striped: Boolean,
  104527. value: {
  104528. type: [Number, String],
  104529. default: 0
  104530. }
  104531. },
  104532. data: function data() {
  104533. return {
  104534. internalLazyValue: this.value || 0
  104535. };
  104536. },
  104537. computed: {
  104538. __cachedBackground: function __cachedBackground() {
  104539. return this.$createElement('div', this.setBackgroundColor(this.backgroundColor || this.color, {
  104540. staticClass: 'v-progress-linear__background',
  104541. style: this.backgroundStyle
  104542. }));
  104543. },
  104544. __cachedBar: function __cachedBar() {
  104545. return this.$createElement(this.computedTransition, [this.__cachedBarType]);
  104546. },
  104547. __cachedBarType: function __cachedBarType() {
  104548. return this.indeterminate ? this.__cachedIndeterminate : this.__cachedDeterminate;
  104549. },
  104550. __cachedBuffer: function __cachedBuffer() {
  104551. return this.$createElement('div', {
  104552. staticClass: 'v-progress-linear__buffer',
  104553. style: this.styles
  104554. });
  104555. },
  104556. __cachedDeterminate: function __cachedDeterminate() {
  104557. return this.$createElement('div', this.setBackgroundColor(this.color, {
  104558. staticClass: "v-progress-linear__determinate",
  104559. style: {
  104560. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["convertToUnit"])(this.normalizedValue, '%')
  104561. }
  104562. }));
  104563. },
  104564. __cachedIndeterminate: function __cachedIndeterminate() {
  104565. return this.$createElement('div', {
  104566. staticClass: 'v-progress-linear__indeterminate',
  104567. class: {
  104568. 'v-progress-linear__indeterminate--active': this.active
  104569. }
  104570. }, [this.genProgressBar('long'), this.genProgressBar('short')]);
  104571. },
  104572. __cachedStream: function __cachedStream() {
  104573. if (!this.stream) return null;
  104574. return this.$createElement('div', this.setTextColor(this.color, {
  104575. staticClass: 'v-progress-linear__stream',
  104576. style: {
  104577. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["convertToUnit"])(100 - this.normalizedBuffer, '%')
  104578. }
  104579. }));
  104580. },
  104581. backgroundStyle: function backgroundStyle() {
  104582. var _a;
  104583. var backgroundOpacity = this.backgroundOpacity == null ? this.backgroundColor ? 1 : 0.3 : parseFloat(this.backgroundOpacity);
  104584. return _a = {
  104585. opacity: backgroundOpacity
  104586. }, _a[this.$vuetify.rtl ? 'right' : 'left'] = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["convertToUnit"])(this.normalizedValue, '%'), _a.width = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["convertToUnit"])(this.normalizedBuffer - this.normalizedValue, '%'), _a;
  104587. },
  104588. classes: function classes() {
  104589. return __assign({
  104590. 'v-progress-linear--absolute': this.absolute,
  104591. 'v-progress-linear--fixed': this.fixed,
  104592. 'v-progress-linear--query': this.query,
  104593. 'v-progress-linear--reactive': this.reactive,
  104594. 'v-progress-linear--rounded': this.rounded,
  104595. 'v-progress-linear--striped': this.striped
  104596. }, this.themeClasses);
  104597. },
  104598. computedTransition: function computedTransition() {
  104599. return this.indeterminate ? _transitions__WEBPACK_IMPORTED_MODULE_1__["VFadeTransition"] : _transitions__WEBPACK_IMPORTED_MODULE_1__["VSlideXTransition"];
  104600. },
  104601. normalizedBuffer: function normalizedBuffer() {
  104602. return this.normalize(this.bufferValue);
  104603. },
  104604. normalizedValue: function normalizedValue() {
  104605. return this.normalize(this.internalLazyValue);
  104606. },
  104607. reactive: function reactive() {
  104608. return Boolean(this.$listeners.change);
  104609. },
  104610. styles: function styles() {
  104611. var styles = {};
  104612. if (!this.active) {
  104613. styles.height = 0;
  104614. }
  104615. if (!this.indeterminate && parseFloat(this.normalizedBuffer) !== 100) {
  104616. styles.width = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["convertToUnit"])(this.normalizedBuffer, '%');
  104617. }
  104618. return styles;
  104619. }
  104620. },
  104621. methods: {
  104622. genContent: function genContent() {
  104623. var slot = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getSlot"])(this, 'default', {
  104624. value: this.internalLazyValue
  104625. });
  104626. if (!slot) return null;
  104627. return this.$createElement('div', {
  104628. staticClass: 'v-progress-linear__content'
  104629. }, slot);
  104630. },
  104631. genListeners: function genListeners() {
  104632. var listeners = this.$listeners;
  104633. if (this.reactive) {
  104634. listeners.click = this.onClick;
  104635. }
  104636. return listeners;
  104637. },
  104638. genProgressBar: function genProgressBar(name) {
  104639. var _a;
  104640. return this.$createElement('div', this.setBackgroundColor(this.color, {
  104641. staticClass: 'v-progress-linear__indeterminate',
  104642. class: (_a = {}, _a[name] = true, _a)
  104643. }));
  104644. },
  104645. onClick: function onClick(e) {
  104646. if (!this.reactive) return;
  104647. var width = this.$el.getBoundingClientRect().width;
  104648. this.internalValue = e.offsetX / width * 100;
  104649. },
  104650. normalize: function normalize(value) {
  104651. if (value < 0) return 0;
  104652. if (value > 100) return 100;
  104653. return parseFloat(value);
  104654. }
  104655. },
  104656. render: function render(h) {
  104657. var data = {
  104658. staticClass: 'v-progress-linear',
  104659. attrs: {
  104660. role: 'progressbar',
  104661. 'aria-valuemin': 0,
  104662. 'aria-valuemax': this.normalizedBuffer,
  104663. 'aria-valuenow': this.indeterminate ? undefined : this.normalizedValue
  104664. },
  104665. class: this.classes,
  104666. style: {
  104667. bottom: this.bottom ? 0 : undefined,
  104668. height: this.active ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["convertToUnit"])(this.height) : 0,
  104669. top: this.top ? 0 : undefined
  104670. },
  104671. on: this.genListeners()
  104672. };
  104673. return h('div', data, [this.__cachedStream, this.__cachedBackground, this.__cachedBuffer, this.__cachedBar, this.genContent()]);
  104674. }
  104675. }));
  104676. /***/ }),
  104677. /***/ "./src/components/VProgressLinear/index.ts":
  104678. /*!*************************************************!*\
  104679. !*** ./src/components/VProgressLinear/index.ts ***!
  104680. \*************************************************/
  104681. /*! exports provided: VProgressLinear, default */
  104682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104683. "use strict";
  104684. __webpack_require__.r(__webpack_exports__);
  104685. /* harmony import */ var _VProgressLinear__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VProgressLinear */ "./src/components/VProgressLinear/VProgressLinear.ts");
  104686. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VProgressLinear", function() { return _VProgressLinear__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  104687. /* harmony default export */ __webpack_exports__["default"] = (_VProgressLinear__WEBPACK_IMPORTED_MODULE_0__["default"]);
  104688. /***/ }),
  104689. /***/ "./src/components/VRadioGroup/VRadio.sass":
  104690. /*!************************************************!*\
  104691. !*** ./src/components/VRadioGroup/VRadio.sass ***!
  104692. \************************************************/
  104693. /*! no static exports found */
  104694. /***/ (function(module, exports, __webpack_require__) {
  104695. // extracted by mini-css-extract-plugin
  104696. /***/ }),
  104697. /***/ "./src/components/VRadioGroup/VRadio.ts":
  104698. /*!**********************************************!*\
  104699. !*** ./src/components/VRadioGroup/VRadio.ts ***!
  104700. \**********************************************/
  104701. /*! exports provided: default */
  104702. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104703. "use strict";
  104704. __webpack_require__.r(__webpack_exports__);
  104705. /* harmony import */ var _VRadio_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VRadio.sass */ "./src/components/VRadioGroup/VRadio.sass");
  104706. /* harmony import */ var _VRadio_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VRadio_sass__WEBPACK_IMPORTED_MODULE_0__);
  104707. /* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VLabel */ "./src/components/VLabel/index.ts");
  104708. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  104709. /* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.ts");
  104710. /* harmony import */ var _mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/binds-attrs */ "./src/mixins/binds-attrs/index.ts");
  104711. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  104712. /* harmony import */ var _mixins_groupable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/groupable */ "./src/mixins/groupable/index.ts");
  104713. /* harmony import */ var _mixins_rippleable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/rippleable */ "./src/mixins/rippleable/index.ts");
  104714. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  104715. /* harmony import */ var _mixins_selectable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../mixins/selectable */ "./src/mixins/selectable/index.ts");
  104716. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  104717. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  104718. var __assign = undefined && undefined.__assign || function () {
  104719. __assign = Object.assign || function (t) {
  104720. for (var s, i = 1, n = arguments.length; i < n; i++) {
  104721. s = arguments[i];
  104722. for (var p in s) {
  104723. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  104724. }
  104725. }
  104726. return t;
  104727. };
  104728. return __assign.apply(this, arguments);
  104729. }; // Styles
  104730. // Mixins
  104731. // Utilities
  104732. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_11__["default"])(_mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_rippleable__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_mixins_groupable__WEBPACK_IMPORTED_MODULE_6__["factory"])('radioGroup'), _mixins_themeable__WEBPACK_IMPORTED_MODULE_8__["default"]);
  104733. /* @vue/component */
  104734. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  104735. name: 'v-radio',
  104736. inheritAttrs: false,
  104737. props: {
  104738. disabled: Boolean,
  104739. id: String,
  104740. label: String,
  104741. name: String,
  104742. offIcon: {
  104743. type: String,
  104744. default: '$radioOff'
  104745. },
  104746. onIcon: {
  104747. type: String,
  104748. default: '$radioOn'
  104749. },
  104750. readonly: Boolean,
  104751. value: {
  104752. default: null
  104753. }
  104754. },
  104755. data: function data() {
  104756. return {
  104757. isFocused: false
  104758. };
  104759. },
  104760. computed: {
  104761. classes: function classes() {
  104762. return __assign({
  104763. 'v-radio--is-disabled': this.isDisabled,
  104764. 'v-radio--is-focused': this.isFocused
  104765. }, this.themeClasses, this.groupClasses);
  104766. },
  104767. computedColor: function computedColor() {
  104768. return _mixins_selectable__WEBPACK_IMPORTED_MODULE_9__["default"].options.computed.computedColor.call(this);
  104769. },
  104770. computedIcon: function computedIcon() {
  104771. return this.isActive ? this.onIcon : this.offIcon;
  104772. },
  104773. computedId: function computedId() {
  104774. return _VInput__WEBPACK_IMPORTED_MODULE_3__["default"].options.computed.computedId.call(this);
  104775. },
  104776. hasLabel: _VInput__WEBPACK_IMPORTED_MODULE_3__["default"].options.computed.hasLabel,
  104777. hasState: function hasState() {
  104778. return (this.radioGroup || {}).hasState;
  104779. },
  104780. isDisabled: function isDisabled() {
  104781. return this.disabled || !!(this.radioGroup || {}).disabled;
  104782. },
  104783. isReadonly: function isReadonly() {
  104784. return this.readonly || !!(this.radioGroup || {}).readonly;
  104785. },
  104786. computedName: function computedName() {
  104787. if (this.name || !this.radioGroup) {
  104788. return this.name;
  104789. }
  104790. return this.radioGroup.name || "radio-" + this.radioGroup._uid;
  104791. },
  104792. rippleState: function rippleState() {
  104793. return _mixins_selectable__WEBPACK_IMPORTED_MODULE_9__["default"].options.computed.rippleState.call(this);
  104794. },
  104795. validationState: function validationState() {
  104796. return (this.radioGroup || {}).validationState || this.computedColor;
  104797. }
  104798. },
  104799. methods: {
  104800. genInput: function genInput(args) {
  104801. // We can't actually use the mixin directly because
  104802. // it's made for standalone components, but its
  104803. // genInput method is exactly what we need
  104804. return _mixins_selectable__WEBPACK_IMPORTED_MODULE_9__["default"].options.methods.genInput.call(this, 'radio', args);
  104805. },
  104806. genLabel: function genLabel() {
  104807. var _this = this;
  104808. if (!this.hasLabel) return null;
  104809. return this.$createElement(_VLabel__WEBPACK_IMPORTED_MODULE_1__["default"], {
  104810. on: {
  104811. click: function click(e) {
  104812. // Prevent label from
  104813. // causing the input
  104814. // to focus
  104815. e.preventDefault();
  104816. _this.onChange();
  104817. }
  104818. },
  104819. attrs: {
  104820. for: this.computedId
  104821. },
  104822. props: {
  104823. color: this.validationState,
  104824. focused: this.hasState
  104825. }
  104826. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_10__["getSlot"])(this, 'label') || this.label);
  104827. },
  104828. genRadio: function genRadio() {
  104829. return this.$createElement('div', {
  104830. staticClass: 'v-input--selection-controls__input'
  104831. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], this.setTextColor(this.validationState, {
  104832. props: {
  104833. dense: this.radioGroup && this.radioGroup.dense
  104834. }
  104835. }), this.computedIcon), this.genInput(__assign({
  104836. name: this.computedName,
  104837. value: this.value
  104838. }, this.attrs$)), this.genRipple(this.setTextColor(this.rippleState))]);
  104839. },
  104840. onFocus: function onFocus(e) {
  104841. this.isFocused = true;
  104842. this.$emit('focus', e);
  104843. },
  104844. onBlur: function onBlur(e) {
  104845. this.isFocused = false;
  104846. this.$emit('blur', e);
  104847. },
  104848. onChange: function onChange() {
  104849. if (this.isDisabled || this.isReadonly || this.isActive) return;
  104850. this.toggle();
  104851. },
  104852. onKeydown: function onKeydown() {}
  104853. },
  104854. render: function render(h) {
  104855. var data = {
  104856. staticClass: 'v-radio',
  104857. class: this.classes
  104858. };
  104859. return h('div', data, [this.genRadio(), this.genLabel()]);
  104860. }
  104861. }));
  104862. /***/ }),
  104863. /***/ "./src/components/VRadioGroup/VRadioGroup.sass":
  104864. /*!*****************************************************!*\
  104865. !*** ./src/components/VRadioGroup/VRadioGroup.sass ***!
  104866. \*****************************************************/
  104867. /*! no static exports found */
  104868. /***/ (function(module, exports, __webpack_require__) {
  104869. // extracted by mini-css-extract-plugin
  104870. /***/ }),
  104871. /***/ "./src/components/VRadioGroup/VRadioGroup.ts":
  104872. /*!***************************************************!*\
  104873. !*** ./src/components/VRadioGroup/VRadioGroup.ts ***!
  104874. \***************************************************/
  104875. /*! exports provided: default */
  104876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104877. "use strict";
  104878. __webpack_require__.r(__webpack_exports__);
  104879. /* harmony import */ var _styles_components_selection_controls_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../styles/components/_selection-controls.sass */ "./src/styles/components/_selection-controls.sass");
  104880. /* harmony import */ var _styles_components_selection_controls_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_styles_components_selection_controls_sass__WEBPACK_IMPORTED_MODULE_0__);
  104881. /* harmony import */ var _VRadioGroup_sass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VRadioGroup.sass */ "./src/components/VRadioGroup/VRadioGroup.sass");
  104882. /* harmony import */ var _VRadioGroup_sass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_VRadioGroup_sass__WEBPACK_IMPORTED_MODULE_1__);
  104883. /* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.ts");
  104884. /* harmony import */ var _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VItemGroup/VItemGroup */ "./src/components/VItemGroup/VItemGroup.ts");
  104885. /* harmony import */ var _mixins_comparable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/comparable */ "./src/mixins/comparable/index.ts");
  104886. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  104887. var __assign = undefined && undefined.__assign || function () {
  104888. __assign = Object.assign || function (t) {
  104889. for (var s, i = 1, n = arguments.length; i < n; i++) {
  104890. s = arguments[i];
  104891. for (var p in s) {
  104892. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  104893. }
  104894. }
  104895. return t;
  104896. };
  104897. return __assign.apply(this, arguments);
  104898. }; // Styles
  104899. // Extensions
  104900. // Mixins
  104901. // Types
  104902. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_mixins_comparable__WEBPACK_IMPORTED_MODULE_4__["default"], _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_3__["BaseItemGroup"], _VInput__WEBPACK_IMPORTED_MODULE_2__["default"]);
  104903. /* @vue/component */
  104904. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  104905. name: 'v-radio-group',
  104906. provide: function provide() {
  104907. return {
  104908. radioGroup: this
  104909. };
  104910. },
  104911. props: {
  104912. column: {
  104913. type: Boolean,
  104914. default: true
  104915. },
  104916. height: {
  104917. type: [Number, String],
  104918. default: 'auto'
  104919. },
  104920. name: String,
  104921. row: Boolean,
  104922. // If no value set on VRadio
  104923. // will match valueComparator
  104924. // force default to null
  104925. value: null
  104926. },
  104927. computed: {
  104928. classes: function classes() {
  104929. return __assign({}, _VInput__WEBPACK_IMPORTED_MODULE_2__["default"].options.computed.classes.call(this), {
  104930. 'v-input--selection-controls v-input--radio-group': true,
  104931. 'v-input--radio-group--column': this.column && !this.row,
  104932. 'v-input--radio-group--row': this.row
  104933. });
  104934. }
  104935. },
  104936. methods: {
  104937. genDefaultSlot: function genDefaultSlot() {
  104938. return this.$createElement('div', {
  104939. staticClass: 'v-input--radio-group__input',
  104940. attrs: {
  104941. id: this.id,
  104942. role: 'radiogroup',
  104943. 'aria-labelledby': this.computedId
  104944. }
  104945. }, _VInput__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genDefaultSlot.call(this));
  104946. },
  104947. genInputSlot: function genInputSlot() {
  104948. var render = _VInput__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genInputSlot.call(this);
  104949. delete render.data.on.click;
  104950. return render;
  104951. },
  104952. genLabel: function genLabel() {
  104953. var label = _VInput__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genLabel.call(this);
  104954. if (!label) return null;
  104955. label.data.attrs.id = this.computedId; // WAI considers this an orphaned label
  104956. delete label.data.attrs.for;
  104957. label.tag = 'legend';
  104958. return label;
  104959. },
  104960. onClick: _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_3__["BaseItemGroup"].options.methods.onClick
  104961. }
  104962. }));
  104963. /***/ }),
  104964. /***/ "./src/components/VRadioGroup/index.ts":
  104965. /*!*********************************************!*\
  104966. !*** ./src/components/VRadioGroup/index.ts ***!
  104967. \*********************************************/
  104968. /*! exports provided: VRadioGroup, VRadio, default */
  104969. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104970. "use strict";
  104971. __webpack_require__.r(__webpack_exports__);
  104972. /* harmony import */ var _VRadioGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VRadioGroup */ "./src/components/VRadioGroup/VRadioGroup.ts");
  104973. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRadioGroup", function() { return _VRadioGroup__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  104974. /* harmony import */ var _VRadio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VRadio */ "./src/components/VRadioGroup/VRadio.ts");
  104975. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRadio", function() { return _VRadio__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  104976. /* harmony default export */ __webpack_exports__["default"] = ({
  104977. $_vuetify_subcomponents: {
  104978. VRadioGroup: _VRadioGroup__WEBPACK_IMPORTED_MODULE_0__["default"],
  104979. VRadio: _VRadio__WEBPACK_IMPORTED_MODULE_1__["default"]
  104980. }
  104981. });
  104982. /***/ }),
  104983. /***/ "./src/components/VRangeSlider/VRangeSlider.sass":
  104984. /*!*******************************************************!*\
  104985. !*** ./src/components/VRangeSlider/VRangeSlider.sass ***!
  104986. \*******************************************************/
  104987. /*! no static exports found */
  104988. /***/ (function(module, exports, __webpack_require__) {
  104989. // extracted by mini-css-extract-plugin
  104990. /***/ }),
  104991. /***/ "./src/components/VRangeSlider/VRangeSlider.ts":
  104992. /*!*****************************************************!*\
  104993. !*** ./src/components/VRangeSlider/VRangeSlider.ts ***!
  104994. \*****************************************************/
  104995. /*! exports provided: default */
  104996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104997. "use strict";
  104998. __webpack_require__.r(__webpack_exports__);
  104999. /* harmony import */ var _VRangeSlider_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VRangeSlider.sass */ "./src/components/VRangeSlider/VRangeSlider.sass");
  105000. /* harmony import */ var _VRangeSlider_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VRangeSlider_sass__WEBPACK_IMPORTED_MODULE_0__);
  105001. /* harmony import */ var _VSlider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSlider */ "./src/components/VSlider/index.ts");
  105002. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  105003. var __assign = undefined && undefined.__assign || function () {
  105004. __assign = Object.assign || function (t) {
  105005. for (var s, i = 1, n = arguments.length; i < n; i++) {
  105006. s = arguments[i];
  105007. for (var p in s) {
  105008. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  105009. }
  105010. }
  105011. return t;
  105012. };
  105013. return __assign.apply(this, arguments);
  105014. };
  105015. var __read = undefined && undefined.__read || function (o, n) {
  105016. var m = typeof Symbol === "function" && o[Symbol.iterator];
  105017. if (!m) return o;
  105018. var i = m.call(o),
  105019. r,
  105020. ar = [],
  105021. e;
  105022. try {
  105023. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  105024. ar.push(r.value);
  105025. }
  105026. } catch (error) {
  105027. e = {
  105028. error: error
  105029. };
  105030. } finally {
  105031. try {
  105032. if (r && !r.done && (m = i["return"])) m.call(i);
  105033. } finally {
  105034. if (e) throw e.error;
  105035. }
  105036. }
  105037. return ar;
  105038. };
  105039. var __spread = undefined && undefined.__spread || function () {
  105040. for (var ar = [], i = 0; i < arguments.length; i++) {
  105041. ar = ar.concat(__read(arguments[i]));
  105042. }
  105043. return ar;
  105044. }; // Styles
  105045. // Components
  105046. // Helpers
  105047. /* @vue/component */
  105048. /* harmony default export */ __webpack_exports__["default"] = (_VSlider__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  105049. name: 'v-range-slider',
  105050. props: {
  105051. value: {
  105052. type: Array,
  105053. default: function _default() {
  105054. return [0, 0];
  105055. }
  105056. }
  105057. },
  105058. data: function data() {
  105059. return {
  105060. activeThumb: null,
  105061. lazyValue: this.value
  105062. };
  105063. },
  105064. computed: {
  105065. classes: function classes() {
  105066. return __assign({}, _VSlider__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  105067. 'v-input--range-slider': true
  105068. });
  105069. },
  105070. internalValue: {
  105071. get: function get() {
  105072. return this.lazyValue;
  105073. },
  105074. set: function set(val) {
  105075. var _this = this; // Round value to ensure the
  105076. // entire slider range can
  105077. // be selected with step
  105078. var value = val.map(function (v) {
  105079. if (v === void 0) {
  105080. v = 0;
  105081. }
  105082. return _this.roundValue(Math.min(Math.max(v, _this.minValue), _this.maxValue));
  105083. }); // Switch values if range and wrong order
  105084. if (value[0] > value[1] || value[1] < value[0]) {
  105085. if (this.activeThumb !== null) {
  105086. var toFocus = this.activeThumb === 1 ? 0 : 1;
  105087. var el = this.$refs["thumb_" + toFocus];
  105088. el.focus();
  105089. }
  105090. value = [value[1], value[0]];
  105091. }
  105092. this.lazyValue = value;
  105093. if (!Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["deepEqual"])(value, this.value)) this.$emit('input', value);
  105094. this.validate();
  105095. }
  105096. },
  105097. inputWidth: function inputWidth() {
  105098. var _this = this;
  105099. return this.internalValue.map(function (v) {
  105100. return (_this.roundValue(v) - _this.minValue) / (_this.maxValue - _this.minValue) * 100;
  105101. });
  105102. }
  105103. },
  105104. methods: {
  105105. getTrackStyle: function getTrackStyle(startLength, endLength, startPadding, endPadding) {
  105106. var _a;
  105107. if (startPadding === void 0) {
  105108. startPadding = 0;
  105109. }
  105110. if (endPadding === void 0) {
  105111. endPadding = 0;
  105112. }
  105113. var startDir = this.vertical ? this.$vuetify.rtl ? 'top' : 'bottom' : this.$vuetify.rtl ? 'right' : 'left';
  105114. var endDir = this.vertical ? 'height' : 'width';
  105115. var start = "calc(" + startLength + "% + " + startPadding + "px)";
  105116. var end = "calc(" + endLength + "% + " + endPadding + "px)";
  105117. return _a = {
  105118. transition: this.trackTransition
  105119. }, _a[startDir] = start, _a[endDir] = end, _a;
  105120. },
  105121. getIndexOfClosestValue: function getIndexOfClosestValue(arr, v) {
  105122. if (Math.abs(arr[0] - v) < Math.abs(arr[1] - v)) return 0;else return 1;
  105123. },
  105124. genInput: function genInput() {
  105125. var _this = this;
  105126. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["createRange"])(2).map(function (i) {
  105127. var input = _VSlider__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genInput.call(_this);
  105128. input.data = input.data || {};
  105129. input.data.attrs = input.data.attrs || {};
  105130. input.data.attrs.value = _this.internalValue[i];
  105131. input.data.attrs.id = "input-" + (i ? 'max' : 'min') + "-" + _this._uid;
  105132. return input;
  105133. });
  105134. },
  105135. genTrackContainer: function genTrackContainer() {
  105136. var _this = this;
  105137. var children = [];
  105138. var padding = this.disabled ? 10 : 0;
  105139. var sections = [{
  105140. class: 'v-slider__track-background',
  105141. color: this.computedTrackColor,
  105142. styles: [0, this.inputWidth[0], 0, -padding]
  105143. }, {
  105144. class: this.disabled ? 'v-slider__track-background' : 'v-slider__track-fill',
  105145. color: this.disabled ? this.computedTrackColor : this.computedColor,
  105146. styles: [this.inputWidth[0], Math.abs(this.inputWidth[1] - this.inputWidth[0]), padding, padding * -2]
  105147. }, {
  105148. class: 'v-slider__track-background',
  105149. color: this.computedTrackColor,
  105150. styles: [this.inputWidth[1], Math.abs(100 - this.inputWidth[1]), padding, -padding]
  105151. }];
  105152. if (this.$vuetify.rtl) sections.reverse();
  105153. children.push.apply(children, __spread(sections.map(function (section) {
  105154. return _this.$createElement('div', _this.setBackgroundColor(section.color, {
  105155. staticClass: section.class,
  105156. style: _this.getTrackStyle.apply(_this, __spread(section.styles))
  105157. }));
  105158. })));
  105159. return this.$createElement('div', {
  105160. staticClass: 'v-slider__track-container',
  105161. ref: 'track'
  105162. }, children);
  105163. },
  105164. genChildren: function genChildren() {
  105165. var _this = this;
  105166. return [this.genInput(), this.genTrackContainer(), this.genSteps(), Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["createRange"])(2).map(function (index) {
  105167. var value = _this.internalValue[index];
  105168. var onDrag = function onDrag(e) {
  105169. _this.isActive = true;
  105170. _this.activeThumb = index;
  105171. _this.onThumbMouseDown(e);
  105172. };
  105173. var onFocus = function onFocus(e) {
  105174. _this.isFocused = true;
  105175. _this.activeThumb = index;
  105176. _this.$emit('focus', e);
  105177. };
  105178. var onBlur = function onBlur(e) {
  105179. _this.isFocused = false;
  105180. _this.activeThumb = null;
  105181. _this.$emit('blur', e);
  105182. };
  105183. var valueWidth = _this.inputWidth[index];
  105184. var isActive = _this.isActive && _this.activeThumb === index;
  105185. var isFocused = _this.isFocused && _this.activeThumb === index;
  105186. return _this.genThumbContainer(value, valueWidth, isActive, isFocused, onDrag, onFocus, onBlur, "thumb_" + index);
  105187. })];
  105188. },
  105189. onSliderClick: function onSliderClick(e) {
  105190. if (!this.isActive) {
  105191. if (this.noClick) {
  105192. this.noClick = false;
  105193. return;
  105194. }
  105195. var _a = this.parseMouseMove(e),
  105196. value = _a.value,
  105197. isInsideTrack = _a.isInsideTrack;
  105198. if (isInsideTrack) {
  105199. this.activeThumb = this.getIndexOfClosestValue(this.internalValue, value);
  105200. var refName = "thumb_" + this.activeThumb;
  105201. var thumbRef = this.$refs[refName];
  105202. thumbRef.focus();
  105203. }
  105204. this.setInternalValue(value);
  105205. this.$emit('change', this.internalValue);
  105206. }
  105207. },
  105208. onMouseMove: function onMouseMove(e) {
  105209. var _a = this.parseMouseMove(e),
  105210. value = _a.value,
  105211. isInsideTrack = _a.isInsideTrack;
  105212. if (isInsideTrack && this.activeThumb === null) {
  105213. this.activeThumb = this.getIndexOfClosestValue(this.internalValue, value);
  105214. }
  105215. this.setInternalValue(value);
  105216. },
  105217. onKeyDown: function onKeyDown(e) {
  105218. if (this.activeThumb === null) return;
  105219. var value = this.parseKeyDown(e, this.internalValue[this.activeThumb]);
  105220. if (value == null) return;
  105221. this.setInternalValue(value);
  105222. this.$emit('change', this.internalValue);
  105223. },
  105224. setInternalValue: function setInternalValue(value) {
  105225. var _this = this;
  105226. this.internalValue = this.internalValue.map(function (v, i) {
  105227. if (i === _this.activeThumb) return value;else return Number(v);
  105228. });
  105229. }
  105230. }
  105231. }));
  105232. /***/ }),
  105233. /***/ "./src/components/VRangeSlider/index.ts":
  105234. /*!**********************************************!*\
  105235. !*** ./src/components/VRangeSlider/index.ts ***!
  105236. \**********************************************/
  105237. /*! exports provided: VRangeSlider, default */
  105238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105239. "use strict";
  105240. __webpack_require__.r(__webpack_exports__);
  105241. /* harmony import */ var _VRangeSlider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VRangeSlider */ "./src/components/VRangeSlider/VRangeSlider.ts");
  105242. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRangeSlider", function() { return _VRangeSlider__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  105243. /* harmony default export */ __webpack_exports__["default"] = (_VRangeSlider__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105244. /***/ }),
  105245. /***/ "./src/components/VRating/VRating.sass":
  105246. /*!*********************************************!*\
  105247. !*** ./src/components/VRating/VRating.sass ***!
  105248. \*********************************************/
  105249. /*! no static exports found */
  105250. /***/ (function(module, exports, __webpack_require__) {
  105251. // extracted by mini-css-extract-plugin
  105252. /***/ }),
  105253. /***/ "./src/components/VRating/VRating.ts":
  105254. /*!*******************************************!*\
  105255. !*** ./src/components/VRating/VRating.ts ***!
  105256. \*******************************************/
  105257. /*! exports provided: default */
  105258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105259. "use strict";
  105260. __webpack_require__.r(__webpack_exports__);
  105261. /* harmony import */ var _VRating_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VRating.sass */ "./src/components/VRating/VRating.sass");
  105262. /* harmony import */ var _VRating_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VRating_sass__WEBPACK_IMPORTED_MODULE_0__);
  105263. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  105264. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  105265. /* harmony import */ var _mixins_delayable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/delayable */ "./src/mixins/delayable/index.ts");
  105266. /* harmony import */ var _mixins_sizeable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/sizeable */ "./src/mixins/sizeable/index.ts");
  105267. /* harmony import */ var _mixins_rippleable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/rippleable */ "./src/mixins/rippleable/index.ts");
  105268. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  105269. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  105270. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  105271. // Styles
  105272. // Components
  105273. // Mixins
  105274. // Utilities
  105275. /* @vue/component */
  105276. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_8__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_delayable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_rippleable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_sizeable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__["default"]).extend({
  105277. name: 'v-rating',
  105278. props: {
  105279. backgroundColor: {
  105280. type: String,
  105281. default: 'accent'
  105282. },
  105283. color: {
  105284. type: String,
  105285. default: 'primary'
  105286. },
  105287. clearable: Boolean,
  105288. dense: Boolean,
  105289. emptyIcon: {
  105290. type: String,
  105291. default: '$ratingEmpty'
  105292. },
  105293. fullIcon: {
  105294. type: String,
  105295. default: '$ratingFull'
  105296. },
  105297. halfIcon: {
  105298. type: String,
  105299. default: '$ratingHalf'
  105300. },
  105301. halfIncrements: Boolean,
  105302. hover: Boolean,
  105303. length: {
  105304. type: [Number, String],
  105305. default: 5
  105306. },
  105307. readonly: Boolean,
  105308. size: [Number, String],
  105309. value: {
  105310. type: Number,
  105311. default: 0
  105312. }
  105313. },
  105314. data: function data() {
  105315. return {
  105316. hoverIndex: -1,
  105317. internalValue: this.value
  105318. };
  105319. },
  105320. computed: {
  105321. directives: function directives() {
  105322. if (this.readonly || !this.ripple) return [];
  105323. return [{
  105324. name: 'ripple',
  105325. value: {
  105326. circle: true
  105327. }
  105328. }];
  105329. },
  105330. iconProps: function iconProps() {
  105331. var _a = this.$props,
  105332. dark = _a.dark,
  105333. large = _a.large,
  105334. light = _a.light,
  105335. medium = _a.medium,
  105336. small = _a.small,
  105337. size = _a.size,
  105338. xLarge = _a.xLarge,
  105339. xSmall = _a.xSmall;
  105340. return {
  105341. dark: dark,
  105342. large: large,
  105343. light: light,
  105344. medium: medium,
  105345. size: size,
  105346. small: small,
  105347. xLarge: xLarge,
  105348. xSmall: xSmall
  105349. };
  105350. },
  105351. isHovering: function isHovering() {
  105352. return this.hover && this.hoverIndex >= 0;
  105353. }
  105354. },
  105355. watch: {
  105356. internalValue: function internalValue(val) {
  105357. val !== this.value && this.$emit('input', val);
  105358. },
  105359. value: function value(val) {
  105360. this.internalValue = val;
  105361. }
  105362. },
  105363. methods: {
  105364. createClickFn: function createClickFn(i) {
  105365. var _this = this;
  105366. return function (e) {
  105367. if (_this.readonly) return;
  105368. var newValue = _this.genHoverIndex(e, i);
  105369. if (_this.clearable && _this.internalValue === newValue) {
  105370. _this.internalValue = 0;
  105371. } else {
  105372. _this.internalValue = newValue;
  105373. }
  105374. };
  105375. },
  105376. createProps: function createProps(i) {
  105377. var props = {
  105378. index: i,
  105379. value: this.internalValue,
  105380. click: this.createClickFn(i),
  105381. isFilled: Math.floor(this.internalValue) > i,
  105382. isHovered: Math.floor(this.hoverIndex) > i
  105383. };
  105384. if (this.halfIncrements) {
  105385. props.isHalfHovered = !props.isHovered && (this.hoverIndex - i) % 1 > 0;
  105386. props.isHalfFilled = !props.isFilled && (this.internalValue - i) % 1 > 0;
  105387. }
  105388. return props;
  105389. },
  105390. genHoverIndex: function genHoverIndex(e, i) {
  105391. var isHalf = this.isHalfEvent(e);
  105392. if (this.halfIncrements && this.$vuetify.rtl) {
  105393. isHalf = !isHalf;
  105394. }
  105395. return i + (isHalf ? 0.5 : 1);
  105396. },
  105397. getIconName: function getIconName(props) {
  105398. var isFull = this.isHovering ? props.isHovered : props.isFilled;
  105399. var isHalf = this.isHovering ? props.isHalfHovered : props.isHalfFilled;
  105400. return isFull ? this.fullIcon : isHalf ? this.halfIcon : this.emptyIcon;
  105401. },
  105402. getColor: function getColor(props) {
  105403. if (this.isHovering) {
  105404. if (props.isHovered || props.isHalfHovered) return this.color;
  105405. } else {
  105406. if (props.isFilled || props.isHalfFilled) return this.color;
  105407. }
  105408. return this.backgroundColor;
  105409. },
  105410. isHalfEvent: function isHalfEvent(e) {
  105411. if (this.halfIncrements) {
  105412. var rect = e.target && e.target.getBoundingClientRect();
  105413. if (rect && e.pageX - rect.left < rect.width / 2) return true;
  105414. }
  105415. return false;
  105416. },
  105417. onMouseEnter: function onMouseEnter(e, i) {
  105418. var _this = this;
  105419. this.runDelay('open', function () {
  105420. _this.hoverIndex = _this.genHoverIndex(e, i);
  105421. });
  105422. },
  105423. onMouseLeave: function onMouseLeave() {
  105424. var _this = this;
  105425. this.runDelay('close', function () {
  105426. return _this.hoverIndex = -1;
  105427. });
  105428. },
  105429. genItem: function genItem(i) {
  105430. var _this = this;
  105431. var props = this.createProps(i);
  105432. if (this.$scopedSlots.item) return this.$scopedSlots.item(props);
  105433. var listeners = {
  105434. click: props.click
  105435. };
  105436. if (this.hover) {
  105437. listeners.mouseenter = function (e) {
  105438. return _this.onMouseEnter(e, i);
  105439. };
  105440. listeners.mouseleave = this.onMouseLeave;
  105441. if (this.halfIncrements) {
  105442. listeners.mousemove = function (e) {
  105443. return _this.onMouseEnter(e, i);
  105444. };
  105445. }
  105446. }
  105447. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], this.setTextColor(this.getColor(props), {
  105448. attrs: {
  105449. tabindex: -1
  105450. },
  105451. directives: this.directives,
  105452. props: this.iconProps,
  105453. on: listeners
  105454. }), [this.getIconName(props)]);
  105455. }
  105456. },
  105457. render: function render(h) {
  105458. var _this = this;
  105459. var children = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["createRange"])(Number(this.length)).map(function (i) {
  105460. return _this.genItem(i);
  105461. });
  105462. return h('div', {
  105463. staticClass: 'v-rating',
  105464. class: {
  105465. 'v-rating--readonly': this.readonly,
  105466. 'v-rating--dense': this.dense
  105467. }
  105468. }, children);
  105469. }
  105470. }));
  105471. /***/ }),
  105472. /***/ "./src/components/VRating/index.ts":
  105473. /*!*****************************************!*\
  105474. !*** ./src/components/VRating/index.ts ***!
  105475. \*****************************************/
  105476. /*! exports provided: VRating, default */
  105477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105478. "use strict";
  105479. __webpack_require__.r(__webpack_exports__);
  105480. /* harmony import */ var _VRating__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VRating */ "./src/components/VRating/VRating.ts");
  105481. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRating", function() { return _VRating__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  105482. /* harmony default export */ __webpack_exports__["default"] = (_VRating__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105483. /***/ }),
  105484. /***/ "./src/components/VResponsive/VResponsive.sass":
  105485. /*!*****************************************************!*\
  105486. !*** ./src/components/VResponsive/VResponsive.sass ***!
  105487. \*****************************************************/
  105488. /*! no static exports found */
  105489. /***/ (function(module, exports, __webpack_require__) {
  105490. // extracted by mini-css-extract-plugin
  105491. /***/ }),
  105492. /***/ "./src/components/VResponsive/VResponsive.ts":
  105493. /*!***************************************************!*\
  105494. !*** ./src/components/VResponsive/VResponsive.ts ***!
  105495. \***************************************************/
  105496. /*! exports provided: default */
  105497. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105498. "use strict";
  105499. __webpack_require__.r(__webpack_exports__);
  105500. /* harmony import */ var _VResponsive_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VResponsive.sass */ "./src/components/VResponsive/VResponsive.sass");
  105501. /* harmony import */ var _VResponsive_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VResponsive_sass__WEBPACK_IMPORTED_MODULE_0__);
  105502. /* harmony import */ var _mixins_measurable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/measurable */ "./src/mixins/measurable/index.ts");
  105503. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  105504. // Mixins
  105505. // Utils
  105506. /* @vue/component */
  105507. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_measurable__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
  105508. name: 'v-responsive',
  105509. props: {
  105510. aspectRatio: [String, Number]
  105511. },
  105512. computed: {
  105513. computedAspectRatio: function computedAspectRatio() {
  105514. return Number(this.aspectRatio);
  105515. },
  105516. aspectStyle: function aspectStyle() {
  105517. return this.computedAspectRatio ? {
  105518. paddingBottom: 1 / this.computedAspectRatio * 100 + '%'
  105519. } : undefined;
  105520. },
  105521. __cachedSizer: function __cachedSizer() {
  105522. if (!this.aspectStyle) return [];
  105523. return this.$createElement('div', {
  105524. style: this.aspectStyle,
  105525. staticClass: 'v-responsive__sizer'
  105526. });
  105527. }
  105528. },
  105529. methods: {
  105530. genContent: function genContent() {
  105531. return this.$createElement('div', {
  105532. staticClass: 'v-responsive__content'
  105533. }, this.$slots.default);
  105534. }
  105535. },
  105536. render: function render(h) {
  105537. return h('div', {
  105538. staticClass: 'v-responsive',
  105539. style: this.measurableStyles,
  105540. on: this.$listeners
  105541. }, [this.__cachedSizer, this.genContent()]);
  105542. }
  105543. }));
  105544. /***/ }),
  105545. /***/ "./src/components/VResponsive/index.ts":
  105546. /*!*********************************************!*\
  105547. !*** ./src/components/VResponsive/index.ts ***!
  105548. \*********************************************/
  105549. /*! exports provided: VResponsive, default */
  105550. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105551. "use strict";
  105552. __webpack_require__.r(__webpack_exports__);
  105553. /* harmony import */ var _VResponsive__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VResponsive */ "./src/components/VResponsive/VResponsive.ts");
  105554. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VResponsive", function() { return _VResponsive__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  105555. /* harmony default export */ __webpack_exports__["default"] = (_VResponsive__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105556. /***/ }),
  105557. /***/ "./src/components/VSelect/VSelect.sass":
  105558. /*!*********************************************!*\
  105559. !*** ./src/components/VSelect/VSelect.sass ***!
  105560. \*********************************************/
  105561. /*! no static exports found */
  105562. /***/ (function(module, exports, __webpack_require__) {
  105563. // extracted by mini-css-extract-plugin
  105564. /***/ }),
  105565. /***/ "./src/components/VSelect/VSelect.ts":
  105566. /*!*******************************************!*\
  105567. !*** ./src/components/VSelect/VSelect.ts ***!
  105568. \*******************************************/
  105569. /*! exports provided: defaultMenuProps, default */
  105570. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105571. "use strict";
  105572. __webpack_require__.r(__webpack_exports__);
  105573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultMenuProps", function() { return defaultMenuProps; });
  105574. /* harmony import */ var _VTextField_VTextField_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VTextField/VTextField.sass */ "./src/components/VTextField/VTextField.sass");
  105575. /* harmony import */ var _VTextField_VTextField_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VTextField_VTextField_sass__WEBPACK_IMPORTED_MODULE_0__);
  105576. /* harmony import */ var _VSelect_sass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VSelect.sass */ "./src/components/VSelect/VSelect.sass");
  105577. /* harmony import */ var _VSelect_sass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_VSelect_sass__WEBPACK_IMPORTED_MODULE_1__);
  105578. /* harmony import */ var _VChip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VChip */ "./src/components/VChip/index.ts");
  105579. /* harmony import */ var _VMenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VMenu */ "./src/components/VMenu/index.ts");
  105580. /* harmony import */ var _VSelectList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VSelectList */ "./src/components/VSelect/VSelectList.ts");
  105581. /* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.ts");
  105582. /* harmony import */ var _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../VTextField/VTextField */ "./src/components/VTextField/VTextField.ts");
  105583. /* harmony import */ var _mixins_comparable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/comparable */ "./src/mixins/comparable/index.ts");
  105584. /* harmony import */ var _mixins_filterable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/filterable */ "./src/mixins/filterable/index.ts");
  105585. /* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside/index.ts");
  105586. /* harmony import */ var _util_mergeData__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../util/mergeData */ "./src/util/mergeData.ts");
  105587. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  105588. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  105589. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  105590. var __assign = undefined && undefined.__assign || function () {
  105591. __assign = Object.assign || function (t) {
  105592. for (var s, i = 1, n = arguments.length; i < n; i++) {
  105593. s = arguments[i];
  105594. for (var p in s) {
  105595. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  105596. }
  105597. }
  105598. return t;
  105599. };
  105600. return __assign.apply(this, arguments);
  105601. };
  105602. var __values = undefined && undefined.__values || function (o) {
  105603. var m = typeof Symbol === "function" && o[Symbol.iterator],
  105604. i = 0;
  105605. if (m) return m.call(o);
  105606. return {
  105607. next: function next() {
  105608. if (o && i >= o.length) o = void 0;
  105609. return {
  105610. value: o && o[i++],
  105611. done: !o
  105612. };
  105613. }
  105614. };
  105615. }; // Styles
  105616. // Components
  105617. // Extensions
  105618. // Mixins
  105619. // Directives
  105620. // Utilities
  105621. // Types
  105622. var defaultMenuProps = {
  105623. closeOnClick: false,
  105624. closeOnContentClick: false,
  105625. disableKeys: true,
  105626. openOnClick: false,
  105627. maxHeight: 304
  105628. }; // Types
  105629. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_13__["default"])(_VTextField_VTextField__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_comparable__WEBPACK_IMPORTED_MODULE_7__["default"], _mixins_filterable__WEBPACK_IMPORTED_MODULE_8__["default"]);
  105630. /* @vue/component */
  105631. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  105632. name: 'v-select',
  105633. directives: {
  105634. ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_9__["default"]
  105635. },
  105636. props: {
  105637. appendIcon: {
  105638. type: String,
  105639. default: '$dropdown'
  105640. },
  105641. attach: {
  105642. type: null,
  105643. default: false
  105644. },
  105645. cacheItems: Boolean,
  105646. chips: Boolean,
  105647. clearable: Boolean,
  105648. deletableChips: Boolean,
  105649. disableLookup: Boolean,
  105650. eager: Boolean,
  105651. hideSelected: Boolean,
  105652. items: {
  105653. type: Array,
  105654. default: function _default() {
  105655. return [];
  105656. }
  105657. },
  105658. itemColor: {
  105659. type: String,
  105660. default: 'primary'
  105661. },
  105662. itemDisabled: {
  105663. type: [String, Array, Function],
  105664. default: 'disabled'
  105665. },
  105666. itemText: {
  105667. type: [String, Array, Function],
  105668. default: 'text'
  105669. },
  105670. itemValue: {
  105671. type: [String, Array, Function],
  105672. default: 'value'
  105673. },
  105674. menuProps: {
  105675. type: [String, Array, Object],
  105676. default: function _default() {
  105677. return defaultMenuProps;
  105678. }
  105679. },
  105680. multiple: Boolean,
  105681. openOnClear: Boolean,
  105682. returnObject: Boolean,
  105683. smallChips: Boolean
  105684. },
  105685. data: function data() {
  105686. return {
  105687. cachedItems: this.cacheItems ? this.items : [],
  105688. menuIsBooted: false,
  105689. isMenuActive: false,
  105690. lastItem: 20,
  105691. // As long as a value is defined, show it
  105692. // Otherwise, check if multiple
  105693. // to determine which default to provide
  105694. lazyValue: this.value !== undefined ? this.value : this.multiple ? [] : undefined,
  105695. selectedIndex: -1,
  105696. selectedItems: [],
  105697. keyboardLookupPrefix: '',
  105698. keyboardLookupLastTime: 0
  105699. };
  105700. },
  105701. computed: {
  105702. /* All items that the select has */
  105703. allItems: function allItems() {
  105704. return this.filterDuplicates(this.cachedItems.concat(this.items));
  105705. },
  105706. classes: function classes() {
  105707. return __assign({}, _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_6__["default"].options.computed.classes.call(this), {
  105708. 'v-select': true,
  105709. 'v-select--chips': this.hasChips,
  105710. 'v-select--chips--small': this.smallChips,
  105711. 'v-select--is-menu-active': this.isMenuActive,
  105712. 'v-select--is-multi': this.multiple
  105713. });
  105714. },
  105715. /* Used by other components to overwrite */
  105716. computedItems: function computedItems() {
  105717. return this.allItems;
  105718. },
  105719. computedOwns: function computedOwns() {
  105720. return "list-" + this._uid;
  105721. },
  105722. computedCounterValue: function computedCounterValue() {
  105723. return this.multiple ? this.selectedItems.length : (this.getText(this.selectedItems[0]) || '').toString().length;
  105724. },
  105725. directives: function directives() {
  105726. return this.isFocused ? [{
  105727. name: 'click-outside',
  105728. value: this.blur,
  105729. args: {
  105730. closeConditional: this.closeConditional
  105731. }
  105732. }] : undefined;
  105733. },
  105734. dynamicHeight: function dynamicHeight() {
  105735. return 'auto';
  105736. },
  105737. hasChips: function hasChips() {
  105738. return this.chips || this.smallChips;
  105739. },
  105740. hasSlot: function hasSlot() {
  105741. return Boolean(this.hasChips || this.$scopedSlots.selection);
  105742. },
  105743. isDirty: function isDirty() {
  105744. return this.selectedItems.length > 0;
  105745. },
  105746. listData: function listData() {
  105747. var _a;
  105748. var scopeId = this.$vnode && this.$vnode.context.$options._scopeId;
  105749. var attrs = scopeId ? (_a = {}, _a[scopeId] = true, _a) : {};
  105750. return {
  105751. attrs: __assign({}, attrs, {
  105752. id: this.computedOwns
  105753. }),
  105754. props: {
  105755. action: this.multiple,
  105756. color: this.itemColor,
  105757. dense: this.dense,
  105758. hideSelected: this.hideSelected,
  105759. items: this.virtualizedItems,
  105760. itemDisabled: this.itemDisabled,
  105761. itemText: this.itemText,
  105762. itemValue: this.itemValue,
  105763. noDataText: this.$vuetify.lang.t(this.noDataText),
  105764. selectedItems: this.selectedItems
  105765. },
  105766. on: {
  105767. select: this.selectItem
  105768. },
  105769. scopedSlots: {
  105770. item: this.$scopedSlots.item
  105771. }
  105772. };
  105773. },
  105774. staticList: function staticList() {
  105775. if (this.$slots['no-data'] || this.$slots['prepend-item'] || this.$slots['append-item']) {
  105776. Object(_util_console__WEBPACK_IMPORTED_MODULE_12__["consoleError"])('assert: staticList should not be called if slots are used');
  105777. }
  105778. return this.$createElement(_VSelectList__WEBPACK_IMPORTED_MODULE_4__["default"], this.listData);
  105779. },
  105780. virtualizedItems: function virtualizedItems() {
  105781. return this.$_menuProps.auto ? this.computedItems : this.computedItems.slice(0, this.lastItem);
  105782. },
  105783. menuCanShow: function menuCanShow() {
  105784. return true;
  105785. },
  105786. $_menuProps: function $_menuProps() {
  105787. var normalisedProps = typeof this.menuProps === 'string' ? this.menuProps.split(',') : this.menuProps;
  105788. if (Array.isArray(normalisedProps)) {
  105789. normalisedProps = normalisedProps.reduce(function (acc, p) {
  105790. acc[p.trim()] = true;
  105791. return acc;
  105792. }, {});
  105793. }
  105794. return __assign({}, defaultMenuProps, {
  105795. eager: this.eager,
  105796. value: this.menuCanShow && this.isMenuActive,
  105797. nudgeBottom: normalisedProps.offsetY ? 1 : 0
  105798. }, normalisedProps);
  105799. }
  105800. },
  105801. watch: {
  105802. internalValue: function internalValue(val) {
  105803. this.initialValue = val;
  105804. this.setSelectedItems();
  105805. },
  105806. menuIsBooted: function menuIsBooted() {
  105807. var _this = this;
  105808. window.setTimeout(function () {
  105809. if (_this.getContent() && _this.getContent().addEventListener) {
  105810. _this.getContent().addEventListener('scroll', _this.onScroll, false);
  105811. }
  105812. });
  105813. },
  105814. isMenuActive: function isMenuActive(val) {
  105815. var _this = this;
  105816. window.setTimeout(function () {
  105817. return _this.onMenuActiveChange(val);
  105818. });
  105819. if (!val) return;
  105820. this.menuIsBooted = true;
  105821. },
  105822. items: {
  105823. immediate: true,
  105824. handler: function handler(val) {
  105825. var _this = this;
  105826. if (this.cacheItems) {
  105827. // Breaks vue-test-utils if
  105828. // this isn't calculated
  105829. // on the next tick
  105830. this.$nextTick(function () {
  105831. _this.cachedItems = _this.filterDuplicates(_this.cachedItems.concat(val));
  105832. });
  105833. }
  105834. this.setSelectedItems();
  105835. }
  105836. }
  105837. },
  105838. methods: {
  105839. /** @public */
  105840. blur: function blur(e) {
  105841. _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_6__["default"].options.methods.blur.call(this, e);
  105842. this.isMenuActive = false;
  105843. this.isFocused = false;
  105844. this.selectedIndex = -1;
  105845. },
  105846. /** @public */
  105847. activateMenu: function activateMenu() {
  105848. if (this.disabled || this.readonly || this.isMenuActive) return;
  105849. this.isMenuActive = true;
  105850. },
  105851. clearableCallback: function clearableCallback() {
  105852. var _this = this;
  105853. this.setValue(this.multiple ? [] : undefined);
  105854. this.setMenuIndex(-1);
  105855. this.$nextTick(function () {
  105856. return _this.$refs.input && _this.$refs.input.focus();
  105857. });
  105858. if (this.openOnClear) this.isMenuActive = true;
  105859. },
  105860. closeConditional: function closeConditional(e) {
  105861. if (!this.isMenuActive) return true;
  105862. return !this._isDestroyed && ( // Click originates from outside the menu content
  105863. // Multiple selects don't close when an item is clicked
  105864. !this.getContent() || !this.getContent().contains(e.target)) && // Click originates from outside the element
  105865. this.$el && !this.$el.contains(e.target) && e.target !== this.$el;
  105866. },
  105867. filterDuplicates: function filterDuplicates(arr) {
  105868. var uniqueValues = new Map();
  105869. for (var index = 0; index < arr.length; ++index) {
  105870. var item = arr[index];
  105871. var val = this.getValue(item); // TODO: comparator
  105872. !uniqueValues.has(val) && uniqueValues.set(val, item);
  105873. }
  105874. return Array.from(uniqueValues.values());
  105875. },
  105876. findExistingIndex: function findExistingIndex(item) {
  105877. var _this = this;
  105878. var itemValue = this.getValue(item);
  105879. return (this.internalValue || []).findIndex(function (i) {
  105880. return _this.valueComparator(_this.getValue(i), itemValue);
  105881. });
  105882. },
  105883. getContent: function getContent() {
  105884. return this.$refs.menu && this.$refs.menu.$refs.content;
  105885. },
  105886. genChipSelection: function genChipSelection(item, index) {
  105887. var _this = this;
  105888. var isDisabled = this.disabled || this.readonly || this.getDisabled(item);
  105889. return this.$createElement(_VChip__WEBPACK_IMPORTED_MODULE_2__["default"], {
  105890. staticClass: 'v-chip--select',
  105891. attrs: {
  105892. tabindex: -1
  105893. },
  105894. props: {
  105895. close: this.deletableChips && !isDisabled,
  105896. disabled: isDisabled,
  105897. inputValue: index === this.selectedIndex,
  105898. small: this.smallChips
  105899. },
  105900. on: {
  105901. click: function click(e) {
  105902. if (isDisabled) return;
  105903. e.stopPropagation();
  105904. _this.selectedIndex = index;
  105905. },
  105906. 'click:close': function clickClose() {
  105907. return _this.onChipInput(item);
  105908. }
  105909. },
  105910. key: JSON.stringify(this.getValue(item))
  105911. }, this.getText(item));
  105912. },
  105913. genCommaSelection: function genCommaSelection(item, index, last) {
  105914. var color = index === this.selectedIndex && this.computedColor;
  105915. var isDisabled = this.disabled || this.getDisabled(item);
  105916. return this.$createElement('div', this.setTextColor(color, {
  105917. staticClass: 'v-select__selection v-select__selection--comma',
  105918. class: {
  105919. 'v-select__selection--disabled': isDisabled
  105920. },
  105921. key: JSON.stringify(this.getValue(item))
  105922. }), "" + this.getText(item) + (last ? '' : ', '));
  105923. },
  105924. genDefaultSlot: function genDefaultSlot() {
  105925. var selections = this.genSelections();
  105926. var input = this.genInput(); // If the return is an empty array
  105927. // push the input
  105928. if (Array.isArray(selections)) {
  105929. selections.push(input); // Otherwise push it into children
  105930. } else {
  105931. selections.children = selections.children || [];
  105932. selections.children.push(input);
  105933. }
  105934. return [this.genFieldset(), this.$createElement('div', {
  105935. staticClass: 'v-select__slot',
  105936. directives: this.directives
  105937. }, [this.genLabel(), this.prefix ? this.genAffix('prefix') : null, selections, this.suffix ? this.genAffix('suffix') : null, this.genClearIcon(), this.genIconSlot(), this.genHiddenInput()]), this.genMenu(), this.genProgress()];
  105938. },
  105939. genIcon: function genIcon(type, cb, extraData) {
  105940. var icon = _VInput__WEBPACK_IMPORTED_MODULE_5__["default"].options.methods.genIcon.call(this, type, cb, extraData);
  105941. if (type === 'append') {
  105942. // Don't allow the dropdown icon to be focused
  105943. icon.children[0].data = Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_10__["default"])(icon.children[0].data, {
  105944. attrs: {
  105945. tabindex: icon.children[0].componentOptions.listeners && '-1',
  105946. 'aria-hidden': 'true',
  105947. 'aria-label': undefined
  105948. }
  105949. });
  105950. }
  105951. return icon;
  105952. },
  105953. genInput: function genInput() {
  105954. var input = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_6__["default"].options.methods.genInput.call(this);
  105955. delete input.data.attrs.name;
  105956. input.data = Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_10__["default"])(input.data, {
  105957. domProps: {
  105958. value: null
  105959. },
  105960. attrs: {
  105961. readonly: true,
  105962. type: 'text',
  105963. 'aria-readonly': String(this.readonly),
  105964. 'aria-activedescendant': Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["getObjectValueByPath"])(this.$refs.menu, 'activeTile.id'),
  105965. autocomplete: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["getObjectValueByPath"])(input.data, 'attrs.autocomplete', 'off')
  105966. },
  105967. on: {
  105968. keypress: this.onKeyPress
  105969. }
  105970. });
  105971. return input;
  105972. },
  105973. genHiddenInput: function genHiddenInput() {
  105974. return this.$createElement('input', {
  105975. domProps: {
  105976. value: this.lazyValue
  105977. },
  105978. attrs: {
  105979. type: 'hidden',
  105980. name: this.attrs$.name
  105981. }
  105982. });
  105983. },
  105984. genInputSlot: function genInputSlot() {
  105985. var render = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_6__["default"].options.methods.genInputSlot.call(this);
  105986. render.data.attrs = __assign({}, render.data.attrs, {
  105987. role: 'button',
  105988. 'aria-haspopup': 'listbox',
  105989. 'aria-expanded': String(this.isMenuActive),
  105990. 'aria-owns': this.computedOwns
  105991. });
  105992. return render;
  105993. },
  105994. genList: function genList() {
  105995. // If there's no slots, we can use a cached VNode to improve performance
  105996. if (this.$slots['no-data'] || this.$slots['prepend-item'] || this.$slots['append-item']) {
  105997. return this.genListWithSlot();
  105998. } else {
  105999. return this.staticList;
  106000. }
  106001. },
  106002. genListWithSlot: function genListWithSlot() {
  106003. var _this = this;
  106004. var slots = ['prepend-item', 'no-data', 'append-item'].filter(function (slotName) {
  106005. return _this.$slots[slotName];
  106006. }).map(function (slotName) {
  106007. return _this.$createElement('template', {
  106008. slot: slotName
  106009. }, _this.$slots[slotName]);
  106010. }); // Requires destructuring due to Vue
  106011. // modifying the `on` property when passed
  106012. // as a referenced object
  106013. return this.$createElement(_VSelectList__WEBPACK_IMPORTED_MODULE_4__["default"], __assign({}, this.listData), slots);
  106014. },
  106015. genMenu: function genMenu() {
  106016. var _this = this;
  106017. var props = this.$_menuProps;
  106018. props.activator = this.$refs['input-slot']; // Attach to root el so that
  106019. // menu covers prepend/append icons
  106020. if ( // TODO: make this a computed property or helper or something
  106021. this.attach === '' || // If used as a boolean prop (<v-menu attach>)
  106022. this.attach === true || // If bound to a boolean (<v-menu :attach="true">)
  106023. this.attach === 'attach' // If bound as boolean prop in pug (v-menu(attach))
  106024. ) {
  106025. props.attach = this.$el;
  106026. } else {
  106027. props.attach = this.attach;
  106028. }
  106029. return this.$createElement(_VMenu__WEBPACK_IMPORTED_MODULE_3__["default"], {
  106030. attrs: {
  106031. role: undefined,
  106032. offsetY: true
  106033. },
  106034. props: props,
  106035. on: {
  106036. input: function input(val) {
  106037. _this.isMenuActive = val;
  106038. _this.isFocused = val;
  106039. }
  106040. },
  106041. ref: 'menu'
  106042. }, [this.genList()]);
  106043. },
  106044. genSelections: function genSelections() {
  106045. var length = this.selectedItems.length;
  106046. var children = new Array(length);
  106047. var genSelection;
  106048. if (this.$scopedSlots.selection) {
  106049. genSelection = this.genSlotSelection;
  106050. } else if (this.hasChips) {
  106051. genSelection = this.genChipSelection;
  106052. } else {
  106053. genSelection = this.genCommaSelection;
  106054. }
  106055. while (length--) {
  106056. children[length] = genSelection(this.selectedItems[length], length, length === children.length - 1);
  106057. }
  106058. return this.$createElement('div', {
  106059. staticClass: 'v-select__selections'
  106060. }, children);
  106061. },
  106062. genSlotSelection: function genSlotSelection(item, index) {
  106063. var _this = this;
  106064. return this.$scopedSlots.selection({
  106065. attrs: {
  106066. class: 'v-chip--select'
  106067. },
  106068. parent: this,
  106069. item: item,
  106070. index: index,
  106071. select: function select(e) {
  106072. e.stopPropagation();
  106073. _this.selectedIndex = index;
  106074. },
  106075. selected: index === this.selectedIndex,
  106076. disabled: this.disabled || this.readonly
  106077. });
  106078. },
  106079. getMenuIndex: function getMenuIndex() {
  106080. return this.$refs.menu ? this.$refs.menu.listIndex : -1;
  106081. },
  106082. getDisabled: function getDisabled(item) {
  106083. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["getPropertyFromItem"])(item, this.itemDisabled, false);
  106084. },
  106085. getText: function getText(item) {
  106086. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["getPropertyFromItem"])(item, this.itemText, item);
  106087. },
  106088. getValue: function getValue(item) {
  106089. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_11__["getPropertyFromItem"])(item, this.itemValue, this.getText(item));
  106090. },
  106091. onBlur: function onBlur(e) {
  106092. e && this.$emit('blur', e);
  106093. },
  106094. onChipInput: function onChipInput(item) {
  106095. if (this.multiple) this.selectItem(item);else this.setValue(null); // If all items have been deleted,
  106096. // open `v-menu`
  106097. if (this.selectedItems.length === 0) {
  106098. this.isMenuActive = true;
  106099. } else {
  106100. this.isMenuActive = false;
  106101. }
  106102. this.selectedIndex = -1;
  106103. },
  106104. onClick: function onClick(e) {
  106105. if (this.isDisabled) return;
  106106. if (!this.isAppendInner(e.target)) {
  106107. this.isMenuActive = true;
  106108. }
  106109. if (!this.isFocused) {
  106110. this.isFocused = true;
  106111. this.$emit('focus');
  106112. }
  106113. this.$emit('click', e);
  106114. },
  106115. onEscDown: function onEscDown(e) {
  106116. e.preventDefault();
  106117. if (this.isMenuActive) {
  106118. e.stopPropagation();
  106119. this.isMenuActive = false;
  106120. }
  106121. },
  106122. onKeyPress: function onKeyPress(e) {
  106123. var _this = this;
  106124. if (this.multiple || this.readonly || this.disableLookup) return;
  106125. var KEYBOARD_LOOKUP_THRESHOLD = 1000; // milliseconds
  106126. var now = performance.now();
  106127. if (now - this.keyboardLookupLastTime > KEYBOARD_LOOKUP_THRESHOLD) {
  106128. this.keyboardLookupPrefix = '';
  106129. }
  106130. this.keyboardLookupPrefix += e.key.toLowerCase();
  106131. this.keyboardLookupLastTime = now;
  106132. var index = this.allItems.findIndex(function (item) {
  106133. var text = (_this.getText(item) || '').toString();
  106134. return text.toLowerCase().startsWith(_this.keyboardLookupPrefix);
  106135. });
  106136. var item = this.allItems[index];
  106137. if (index !== -1) {
  106138. this.lastItem = Math.max(this.lastItem, index + 5);
  106139. this.setValue(this.returnObject ? item : this.getValue(item));
  106140. this.$nextTick(function () {
  106141. return _this.$refs.menu.getTiles();
  106142. });
  106143. setTimeout(function () {
  106144. return _this.setMenuIndex(index);
  106145. });
  106146. }
  106147. },
  106148. onKeyDown: function onKeyDown(e) {
  106149. var _this = this;
  106150. if (this.readonly && e.keyCode !== _util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].tab) return;
  106151. var keyCode = e.keyCode;
  106152. var menu = this.$refs.menu; // If enter, space, open menu
  106153. if ([_util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].enter, _util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].space].includes(keyCode)) this.activateMenu();
  106154. this.$emit('keydown', e);
  106155. if (!menu) return; // If menu is active, allow default
  106156. // listIndex change from menu
  106157. if (this.isMenuActive && keyCode !== _util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].tab) {
  106158. this.$nextTick(function () {
  106159. menu.changeListIndex(e);
  106160. _this.$emit('update:list-index', menu.listIndex);
  106161. });
  106162. } // If menu is not active, up and down can do
  106163. // one of 2 things. If multiple, opens the
  106164. // menu, if not, will cycle through all
  106165. // available options
  106166. if (!this.isMenuActive && [_util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].up, _util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].down].includes(keyCode)) return this.onUpDown(e); // If escape deactivate the menu
  106167. if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].esc) return this.onEscDown(e); // If tab - select item or close menu
  106168. if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].tab) return this.onTabDown(e); // If space preventDefault
  106169. if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].space) return this.onSpaceDown(e);
  106170. },
  106171. onMenuActiveChange: function onMenuActiveChange(val) {
  106172. // If menu is closing and mulitple
  106173. // or menuIndex is already set
  106174. // skip menu index recalculation
  106175. if (this.multiple && !val || this.getMenuIndex() > -1) return;
  106176. var menu = this.$refs.menu;
  106177. if (!menu || !this.isDirty) return; // When menu opens, set index of first active item
  106178. for (var i = 0; i < menu.tiles.length; i++) {
  106179. if (menu.tiles[i].getAttribute('aria-selected') === 'true') {
  106180. this.setMenuIndex(i);
  106181. break;
  106182. }
  106183. }
  106184. },
  106185. onMouseUp: function onMouseUp(e) {
  106186. var _this = this;
  106187. if (this.hasMouseDown && e.which !== 3 && !this.isDisabled) {
  106188. // If append inner is present
  106189. // and the target is itself
  106190. // or inside, toggle menu
  106191. if (this.isAppendInner(e.target)) {
  106192. this.$nextTick(function () {
  106193. return _this.isMenuActive = !_this.isMenuActive;
  106194. }); // If user is clicking in the container
  106195. // and field is enclosed, activate it
  106196. } else if (this.isEnclosed) {
  106197. this.isMenuActive = true;
  106198. }
  106199. }
  106200. _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_6__["default"].options.methods.onMouseUp.call(this, e);
  106201. },
  106202. onScroll: function onScroll() {
  106203. var _this = this;
  106204. if (!this.isMenuActive) {
  106205. requestAnimationFrame(function () {
  106206. return _this.getContent().scrollTop = 0;
  106207. });
  106208. } else {
  106209. if (this.lastItem >= this.computedItems.length) return;
  106210. var showMoreItems = this.getContent().scrollHeight - (this.getContent().scrollTop + this.getContent().clientHeight) < 200;
  106211. if (showMoreItems) {
  106212. this.lastItem += 20;
  106213. }
  106214. }
  106215. },
  106216. onSpaceDown: function onSpaceDown(e) {
  106217. e.preventDefault();
  106218. },
  106219. onTabDown: function onTabDown(e) {
  106220. var menu = this.$refs.menu;
  106221. if (!menu) return;
  106222. var activeTile = menu.activeTile; // An item that is selected by
  106223. // menu-index should toggled
  106224. if (!this.multiple && activeTile && this.isMenuActive) {
  106225. e.preventDefault();
  106226. e.stopPropagation();
  106227. activeTile.click();
  106228. } else {
  106229. // If we make it here,
  106230. // the user has no selected indexes
  106231. // and is probably tabbing out
  106232. this.blur(e);
  106233. }
  106234. },
  106235. onUpDown: function onUpDown(e) {
  106236. var menu = this.$refs.menu;
  106237. if (!menu) return;
  106238. e.preventDefault(); // Multiple selects do not cycle their value
  106239. // when pressing up or down, instead activate
  106240. // the menu
  106241. if (this.multiple) return this.activateMenu();
  106242. var keyCode = e.keyCode; // Cycle through available values to achieve
  106243. // select native behavior
  106244. menu.isBooted = true;
  106245. window.requestAnimationFrame(function () {
  106246. menu.getTiles();
  106247. _util_helpers__WEBPACK_IMPORTED_MODULE_11__["keyCodes"].up === keyCode ? menu.prevTile() : menu.nextTile();
  106248. menu.activeTile && menu.activeTile.click();
  106249. });
  106250. },
  106251. selectItem: function selectItem(item) {
  106252. var _this = this;
  106253. if (!this.multiple) {
  106254. this.setValue(this.returnObject ? item : this.getValue(item));
  106255. this.isMenuActive = false;
  106256. } else {
  106257. var internalValue = (this.internalValue || []).slice();
  106258. var i = this.findExistingIndex(item);
  106259. i !== -1 ? internalValue.splice(i, 1) : internalValue.push(item);
  106260. this.setValue(internalValue.map(function (i) {
  106261. return _this.returnObject ? i : _this.getValue(i);
  106262. })); // When selecting multiple
  106263. // adjust menu after each
  106264. // selection
  106265. this.$nextTick(function () {
  106266. _this.$refs.menu && _this.$refs.menu.updateDimensions();
  106267. }); // We only need to reset list index for multiple
  106268. // to keep highlight when an item is toggled
  106269. // on and off
  106270. if (!this.multiple) return;
  106271. var listIndex_1 = this.getMenuIndex();
  106272. this.setMenuIndex(-1); // There is no item to re-highlight
  106273. // when selections are hidden
  106274. if (this.hideSelected) return;
  106275. this.$nextTick(function () {
  106276. return _this.setMenuIndex(listIndex_1);
  106277. });
  106278. }
  106279. },
  106280. setMenuIndex: function setMenuIndex(index) {
  106281. this.$refs.menu && (this.$refs.menu.listIndex = index);
  106282. },
  106283. setSelectedItems: function setSelectedItems() {
  106284. var e_1, _a;
  106285. var _this = this;
  106286. var selectedItems = [];
  106287. var values = !this.multiple || !Array.isArray(this.internalValue) ? [this.internalValue] : this.internalValue;
  106288. var _loop_1 = function _loop_1(value) {
  106289. var index = this_1.allItems.findIndex(function (v) {
  106290. return _this.valueComparator(_this.getValue(v), _this.getValue(value));
  106291. });
  106292. if (index > -1) {
  106293. selectedItems.push(this_1.allItems[index]);
  106294. }
  106295. };
  106296. var this_1 = this;
  106297. try {
  106298. for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
  106299. var value = values_1_1.value;
  106300. _loop_1(value);
  106301. }
  106302. } catch (e_1_1) {
  106303. e_1 = {
  106304. error: e_1_1
  106305. };
  106306. } finally {
  106307. try {
  106308. if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
  106309. } finally {
  106310. if (e_1) throw e_1.error;
  106311. }
  106312. }
  106313. this.selectedItems = selectedItems;
  106314. },
  106315. setValue: function setValue(value) {
  106316. var oldValue = this.internalValue;
  106317. this.internalValue = value;
  106318. value !== oldValue && this.$emit('change', value);
  106319. },
  106320. isAppendInner: function isAppendInner(target) {
  106321. // return true if append inner is present
  106322. // and the target is itself or inside
  106323. var appendInner = this.$refs['append-inner'];
  106324. return appendInner && (appendInner === target || appendInner.contains(target));
  106325. }
  106326. }
  106327. }));
  106328. /***/ }),
  106329. /***/ "./src/components/VSelect/VSelectList.ts":
  106330. /*!***********************************************!*\
  106331. !*** ./src/components/VSelect/VSelectList.ts ***!
  106332. \***********************************************/
  106333. /*! exports provided: default */
  106334. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106335. "use strict";
  106336. __webpack_require__.r(__webpack_exports__);
  106337. /* harmony import */ var _VCheckbox_VSimpleCheckbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VCheckbox/VSimpleCheckbox */ "./src/components/VCheckbox/VSimpleCheckbox.ts");
  106338. /* harmony import */ var _VDivider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VDivider */ "./src/components/VDivider/index.ts");
  106339. /* harmony import */ var _VSubheader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VSubheader */ "./src/components/VSubheader/index.ts");
  106340. /* harmony import */ var _VList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VList */ "./src/components/VList/index.ts");
  106341. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  106342. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  106343. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  106344. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  106345. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  106346. var __assign = undefined && undefined.__assign || function () {
  106347. __assign = Object.assign || function (t) {
  106348. for (var s, i = 1, n = arguments.length; i < n; i++) {
  106349. s = arguments[i];
  106350. for (var p in s) {
  106351. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  106352. }
  106353. }
  106354. return t;
  106355. };
  106356. return __assign.apply(this, arguments);
  106357. }; // Components
  106358. // Directives
  106359. // Mixins
  106360. // Helpers
  106361. // Types
  106362. /* @vue/component */
  106363. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_8__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__["default"]).extend({
  106364. name: 'v-select-list',
  106365. // https://github.com/vuejs/vue/issues/6872
  106366. directives: {
  106367. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_4__["default"]
  106368. },
  106369. props: {
  106370. action: Boolean,
  106371. dense: Boolean,
  106372. hideSelected: Boolean,
  106373. items: {
  106374. type: Array,
  106375. default: function _default() {
  106376. return [];
  106377. }
  106378. },
  106379. itemDisabled: {
  106380. type: [String, Array, Function],
  106381. default: 'disabled'
  106382. },
  106383. itemText: {
  106384. type: [String, Array, Function],
  106385. default: 'text'
  106386. },
  106387. itemValue: {
  106388. type: [String, Array, Function],
  106389. default: 'value'
  106390. },
  106391. noDataText: String,
  106392. noFilter: Boolean,
  106393. searchInput: null,
  106394. selectedItems: {
  106395. type: Array,
  106396. default: function _default() {
  106397. return [];
  106398. }
  106399. }
  106400. },
  106401. computed: {
  106402. parsedItems: function parsedItems() {
  106403. var _this = this;
  106404. return this.selectedItems.map(function (item) {
  106405. return _this.getValue(item);
  106406. });
  106407. },
  106408. tileActiveClass: function tileActiveClass() {
  106409. return Object.keys(this.setTextColor(this.color).class || {}).join(' ');
  106410. },
  106411. staticNoDataTile: function staticNoDataTile() {
  106412. var tile = {
  106413. attrs: {
  106414. role: undefined
  106415. },
  106416. on: {
  106417. mousedown: function mousedown(e) {
  106418. return e.preventDefault();
  106419. }
  106420. }
  106421. };
  106422. return this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_3__["VListItem"], tile, [this.genTileContent(this.noDataText)]);
  106423. }
  106424. },
  106425. methods: {
  106426. genAction: function genAction(item, inputValue) {
  106427. var _this = this;
  106428. return this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_3__["VListItemAction"], [this.$createElement(_VCheckbox_VSimpleCheckbox__WEBPACK_IMPORTED_MODULE_0__["default"], {
  106429. props: {
  106430. color: this.color,
  106431. value: inputValue
  106432. },
  106433. on: {
  106434. input: function input() {
  106435. return _this.$emit('select', item);
  106436. }
  106437. }
  106438. })]);
  106439. },
  106440. genDivider: function genDivider(props) {
  106441. return this.$createElement(_VDivider__WEBPACK_IMPORTED_MODULE_1__["default"], {
  106442. props: props
  106443. });
  106444. },
  106445. genFilteredText: function genFilteredText(text) {
  106446. text = text || '';
  106447. if (!this.searchInput || this.noFilter) return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["escapeHTML"])(text);
  106448. var _a = this.getMaskedCharacters(text),
  106449. start = _a.start,
  106450. middle = _a.middle,
  106451. end = _a.end;
  106452. return "" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["escapeHTML"])(start) + this.genHighlight(middle) + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["escapeHTML"])(end);
  106453. },
  106454. genHeader: function genHeader(props) {
  106455. return this.$createElement(_VSubheader__WEBPACK_IMPORTED_MODULE_2__["default"], {
  106456. props: props
  106457. }, props.header);
  106458. },
  106459. genHighlight: function genHighlight(text) {
  106460. return "<span class=\"v-list-item__mask\">" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["escapeHTML"])(text) + "</span>";
  106461. },
  106462. getMaskedCharacters: function getMaskedCharacters(text) {
  106463. var searchInput = (this.searchInput || '').toString().toLocaleLowerCase();
  106464. var index = text.toLocaleLowerCase().indexOf(searchInput);
  106465. if (index < 0) return {
  106466. start: '',
  106467. middle: text,
  106468. end: ''
  106469. };
  106470. var start = text.slice(0, index);
  106471. var middle = text.slice(index, index + searchInput.length);
  106472. var end = text.slice(index + searchInput.length);
  106473. return {
  106474. start: start,
  106475. middle: middle,
  106476. end: end
  106477. };
  106478. },
  106479. genTile: function genTile(_a) {
  106480. var _this = this;
  106481. var item = _a.item,
  106482. index = _a.index,
  106483. _b = _a.disabled,
  106484. disabled = _b === void 0 ? null : _b,
  106485. _c = _a.value,
  106486. value = _c === void 0 ? false : _c;
  106487. if (!value) value = this.hasItem(item);
  106488. if (item === Object(item)) {
  106489. disabled = disabled !== null ? disabled : this.getDisabled(item);
  106490. }
  106491. var tile = {
  106492. attrs: {
  106493. // Default behavior in list does not
  106494. // contain aria-selected by default
  106495. 'aria-selected': String(value),
  106496. id: "list-item-" + this._uid + "-" + index,
  106497. role: 'option'
  106498. },
  106499. on: {
  106500. mousedown: function mousedown(e) {
  106501. // Prevent onBlur from being called
  106502. e.preventDefault();
  106503. },
  106504. click: function click() {
  106505. return disabled || _this.$emit('select', item);
  106506. }
  106507. },
  106508. props: {
  106509. activeClass: this.tileActiveClass,
  106510. disabled: disabled,
  106511. ripple: true,
  106512. inputValue: value
  106513. }
  106514. };
  106515. if (!this.$scopedSlots.item) {
  106516. return this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_3__["VListItem"], tile, [this.action && !this.hideSelected && this.items.length > 0 ? this.genAction(item, value) : null, this.genTileContent(item, index)]);
  106517. }
  106518. var parent = this;
  106519. var scopedSlot = this.$scopedSlots.item({
  106520. parent: parent,
  106521. item: item,
  106522. attrs: __assign({}, tile.attrs, tile.props),
  106523. on: tile.on
  106524. });
  106525. return this.needsTile(scopedSlot) ? this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_3__["VListItem"], tile, scopedSlot) : scopedSlot;
  106526. },
  106527. genTileContent: function genTileContent(item, index) {
  106528. if (index === void 0) {
  106529. index = 0;
  106530. }
  106531. var innerHTML = this.genFilteredText(this.getText(item));
  106532. return this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_3__["VListItemContent"], [this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_3__["VListItemTitle"], {
  106533. domProps: {
  106534. innerHTML: innerHTML
  106535. }
  106536. })]);
  106537. },
  106538. hasItem: function hasItem(item) {
  106539. return this.parsedItems.indexOf(this.getValue(item)) > -1;
  106540. },
  106541. needsTile: function needsTile(slot) {
  106542. return slot.length !== 1 || slot[0].componentOptions == null || slot[0].componentOptions.Ctor.options.name !== 'v-list-item';
  106543. },
  106544. getDisabled: function getDisabled(item) {
  106545. return Boolean(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["getPropertyFromItem"])(item, this.itemDisabled, false));
  106546. },
  106547. getText: function getText(item) {
  106548. return String(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["getPropertyFromItem"])(item, this.itemText, item));
  106549. },
  106550. getValue: function getValue(item) {
  106551. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["getPropertyFromItem"])(item, this.itemValue, this.getText(item));
  106552. }
  106553. },
  106554. render: function render() {
  106555. var children = [];
  106556. var itemsLength = this.items.length;
  106557. for (var index = 0; index < itemsLength; index++) {
  106558. var item = this.items[index];
  106559. if (this.hideSelected && this.hasItem(item)) continue;
  106560. if (item == null) children.push(this.genTile({
  106561. item: item,
  106562. index: index
  106563. }));else if (item.header) children.push(this.genHeader(item));else if (item.divider) children.push(this.genDivider(item));else children.push(this.genTile({
  106564. item: item,
  106565. index: index
  106566. }));
  106567. }
  106568. children.length || children.push(this.$slots['no-data'] || this.staticNoDataTile);
  106569. this.$slots['prepend-item'] && children.unshift(this.$slots['prepend-item']);
  106570. this.$slots['append-item'] && children.push(this.$slots['append-item']);
  106571. return this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_3__["VList"], {
  106572. staticClass: 'v-select-list',
  106573. class: this.themeClasses,
  106574. attrs: {
  106575. role: 'listbox',
  106576. tabindex: -1
  106577. },
  106578. props: {
  106579. dense: this.dense
  106580. }
  106581. }, children);
  106582. }
  106583. }));
  106584. /***/ }),
  106585. /***/ "./src/components/VSelect/index.ts":
  106586. /*!*****************************************!*\
  106587. !*** ./src/components/VSelect/index.ts ***!
  106588. \*****************************************/
  106589. /*! exports provided: VSelect, default */
  106590. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106591. "use strict";
  106592. __webpack_require__.r(__webpack_exports__);
  106593. /* harmony import */ var _VSelect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSelect */ "./src/components/VSelect/VSelect.ts");
  106594. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSelect", function() { return _VSelect__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  106595. /* harmony default export */ __webpack_exports__["default"] = (_VSelect__WEBPACK_IMPORTED_MODULE_0__["default"]);
  106596. /***/ }),
  106597. /***/ "./src/components/VSheet/VSheet.sass":
  106598. /*!*******************************************!*\
  106599. !*** ./src/components/VSheet/VSheet.sass ***!
  106600. \*******************************************/
  106601. /*! no static exports found */
  106602. /***/ (function(module, exports, __webpack_require__) {
  106603. // extracted by mini-css-extract-plugin
  106604. /***/ }),
  106605. /***/ "./src/components/VSheet/VSheet.ts":
  106606. /*!*****************************************!*\
  106607. !*** ./src/components/VSheet/VSheet.ts ***!
  106608. \*****************************************/
  106609. /*! exports provided: default */
  106610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106611. "use strict";
  106612. __webpack_require__.r(__webpack_exports__);
  106613. /* harmony import */ var _VSheet_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSheet.sass */ "./src/components/VSheet/VSheet.sass");
  106614. /* harmony import */ var _VSheet_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSheet_sass__WEBPACK_IMPORTED_MODULE_0__);
  106615. /* harmony import */ var _mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/binds-attrs */ "./src/mixins/binds-attrs/index.ts");
  106616. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  106617. /* harmony import */ var _mixins_elevatable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/elevatable */ "./src/mixins/elevatable/index.ts");
  106618. /* harmony import */ var _mixins_measurable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/measurable */ "./src/mixins/measurable/index.ts");
  106619. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  106620. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  106621. var __assign = undefined && undefined.__assign || function () {
  106622. __assign = Object.assign || function (t) {
  106623. for (var s, i = 1, n = arguments.length; i < n; i++) {
  106624. s = arguments[i];
  106625. for (var p in s) {
  106626. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  106627. }
  106628. }
  106629. return t;
  106630. };
  106631. return __assign.apply(this, arguments);
  106632. }; // Styles
  106633. // Mixins
  106634. // Helpers
  106635. /* @vue/component */
  106636. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_6__["default"])(_mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_elevatable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_measurable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__["default"]).extend({
  106637. name: 'v-sheet',
  106638. props: {
  106639. tag: {
  106640. type: String,
  106641. default: 'div'
  106642. },
  106643. tile: Boolean
  106644. },
  106645. computed: {
  106646. classes: function classes() {
  106647. return __assign({
  106648. 'v-sheet': true,
  106649. 'v-sheet--tile': this.tile
  106650. }, this.themeClasses, this.elevationClasses);
  106651. },
  106652. styles: function styles() {
  106653. return this.measurableStyles;
  106654. }
  106655. },
  106656. render: function render(h) {
  106657. var data = {
  106658. class: this.classes,
  106659. style: this.styles,
  106660. on: this.listeners$
  106661. };
  106662. return h(this.tag, this.setBackgroundColor(this.color, data), this.$slots.default);
  106663. }
  106664. }));
  106665. /***/ }),
  106666. /***/ "./src/components/VSheet/index.ts":
  106667. /*!****************************************!*\
  106668. !*** ./src/components/VSheet/index.ts ***!
  106669. \****************************************/
  106670. /*! exports provided: VSheet, default */
  106671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106672. "use strict";
  106673. __webpack_require__.r(__webpack_exports__);
  106674. /* harmony import */ var _VSheet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSheet */ "./src/components/VSheet/VSheet.ts");
  106675. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSheet", function() { return _VSheet__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  106676. /* harmony default export */ __webpack_exports__["default"] = (_VSheet__WEBPACK_IMPORTED_MODULE_0__["default"]);
  106677. /***/ }),
  106678. /***/ "./src/components/VSkeletonLoader/VSkeletonLoader.sass":
  106679. /*!*************************************************************!*\
  106680. !*** ./src/components/VSkeletonLoader/VSkeletonLoader.sass ***!
  106681. \*************************************************************/
  106682. /*! no static exports found */
  106683. /***/ (function(module, exports, __webpack_require__) {
  106684. // extracted by mini-css-extract-plugin
  106685. /***/ }),
  106686. /***/ "./src/components/VSkeletonLoader/VSkeletonLoader.ts":
  106687. /*!***********************************************************!*\
  106688. !*** ./src/components/VSkeletonLoader/VSkeletonLoader.ts ***!
  106689. \***********************************************************/
  106690. /*! exports provided: default */
  106691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106692. "use strict";
  106693. __webpack_require__.r(__webpack_exports__);
  106694. /* harmony import */ var _VSkeletonLoader_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSkeletonLoader.sass */ "./src/components/VSkeletonLoader/VSkeletonLoader.sass");
  106695. /* harmony import */ var _VSkeletonLoader_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSkeletonLoader_sass__WEBPACK_IMPORTED_MODULE_0__);
  106696. /* harmony import */ var _mixins_elevatable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/elevatable */ "./src/mixins/elevatable/index.ts");
  106697. /* harmony import */ var _mixins_measurable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/measurable */ "./src/mixins/measurable/index.ts");
  106698. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  106699. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  106700. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  106701. var __assign = undefined && undefined.__assign || function () {
  106702. __assign = Object.assign || function (t) {
  106703. for (var s, i = 1, n = arguments.length; i < n; i++) {
  106704. s = arguments[i];
  106705. for (var p in s) {
  106706. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  106707. }
  106708. }
  106709. return t;
  106710. };
  106711. return __assign.apply(this, arguments);
  106712. };
  106713. var __read = undefined && undefined.__read || function (o, n) {
  106714. var m = typeof Symbol === "function" && o[Symbol.iterator];
  106715. if (!m) return o;
  106716. var i = m.call(o),
  106717. r,
  106718. ar = [],
  106719. e;
  106720. try {
  106721. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  106722. ar.push(r.value);
  106723. }
  106724. } catch (error) {
  106725. e = {
  106726. error: error
  106727. };
  106728. } finally {
  106729. try {
  106730. if (r && !r.done && (m = i["return"])) m.call(i);
  106731. } finally {
  106732. if (e) throw e.error;
  106733. }
  106734. }
  106735. return ar;
  106736. }; // Styles
  106737. // Mixins
  106738. // Utilities
  106739. /* @vue/component */
  106740. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_elevatable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_measurable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]).extend({
  106741. name: 'VSkeletonLoader',
  106742. props: {
  106743. boilerplate: Boolean,
  106744. loading: Boolean,
  106745. tile: Boolean,
  106746. transition: String,
  106747. type: String,
  106748. types: {
  106749. type: Object,
  106750. default: function _default() {
  106751. return {};
  106752. }
  106753. }
  106754. },
  106755. computed: {
  106756. attrs: function attrs() {
  106757. if (!this.isLoading) return this.$attrs;
  106758. return !this.boilerplate ? __assign({
  106759. 'aria-busy': true,
  106760. 'aria-live': 'polite',
  106761. role: 'alert'
  106762. }, this.$attrs) : {};
  106763. },
  106764. classes: function classes() {
  106765. return __assign({
  106766. 'v-skeleton-loader--boilerplate': this.boilerplate,
  106767. 'v-skeleton-loader--is-loading': this.isLoading,
  106768. 'v-skeleton-loader--tile': this.tile
  106769. }, this.themeClasses, this.elevationClasses);
  106770. },
  106771. isLoading: function isLoading() {
  106772. return !('default' in this.$scopedSlots) || this.loading;
  106773. },
  106774. rootTypes: function rootTypes() {
  106775. return __assign({
  106776. actions: 'button@2',
  106777. article: 'heading, paragraph',
  106778. avatar: 'avatar',
  106779. button: 'button',
  106780. card: 'image, card-heading',
  106781. 'card-avatar': 'image, list-item-avatar',
  106782. 'card-heading': 'heading',
  106783. chip: 'chip',
  106784. 'date-picker': 'list-item, card-heading, divider, date-picker-options, date-picker-days, actions',
  106785. 'date-picker-options': 'text, avatar@2',
  106786. 'date-picker-days': 'avatar@28',
  106787. heading: 'heading',
  106788. image: 'image',
  106789. 'list-item': 'text',
  106790. 'list-item-avatar': 'avatar, text',
  106791. 'list-item-two-line': 'sentences',
  106792. 'list-item-avatar-two-line': 'avatar, sentences',
  106793. 'list-item-three-line': 'paragraph',
  106794. 'list-item-avatar-three-line': 'avatar, paragraph',
  106795. paragraph: 'text@3',
  106796. sentences: 'text@2',
  106797. table: 'table-heading, table-thead, table-tbody, table-tfoot',
  106798. 'table-heading': 'heading, text',
  106799. 'table-thead': 'heading@6',
  106800. 'table-tbody': 'table-row-divider@6',
  106801. 'table-row-divider': 'table-row, divider',
  106802. 'table-row': 'table-cell@6',
  106803. 'table-cell': 'text',
  106804. 'table-tfoot': 'text@2, avatar@2',
  106805. text: 'text'
  106806. }, this.types);
  106807. }
  106808. },
  106809. methods: {
  106810. genBone: function genBone(text, children) {
  106811. return this.$createElement('div', {
  106812. staticClass: "v-skeleton-loader__" + text + " v-skeleton-loader__bone"
  106813. }, children);
  106814. },
  106815. genBones: function genBones(bone) {
  106816. var _this = this; // e.g. 'text@3'
  106817. var _a = __read(bone.split('@'), 2),
  106818. type = _a[0],
  106819. length = _a[1];
  106820. var generator = function generator() {
  106821. return _this.genStructure(type);
  106822. }; // Generate a length array based upon
  106823. // value after @ in the bone string
  106824. return Array.from({
  106825. length: length
  106826. }).map(generator);
  106827. },
  106828. // Fix type when this is merged
  106829. // https://github.com/microsoft/TypeScript/pull/33050
  106830. genStructure: function genStructure(type) {
  106831. var children = [];
  106832. type = type || this.type || '';
  106833. var bone = this.rootTypes[type] || ''; // End of recursion, do nothing
  106834. /* eslint-disable-next-line no-empty, brace-style */
  106835. if (type === bone) {} // Array of values - e.g. 'heading, paragraph, text@2'
  106836. else if (type.indexOf(',') > -1) return this.mapBones(type); // Array of values - e.g. 'paragraph@4'
  106837. else if (type.indexOf('@') > -1) return this.genBones(type); // Array of values - e.g. 'card@2'
  106838. else if (bone.indexOf(',') > -1) children = this.mapBones(bone); // Array of values - e.g. 'list-item@2'
  106839. else if (bone.indexOf('@') > -1) children = this.genBones(bone); // Single value - e.g. 'card-heading'
  106840. else if (bone) children.push(this.genStructure(bone));
  106841. return [this.genBone(type, children)];
  106842. },
  106843. genSkeleton: function genSkeleton() {
  106844. var children = [];
  106845. if (!this.isLoading) children.push(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["getSlot"])(this));else children.push(this.genStructure());
  106846. /* istanbul ignore else */
  106847. if (!this.transition) return children;
  106848. /* istanbul ignore next */
  106849. return this.$createElement('transition', {
  106850. props: {
  106851. name: this.transition
  106852. },
  106853. // Only show transition when
  106854. // content has been loaded
  106855. on: {
  106856. afterEnter: this.resetStyles,
  106857. beforeEnter: this.onBeforeEnter,
  106858. beforeLeave: this.onBeforeLeave,
  106859. leaveCancelled: this.resetStyles
  106860. }
  106861. }, children);
  106862. },
  106863. mapBones: function mapBones(bones) {
  106864. // Remove spaces and return array of structures
  106865. return bones.replace(/\s/g, '').split(',').map(this.genStructure);
  106866. },
  106867. onBeforeEnter: function onBeforeEnter(el) {
  106868. this.resetStyles(el);
  106869. if (!this.isLoading) return;
  106870. el._initialStyle = {
  106871. display: el.style.display,
  106872. transition: el.style.transition
  106873. };
  106874. el.style.setProperty('transition', 'none', 'important');
  106875. },
  106876. onBeforeLeave: function onBeforeLeave(el) {
  106877. el.style.setProperty('display', 'none', 'important');
  106878. },
  106879. resetStyles: function resetStyles(el) {
  106880. if (!el._initialStyle) return;
  106881. el.style.display = el._initialStyle.display || '';
  106882. el.style.transition = el._initialStyle.transition;
  106883. delete el._initialStyle;
  106884. }
  106885. },
  106886. render: function render(h) {
  106887. return h('div', {
  106888. staticClass: 'v-skeleton-loader',
  106889. attrs: this.attrs,
  106890. on: this.$listeners,
  106891. class: this.classes,
  106892. style: this.isLoading ? this.measurableStyles : undefined
  106893. }, [this.genSkeleton()]);
  106894. }
  106895. }));
  106896. /***/ }),
  106897. /***/ "./src/components/VSkeletonLoader/index.ts":
  106898. /*!*************************************************!*\
  106899. !*** ./src/components/VSkeletonLoader/index.ts ***!
  106900. \*************************************************/
  106901. /*! exports provided: VSkeletonLoader, default */
  106902. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106903. "use strict";
  106904. __webpack_require__.r(__webpack_exports__);
  106905. /* harmony import */ var _VSkeletonLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSkeletonLoader */ "./src/components/VSkeletonLoader/VSkeletonLoader.ts");
  106906. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSkeletonLoader", function() { return _VSkeletonLoader__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  106907. /* harmony default export */ __webpack_exports__["default"] = (_VSkeletonLoader__WEBPACK_IMPORTED_MODULE_0__["default"]);
  106908. /***/ }),
  106909. /***/ "./src/components/VSlideGroup/VSlideGroup.sass":
  106910. /*!*****************************************************!*\
  106911. !*** ./src/components/VSlideGroup/VSlideGroup.sass ***!
  106912. \*****************************************************/
  106913. /*! no static exports found */
  106914. /***/ (function(module, exports, __webpack_require__) {
  106915. // extracted by mini-css-extract-plugin
  106916. /***/ }),
  106917. /***/ "./src/components/VSlideGroup/VSlideGroup.ts":
  106918. /*!***************************************************!*\
  106919. !*** ./src/components/VSlideGroup/VSlideGroup.ts ***!
  106920. \***************************************************/
  106921. /*! exports provided: BaseSlideGroup, default */
  106922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106923. "use strict";
  106924. __webpack_require__.r(__webpack_exports__);
  106925. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseSlideGroup", function() { return BaseSlideGroup; });
  106926. /* harmony import */ var _VSlideGroup_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSlideGroup.sass */ "./src/components/VSlideGroup/VSlideGroup.sass");
  106927. /* harmony import */ var _VSlideGroup_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSlideGroup_sass__WEBPACK_IMPORTED_MODULE_0__);
  106928. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  106929. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  106930. /* harmony import */ var _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VItemGroup/VItemGroup */ "./src/components/VItemGroup/VItemGroup.ts");
  106931. /* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize/index.ts");
  106932. /* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch/index.ts");
  106933. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  106934. var __assign = undefined && undefined.__assign || function () {
  106935. __assign = Object.assign || function (t) {
  106936. for (var s, i = 1, n = arguments.length; i < n; i++) {
  106937. s = arguments[i];
  106938. for (var p in s) {
  106939. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  106940. }
  106941. }
  106942. return t;
  106943. };
  106944. return __assign.apply(this, arguments);
  106945. }; // Styles
  106946. // Components
  106947. // Extensions
  106948. // Directives
  106949. // Utilities
  106950. var BaseSlideGroup = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_6__["default"])(_VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_3__["BaseItemGroup"]
  106951. /* @vue/component */
  106952. ).extend({
  106953. name: 'base-slide-group',
  106954. directives: {
  106955. Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_4__["default"],
  106956. Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_5__["default"]
  106957. },
  106958. props: {
  106959. activeClass: {
  106960. type: String,
  106961. default: 'v-slide-item--active'
  106962. },
  106963. centerActive: Boolean,
  106964. nextIcon: {
  106965. type: String,
  106966. default: '$next'
  106967. },
  106968. mobileBreakPoint: {
  106969. type: [Number, String],
  106970. default: 1264,
  106971. validator: function validator(v) {
  106972. return !isNaN(parseInt(v));
  106973. }
  106974. },
  106975. prevIcon: {
  106976. type: String,
  106977. default: '$prev'
  106978. },
  106979. showArrows: Boolean
  106980. },
  106981. data: function data() {
  106982. return {
  106983. internalItemsLength: 0,
  106984. isOverflowing: false,
  106985. resizeTimeout: 0,
  106986. startX: 0,
  106987. scrollOffset: 0,
  106988. widths: {
  106989. content: 0,
  106990. wrapper: 0
  106991. }
  106992. };
  106993. },
  106994. computed: {
  106995. __cachedNext: function __cachedNext() {
  106996. return this.genTransition('next');
  106997. },
  106998. __cachedPrev: function __cachedPrev() {
  106999. return this.genTransition('prev');
  107000. },
  107001. classes: function classes() {
  107002. return __assign({}, _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_3__["BaseItemGroup"].options.computed.classes.call(this), {
  107003. 'v-slide-group': true,
  107004. 'v-slide-group--has-affixes': this.hasAffixes,
  107005. 'v-slide-group--is-overflowing': this.isOverflowing
  107006. });
  107007. },
  107008. hasAffixes: function hasAffixes() {
  107009. return (this.showArrows || !this.isMobile) && this.isOverflowing;
  107010. },
  107011. hasNext: function hasNext() {
  107012. if (!this.hasAffixes) return false;
  107013. var _a = this.widths,
  107014. content = _a.content,
  107015. wrapper = _a.wrapper; // Check one scroll ahead to know the width of right-most item
  107016. return content > Math.abs(this.scrollOffset) + wrapper;
  107017. },
  107018. hasPrev: function hasPrev() {
  107019. return this.hasAffixes && this.scrollOffset !== 0;
  107020. },
  107021. isMobile: function isMobile() {
  107022. return this.$vuetify.breakpoint.width < this.mobileBreakPoint;
  107023. }
  107024. },
  107025. watch: {
  107026. internalValue: 'setWidths',
  107027. // When overflow changes, the arrows alter
  107028. // the widths of the content and wrapper
  107029. // and need to be recalculated
  107030. isOverflowing: 'setWidths',
  107031. scrollOffset: function scrollOffset(val) {
  107032. this.$refs.content.style.transform = "translateX(" + -val + "px)";
  107033. }
  107034. },
  107035. beforeUpdate: function beforeUpdate() {
  107036. this.internalItemsLength = (this.$children || []).length;
  107037. },
  107038. updated: function updated() {
  107039. if (this.internalItemsLength === (this.$children || []).length) return;
  107040. this.setWidths();
  107041. },
  107042. methods: {
  107043. // Always generate next for scrollable hint
  107044. genNext: function genNext() {
  107045. var _this = this;
  107046. var slot = this.$scopedSlots.next ? this.$scopedSlots.next({}) : this.$slots.next || this.__cachedNext;
  107047. return this.$createElement('div', {
  107048. staticClass: 'v-slide-group__next',
  107049. class: {
  107050. 'v-slide-group__next--disabled': !this.hasNext
  107051. },
  107052. on: {
  107053. click: function click() {
  107054. return _this.onAffixClick('next');
  107055. }
  107056. },
  107057. key: 'next'
  107058. }, [slot]);
  107059. },
  107060. genContent: function genContent() {
  107061. return this.$createElement('div', {
  107062. staticClass: 'v-slide-group__content',
  107063. ref: 'content'
  107064. }, this.$slots.default);
  107065. },
  107066. genData: function genData() {
  107067. return {
  107068. class: this.classes,
  107069. directives: [{
  107070. name: 'resize',
  107071. value: this.onResize
  107072. }]
  107073. };
  107074. },
  107075. genIcon: function genIcon(location) {
  107076. var icon = location;
  107077. if (this.$vuetify.rtl && location === 'prev') {
  107078. icon = 'next';
  107079. } else if (this.$vuetify.rtl && location === 'next') {
  107080. icon = 'prev';
  107081. }
  107082. var upperLocation = "" + location[0].toUpperCase() + location.slice(1);
  107083. var hasAffix = this["has" + upperLocation];
  107084. if (!this.showArrows && !hasAffix) return null;
  107085. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], {
  107086. props: {
  107087. disabled: !hasAffix
  107088. }
  107089. }, this[icon + "Icon"]);
  107090. },
  107091. // Always generate prev for scrollable hint
  107092. genPrev: function genPrev() {
  107093. var _this = this;
  107094. var slot = this.$scopedSlots.prev ? this.$scopedSlots.prev({}) : this.$slots.prev || this.__cachedPrev;
  107095. return this.$createElement('div', {
  107096. staticClass: 'v-slide-group__prev',
  107097. class: {
  107098. 'v-slide-group__prev--disabled': !this.hasPrev
  107099. },
  107100. on: {
  107101. click: function click() {
  107102. return _this.onAffixClick('prev');
  107103. }
  107104. },
  107105. key: 'prev'
  107106. }, [slot]);
  107107. },
  107108. genTransition: function genTransition(location) {
  107109. return this.$createElement(_transitions__WEBPACK_IMPORTED_MODULE_2__["VFadeTransition"], [this.genIcon(location)]);
  107110. },
  107111. genWrapper: function genWrapper() {
  107112. var _this = this;
  107113. return this.$createElement('div', {
  107114. staticClass: 'v-slide-group__wrapper',
  107115. directives: [{
  107116. name: 'touch',
  107117. value: {
  107118. start: function start(e) {
  107119. return _this.overflowCheck(e, _this.onTouchStart);
  107120. },
  107121. move: function move(e) {
  107122. return _this.overflowCheck(e, _this.onTouchMove);
  107123. },
  107124. end: function end(e) {
  107125. return _this.overflowCheck(e, _this.onTouchEnd);
  107126. }
  107127. }
  107128. }],
  107129. ref: 'wrapper'
  107130. }, [this.genContent()]);
  107131. },
  107132. calculateNewOffset: function calculateNewOffset(direction, widths, rtl, currentScrollOffset) {
  107133. var sign = rtl ? -1 : 1;
  107134. var newAbosluteOffset = sign * currentScrollOffset + (direction === 'prev' ? -1 : 1) * widths.wrapper;
  107135. return sign * Math.max(Math.min(newAbosluteOffset, widths.content - widths.wrapper), 0);
  107136. },
  107137. onAffixClick: function onAffixClick(location) {
  107138. this.$emit("click:" + location);
  107139. this.scrollTo(location);
  107140. },
  107141. onResize: function onResize() {
  107142. /* istanbul ignore next */
  107143. if (this._isDestroyed) return;
  107144. this.setWidths();
  107145. },
  107146. onTouchStart: function onTouchStart(e) {
  107147. var content = this.$refs.content;
  107148. this.startX = this.scrollOffset + e.touchstartX;
  107149. content.style.setProperty('transition', 'none');
  107150. content.style.setProperty('willChange', 'transform');
  107151. },
  107152. onTouchMove: function onTouchMove(e) {
  107153. this.scrollOffset = this.startX - e.touchmoveX;
  107154. },
  107155. onTouchEnd: function onTouchEnd() {
  107156. var _a = this.$refs,
  107157. content = _a.content,
  107158. wrapper = _a.wrapper;
  107159. var maxScrollOffset = content.clientWidth - wrapper.clientWidth;
  107160. content.style.setProperty('transition', null);
  107161. content.style.setProperty('willChange', null);
  107162. if (this.$vuetify.rtl) {
  107163. /* istanbul ignore else */
  107164. if (this.scrollOffset > 0 || !this.isOverflowing) {
  107165. this.scrollOffset = 0;
  107166. } else if (this.scrollOffset <= -maxScrollOffset) {
  107167. this.scrollOffset = -maxScrollOffset;
  107168. }
  107169. } else {
  107170. /* istanbul ignore else */
  107171. if (this.scrollOffset < 0 || !this.isOverflowing) {
  107172. this.scrollOffset = 0;
  107173. } else if (this.scrollOffset >= maxScrollOffset) {
  107174. this.scrollOffset = maxScrollOffset;
  107175. }
  107176. }
  107177. },
  107178. overflowCheck: function overflowCheck(e, fn) {
  107179. e.stopPropagation();
  107180. this.isOverflowing && fn(e);
  107181. },
  107182. scrollIntoView
  107183. /* istanbul ignore next */
  107184. : function scrollIntoView() {
  107185. if (!this.selectedItem) {
  107186. return;
  107187. }
  107188. if (this.selectedIndex === 0 || !this.centerActive && !this.isOverflowing) {
  107189. this.scrollOffset = 0;
  107190. } else if (this.centerActive) {
  107191. this.scrollOffset = this.calculateCenteredOffset(this.selectedItem.$el, this.widths, this.$vuetify.rtl);
  107192. } else if (this.isOverflowing) {
  107193. this.scrollOffset = this.calculateUpdatedOffset(this.selectedItem.$el, this.widths, this.$vuetify.rtl, this.scrollOffset);
  107194. }
  107195. },
  107196. calculateUpdatedOffset: function calculateUpdatedOffset(selectedElement, widths, rtl, currentScrollOffset) {
  107197. var clientWidth = selectedElement.clientWidth;
  107198. var offsetLeft = rtl ? widths.content - selectedElement.offsetLeft - clientWidth : selectedElement.offsetLeft;
  107199. if (rtl) {
  107200. currentScrollOffset = -currentScrollOffset;
  107201. }
  107202. var totalWidth = widths.wrapper + currentScrollOffset;
  107203. var itemOffset = clientWidth + offsetLeft;
  107204. var additionalOffset = clientWidth * 0.4;
  107205. if (offsetLeft < currentScrollOffset) {
  107206. currentScrollOffset = Math.max(offsetLeft - additionalOffset, 0);
  107207. } else if (totalWidth < itemOffset) {
  107208. currentScrollOffset = Math.min(currentScrollOffset - (totalWidth - itemOffset - additionalOffset), widths.content - widths.wrapper);
  107209. }
  107210. return rtl ? -currentScrollOffset : currentScrollOffset;
  107211. },
  107212. calculateCenteredOffset: function calculateCenteredOffset(selectedElement, widths, rtl) {
  107213. var offsetLeft = selectedElement.offsetLeft,
  107214. clientWidth = selectedElement.clientWidth;
  107215. if (rtl) {
  107216. var offsetCentered = widths.content - offsetLeft - clientWidth / 2 - widths.wrapper / 2;
  107217. return -Math.min(widths.content - widths.wrapper, Math.max(0, offsetCentered));
  107218. } else {
  107219. var offsetCentered = offsetLeft + clientWidth / 2 - widths.wrapper / 2;
  107220. return Math.min(widths.content - widths.wrapper, Math.max(0, offsetCentered));
  107221. }
  107222. },
  107223. scrollTo
  107224. /* istanbul ignore next */
  107225. : function scrollTo(location) {
  107226. this.scrollOffset = this.calculateNewOffset(location, {
  107227. // Force reflow
  107228. content: this.$refs.content ? this.$refs.content.clientWidth : 0,
  107229. wrapper: this.$refs.wrapper ? this.$refs.wrapper.clientWidth : 0
  107230. }, this.$vuetify.rtl, this.scrollOffset);
  107231. },
  107232. setWidths
  107233. /* istanbul ignore next */
  107234. : function setWidths() {
  107235. var _this = this;
  107236. window.requestAnimationFrame(function () {
  107237. var _a = _this.$refs,
  107238. content = _a.content,
  107239. wrapper = _a.wrapper;
  107240. _this.widths = {
  107241. content: content ? content.clientWidth : 0,
  107242. wrapper: wrapper ? wrapper.clientWidth : 0
  107243. };
  107244. _this.isOverflowing = _this.widths.wrapper < _this.widths.content;
  107245. _this.scrollIntoView();
  107246. });
  107247. }
  107248. },
  107249. render: function render(h) {
  107250. return h('div', this.genData(), [this.genPrev(), this.genWrapper(), this.genNext()]);
  107251. }
  107252. });
  107253. /* harmony default export */ __webpack_exports__["default"] = (BaseSlideGroup.extend({
  107254. name: 'v-slide-group',
  107255. provide: function provide() {
  107256. return {
  107257. slideGroup: this
  107258. };
  107259. }
  107260. }));
  107261. /***/ }),
  107262. /***/ "./src/components/VSlideGroup/VSlideItem.ts":
  107263. /*!**************************************************!*\
  107264. !*** ./src/components/VSlideGroup/VSlideItem.ts ***!
  107265. \**************************************************/
  107266. /*! exports provided: default */
  107267. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107268. "use strict";
  107269. __webpack_require__.r(__webpack_exports__);
  107270. /* harmony import */ var _VItemGroup_VItem__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VItemGroup/VItem */ "./src/components/VItemGroup/VItem.ts");
  107271. /* harmony import */ var _mixins_groupable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/groupable */ "./src/mixins/groupable/index.ts");
  107272. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  107273. // Extensions
  107274. // Mixins
  107275. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_VItemGroup_VItem__WEBPACK_IMPORTED_MODULE_0__["BaseItem"], Object(_mixins_groupable__WEBPACK_IMPORTED_MODULE_1__["factory"])('slideGroup')
  107276. /* @vue/component */
  107277. ).extend({
  107278. name: 'v-slide-item'
  107279. }));
  107280. /***/ }),
  107281. /***/ "./src/components/VSlideGroup/index.ts":
  107282. /*!*********************************************!*\
  107283. !*** ./src/components/VSlideGroup/index.ts ***!
  107284. \*********************************************/
  107285. /*! exports provided: VSlideGroup, VSlideItem, default */
  107286. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107287. "use strict";
  107288. __webpack_require__.r(__webpack_exports__);
  107289. /* harmony import */ var _VSlideGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSlideGroup */ "./src/components/VSlideGroup/VSlideGroup.ts");
  107290. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlideGroup", function() { return _VSlideGroup__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  107291. /* harmony import */ var _VSlideItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VSlideItem */ "./src/components/VSlideGroup/VSlideItem.ts");
  107292. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlideItem", function() { return _VSlideItem__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  107293. /* harmony default export */ __webpack_exports__["default"] = ({
  107294. $_vuetify_subcomponents: {
  107295. VSlideGroup: _VSlideGroup__WEBPACK_IMPORTED_MODULE_0__["default"],
  107296. VSlideItem: _VSlideItem__WEBPACK_IMPORTED_MODULE_1__["default"]
  107297. }
  107298. });
  107299. /***/ }),
  107300. /***/ "./src/components/VSlider/VSlider.sass":
  107301. /*!*********************************************!*\
  107302. !*** ./src/components/VSlider/VSlider.sass ***!
  107303. \*********************************************/
  107304. /*! no static exports found */
  107305. /***/ (function(module, exports, __webpack_require__) {
  107306. // extracted by mini-css-extract-plugin
  107307. /***/ }),
  107308. /***/ "./src/components/VSlider/VSlider.ts":
  107309. /*!*******************************************!*\
  107310. !*** ./src/components/VSlider/VSlider.ts ***!
  107311. \*******************************************/
  107312. /*! exports provided: default */
  107313. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107314. "use strict";
  107315. __webpack_require__.r(__webpack_exports__);
  107316. /* harmony import */ var _VSlider_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSlider.sass */ "./src/components/VSlider/VSlider.sass");
  107317. /* harmony import */ var _VSlider_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSlider_sass__WEBPACK_IMPORTED_MODULE_0__);
  107318. /* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.ts");
  107319. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  107320. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  107321. /* harmony import */ var _mixins_loadable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/loadable */ "./src/mixins/loadable/index.ts");
  107322. /* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside/index.ts");
  107323. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  107324. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  107325. var __assign = undefined && undefined.__assign || function () {
  107326. __assign = Object.assign || function (t) {
  107327. for (var s, i = 1, n = arguments.length; i < n; i++) {
  107328. s = arguments[i];
  107329. for (var p in s) {
  107330. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  107331. }
  107332. }
  107333. return t;
  107334. };
  107335. return __assign.apply(this, arguments);
  107336. };
  107337. // Components
  107338. // Mixins
  107339. // Directives
  107340. // Helpers
  107341. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_VInput__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_loadable__WEBPACK_IMPORTED_MODULE_4__["default"]
  107342. /* @vue/component */
  107343. ).extend({
  107344. name: 'v-slider',
  107345. directives: {
  107346. ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_5__["default"]
  107347. },
  107348. mixins: [_mixins_loadable__WEBPACK_IMPORTED_MODULE_4__["default"]],
  107349. props: {
  107350. disabled: Boolean,
  107351. inverseLabel: Boolean,
  107352. max: {
  107353. type: [Number, String],
  107354. default: 100
  107355. },
  107356. min: {
  107357. type: [Number, String],
  107358. default: 0
  107359. },
  107360. step: {
  107361. type: [Number, String],
  107362. default: 1
  107363. },
  107364. thumbColor: String,
  107365. thumbLabel: {
  107366. type: [Boolean, String],
  107367. default: undefined,
  107368. validator: function validator(v) {
  107369. return typeof v === 'boolean' || v === 'always';
  107370. }
  107371. },
  107372. thumbSize: {
  107373. type: [Number, String],
  107374. default: 32
  107375. },
  107376. tickLabels: {
  107377. type: Array,
  107378. default: function _default() {
  107379. return [];
  107380. }
  107381. },
  107382. ticks: {
  107383. type: [Boolean, String],
  107384. default: false,
  107385. validator: function validator(v) {
  107386. return typeof v === 'boolean' || v === 'always';
  107387. }
  107388. },
  107389. tickSize: {
  107390. type: [Number, String],
  107391. default: 2
  107392. },
  107393. trackColor: String,
  107394. trackFillColor: String,
  107395. value: [Number, String],
  107396. vertical: Boolean
  107397. },
  107398. data: function data() {
  107399. return {
  107400. app: null,
  107401. oldValue: null,
  107402. keyPressed: 0,
  107403. isFocused: false,
  107404. isActive: false,
  107405. noClick: false
  107406. };
  107407. },
  107408. computed: {
  107409. classes: function classes() {
  107410. return __assign({}, _VInput__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  107411. 'v-input__slider': true,
  107412. 'v-input__slider--vertical': this.vertical,
  107413. 'v-input__slider--inverse-label': this.inverseLabel
  107414. });
  107415. },
  107416. internalValue: {
  107417. get: function get() {
  107418. return this.lazyValue;
  107419. },
  107420. set: function set(val) {
  107421. val = isNaN(val) ? this.minValue : val; // Round value to ensure the
  107422. // entire slider range can
  107423. // be selected with step
  107424. var value = this.roundValue(Math.min(Math.max(val, this.minValue), this.maxValue));
  107425. if (value === this.lazyValue) return;
  107426. this.lazyValue = value;
  107427. this.$emit('input', value);
  107428. }
  107429. },
  107430. trackTransition: function trackTransition() {
  107431. return this.keyPressed >= 2 ? 'none' : '';
  107432. },
  107433. minValue: function minValue() {
  107434. return parseFloat(this.min);
  107435. },
  107436. maxValue: function maxValue() {
  107437. return parseFloat(this.max);
  107438. },
  107439. stepNumeric: function stepNumeric() {
  107440. return this.step > 0 ? parseFloat(this.step) : 0;
  107441. },
  107442. inputWidth: function inputWidth() {
  107443. var value = (this.roundValue(this.internalValue) - this.minValue) / (this.maxValue - this.minValue) * 100;
  107444. return value;
  107445. },
  107446. trackFillStyles: function trackFillStyles() {
  107447. var _a;
  107448. var startDir = this.vertical ? 'bottom' : 'left';
  107449. var endDir = this.vertical ? 'top' : 'right';
  107450. var valueDir = this.vertical ? 'height' : 'width';
  107451. var start = this.$vuetify.rtl ? 'auto' : '0';
  107452. var end = this.$vuetify.rtl ? '0' : 'auto';
  107453. var value = this.disabled ? "calc(" + this.inputWidth + "% - 10px)" : this.inputWidth + "%";
  107454. return _a = {
  107455. transition: this.trackTransition
  107456. }, _a[startDir] = start, _a[endDir] = end, _a[valueDir] = value, _a;
  107457. },
  107458. trackStyles: function trackStyles() {
  107459. var _a;
  107460. var startDir = this.vertical ? this.$vuetify.rtl ? 'bottom' : 'top' : this.$vuetify.rtl ? 'left' : 'right';
  107461. var endDir = this.vertical ? 'height' : 'width';
  107462. var start = '0px';
  107463. var end = this.disabled ? "calc(" + (100 - this.inputWidth) + "% - 10px)" : "calc(" + (100 - this.inputWidth) + "%)";
  107464. return _a = {
  107465. transition: this.trackTransition
  107466. }, _a[startDir] = start, _a[endDir] = end, _a;
  107467. },
  107468. showTicks: function showTicks() {
  107469. return this.tickLabels.length > 0 || !!(!this.disabled && this.stepNumeric && this.ticks);
  107470. },
  107471. numTicks: function numTicks() {
  107472. return Math.ceil((this.maxValue - this.minValue) / this.stepNumeric);
  107473. },
  107474. showThumbLabel: function showThumbLabel() {
  107475. return !this.disabled && !!(this.thumbLabel || this.$scopedSlots['thumb-label']);
  107476. },
  107477. computedTrackColor: function computedTrackColor() {
  107478. if (this.disabled) return undefined;
  107479. if (this.trackColor) return this.trackColor;
  107480. if (this.isDark) return this.validationState;
  107481. return this.validationState || 'primary lighten-3';
  107482. },
  107483. computedTrackFillColor: function computedTrackFillColor() {
  107484. if (this.disabled) return undefined;
  107485. if (this.trackFillColor) return this.trackFillColor;
  107486. return this.validationState || this.computedColor;
  107487. },
  107488. computedThumbColor: function computedThumbColor() {
  107489. if (this.thumbColor) return this.thumbColor;
  107490. return this.validationState || this.computedColor;
  107491. }
  107492. },
  107493. watch: {
  107494. min: function min(val) {
  107495. var parsed = parseFloat(val);
  107496. parsed > this.internalValue && this.$emit('input', parsed);
  107497. },
  107498. max: function max(val) {
  107499. var parsed = parseFloat(val);
  107500. parsed < this.internalValue && this.$emit('input', parsed);
  107501. },
  107502. value: {
  107503. handler: function handler(v) {
  107504. this.internalValue = v;
  107505. }
  107506. }
  107507. },
  107508. // If done in as immediate in
  107509. // value watcher, causes issues
  107510. // with vue-test-utils
  107511. beforeMount: function beforeMount() {
  107512. this.internalValue = this.value;
  107513. },
  107514. mounted: function mounted() {
  107515. // Without a v-app, iOS does not work with body selectors
  107516. this.app = document.querySelector('[data-app]') || Object(_util_console__WEBPACK_IMPORTED_MODULE_7__["consoleWarn"])('Missing v-app or a non-body wrapping element with the [data-app] attribute', this);
  107517. },
  107518. methods: {
  107519. genDefaultSlot: function genDefaultSlot() {
  107520. var children = [this.genLabel()];
  107521. var slider = this.genSlider();
  107522. this.inverseLabel ? children.unshift(slider) : children.push(slider);
  107523. children.push(this.genProgress());
  107524. return children;
  107525. },
  107526. genSlider: function genSlider() {
  107527. return this.$createElement('div', {
  107528. class: __assign({
  107529. 'v-slider': true,
  107530. 'v-slider--horizontal': !this.vertical,
  107531. 'v-slider--vertical': this.vertical,
  107532. 'v-slider--focused': this.isFocused,
  107533. 'v-slider--active': this.isActive,
  107534. 'v-slider--disabled': this.disabled,
  107535. 'v-slider--readonly': this.readonly
  107536. }, this.themeClasses),
  107537. directives: [{
  107538. name: 'click-outside',
  107539. value: this.onBlur
  107540. }],
  107541. on: {
  107542. click: this.onSliderClick
  107543. }
  107544. }, this.genChildren());
  107545. },
  107546. genChildren: function genChildren() {
  107547. return [this.genInput(), this.genTrackContainer(), this.genSteps(), this.genThumbContainer(this.internalValue, this.inputWidth, this.isActive, this.isFocused, this.onThumbMouseDown, this.onFocus, this.onBlur)];
  107548. },
  107549. genInput: function genInput() {
  107550. return this.$createElement('input', {
  107551. attrs: __assign({
  107552. value: this.internalValue,
  107553. id: this.computedId,
  107554. disabled: this.disabled,
  107555. readonly: true,
  107556. tabindex: -1
  107557. }, this.$attrs)
  107558. });
  107559. },
  107560. genTrackContainer: function genTrackContainer() {
  107561. var children = [this.$createElement('div', this.setBackgroundColor(this.computedTrackColor, {
  107562. staticClass: 'v-slider__track-background',
  107563. style: this.trackStyles
  107564. })), this.$createElement('div', this.setBackgroundColor(this.computedTrackFillColor, {
  107565. staticClass: 'v-slider__track-fill',
  107566. style: this.trackFillStyles
  107567. }))];
  107568. return this.$createElement('div', {
  107569. staticClass: 'v-slider__track-container',
  107570. ref: 'track'
  107571. }, children);
  107572. },
  107573. genSteps: function genSteps() {
  107574. var _this = this;
  107575. if (!this.step || !this.showTicks) return null;
  107576. var tickSize = parseFloat(this.tickSize);
  107577. var range = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["createRange"])(this.numTicks + 1);
  107578. var direction = this.vertical ? 'bottom' : this.$vuetify.rtl ? 'right' : 'left';
  107579. var offsetDirection = this.vertical ? this.$vuetify.rtl ? 'left' : 'right' : 'top';
  107580. if (this.vertical) range.reverse();
  107581. var ticks = range.map(function (index) {
  107582. var _a;
  107583. var children = [];
  107584. if (_this.tickLabels[index]) {
  107585. children.push(_this.$createElement('div', {
  107586. staticClass: 'v-slider__tick-label'
  107587. }, _this.tickLabels[index]));
  107588. }
  107589. var width = index * (100 / _this.numTicks);
  107590. var filled = _this.$vuetify.rtl ? 100 - _this.inputWidth < width : width < _this.inputWidth;
  107591. return _this.$createElement('span', {
  107592. key: index,
  107593. staticClass: 'v-slider__tick',
  107594. class: {
  107595. 'v-slider__tick--filled': filled
  107596. },
  107597. style: (_a = {
  107598. width: tickSize + "px",
  107599. height: tickSize + "px"
  107600. }, _a[direction] = "calc(" + width + "% - " + tickSize / 2 + "px)", _a[offsetDirection] = "calc(50% - " + tickSize / 2 + "px)", _a)
  107601. }, children);
  107602. });
  107603. return this.$createElement('div', {
  107604. staticClass: 'v-slider__ticks-container',
  107605. class: {
  107606. 'v-slider__ticks-container--always-show': this.ticks === 'always' || this.tickLabels.length > 0
  107607. }
  107608. }, ticks);
  107609. },
  107610. genThumbContainer: function genThumbContainer(value, valueWidth, isActive, isFocused, onDrag, onFocus, onBlur, ref) {
  107611. if (ref === void 0) {
  107612. ref = 'thumb';
  107613. }
  107614. var children = [this.genThumb()];
  107615. var thumbLabelContent = this.genThumbLabelContent(value);
  107616. this.showThumbLabel && children.push(this.genThumbLabel(thumbLabelContent));
  107617. return this.$createElement('div', this.setTextColor(this.computedThumbColor, {
  107618. ref: ref,
  107619. key: ref,
  107620. staticClass: 'v-slider__thumb-container',
  107621. class: {
  107622. 'v-slider__thumb-container--active': isActive,
  107623. 'v-slider__thumb-container--focused': isFocused,
  107624. 'v-slider__thumb-container--show-label': this.showThumbLabel
  107625. },
  107626. style: this.getThumbContainerStyles(valueWidth),
  107627. attrs: __assign({
  107628. role: 'slider',
  107629. tabindex: this.disabled || this.readonly ? -1 : this.$attrs.tabindex ? this.$attrs.tabindex : 0,
  107630. 'aria-label': this.label,
  107631. 'aria-valuemin': this.min,
  107632. 'aria-valuemax': this.max,
  107633. 'aria-valuenow': this.internalValue,
  107634. 'aria-readonly': String(this.readonly),
  107635. 'aria-orientation': this.vertical ? 'vertical' : 'horizontal'
  107636. }, this.$attrs),
  107637. on: {
  107638. focus: onFocus,
  107639. blur: onBlur,
  107640. keydown: this.onKeyDown,
  107641. keyup: this.onKeyUp,
  107642. touchstart: onDrag,
  107643. mousedown: onDrag
  107644. }
  107645. }), children);
  107646. },
  107647. genThumbLabelContent: function genThumbLabelContent(value) {
  107648. return this.$scopedSlots['thumb-label'] ? this.$scopedSlots['thumb-label']({
  107649. value: value
  107650. }) : [this.$createElement('span', [String(value)])];
  107651. },
  107652. genThumbLabel: function genThumbLabel(content) {
  107653. var size = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["convertToUnit"])(this.thumbSize);
  107654. var transform = this.vertical ? "translateY(20%) translateY(" + (Number(this.thumbSize) / 3 - 1) + "px) translateX(55%) rotate(135deg)" : "translateY(-20%) translateY(-12px) translateX(-50%) rotate(45deg)";
  107655. return this.$createElement(_transitions__WEBPACK_IMPORTED_MODULE_2__["VScaleTransition"], {
  107656. props: {
  107657. origin: 'bottom center'
  107658. }
  107659. }, [this.$createElement('div', {
  107660. staticClass: 'v-slider__thumb-label-container',
  107661. directives: [{
  107662. name: 'show',
  107663. value: this.isFocused || this.isActive || this.thumbLabel === 'always'
  107664. }]
  107665. }, [this.$createElement('div', this.setBackgroundColor(this.computedThumbColor, {
  107666. staticClass: 'v-slider__thumb-label',
  107667. style: {
  107668. height: size,
  107669. width: size,
  107670. transform: transform
  107671. }
  107672. }), [this.$createElement('div', content)])])]);
  107673. },
  107674. genThumb: function genThumb() {
  107675. return this.$createElement('div', this.setBackgroundColor(this.computedThumbColor, {
  107676. staticClass: 'v-slider__thumb'
  107677. }));
  107678. },
  107679. getThumbContainerStyles: function getThumbContainerStyles(width) {
  107680. var _a;
  107681. var direction = this.vertical ? 'top' : 'left';
  107682. var value = this.$vuetify.rtl ? 100 - width : width;
  107683. value = this.vertical ? 100 - value : value;
  107684. return _a = {
  107685. transition: this.trackTransition
  107686. }, _a[direction] = value + "%", _a;
  107687. },
  107688. onThumbMouseDown: function onThumbMouseDown(e) {
  107689. e.preventDefault();
  107690. this.oldValue = this.internalValue;
  107691. this.keyPressed = 2;
  107692. this.isActive = true;
  107693. var mouseUpOptions = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["passiveSupported"] ? {
  107694. passive: true,
  107695. capture: true
  107696. } : true;
  107697. var mouseMoveOptions = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["passiveSupported"] ? {
  107698. passive: true
  107699. } : false;
  107700. if ('touches' in e) {
  107701. this.app.addEventListener('touchmove', this.onMouseMove, mouseMoveOptions);
  107702. Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["addOnceEventListener"])(this.app, 'touchend', this.onSliderMouseUp, mouseUpOptions);
  107703. } else {
  107704. this.app.addEventListener('mousemove', this.onMouseMove, mouseMoveOptions);
  107705. Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["addOnceEventListener"])(this.app, 'mouseup', this.onSliderMouseUp, mouseUpOptions);
  107706. }
  107707. this.$emit('start', this.internalValue);
  107708. },
  107709. onSliderMouseUp: function onSliderMouseUp(e) {
  107710. e.stopPropagation();
  107711. this.keyPressed = 0;
  107712. var mouseMoveOptions = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["passiveSupported"] ? {
  107713. passive: true
  107714. } : false;
  107715. this.app.removeEventListener('touchmove', this.onMouseMove, mouseMoveOptions);
  107716. this.app.removeEventListener('mousemove', this.onMouseMove, mouseMoveOptions);
  107717. this.$emit('end', this.internalValue);
  107718. if (!Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["deepEqual"])(this.oldValue, this.internalValue)) {
  107719. this.$emit('change', this.internalValue);
  107720. this.noClick = true;
  107721. }
  107722. this.isActive = false;
  107723. },
  107724. onMouseMove: function onMouseMove(e) {
  107725. var value = this.parseMouseMove(e).value;
  107726. this.internalValue = value;
  107727. },
  107728. onKeyDown: function onKeyDown(e) {
  107729. if (this.disabled || this.readonly) return;
  107730. var value = this.parseKeyDown(e, this.internalValue);
  107731. if (value == null) return;
  107732. this.internalValue = value;
  107733. this.$emit('change', value);
  107734. },
  107735. onKeyUp: function onKeyUp() {
  107736. this.keyPressed = 0;
  107737. },
  107738. onSliderClick: function onSliderClick(e) {
  107739. if (this.noClick) {
  107740. this.noClick = false;
  107741. return;
  107742. }
  107743. var thumb = this.$refs.thumb;
  107744. thumb.focus();
  107745. this.onMouseMove(e);
  107746. this.$emit('change', this.internalValue);
  107747. },
  107748. onBlur: function onBlur(e) {
  107749. this.isFocused = false;
  107750. this.$emit('blur', e);
  107751. },
  107752. onFocus: function onFocus(e) {
  107753. this.isFocused = true;
  107754. this.$emit('focus', e);
  107755. },
  107756. parseMouseMove: function parseMouseMove(e) {
  107757. var start = this.vertical ? 'top' : 'left';
  107758. var length = this.vertical ? 'height' : 'width';
  107759. var click = this.vertical ? 'clientY' : 'clientX';
  107760. var _a = this.$refs.track.getBoundingClientRect(),
  107761. _b = start,
  107762. trackStart = _a[_b],
  107763. _c = length,
  107764. trackLength = _a[_c];
  107765. var clickOffset = 'touches' in e ? e.touches[0][click] : e[click]; // Can we get rid of any here?
  107766. // It is possible for left to be NaN, force to number
  107767. var clickPos = Math.min(Math.max((clickOffset - trackStart) / trackLength, 0), 1) || 0;
  107768. if (this.vertical) clickPos = 1 - clickPos;
  107769. if (this.$vuetify.rtl) clickPos = 1 - clickPos;
  107770. var isInsideTrack = clickOffset >= trackStart && clickOffset <= trackStart + trackLength;
  107771. var value = parseFloat(this.min) + clickPos * (this.maxValue - this.minValue);
  107772. return {
  107773. value: value,
  107774. isInsideTrack: isInsideTrack
  107775. };
  107776. },
  107777. parseKeyDown: function parseKeyDown(e, value) {
  107778. if (this.disabled) return;
  107779. var pageup = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["keyCodes"].pageup,
  107780. pagedown = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["keyCodes"].pagedown,
  107781. end = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["keyCodes"].end,
  107782. home = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["keyCodes"].home,
  107783. left = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["keyCodes"].left,
  107784. right = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["keyCodes"].right,
  107785. down = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["keyCodes"].down,
  107786. up = _util_helpers__WEBPACK_IMPORTED_MODULE_6__["keyCodes"].up;
  107787. if (![pageup, pagedown, end, home, left, right, down, up].includes(e.keyCode)) return;
  107788. e.preventDefault();
  107789. var step = this.stepNumeric || 1;
  107790. var steps = (this.maxValue - this.minValue) / step;
  107791. if ([left, right, down, up].includes(e.keyCode)) {
  107792. this.keyPressed += 1;
  107793. var increase = this.$vuetify.rtl ? [left, up] : [right, up];
  107794. var direction = increase.includes(e.keyCode) ? 1 : -1;
  107795. var multiplier = e.shiftKey ? 3 : e.ctrlKey ? 2 : 1;
  107796. value = value + direction * step * multiplier;
  107797. } else if (e.keyCode === home) {
  107798. value = this.minValue;
  107799. } else if (e.keyCode === end) {
  107800. value = this.maxValue;
  107801. } else {
  107802. var direction = e.keyCode === pagedown ? 1 : -1;
  107803. value = value - direction * step * (steps > 100 ? steps / 10 : 10);
  107804. }
  107805. return value;
  107806. },
  107807. roundValue: function roundValue(value) {
  107808. if (!this.stepNumeric) return value; // Format input value using the same number
  107809. // of decimals places as in the step prop
  107810. var trimmedStep = this.step.toString().trim();
  107811. var decimals = trimmedStep.indexOf('.') > -1 ? trimmedStep.length - trimmedStep.indexOf('.') - 1 : 0;
  107812. var offset = this.minValue % this.stepNumeric;
  107813. var newValue = Math.round((value - offset) / this.stepNumeric) * this.stepNumeric + offset;
  107814. return parseFloat(Math.min(newValue, this.maxValue).toFixed(decimals));
  107815. }
  107816. }
  107817. }));
  107818. /***/ }),
  107819. /***/ "./src/components/VSlider/index.ts":
  107820. /*!*****************************************!*\
  107821. !*** ./src/components/VSlider/index.ts ***!
  107822. \*****************************************/
  107823. /*! exports provided: VSlider, default */
  107824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107825. "use strict";
  107826. __webpack_require__.r(__webpack_exports__);
  107827. /* harmony import */ var _VSlider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSlider */ "./src/components/VSlider/VSlider.ts");
  107828. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlider", function() { return _VSlider__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  107829. /* harmony default export */ __webpack_exports__["default"] = (_VSlider__WEBPACK_IMPORTED_MODULE_0__["default"]);
  107830. /***/ }),
  107831. /***/ "./src/components/VSnackbar/VSnackbar.sass":
  107832. /*!*************************************************!*\
  107833. !*** ./src/components/VSnackbar/VSnackbar.sass ***!
  107834. \*************************************************/
  107835. /*! no static exports found */
  107836. /***/ (function(module, exports, __webpack_require__) {
  107837. // extracted by mini-css-extract-plugin
  107838. /***/ }),
  107839. /***/ "./src/components/VSnackbar/VSnackbar.ts":
  107840. /*!***********************************************!*\
  107841. !*** ./src/components/VSnackbar/VSnackbar.ts ***!
  107842. \***********************************************/
  107843. /*! exports provided: default */
  107844. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107845. "use strict";
  107846. __webpack_require__.r(__webpack_exports__);
  107847. /* harmony import */ var _VSnackbar_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSnackbar.sass */ "./src/components/VSnackbar/VSnackbar.sass");
  107848. /* harmony import */ var _VSnackbar_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSnackbar_sass__WEBPACK_IMPORTED_MODULE_0__);
  107849. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  107850. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  107851. /* harmony import */ var _mixins_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/positionable */ "./src/mixins/positionable/index.ts");
  107852. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  107853. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  107854. // Styles
  107855. // Mixins
  107856. // Types
  107857. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_mixins_positionable__WEBPACK_IMPORTED_MODULE_3__["factory"])(['absolute', 'top', 'bottom', 'left', 'right'])
  107858. /* @vue/component */
  107859. ).extend({
  107860. name: 'v-snackbar',
  107861. props: {
  107862. multiLine: Boolean,
  107863. // TODO: change this to closeDelay to match other API in delayable.js
  107864. timeout: {
  107865. type: Number,
  107866. default: 6000
  107867. },
  107868. vertical: Boolean
  107869. },
  107870. data: function data() {
  107871. return {
  107872. activeTimeout: -1
  107873. };
  107874. },
  107875. computed: {
  107876. classes: function classes() {
  107877. return {
  107878. 'v-snack--active': this.isActive,
  107879. 'v-snack--absolute': this.absolute,
  107880. 'v-snack--bottom': this.bottom || !this.top,
  107881. 'v-snack--left': this.left,
  107882. 'v-snack--multi-line': this.multiLine && !this.vertical,
  107883. 'v-snack--right': this.right,
  107884. 'v-snack--top': this.top,
  107885. 'v-snack--vertical': this.vertical
  107886. };
  107887. }
  107888. },
  107889. watch: {
  107890. isActive: function isActive() {
  107891. this.setTimeout();
  107892. }
  107893. },
  107894. created: function created() {
  107895. if (this.$attrs.hasOwnProperty('auto-height')) {
  107896. Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["removed"])('auto-height', this);
  107897. }
  107898. },
  107899. mounted: function mounted() {
  107900. this.setTimeout();
  107901. },
  107902. methods: {
  107903. setTimeout: function setTimeout() {
  107904. var _this = this;
  107905. window.clearTimeout(this.activeTimeout);
  107906. if (this.isActive && this.timeout) {
  107907. this.activeTimeout = window.setTimeout(function () {
  107908. _this.isActive = false;
  107909. }, this.timeout);
  107910. }
  107911. }
  107912. },
  107913. render: function render(h) {
  107914. return h('transition', {
  107915. attrs: {
  107916. name: 'v-snack-transition'
  107917. }
  107918. }, [this.isActive && h('div', {
  107919. staticClass: 'v-snack',
  107920. class: this.classes,
  107921. on: this.$listeners
  107922. }, [h('div', this.setBackgroundColor(this.color, {
  107923. staticClass: 'v-snack__wrapper',
  107924. attrs: {
  107925. role: 'alert'
  107926. }
  107927. }), [h('div', {
  107928. staticClass: 'v-snack__content'
  107929. }, this.$slots.default)])])]);
  107930. }
  107931. }));
  107932. /***/ }),
  107933. /***/ "./src/components/VSnackbar/index.ts":
  107934. /*!*******************************************!*\
  107935. !*** ./src/components/VSnackbar/index.ts ***!
  107936. \*******************************************/
  107937. /*! exports provided: VSnackbar, default */
  107938. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107939. "use strict";
  107940. __webpack_require__.r(__webpack_exports__);
  107941. /* harmony import */ var _VSnackbar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSnackbar */ "./src/components/VSnackbar/VSnackbar.ts");
  107942. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSnackbar", function() { return _VSnackbar__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  107943. /* harmony default export */ __webpack_exports__["default"] = (_VSnackbar__WEBPACK_IMPORTED_MODULE_0__["default"]);
  107944. /***/ }),
  107945. /***/ "./src/components/VSparkline/VSparkline.ts":
  107946. /*!*************************************************!*\
  107947. !*** ./src/components/VSparkline/VSparkline.ts ***!
  107948. \*************************************************/
  107949. /*! exports provided: default */
  107950. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107951. "use strict";
  107952. __webpack_require__.r(__webpack_exports__);
  107953. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  107954. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  107955. /* harmony import */ var _helpers_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/core */ "./src/components/VSparkline/helpers/core.ts");
  107956. /* harmony import */ var _helpers_path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/path */ "./src/components/VSparkline/helpers/path.ts");
  107957. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  107958. var __assign = undefined && undefined.__assign || function () {
  107959. __assign = Object.assign || function (t) {
  107960. for (var s, i = 1, n = arguments.length; i < n; i++) {
  107961. s = arguments[i];
  107962. for (var p in s) {
  107963. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  107964. }
  107965. }
  107966. return t;
  107967. };
  107968. return __assign.apply(this, arguments);
  107969. }; // Mixins
  107970. // Utilities
  107971. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_0__["default"]).extend({
  107972. name: 'VSparkline',
  107973. inheritAttrs: false,
  107974. props: {
  107975. autoDraw: Boolean,
  107976. autoDrawDuration: {
  107977. type: Number,
  107978. default: 2000
  107979. },
  107980. autoDrawEasing: {
  107981. type: String,
  107982. default: 'ease'
  107983. },
  107984. autoLineWidth: {
  107985. type: Boolean,
  107986. default: false
  107987. },
  107988. color: {
  107989. type: String,
  107990. default: 'primary'
  107991. },
  107992. fill: {
  107993. type: Boolean,
  107994. default: false
  107995. },
  107996. gradient: {
  107997. type: Array,
  107998. default: function _default() {
  107999. return [];
  108000. }
  108001. },
  108002. gradientDirection: {
  108003. type: String,
  108004. validator: function validator(val) {
  108005. return ['top', 'bottom', 'left', 'right'].includes(val);
  108006. },
  108007. default: 'top'
  108008. },
  108009. height: {
  108010. type: [String, Number],
  108011. default: 75
  108012. },
  108013. labels: {
  108014. type: Array,
  108015. default: function _default() {
  108016. return [];
  108017. }
  108018. },
  108019. labelSize: {
  108020. type: [Number, String],
  108021. default: 7
  108022. },
  108023. lineWidth: {
  108024. type: [String, Number],
  108025. default: 4
  108026. },
  108027. padding: {
  108028. type: [String, Number],
  108029. default: 8
  108030. },
  108031. showLabels: Boolean,
  108032. smooth: {
  108033. type: [Boolean, Number, String],
  108034. default: false
  108035. },
  108036. type: {
  108037. type: String,
  108038. default: 'trend',
  108039. validator: function validator(val) {
  108040. return ['trend', 'bar'].includes(val);
  108041. }
  108042. },
  108043. value: {
  108044. type: Array,
  108045. default: function _default() {
  108046. return [];
  108047. }
  108048. },
  108049. width: {
  108050. type: [Number, String],
  108051. default: 300
  108052. }
  108053. },
  108054. data: function data() {
  108055. return {
  108056. lastLength: 0
  108057. };
  108058. },
  108059. computed: {
  108060. parsedPadding: function parsedPadding() {
  108061. return Number(this.padding);
  108062. },
  108063. parsedWidth: function parsedWidth() {
  108064. return Number(this.width);
  108065. },
  108066. parsedHeight: function parsedHeight() {
  108067. return parseInt(this.height, 10);
  108068. },
  108069. parsedLabelSize: function parsedLabelSize() {
  108070. return parseInt(this.labelSize, 10) || 7;
  108071. },
  108072. totalHeight: function totalHeight() {
  108073. var height = this.parsedHeight;
  108074. if (this.hasLabels) height += parseInt(this.labelSize, 10) * 1.5;
  108075. return height;
  108076. },
  108077. totalWidth: function totalWidth() {
  108078. var width = this.parsedWidth;
  108079. if (this.type === 'bar') width = Math.max(this.value.length * this._lineWidth, width);
  108080. return width;
  108081. },
  108082. totalValues: function totalValues() {
  108083. return this.value.length;
  108084. },
  108085. _lineWidth: function _lineWidth() {
  108086. if (this.autoLineWidth && this.type !== 'trend') {
  108087. var totalPadding = this.parsedPadding * (this.totalValues + 1);
  108088. return (this.parsedWidth - totalPadding) / this.totalValues;
  108089. } else {
  108090. return parseFloat(this.lineWidth) || 4;
  108091. }
  108092. },
  108093. boundary: function boundary() {
  108094. if (this.type === 'bar') return {
  108095. minX: 0,
  108096. maxX: this.totalWidth,
  108097. minY: 0,
  108098. maxY: this.parsedHeight
  108099. };
  108100. var padding = this.parsedPadding;
  108101. return {
  108102. minX: padding,
  108103. maxX: this.totalWidth - padding,
  108104. minY: padding,
  108105. maxY: this.parsedHeight - padding
  108106. };
  108107. },
  108108. hasLabels: function hasLabels() {
  108109. return Boolean(this.showLabels || this.labels.length > 0 || this.$scopedSlots.label);
  108110. },
  108111. parsedLabels: function parsedLabels() {
  108112. var labels = [];
  108113. var points = this._values;
  108114. var len = points.length;
  108115. for (var i = 0; labels.length < len; i++) {
  108116. var item = points[i];
  108117. var value = this.labels[i];
  108118. if (!value) {
  108119. value = _typeof(item) === 'object' ? item.value : item;
  108120. }
  108121. labels.push({
  108122. x: item.x,
  108123. value: String(value)
  108124. });
  108125. }
  108126. return labels;
  108127. },
  108128. normalizedValues: function normalizedValues() {
  108129. return this.value.map(function (item) {
  108130. return typeof item === 'number' ? item : item.value;
  108131. });
  108132. },
  108133. _values: function _values() {
  108134. return this.type === 'trend' ? Object(_helpers_core__WEBPACK_IMPORTED_MODULE_2__["genPoints"])(this.normalizedValues, this.boundary) : Object(_helpers_core__WEBPACK_IMPORTED_MODULE_2__["genBars"])(this.normalizedValues, this.boundary);
  108135. },
  108136. textY: function textY() {
  108137. var y = this.parsedHeight;
  108138. if (this.type === 'trend') y -= 4;
  108139. return y;
  108140. },
  108141. _radius: function _radius() {
  108142. return this.smooth === true ? 8 : Number(this.smooth);
  108143. }
  108144. },
  108145. watch: {
  108146. value: {
  108147. immediate: true,
  108148. handler: function handler() {
  108149. var _this = this;
  108150. this.$nextTick(function () {
  108151. if (!_this.autoDraw || _this.type === 'bar' || !_this.$refs.path) return;
  108152. var path = _this.$refs.path;
  108153. var length = path.getTotalLength();
  108154. if (!_this.fill) {
  108155. path.style.transition = 'none';
  108156. path.style.strokeDasharray = length + ' ' + length;
  108157. path.style.strokeDashoffset = Math.abs(length - (_this.lastLength || 0)).toString();
  108158. path.getBoundingClientRect();
  108159. path.style.transition = "stroke-dashoffset " + _this.autoDrawDuration + "ms " + _this.autoDrawEasing;
  108160. path.style.strokeDashoffset = '0';
  108161. } else {
  108162. path.style.transformOrigin = 'bottom center';
  108163. path.style.transition = 'none';
  108164. path.style.transform = "scaleY(0)";
  108165. path.getBoundingClientRect();
  108166. path.style.transition = "transform " + _this.autoDrawDuration + "ms " + _this.autoDrawEasing;
  108167. path.style.transform = "scaleY(1)";
  108168. }
  108169. _this.lastLength = length;
  108170. });
  108171. }
  108172. }
  108173. },
  108174. methods: {
  108175. genGradient: function genGradient() {
  108176. var _this = this;
  108177. var gradientDirection = this.gradientDirection;
  108178. var gradient = this.gradient.slice(); // Pushes empty string to force
  108179. // a fallback to currentColor
  108180. if (!gradient.length) gradient.push('');
  108181. var len = Math.max(gradient.length - 1, 1);
  108182. var stops = gradient.reverse().map(function (color, index) {
  108183. return _this.$createElement('stop', {
  108184. attrs: {
  108185. offset: index / len,
  108186. 'stop-color': color || 'currentColor'
  108187. }
  108188. });
  108189. });
  108190. return this.$createElement('defs', [this.$createElement('linearGradient', {
  108191. attrs: {
  108192. id: this._uid,
  108193. x1: +(gradientDirection === 'left'),
  108194. y1: +(gradientDirection === 'top'),
  108195. x2: +(gradientDirection === 'right'),
  108196. y2: +(gradientDirection === 'bottom')
  108197. }
  108198. }, stops)]);
  108199. },
  108200. genG: function genG(children) {
  108201. return this.$createElement('g', {
  108202. style: {
  108203. fontSize: '8',
  108204. textAnchor: 'middle',
  108205. dominantBaseline: 'mathematical',
  108206. fill: 'currentColor'
  108207. }
  108208. }, children);
  108209. },
  108210. genPath: function genPath() {
  108211. var points = Object(_helpers_core__WEBPACK_IMPORTED_MODULE_2__["genPoints"])(this.normalizedValues, this.boundary);
  108212. return this.$createElement('path', {
  108213. attrs: {
  108214. d: Object(_helpers_path__WEBPACK_IMPORTED_MODULE_3__["genPath"])(points, this._radius, this.fill, this.parsedHeight),
  108215. fill: this.fill ? "url(#" + this._uid + ")" : 'none',
  108216. stroke: this.fill ? 'none' : "url(#" + this._uid + ")"
  108217. },
  108218. ref: 'path'
  108219. });
  108220. },
  108221. genLabels: function genLabels(offsetX) {
  108222. var _this = this;
  108223. var children = this.parsedLabels.map(function (item, i) {
  108224. return _this.$createElement('text', {
  108225. attrs: {
  108226. x: item.x + offsetX + _this._lineWidth / 2,
  108227. y: _this.textY + _this.parsedLabelSize * 0.75,
  108228. 'font-size': Number(_this.labelSize) || 7
  108229. }
  108230. }, [_this.genLabel(item, i)]);
  108231. });
  108232. return this.genG(children);
  108233. },
  108234. genLabel: function genLabel(item, index) {
  108235. return this.$scopedSlots.label ? this.$scopedSlots.label({
  108236. index: index,
  108237. value: item.value
  108238. }) : item.value;
  108239. },
  108240. genBars: function genBars() {
  108241. if (!this.value || this.totalValues < 2) return undefined;
  108242. var bars = Object(_helpers_core__WEBPACK_IMPORTED_MODULE_2__["genBars"])(this.normalizedValues, this.boundary);
  108243. var offsetX = (Math.abs(bars[0].x - bars[1].x) - this._lineWidth) / 2;
  108244. return this.$createElement('svg', {
  108245. attrs: {
  108246. display: 'block',
  108247. viewBox: "0 0 " + this.totalWidth + " " + this.totalHeight
  108248. }
  108249. }, [this.genGradient(), this.genClipPath(bars, offsetX, this._lineWidth, 'sparkline-bar-' + this._uid), this.hasLabels ? this.genLabels(offsetX) : undefined, this.$createElement('g', {
  108250. attrs: {
  108251. 'clip-path': "url(#sparkline-bar-" + this._uid + "-clip)",
  108252. fill: "url(#" + this._uid + ")"
  108253. }
  108254. }, [this.$createElement('rect', {
  108255. attrs: {
  108256. x: 0,
  108257. y: 0,
  108258. width: this.totalWidth,
  108259. height: this.height
  108260. }
  108261. })])]);
  108262. },
  108263. genClipPath: function genClipPath(bars, offsetX, lineWidth, id) {
  108264. var _this = this;
  108265. var rounding = typeof this.smooth === 'number' ? this.smooth : this.smooth ? 2 : 0;
  108266. return this.$createElement('clipPath', {
  108267. attrs: {
  108268. id: id + "-clip"
  108269. }
  108270. }, bars.map(function (item) {
  108271. return _this.$createElement('rect', {
  108272. attrs: {
  108273. x: item.x + offsetX,
  108274. y: item.y,
  108275. width: lineWidth,
  108276. height: item.height,
  108277. rx: rounding,
  108278. ry: rounding
  108279. }
  108280. }, [_this.autoDraw ? _this.$createElement('animate', {
  108281. attrs: {
  108282. attributeName: 'height',
  108283. from: 0,
  108284. to: item.height,
  108285. dur: _this.autoDrawDuration + "ms",
  108286. fill: 'freeze'
  108287. }
  108288. }) : undefined]);
  108289. }));
  108290. },
  108291. genTrend: function genTrend() {
  108292. return this.$createElement('svg', this.setTextColor(this.color, {
  108293. attrs: __assign({}, this.$attrs, {
  108294. display: 'block',
  108295. 'stroke-width': this._lineWidth || 1,
  108296. viewBox: "0 0 " + this.width + " " + this.totalHeight
  108297. })
  108298. }), [this.genGradient(), this.hasLabels && this.genLabels(-(this._lineWidth / 2)), this.genPath()]);
  108299. }
  108300. },
  108301. render: function render(h) {
  108302. if (this.totalValues < 2) return undefined;
  108303. return this.type === 'trend' ? this.genTrend() : this.genBars();
  108304. }
  108305. }));
  108306. /***/ }),
  108307. /***/ "./src/components/VSparkline/helpers/core.ts":
  108308. /*!***************************************************!*\
  108309. !*** ./src/components/VSparkline/helpers/core.ts ***!
  108310. \***************************************************/
  108311. /*! exports provided: genPoints, genBars */
  108312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108313. "use strict";
  108314. __webpack_require__.r(__webpack_exports__);
  108315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genPoints", function() { return genPoints; });
  108316. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genBars", function() { return genBars; });
  108317. var __read = undefined && undefined.__read || function (o, n) {
  108318. var m = typeof Symbol === "function" && o[Symbol.iterator];
  108319. if (!m) return o;
  108320. var i = m.call(o),
  108321. r,
  108322. ar = [],
  108323. e;
  108324. try {
  108325. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  108326. ar.push(r.value);
  108327. }
  108328. } catch (error) {
  108329. e = {
  108330. error: error
  108331. };
  108332. } finally {
  108333. try {
  108334. if (r && !r.done && (m = i["return"])) m.call(i);
  108335. } finally {
  108336. if (e) throw e.error;
  108337. }
  108338. }
  108339. return ar;
  108340. };
  108341. var __spread = undefined && undefined.__spread || function () {
  108342. for (var ar = [], i = 0; i < arguments.length; i++) {
  108343. ar = ar.concat(__read(arguments[i]));
  108344. }
  108345. return ar;
  108346. };
  108347. function genPoints(values, boundary) {
  108348. var minX = boundary.minX,
  108349. maxX = boundary.maxX,
  108350. minY = boundary.minY,
  108351. maxY = boundary.maxY;
  108352. var totalValues = values.length;
  108353. var maxValue = Math.max.apply(Math, __spread(values));
  108354. var minValue = Math.min.apply(Math, __spread(values));
  108355. var gridX = (maxX - minX) / (totalValues - 1);
  108356. var gridY = (maxY - minY) / (maxValue - minValue || 1);
  108357. return values.map(function (value, index) {
  108358. return {
  108359. x: minX + index * gridX,
  108360. y: maxY - (value - minValue) * gridY + +(index === totalValues - 1) * 0.00001 - +(index === 0) * 0.00001,
  108361. value: value
  108362. };
  108363. });
  108364. }
  108365. function genBars(values, boundary) {
  108366. var minX = boundary.minX,
  108367. maxX = boundary.maxX,
  108368. minY = boundary.minY,
  108369. maxY = boundary.maxY;
  108370. var totalValues = values.length;
  108371. var maxValue = Math.max.apply(Math, __spread(values));
  108372. var minValue = Math.min.apply(Math, __spread(values));
  108373. if (minValue > 0) minValue = 0;
  108374. if (maxValue < 0) maxValue = 0;
  108375. var gridX = maxX / totalValues;
  108376. var gridY = (maxY - minY) / (maxValue - minValue || 1);
  108377. var horizonY = maxY - Math.abs(minValue * gridY);
  108378. return values.map(function (value, index) {
  108379. var height = Math.abs(gridY * value);
  108380. return {
  108381. x: minX + index * gridX,
  108382. y: horizonY - height + +(value < 0) * height,
  108383. height: height,
  108384. value: value
  108385. };
  108386. });
  108387. }
  108388. /***/ }),
  108389. /***/ "./src/components/VSparkline/helpers/math.ts":
  108390. /*!***************************************************!*\
  108391. !*** ./src/components/VSparkline/helpers/math.ts ***!
  108392. \***************************************************/
  108393. /*! exports provided: checkCollinear, getDistance, moveTo */
  108394. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108395. "use strict";
  108396. __webpack_require__.r(__webpack_exports__);
  108397. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkCollinear", function() { return checkCollinear; });
  108398. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDistance", function() { return getDistance; });
  108399. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moveTo", function() { return moveTo; });
  108400. function int(value) {
  108401. return parseInt(value, 10);
  108402. }
  108403. /**
  108404. * https://en.wikipedia.org/wiki/Collinearity
  108405. * x=(x1+x2)/2
  108406. * y=(y1+y2)/2
  108407. */
  108408. function checkCollinear(p0, p1, p2) {
  108409. return int(p0.x + p2.x) === int(2 * p1.x) && int(p0.y + p2.y) === int(2 * p1.y);
  108410. }
  108411. function getDistance(p1, p2) {
  108412. return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
  108413. }
  108414. function moveTo(to, from, radius) {
  108415. var vector = {
  108416. x: to.x - from.x,
  108417. y: to.y - from.y
  108418. };
  108419. var length = Math.sqrt(vector.x * vector.x + vector.y * vector.y);
  108420. var unitVector = {
  108421. x: vector.x / length,
  108422. y: vector.y / length
  108423. };
  108424. return {
  108425. x: from.x + unitVector.x * radius,
  108426. y: from.y + unitVector.y * radius
  108427. };
  108428. }
  108429. /***/ }),
  108430. /***/ "./src/components/VSparkline/helpers/path.ts":
  108431. /*!***************************************************!*\
  108432. !*** ./src/components/VSparkline/helpers/path.ts ***!
  108433. \***************************************************/
  108434. /*! exports provided: genPath */
  108435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108436. "use strict";
  108437. __webpack_require__.r(__webpack_exports__);
  108438. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genPath", function() { return genPath; });
  108439. /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math */ "./src/components/VSparkline/helpers/math.ts");
  108440. /**
  108441. * From https://github.com/unsplash/react-trend/blob/master/src/helpers/DOM.helpers.js#L18
  108442. */
  108443. function genPath(points, radius, fill, height) {
  108444. if (fill === void 0) {
  108445. fill = false;
  108446. }
  108447. if (height === void 0) {
  108448. height = 75;
  108449. }
  108450. var start = points.shift();
  108451. var end = points[points.length - 1];
  108452. return (fill ? "M" + start.x + " " + (height - start.x + 2) + " L" + start.x + " " + start.y : "M" + start.x + " " + start.y) + points.map(function (point, index) {
  108453. var next = points[index + 1];
  108454. var prev = points[index - 1] || start;
  108455. var isCollinear = next && Object(_math__WEBPACK_IMPORTED_MODULE_0__["checkCollinear"])(next, point, prev);
  108456. if (!next || isCollinear) {
  108457. return "L" + point.x + " " + point.y;
  108458. }
  108459. var threshold = Math.min(Object(_math__WEBPACK_IMPORTED_MODULE_0__["getDistance"])(prev, point), Object(_math__WEBPACK_IMPORTED_MODULE_0__["getDistance"])(next, point));
  108460. var isTooCloseForRadius = threshold / 2 < radius;
  108461. var radiusForPoint = isTooCloseForRadius ? threshold / 2 : radius;
  108462. var before = Object(_math__WEBPACK_IMPORTED_MODULE_0__["moveTo"])(prev, point, radiusForPoint);
  108463. var after = Object(_math__WEBPACK_IMPORTED_MODULE_0__["moveTo"])(next, point, radiusForPoint);
  108464. return "L" + before.x + " " + before.y + "S" + point.x + " " + point.y + " " + after.x + " " + after.y;
  108465. }).join('') + (fill ? "L" + end.x + " " + (height - start.x + 2) + " Z" : '');
  108466. }
  108467. /***/ }),
  108468. /***/ "./src/components/VSparkline/index.ts":
  108469. /*!********************************************!*\
  108470. !*** ./src/components/VSparkline/index.ts ***!
  108471. \********************************************/
  108472. /*! exports provided: VSparkline, default */
  108473. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108474. "use strict";
  108475. __webpack_require__.r(__webpack_exports__);
  108476. /* harmony import */ var _VSparkline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSparkline */ "./src/components/VSparkline/VSparkline.ts");
  108477. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSparkline", function() { return _VSparkline__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  108478. /* harmony default export */ __webpack_exports__["default"] = (_VSparkline__WEBPACK_IMPORTED_MODULE_0__["default"]);
  108479. /***/ }),
  108480. /***/ "./src/components/VSpeedDial/VSpeedDial.sass":
  108481. /*!***************************************************!*\
  108482. !*** ./src/components/VSpeedDial/VSpeedDial.sass ***!
  108483. \***************************************************/
  108484. /*! no static exports found */
  108485. /***/ (function(module, exports, __webpack_require__) {
  108486. // extracted by mini-css-extract-plugin
  108487. /***/ }),
  108488. /***/ "./src/components/VSpeedDial/VSpeedDial.ts":
  108489. /*!*************************************************!*\
  108490. !*** ./src/components/VSpeedDial/VSpeedDial.ts ***!
  108491. \*************************************************/
  108492. /*! exports provided: default */
  108493. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108494. "use strict";
  108495. __webpack_require__.r(__webpack_exports__);
  108496. /* harmony import */ var _VSpeedDial_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSpeedDial.sass */ "./src/components/VSpeedDial/VSpeedDial.sass");
  108497. /* harmony import */ var _VSpeedDial_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSpeedDial_sass__WEBPACK_IMPORTED_MODULE_0__);
  108498. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  108499. /* harmony import */ var _mixins_positionable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/positionable */ "./src/mixins/positionable/index.ts");
  108500. /* harmony import */ var _mixins_transitionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/transitionable */ "./src/mixins/transitionable/index.ts");
  108501. /* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside/index.ts");
  108502. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  108503. // Styles
  108504. // Mixins
  108505. // Directives
  108506. // Types
  108507. /* @vue/component */
  108508. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_mixins_positionable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_transitionable__WEBPACK_IMPORTED_MODULE_3__["default"]).extend({
  108509. name: 'v-speed-dial',
  108510. directives: {
  108511. ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_4__["default"]
  108512. },
  108513. props: {
  108514. direction: {
  108515. type: String,
  108516. default: 'top',
  108517. validator: function validator(val) {
  108518. return ['top', 'right', 'bottom', 'left'].includes(val);
  108519. }
  108520. },
  108521. openOnHover: Boolean,
  108522. transition: {
  108523. type: String,
  108524. default: 'scale-transition'
  108525. }
  108526. },
  108527. computed: {
  108528. classes: function classes() {
  108529. var _a;
  108530. return _a = {
  108531. 'v-speed-dial': true,
  108532. 'v-speed-dial--top': this.top,
  108533. 'v-speed-dial--right': this.right,
  108534. 'v-speed-dial--bottom': this.bottom,
  108535. 'v-speed-dial--left': this.left,
  108536. 'v-speed-dial--absolute': this.absolute,
  108537. 'v-speed-dial--fixed': this.fixed
  108538. }, _a["v-speed-dial--direction-" + this.direction] = true, _a['v-speed-dial--is-active'] = this.isActive, _a;
  108539. }
  108540. },
  108541. render: function render(h) {
  108542. var _this = this;
  108543. var children = [];
  108544. var data = {
  108545. class: this.classes,
  108546. directives: [{
  108547. name: 'click-outside',
  108548. value: function value() {
  108549. return _this.isActive = false;
  108550. }
  108551. }],
  108552. on: {
  108553. click: function click() {
  108554. return _this.isActive = !_this.isActive;
  108555. }
  108556. }
  108557. };
  108558. if (this.openOnHover) {
  108559. data.on.mouseenter = function () {
  108560. return _this.isActive = true;
  108561. };
  108562. data.on.mouseleave = function () {
  108563. return _this.isActive = false;
  108564. };
  108565. }
  108566. if (this.isActive) {
  108567. var btnCount_1 = 0;
  108568. children = (this.$slots.default || []).map(function (b, i) {
  108569. if (b.tag && typeof b.componentOptions !== 'undefined' && (b.componentOptions.Ctor.options.name === 'v-btn' || b.componentOptions.Ctor.options.name === 'v-tooltip')) {
  108570. btnCount_1++;
  108571. return h('div', {
  108572. style: {
  108573. transitionDelay: btnCount_1 * 0.05 + 's'
  108574. },
  108575. key: i
  108576. }, [b]);
  108577. } else {
  108578. b.key = i;
  108579. return b;
  108580. }
  108581. });
  108582. }
  108583. var list = h('transition-group', {
  108584. class: 'v-speed-dial__list',
  108585. props: {
  108586. name: this.transition,
  108587. mode: this.mode,
  108588. origin: this.origin,
  108589. tag: 'div'
  108590. }
  108591. }, children);
  108592. return h('div', data, [this.$slots.activator, list]);
  108593. }
  108594. }));
  108595. /***/ }),
  108596. /***/ "./src/components/VSpeedDial/index.ts":
  108597. /*!********************************************!*\
  108598. !*** ./src/components/VSpeedDial/index.ts ***!
  108599. \********************************************/
  108600. /*! exports provided: VSpeedDial, default */
  108601. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108602. "use strict";
  108603. __webpack_require__.r(__webpack_exports__);
  108604. /* harmony import */ var _VSpeedDial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSpeedDial */ "./src/components/VSpeedDial/VSpeedDial.ts");
  108605. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSpeedDial", function() { return _VSpeedDial__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  108606. /* harmony default export */ __webpack_exports__["default"] = (_VSpeedDial__WEBPACK_IMPORTED_MODULE_0__["default"]);
  108607. /***/ }),
  108608. /***/ "./src/components/VStepper/VStepper.sass":
  108609. /*!***********************************************!*\
  108610. !*** ./src/components/VStepper/VStepper.sass ***!
  108611. \***********************************************/
  108612. /*! no static exports found */
  108613. /***/ (function(module, exports, __webpack_require__) {
  108614. // extracted by mini-css-extract-plugin
  108615. /***/ }),
  108616. /***/ "./src/components/VStepper/VStepper.ts":
  108617. /*!*********************************************!*\
  108618. !*** ./src/components/VStepper/VStepper.ts ***!
  108619. \*********************************************/
  108620. /*! exports provided: default */
  108621. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108622. "use strict";
  108623. __webpack_require__.r(__webpack_exports__);
  108624. /* harmony import */ var _VStepper_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VStepper.sass */ "./src/components/VStepper/VStepper.sass");
  108625. /* harmony import */ var _VStepper_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VStepper_sass__WEBPACK_IMPORTED_MODULE_0__);
  108626. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  108627. /* harmony import */ var _mixins_proxyable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/proxyable */ "./src/mixins/proxyable/index.ts");
  108628. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  108629. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  108630. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  108631. var __assign = undefined && undefined.__assign || function () {
  108632. __assign = Object.assign || function (t) {
  108633. for (var s, i = 1, n = arguments.length; i < n; i++) {
  108634. s = arguments[i];
  108635. for (var p in s) {
  108636. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  108637. }
  108638. }
  108639. return t;
  108640. };
  108641. return __assign.apply(this, arguments);
  108642. }; // Styles
  108643. // Mixins
  108644. // Utilities
  108645. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_1__["provide"])('stepper'), _mixins_proxyable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]);
  108646. /* @vue/component */
  108647. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  108648. name: 'v-stepper',
  108649. provide: function provide() {
  108650. return {
  108651. stepClick: this.stepClick,
  108652. isVertical: this.vertical
  108653. };
  108654. },
  108655. props: {
  108656. altLabels: Boolean,
  108657. nonLinear: Boolean,
  108658. vertical: Boolean
  108659. },
  108660. data: function data() {
  108661. var data = {
  108662. isBooted: false,
  108663. steps: [],
  108664. content: [],
  108665. isReverse: false
  108666. };
  108667. data.internalLazyValue = this.value != null ? this.value : (data[0] || {}).step || 1;
  108668. return data;
  108669. },
  108670. computed: {
  108671. classes: function classes() {
  108672. return __assign({
  108673. 'v-stepper--is-booted': this.isBooted,
  108674. 'v-stepper--vertical': this.vertical,
  108675. 'v-stepper--alt-labels': this.altLabels,
  108676. 'v-stepper--non-linear': this.nonLinear
  108677. }, this.themeClasses);
  108678. }
  108679. },
  108680. watch: {
  108681. internalValue: function internalValue(val, oldVal) {
  108682. this.isReverse = Number(val) < Number(oldVal);
  108683. oldVal && (this.isBooted = true);
  108684. this.updateView();
  108685. }
  108686. },
  108687. created: function created() {
  108688. /* istanbul ignore next */
  108689. if (this.$listeners.input) {
  108690. Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["breaking"])('@input', '@change', this);
  108691. }
  108692. },
  108693. mounted: function mounted() {
  108694. this.updateView();
  108695. },
  108696. methods: {
  108697. register: function register(item) {
  108698. if (item.$options.name === 'v-stepper-step') {
  108699. this.steps.push(item);
  108700. } else if (item.$options.name === 'v-stepper-content') {
  108701. item.isVertical = this.vertical;
  108702. this.content.push(item);
  108703. }
  108704. },
  108705. unregister: function unregister(item) {
  108706. if (item.$options.name === 'v-stepper-step') {
  108707. this.steps = this.steps.filter(function (i) {
  108708. return i !== item;
  108709. });
  108710. } else if (item.$options.name === 'v-stepper-content') {
  108711. item.isVertical = this.vertical;
  108712. this.content = this.content.filter(function (i) {
  108713. return i !== item;
  108714. });
  108715. }
  108716. },
  108717. stepClick: function stepClick(step) {
  108718. var _this = this;
  108719. this.$nextTick(function () {
  108720. return _this.internalValue = step;
  108721. });
  108722. },
  108723. updateView: function updateView() {
  108724. for (var index = this.steps.length; --index >= 0;) {
  108725. this.steps[index].toggle(this.internalValue);
  108726. }
  108727. for (var index = this.content.length; --index >= 0;) {
  108728. this.content[index].toggle(this.internalValue, this.isReverse);
  108729. }
  108730. }
  108731. },
  108732. render: function render(h) {
  108733. return h('div', {
  108734. staticClass: 'v-stepper',
  108735. class: this.classes
  108736. }, this.$slots.default);
  108737. }
  108738. }));
  108739. /***/ }),
  108740. /***/ "./src/components/VStepper/VStepperContent.ts":
  108741. /*!****************************************************!*\
  108742. !*** ./src/components/VStepper/VStepperContent.ts ***!
  108743. \****************************************************/
  108744. /*! exports provided: default */
  108745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108746. "use strict";
  108747. __webpack_require__.r(__webpack_exports__);
  108748. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  108749. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  108750. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  108751. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  108752. // Components
  108753. // Mixins
  108754. // Helpers
  108755. // Utilities
  108756. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_1__["inject"])('stepper', 'v-stepper-content', 'v-stepper'));
  108757. /* @vue/component */
  108758. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  108759. name: 'v-stepper-content',
  108760. inject: {
  108761. isVerticalProvided: {
  108762. from: 'isVertical'
  108763. }
  108764. },
  108765. props: {
  108766. step: {
  108767. type: [Number, String],
  108768. required: true
  108769. }
  108770. },
  108771. data: function data() {
  108772. return {
  108773. height: 0,
  108774. // Must be null to allow
  108775. // previous comparison
  108776. isActive: null,
  108777. isReverse: false,
  108778. isVertical: this.isVerticalProvided
  108779. };
  108780. },
  108781. computed: {
  108782. computedTransition: function computedTransition() {
  108783. // Fix for #8978
  108784. var reverse = this.$vuetify.rtl ? !this.isReverse : this.isReverse;
  108785. return reverse ? _transitions__WEBPACK_IMPORTED_MODULE_0__["VTabReverseTransition"] : _transitions__WEBPACK_IMPORTED_MODULE_0__["VTabTransition"];
  108786. },
  108787. styles: function styles() {
  108788. if (!this.isVertical) return {};
  108789. return {
  108790. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["convertToUnit"])(this.height)
  108791. };
  108792. }
  108793. },
  108794. watch: {
  108795. isActive: function isActive(current, previous) {
  108796. // If active and the previous state
  108797. // was null, is just booting up
  108798. if (current && previous == null) {
  108799. this.height = 'auto';
  108800. return;
  108801. }
  108802. if (!this.isVertical) return;
  108803. if (this.isActive) this.enter();else this.leave();
  108804. }
  108805. },
  108806. mounted: function mounted() {
  108807. this.$refs.wrapper.addEventListener('transitionend', this.onTransition, false);
  108808. this.stepper && this.stepper.register(this);
  108809. },
  108810. beforeDestroy: function beforeDestroy() {
  108811. this.$refs.wrapper.removeEventListener('transitionend', this.onTransition, false);
  108812. this.stepper && this.stepper.unregister(this);
  108813. },
  108814. methods: {
  108815. onTransition: function onTransition(e) {
  108816. if (!this.isActive || e.propertyName !== 'height') return;
  108817. this.height = 'auto';
  108818. },
  108819. enter: function enter() {
  108820. var _this = this;
  108821. var scrollHeight = 0; // Render bug with height
  108822. requestAnimationFrame(function () {
  108823. scrollHeight = _this.$refs.wrapper.scrollHeight;
  108824. });
  108825. this.height = 0; // Give the collapsing element time to collapse
  108826. setTimeout(function () {
  108827. return _this.isActive && (_this.height = scrollHeight || 'auto');
  108828. }, 450);
  108829. },
  108830. leave: function leave() {
  108831. var _this = this;
  108832. this.height = this.$refs.wrapper.clientHeight;
  108833. setTimeout(function () {
  108834. return _this.height = 0;
  108835. }, 10);
  108836. },
  108837. toggle: function toggle(step, reverse) {
  108838. this.isActive = step.toString() === this.step.toString();
  108839. this.isReverse = reverse;
  108840. }
  108841. },
  108842. render: function render(h) {
  108843. var contentData = {
  108844. staticClass: 'v-stepper__content'
  108845. };
  108846. var wrapperData = {
  108847. staticClass: 'v-stepper__wrapper',
  108848. style: this.styles,
  108849. ref: 'wrapper'
  108850. };
  108851. if (!this.isVertical) {
  108852. contentData.directives = [{
  108853. name: 'show',
  108854. value: this.isActive
  108855. }];
  108856. }
  108857. var wrapper = h('div', wrapperData, [this.$slots.default]);
  108858. var content = h('div', contentData, [wrapper]);
  108859. return h(this.computedTransition, {
  108860. on: this.$listeners
  108861. }, [content]);
  108862. }
  108863. }));
  108864. /***/ }),
  108865. /***/ "./src/components/VStepper/VStepperStep.ts":
  108866. /*!*************************************************!*\
  108867. !*** ./src/components/VStepper/VStepperStep.ts ***!
  108868. \*************************************************/
  108869. /*! exports provided: default */
  108870. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108871. "use strict";
  108872. __webpack_require__.r(__webpack_exports__);
  108873. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  108874. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  108875. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  108876. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  108877. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  108878. // Components
  108879. // Mixins
  108880. // Directives
  108881. // Utilities
  108882. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_2__["inject"])('stepper', 'v-stepper-step', 'v-stepper'));
  108883. /* @vue/component */
  108884. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  108885. name: 'v-stepper-step',
  108886. directives: {
  108887. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_3__["default"]
  108888. },
  108889. inject: ['stepClick'],
  108890. props: {
  108891. color: {
  108892. type: String,
  108893. default: 'primary'
  108894. },
  108895. complete: Boolean,
  108896. completeIcon: {
  108897. type: String,
  108898. default: '$complete'
  108899. },
  108900. editable: Boolean,
  108901. editIcon: {
  108902. type: String,
  108903. default: '$edit'
  108904. },
  108905. errorIcon: {
  108906. type: String,
  108907. default: '$error'
  108908. },
  108909. rules: {
  108910. type: Array,
  108911. default: function _default() {
  108912. return [];
  108913. }
  108914. },
  108915. step: [Number, String]
  108916. },
  108917. data: function data() {
  108918. return {
  108919. isActive: false,
  108920. isInactive: true
  108921. };
  108922. },
  108923. computed: {
  108924. classes: function classes() {
  108925. return {
  108926. 'v-stepper__step--active': this.isActive,
  108927. 'v-stepper__step--editable': this.editable,
  108928. 'v-stepper__step--inactive': this.isInactive,
  108929. 'v-stepper__step--error error--text': this.hasError,
  108930. 'v-stepper__step--complete': this.complete
  108931. };
  108932. },
  108933. hasError: function hasError() {
  108934. return this.rules.some(function (validate) {
  108935. return validate() !== true;
  108936. });
  108937. }
  108938. },
  108939. mounted: function mounted() {
  108940. this.stepper && this.stepper.register(this);
  108941. },
  108942. beforeDestroy: function beforeDestroy() {
  108943. this.stepper && this.stepper.unregister(this);
  108944. },
  108945. methods: {
  108946. click: function click(e) {
  108947. e.stopPropagation();
  108948. this.$emit('click', e);
  108949. if (this.editable) {
  108950. this.stepClick(this.step);
  108951. }
  108952. },
  108953. genIcon: function genIcon(icon) {
  108954. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"], icon);
  108955. },
  108956. genLabel: function genLabel() {
  108957. return this.$createElement('div', {
  108958. staticClass: 'v-stepper__label'
  108959. }, this.$slots.default);
  108960. },
  108961. genStep: function genStep() {
  108962. var color = !this.hasError && (this.complete || this.isActive) ? this.color : false;
  108963. return this.$createElement('span', this.setBackgroundColor(color, {
  108964. staticClass: 'v-stepper__step__step'
  108965. }), this.genStepContent());
  108966. },
  108967. genStepContent: function genStepContent() {
  108968. var children = [];
  108969. if (this.hasError) {
  108970. children.push(this.genIcon(this.errorIcon));
  108971. } else if (this.complete) {
  108972. if (this.editable) {
  108973. children.push(this.genIcon(this.editIcon));
  108974. } else {
  108975. children.push(this.genIcon(this.completeIcon));
  108976. }
  108977. } else {
  108978. children.push(String(this.step));
  108979. }
  108980. return children;
  108981. },
  108982. toggle: function toggle(step) {
  108983. this.isActive = step.toString() === this.step.toString();
  108984. this.isInactive = Number(step) < Number(this.step);
  108985. }
  108986. },
  108987. render: function render(h) {
  108988. return h('div', {
  108989. staticClass: 'v-stepper__step',
  108990. class: this.classes,
  108991. directives: [{
  108992. name: 'ripple',
  108993. value: this.editable
  108994. }],
  108995. on: {
  108996. click: this.click
  108997. }
  108998. }, [this.genStep(), this.genLabel()]);
  108999. }
  109000. }));
  109001. /***/ }),
  109002. /***/ "./src/components/VStepper/index.ts":
  109003. /*!******************************************!*\
  109004. !*** ./src/components/VStepper/index.ts ***!
  109005. \******************************************/
  109006. /*! exports provided: VStepper, VStepperContent, VStepperStep, VStepperHeader, VStepperItems, default */
  109007. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109008. "use strict";
  109009. __webpack_require__.r(__webpack_exports__);
  109010. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VStepperHeader", function() { return VStepperHeader; });
  109011. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VStepperItems", function() { return VStepperItems; });
  109012. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  109013. /* harmony import */ var _VStepper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VStepper */ "./src/components/VStepper/VStepper.ts");
  109014. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepper", function() { return _VStepper__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  109015. /* harmony import */ var _VStepperStep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VStepperStep */ "./src/components/VStepper/VStepperStep.ts");
  109016. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepperStep", function() { return _VStepperStep__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  109017. /* harmony import */ var _VStepperContent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VStepperContent */ "./src/components/VStepper/VStepperContent.ts");
  109018. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepperContent", function() { return _VStepperContent__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  109019. var VStepperHeader = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-stepper__header');
  109020. var VStepperItems = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-stepper__items');
  109021. /* harmony default export */ __webpack_exports__["default"] = ({
  109022. $_vuetify_subcomponents: {
  109023. VStepper: _VStepper__WEBPACK_IMPORTED_MODULE_1__["default"],
  109024. VStepperContent: _VStepperContent__WEBPACK_IMPORTED_MODULE_3__["default"],
  109025. VStepperStep: _VStepperStep__WEBPACK_IMPORTED_MODULE_2__["default"],
  109026. VStepperHeader: VStepperHeader,
  109027. VStepperItems: VStepperItems
  109028. }
  109029. });
  109030. /***/ }),
  109031. /***/ "./src/components/VSubheader/VSubheader.sass":
  109032. /*!***************************************************!*\
  109033. !*** ./src/components/VSubheader/VSubheader.sass ***!
  109034. \***************************************************/
  109035. /*! no static exports found */
  109036. /***/ (function(module, exports, __webpack_require__) {
  109037. // extracted by mini-css-extract-plugin
  109038. /***/ }),
  109039. /***/ "./src/components/VSubheader/VSubheader.ts":
  109040. /*!*************************************************!*\
  109041. !*** ./src/components/VSubheader/VSubheader.ts ***!
  109042. \*************************************************/
  109043. /*! exports provided: default */
  109044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109045. "use strict";
  109046. __webpack_require__.r(__webpack_exports__);
  109047. /* harmony import */ var _VSubheader_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSubheader.sass */ "./src/components/VSubheader/VSubheader.sass");
  109048. /* harmony import */ var _VSubheader_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSubheader_sass__WEBPACK_IMPORTED_MODULE_0__);
  109049. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  109050. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  109051. var __assign = undefined && undefined.__assign || function () {
  109052. __assign = Object.assign || function (t) {
  109053. for (var s, i = 1, n = arguments.length; i < n; i++) {
  109054. s = arguments[i];
  109055. for (var p in s) {
  109056. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  109057. }
  109058. }
  109059. return t;
  109060. };
  109061. return __assign.apply(this, arguments);
  109062. }; // Styles
  109063. // Mixins
  109064. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"]
  109065. /* @vue/component */
  109066. ).extend({
  109067. name: 'v-subheader',
  109068. props: {
  109069. inset: Boolean
  109070. },
  109071. render: function render(h) {
  109072. return h('div', {
  109073. staticClass: 'v-subheader',
  109074. class: __assign({
  109075. 'v-subheader--inset': this.inset
  109076. }, this.themeClasses),
  109077. attrs: this.$attrs,
  109078. on: this.$listeners
  109079. }, this.$slots.default);
  109080. }
  109081. }));
  109082. /***/ }),
  109083. /***/ "./src/components/VSubheader/index.ts":
  109084. /*!********************************************!*\
  109085. !*** ./src/components/VSubheader/index.ts ***!
  109086. \********************************************/
  109087. /*! exports provided: VSubheader, default */
  109088. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109089. "use strict";
  109090. __webpack_require__.r(__webpack_exports__);
  109091. /* harmony import */ var _VSubheader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSubheader */ "./src/components/VSubheader/VSubheader.ts");
  109092. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSubheader", function() { return _VSubheader__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  109093. /* harmony default export */ __webpack_exports__["default"] = (_VSubheader__WEBPACK_IMPORTED_MODULE_0__["default"]);
  109094. /***/ }),
  109095. /***/ "./src/components/VSwitch/VSwitch.sass":
  109096. /*!*********************************************!*\
  109097. !*** ./src/components/VSwitch/VSwitch.sass ***!
  109098. \*********************************************/
  109099. /*! no static exports found */
  109100. /***/ (function(module, exports, __webpack_require__) {
  109101. // extracted by mini-css-extract-plugin
  109102. /***/ }),
  109103. /***/ "./src/components/VSwitch/VSwitch.ts":
  109104. /*!*******************************************!*\
  109105. !*** ./src/components/VSwitch/VSwitch.ts ***!
  109106. \*******************************************/
  109107. /*! exports provided: default */
  109108. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109109. "use strict";
  109110. __webpack_require__.r(__webpack_exports__);
  109111. /* harmony import */ var _styles_components_selection_controls_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../styles/components/_selection-controls.sass */ "./src/styles/components/_selection-controls.sass");
  109112. /* harmony import */ var _styles_components_selection_controls_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_styles_components_selection_controls_sass__WEBPACK_IMPORTED_MODULE_0__);
  109113. /* harmony import */ var _VSwitch_sass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VSwitch.sass */ "./src/components/VSwitch/VSwitch.sass");
  109114. /* harmony import */ var _VSwitch_sass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_VSwitch_sass__WEBPACK_IMPORTED_MODULE_1__);
  109115. /* harmony import */ var _mixins_selectable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/selectable */ "./src/mixins/selectable/index.ts");
  109116. /* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.ts");
  109117. /* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch/index.ts");
  109118. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  109119. /* harmony import */ var _VProgressCircular_VProgressCircular__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../VProgressCircular/VProgressCircular */ "./src/components/VProgressCircular/VProgressCircular.ts");
  109120. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  109121. var __assign = undefined && undefined.__assign || function () {
  109122. __assign = Object.assign || function (t) {
  109123. for (var s, i = 1, n = arguments.length; i < n; i++) {
  109124. s = arguments[i];
  109125. for (var p in s) {
  109126. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  109127. }
  109128. }
  109129. return t;
  109130. };
  109131. return __assign.apply(this, arguments);
  109132. }; // Styles
  109133. // Mixins
  109134. // Directives
  109135. // Components
  109136. // Helpers
  109137. /* @vue/component */
  109138. /* harmony default export */ __webpack_exports__["default"] = (_mixins_selectable__WEBPACK_IMPORTED_MODULE_2__["default"].extend({
  109139. name: 'v-switch',
  109140. directives: {
  109141. Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_4__["default"]
  109142. },
  109143. props: {
  109144. inset: Boolean,
  109145. loading: {
  109146. type: [Boolean, String],
  109147. default: false
  109148. },
  109149. flat: {
  109150. type: Boolean,
  109151. default: false
  109152. }
  109153. },
  109154. computed: {
  109155. classes: function classes() {
  109156. return __assign({}, _VInput__WEBPACK_IMPORTED_MODULE_3__["default"].options.computed.classes.call(this), {
  109157. 'v-input--selection-controls v-input--switch': true,
  109158. 'v-input--switch--flat': this.flat,
  109159. 'v-input--switch--inset': this.inset
  109160. });
  109161. },
  109162. attrs: function attrs() {
  109163. return {
  109164. 'aria-checked': String(this.isActive),
  109165. 'aria-disabled': String(this.disabled),
  109166. role: 'switch'
  109167. };
  109168. },
  109169. // Do not return undefined if disabled,
  109170. // according to spec, should still show
  109171. // a color when disabled and active
  109172. validationState: function validationState() {
  109173. if (this.hasError && this.shouldValidate) return 'error';
  109174. if (this.hasSuccess) return 'success';
  109175. if (this.hasColor !== null) return this.computedColor;
  109176. return undefined;
  109177. },
  109178. switchData: function switchData() {
  109179. return this.setTextColor(this.loading ? undefined : this.validationState, {
  109180. class: this.themeClasses
  109181. });
  109182. }
  109183. },
  109184. methods: {
  109185. genDefaultSlot: function genDefaultSlot() {
  109186. return [this.genSwitch(), this.genLabel()];
  109187. },
  109188. genSwitch: function genSwitch() {
  109189. return this.$createElement('div', {
  109190. staticClass: 'v-input--selection-controls__input'
  109191. }, [this.genInput('checkbox', __assign({}, this.attrs, this.attrs$)), this.genRipple(this.setTextColor(this.validationState, {
  109192. directives: [{
  109193. name: 'touch',
  109194. value: {
  109195. left: this.onSwipeLeft,
  109196. right: this.onSwipeRight
  109197. }
  109198. }]
  109199. })), this.$createElement('div', __assign({
  109200. staticClass: 'v-input--switch__track'
  109201. }, this.switchData)), this.$createElement('div', __assign({
  109202. staticClass: 'v-input--switch__thumb'
  109203. }, this.switchData), [this.genProgress()])]);
  109204. },
  109205. genProgress: function genProgress() {
  109206. return this.$createElement(_transitions__WEBPACK_IMPORTED_MODULE_5__["VFabTransition"], {}, [this.loading === false ? null : this.$slots.progress || this.$createElement(_VProgressCircular_VProgressCircular__WEBPACK_IMPORTED_MODULE_6__["default"], {
  109207. props: {
  109208. color: this.loading === true || this.loading === '' ? this.color || 'primary' : this.loading,
  109209. size: 16,
  109210. width: 2,
  109211. indeterminate: true
  109212. }
  109213. })]);
  109214. },
  109215. onSwipeLeft: function onSwipeLeft() {
  109216. if (this.isActive) this.onChange();
  109217. },
  109218. onSwipeRight: function onSwipeRight() {
  109219. if (!this.isActive) this.onChange();
  109220. },
  109221. onKeydown: function onKeydown(e) {
  109222. if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_7__["keyCodes"].left && this.isActive || e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_7__["keyCodes"].right && !this.isActive) this.onChange();
  109223. }
  109224. }
  109225. }));
  109226. /***/ }),
  109227. /***/ "./src/components/VSwitch/index.ts":
  109228. /*!*****************************************!*\
  109229. !*** ./src/components/VSwitch/index.ts ***!
  109230. \*****************************************/
  109231. /*! exports provided: VSwitch, default */
  109232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109233. "use strict";
  109234. __webpack_require__.r(__webpack_exports__);
  109235. /* harmony import */ var _VSwitch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSwitch */ "./src/components/VSwitch/VSwitch.ts");
  109236. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSwitch", function() { return _VSwitch__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  109237. /* harmony default export */ __webpack_exports__["default"] = (_VSwitch__WEBPACK_IMPORTED_MODULE_0__["default"]);
  109238. /***/ }),
  109239. /***/ "./src/components/VSystemBar/VSystemBar.sass":
  109240. /*!***************************************************!*\
  109241. !*** ./src/components/VSystemBar/VSystemBar.sass ***!
  109242. \***************************************************/
  109243. /*! no static exports found */
  109244. /***/ (function(module, exports, __webpack_require__) {
  109245. // extracted by mini-css-extract-plugin
  109246. /***/ }),
  109247. /***/ "./src/components/VSystemBar/VSystemBar.ts":
  109248. /*!*************************************************!*\
  109249. !*** ./src/components/VSystemBar/VSystemBar.ts ***!
  109250. \*************************************************/
  109251. /*! exports provided: default */
  109252. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109253. "use strict";
  109254. __webpack_require__.r(__webpack_exports__);
  109255. /* harmony import */ var _VSystemBar_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSystemBar.sass */ "./src/components/VSystemBar/VSystemBar.sass");
  109256. /* harmony import */ var _VSystemBar_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VSystemBar_sass__WEBPACK_IMPORTED_MODULE_0__);
  109257. /* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable/index.ts");
  109258. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  109259. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  109260. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  109261. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  109262. var __assign = undefined && undefined.__assign || function () {
  109263. __assign = Object.assign || function (t) {
  109264. for (var s, i = 1, n = arguments.length; i < n; i++) {
  109265. s = arguments[i];
  109266. for (var p in s) {
  109267. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  109268. }
  109269. }
  109270. return t;
  109271. };
  109272. return __assign.apply(this, arguments);
  109273. }; // Styles
  109274. // Mixins
  109275. // Utilities
  109276. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__["default"])('bar', ['height', 'window']), _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]
  109277. /* @vue/component */
  109278. ).extend({
  109279. name: 'v-system-bar',
  109280. props: {
  109281. height: [Number, String],
  109282. lightsOut: Boolean,
  109283. window: Boolean
  109284. },
  109285. computed: {
  109286. classes: function classes() {
  109287. return __assign({
  109288. 'v-system-bar--lights-out': this.lightsOut,
  109289. 'v-system-bar--absolute': this.absolute,
  109290. 'v-system-bar--fixed': !this.absolute && (this.app || this.fixed),
  109291. 'v-system-bar--window': this.window
  109292. }, this.themeClasses);
  109293. },
  109294. computedHeight: function computedHeight() {
  109295. if (this.height) {
  109296. return isNaN(parseInt(this.height)) ? this.height : parseInt(this.height);
  109297. }
  109298. return this.window ? 32 : 24;
  109299. },
  109300. styles: function styles() {
  109301. return {
  109302. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["convertToUnit"])(this.computedHeight)
  109303. };
  109304. }
  109305. },
  109306. methods: {
  109307. updateApplication: function updateApplication() {
  109308. return this.$el ? this.$el.clientHeight : this.computedHeight;
  109309. }
  109310. },
  109311. render: function render(h) {
  109312. var data = {
  109313. staticClass: 'v-system-bar',
  109314. class: this.classes,
  109315. style: this.styles,
  109316. on: this.$listeners
  109317. };
  109318. return h('div', this.setBackgroundColor(this.color, data), Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["getSlot"])(this));
  109319. }
  109320. }));
  109321. /***/ }),
  109322. /***/ "./src/components/VSystemBar/index.ts":
  109323. /*!********************************************!*\
  109324. !*** ./src/components/VSystemBar/index.ts ***!
  109325. \********************************************/
  109326. /*! exports provided: VSystemBar, default */
  109327. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109328. "use strict";
  109329. __webpack_require__.r(__webpack_exports__);
  109330. /* harmony import */ var _VSystemBar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSystemBar */ "./src/components/VSystemBar/VSystemBar.ts");
  109331. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSystemBar", function() { return _VSystemBar__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  109332. /* harmony default export */ __webpack_exports__["default"] = (_VSystemBar__WEBPACK_IMPORTED_MODULE_0__["default"]);
  109333. /***/ }),
  109334. /***/ "./src/components/VTabs/VTab.ts":
  109335. /*!**************************************!*\
  109336. !*** ./src/components/VTabs/VTab.ts ***!
  109337. \**************************************/
  109338. /*! exports provided: default */
  109339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109340. "use strict";
  109341. __webpack_require__.r(__webpack_exports__);
  109342. /* harmony import */ var _mixins_groupable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/groupable */ "./src/mixins/groupable/index.ts");
  109343. /* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable/index.ts");
  109344. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  109345. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../util/helpers */ "./src/util/helpers.ts");
  109346. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  109347. var __assign = undefined && undefined.__assign || function () {
  109348. __assign = Object.assign || function (t) {
  109349. for (var s, i = 1, n = arguments.length; i < n; i++) {
  109350. s = arguments[i];
  109351. for (var p in s) {
  109352. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  109353. }
  109354. }
  109355. return t;
  109356. };
  109357. return __assign.apply(this, arguments);
  109358. }; // Mixins
  109359. // Utilities
  109360. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_routable__WEBPACK_IMPORTED_MODULE_1__["default"], // Must be after routable
  109361. // to overwrite activeClass
  109362. Object(_mixins_groupable__WEBPACK_IMPORTED_MODULE_0__["factory"])('tabsBar'), _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]);
  109363. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend().extend({
  109364. name: 'v-tab',
  109365. props: {
  109366. ripple: {
  109367. type: [Boolean, Object],
  109368. default: true
  109369. }
  109370. },
  109371. data: function data() {
  109372. return {
  109373. proxyClass: 'v-tab--active'
  109374. };
  109375. },
  109376. computed: {
  109377. classes: function classes() {
  109378. return __assign({
  109379. 'v-tab': true
  109380. }, _mixins_routable__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  109381. 'v-tab--disabled': this.disabled
  109382. }, this.groupClasses);
  109383. },
  109384. value: function value() {
  109385. var to = this.to || this.href || '';
  109386. if (this.$router && this.to === Object(this.to)) {
  109387. var resolve = this.$router.resolve(this.to, this.$route, this.append);
  109388. to = resolve.href;
  109389. }
  109390. return to.replace('#', '');
  109391. }
  109392. },
  109393. mounted: function mounted() {
  109394. this.onRouteChange();
  109395. },
  109396. methods: {
  109397. click: function click(e) {
  109398. // If user provides an
  109399. // actual link, do not
  109400. // prevent default
  109401. if (this.href && this.href.indexOf('#') > -1) e.preventDefault();
  109402. if (e.detail) this.$el.blur();
  109403. this.$emit('click', e);
  109404. this.to || this.toggle();
  109405. }
  109406. },
  109407. render: function render(h) {
  109408. var _this = this;
  109409. var _a = this.generateRouteLink(),
  109410. tag = _a.tag,
  109411. data = _a.data;
  109412. data.attrs = __assign({}, data.attrs, {
  109413. 'aria-selected': String(this.isActive),
  109414. role: 'tab',
  109415. tabindex: 0
  109416. });
  109417. data.on = __assign({}, data.on, {
  109418. keydown: function keydown(e) {
  109419. if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].enter) _this.click(e);
  109420. _this.$emit('keydown', e);
  109421. }
  109422. });
  109423. return h(tag, data, this.$slots.default);
  109424. }
  109425. }));
  109426. /***/ }),
  109427. /***/ "./src/components/VTabs/VTabItem.ts":
  109428. /*!******************************************!*\
  109429. !*** ./src/components/VTabs/VTabItem.ts ***!
  109430. \******************************************/
  109431. /*! exports provided: default */
  109432. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109433. "use strict";
  109434. __webpack_require__.r(__webpack_exports__);
  109435. /* harmony import */ var _VWindow_VWindowItem__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VWindow/VWindowItem */ "./src/components/VWindow/VWindowItem.ts");
  109436. // Extensions
  109437. /* @vue/component */
  109438. /* harmony default export */ __webpack_exports__["default"] = (_VWindow_VWindowItem__WEBPACK_IMPORTED_MODULE_0__["default"].extend({
  109439. name: 'v-tab-item',
  109440. props: {
  109441. id: String
  109442. },
  109443. methods: {
  109444. genWindowItem: function genWindowItem() {
  109445. var item = _VWindow_VWindowItem__WEBPACK_IMPORTED_MODULE_0__["default"].options.methods.genWindowItem.call(this);
  109446. item.data.domProps = item.data.domProps || {};
  109447. item.data.domProps.id = this.id || this.value;
  109448. return item;
  109449. }
  109450. }
  109451. }));
  109452. /***/ }),
  109453. /***/ "./src/components/VTabs/VTabs.sass":
  109454. /*!*****************************************!*\
  109455. !*** ./src/components/VTabs/VTabs.sass ***!
  109456. \*****************************************/
  109457. /*! no static exports found */
  109458. /***/ (function(module, exports, __webpack_require__) {
  109459. // extracted by mini-css-extract-plugin
  109460. /***/ }),
  109461. /***/ "./src/components/VTabs/VTabs.ts":
  109462. /*!***************************************!*\
  109463. !*** ./src/components/VTabs/VTabs.ts ***!
  109464. \***************************************/
  109465. /*! exports provided: default */
  109466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109467. "use strict";
  109468. __webpack_require__.r(__webpack_exports__);
  109469. /* harmony import */ var _VTabs_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTabs.sass */ "./src/components/VTabs/VTabs.sass");
  109470. /* harmony import */ var _VTabs_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VTabs_sass__WEBPACK_IMPORTED_MODULE_0__);
  109471. /* harmony import */ var _VTabsBar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTabsBar */ "./src/components/VTabs/VTabsBar.ts");
  109472. /* harmony import */ var _VTabsItems__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VTabsItems */ "./src/components/VTabs/VTabsItems.ts");
  109473. /* harmony import */ var _VTabsSlider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VTabsSlider */ "./src/components/VTabs/VTabsSlider.ts");
  109474. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  109475. /* harmony import */ var _mixins_proxyable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/proxyable */ "./src/mixins/proxyable/index.ts");
  109476. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  109477. /* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize/index.ts");
  109478. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  109479. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  109480. var __assign = undefined && undefined.__assign || function () {
  109481. __assign = Object.assign || function (t) {
  109482. for (var s, i = 1, n = arguments.length; i < n; i++) {
  109483. s = arguments[i];
  109484. for (var p in s) {
  109485. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  109486. }
  109487. }
  109488. return t;
  109489. };
  109490. return __assign.apply(this, arguments);
  109491. }; // Styles
  109492. // Components
  109493. // Mixins
  109494. // Directives
  109495. // Utilities
  109496. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_9__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_proxyable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__["default"]);
  109497. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  109498. name: 'v-tabs',
  109499. directives: {
  109500. Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_7__["default"]
  109501. },
  109502. props: {
  109503. activeClass: {
  109504. type: String,
  109505. default: ''
  109506. },
  109507. alignWithTitle: Boolean,
  109508. backgroundColor: String,
  109509. centerActive: Boolean,
  109510. centered: Boolean,
  109511. fixedTabs: Boolean,
  109512. grow: Boolean,
  109513. height: {
  109514. type: [Number, String],
  109515. default: undefined
  109516. },
  109517. hideSlider: Boolean,
  109518. iconsAndText: Boolean,
  109519. mobileBreakPoint: {
  109520. type: [Number, String],
  109521. default: 1264
  109522. },
  109523. nextIcon: {
  109524. type: String,
  109525. default: '$next'
  109526. },
  109527. optional: Boolean,
  109528. prevIcon: {
  109529. type: String,
  109530. default: '$prev'
  109531. },
  109532. right: Boolean,
  109533. showArrows: Boolean,
  109534. sliderColor: String,
  109535. sliderSize: {
  109536. type: [Number, String],
  109537. default: 2
  109538. },
  109539. vertical: Boolean
  109540. },
  109541. data: function data() {
  109542. return {
  109543. resizeTimeout: 0,
  109544. slider: {
  109545. height: null,
  109546. left: null,
  109547. right: null,
  109548. top: null,
  109549. width: null
  109550. },
  109551. transitionTime: 300
  109552. };
  109553. },
  109554. computed: {
  109555. classes: function classes() {
  109556. return __assign({
  109557. 'v-tabs--align-with-title': this.alignWithTitle,
  109558. 'v-tabs--centered': this.centered,
  109559. 'v-tabs--fixed-tabs': this.fixedTabs,
  109560. 'v-tabs--grow': this.grow,
  109561. 'v-tabs--icons-and-text': this.iconsAndText,
  109562. 'v-tabs--right': this.right,
  109563. 'v-tabs--vertical': this.vertical
  109564. }, this.themeClasses);
  109565. },
  109566. isReversed: function isReversed() {
  109567. return this.$vuetify.rtl && this.vertical;
  109568. },
  109569. sliderStyles: function sliderStyles() {
  109570. return {
  109571. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.slider.height),
  109572. left: this.isReversed ? undefined : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.slider.left),
  109573. right: this.isReversed ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.slider.right) : undefined,
  109574. top: this.vertical ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.slider.top) : undefined,
  109575. transition: this.slider.left != null ? null : 'none',
  109576. width: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.slider.width)
  109577. };
  109578. },
  109579. computedColor: function computedColor() {
  109580. if (this.color) return this.color;else if (this.isDark && !this.appIsDark) return 'white';else return 'primary';
  109581. }
  109582. },
  109583. watch: {
  109584. alignWithTitle: 'callSlider',
  109585. centered: 'callSlider',
  109586. centerActive: 'callSlider',
  109587. fixedTabs: 'callSlider',
  109588. grow: 'callSlider',
  109589. right: 'callSlider',
  109590. showArrows: 'callSlider',
  109591. vertical: 'callSlider',
  109592. '$vuetify.application.left': 'onResize',
  109593. '$vuetify.application.right': 'onResize',
  109594. '$vuetify.rtl': 'onResize'
  109595. },
  109596. mounted: function mounted() {
  109597. var _this = this;
  109598. this.$nextTick(function () {
  109599. window.setTimeout(_this.callSlider, 30);
  109600. });
  109601. },
  109602. methods: {
  109603. callSlider: function callSlider() {
  109604. var _this = this;
  109605. if (this.hideSlider || !this.$refs.items || !this.$refs.items.selectedItems.length) {
  109606. this.slider.width = 0;
  109607. return false;
  109608. }
  109609. this.$nextTick(function () {
  109610. // Give screen time to paint
  109611. var activeTab = _this.$refs.items.selectedItems[0];
  109612. /* istanbul ignore if */
  109613. if (!activeTab || !activeTab.$el) {
  109614. _this.slider.width = 0;
  109615. _this.slider.left = 0;
  109616. return;
  109617. }
  109618. var el = activeTab.$el;
  109619. _this.slider = {
  109620. height: !_this.vertical ? Number(_this.sliderSize) : el.scrollHeight,
  109621. left: _this.vertical ? 0 : el.offsetLeft,
  109622. right: _this.vertical ? 0 : el.offsetLeft + el.offsetWidth,
  109623. top: el.offsetTop,
  109624. width: _this.vertical ? Number(_this.sliderSize) : el.scrollWidth
  109625. };
  109626. });
  109627. return true;
  109628. },
  109629. genBar: function genBar(items, slider) {
  109630. var _this = this;
  109631. var data = {
  109632. style: {
  109633. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.height)
  109634. },
  109635. props: {
  109636. activeClass: this.activeClass,
  109637. centerActive: this.centerActive,
  109638. dark: this.dark,
  109639. light: this.light,
  109640. mandatory: !this.optional,
  109641. mobileBreakPoint: this.mobileBreakPoint,
  109642. nextIcon: this.nextIcon,
  109643. prevIcon: this.prevIcon,
  109644. showArrows: this.showArrows,
  109645. value: this.internalValue
  109646. },
  109647. on: {
  109648. 'call:slider': this.callSlider,
  109649. change: function change(val) {
  109650. _this.internalValue = val;
  109651. }
  109652. },
  109653. ref: 'items'
  109654. };
  109655. this.setTextColor(this.computedColor, data);
  109656. this.setBackgroundColor(this.backgroundColor, data);
  109657. return this.$createElement(_VTabsBar__WEBPACK_IMPORTED_MODULE_1__["default"], data, [this.genSlider(slider), items]);
  109658. },
  109659. genItems: function genItems(items, item) {
  109660. var _this = this; // If user provides items
  109661. // opt to use theirs
  109662. if (items) return items; // If no tabs are provided
  109663. // render nothing
  109664. if (!item.length) return null;
  109665. return this.$createElement(_VTabsItems__WEBPACK_IMPORTED_MODULE_2__["default"], {
  109666. props: {
  109667. value: this.internalValue
  109668. },
  109669. on: {
  109670. change: function change(val) {
  109671. _this.internalValue = val;
  109672. }
  109673. }
  109674. }, item);
  109675. },
  109676. genSlider: function genSlider(slider) {
  109677. if (this.hideSlider) return null;
  109678. if (!slider) {
  109679. slider = this.$createElement(_VTabsSlider__WEBPACK_IMPORTED_MODULE_3__["default"], {
  109680. props: {
  109681. color: this.sliderColor
  109682. }
  109683. });
  109684. }
  109685. return this.$createElement('div', {
  109686. staticClass: 'v-tabs-slider-wrapper',
  109687. style: this.sliderStyles
  109688. }, [slider]);
  109689. },
  109690. onResize: function onResize() {
  109691. if (this._isDestroyed) return;
  109692. clearTimeout(this.resizeTimeout);
  109693. this.resizeTimeout = window.setTimeout(this.callSlider, 0);
  109694. },
  109695. parseNodes: function parseNodes() {
  109696. var items = null;
  109697. var slider = null;
  109698. var item = [];
  109699. var tab = [];
  109700. var slot = this.$slots.default || [];
  109701. var length = slot.length;
  109702. for (var i = 0; i < length; i++) {
  109703. var vnode = slot[i];
  109704. if (vnode.componentOptions) {
  109705. switch (vnode.componentOptions.Ctor.options.name) {
  109706. case 'v-tabs-slider':
  109707. slider = vnode;
  109708. break;
  109709. case 'v-tabs-items':
  109710. items = vnode;
  109711. break;
  109712. case 'v-tab-item':
  109713. item.push(vnode);
  109714. break;
  109715. // case 'v-tab' - intentionally omitted
  109716. default:
  109717. tab.push(vnode);
  109718. }
  109719. } else {
  109720. tab.push(vnode);
  109721. }
  109722. }
  109723. /**
  109724. * tab: array of `v-tab`
  109725. * slider: single `v-tabs-slider`
  109726. * items: single `v-tabs-items`
  109727. * item: array of `v-tab-item`
  109728. */
  109729. return {
  109730. tab: tab,
  109731. slider: slider,
  109732. items: items,
  109733. item: item
  109734. };
  109735. }
  109736. },
  109737. render: function render(h) {
  109738. var _a = this.parseNodes(),
  109739. tab = _a.tab,
  109740. slider = _a.slider,
  109741. items = _a.items,
  109742. item = _a.item;
  109743. return h('div', {
  109744. staticClass: 'v-tabs',
  109745. class: this.classes,
  109746. directives: [{
  109747. name: 'resize',
  109748. modifiers: {
  109749. quiet: true
  109750. },
  109751. value: this.onResize
  109752. }]
  109753. }, [this.genBar(tab, slider), this.genItems(items, item)]);
  109754. }
  109755. }));
  109756. /***/ }),
  109757. /***/ "./src/components/VTabs/VTabsBar.ts":
  109758. /*!******************************************!*\
  109759. !*** ./src/components/VTabs/VTabsBar.ts ***!
  109760. \******************************************/
  109761. /*! exports provided: default */
  109762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109763. "use strict";
  109764. __webpack_require__.r(__webpack_exports__);
  109765. /* harmony import */ var _VSlideGroup_VSlideGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VSlideGroup/VSlideGroup */ "./src/components/VSlideGroup/VSlideGroup.ts");
  109766. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  109767. /* harmony import */ var _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/ssr-bootable */ "./src/mixins/ssr-bootable/index.ts");
  109768. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  109769. var __assign = undefined && undefined.__assign || function () {
  109770. __assign = Object.assign || function (t) {
  109771. for (var s, i = 1, n = arguments.length; i < n; i++) {
  109772. s = arguments[i];
  109773. for (var p in s) {
  109774. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  109775. }
  109776. }
  109777. return t;
  109778. };
  109779. return __assign.apply(this, arguments);
  109780. };
  109781. var __values = undefined && undefined.__values || function (o) {
  109782. var m = typeof Symbol === "function" && o[Symbol.iterator],
  109783. i = 0;
  109784. if (m) return m.call(o);
  109785. return {
  109786. next: function next() {
  109787. if (o && i >= o.length) o = void 0;
  109788. return {
  109789. value: o && o[i++],
  109790. done: !o
  109791. };
  109792. }
  109793. };
  109794. }; // Extensions
  109795. // Mixins
  109796. // Utilities
  109797. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_VSlideGroup_VSlideGroup__WEBPACK_IMPORTED_MODULE_0__["BaseSlideGroup"], _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"]
  109798. /* @vue/component */
  109799. ).extend({
  109800. name: 'v-tabs-bar',
  109801. provide: function provide() {
  109802. return {
  109803. tabsBar: this
  109804. };
  109805. },
  109806. computed: {
  109807. classes: function classes() {
  109808. return __assign({}, _VSlideGroup_VSlideGroup__WEBPACK_IMPORTED_MODULE_0__["BaseSlideGroup"].options.computed.classes.call(this), {
  109809. 'v-tabs-bar': true,
  109810. 'v-tabs-bar--is-mobile': this.isMobile,
  109811. // TODO: Remove this and move to v-slide-group
  109812. 'v-tabs-bar--show-arrows': this.showArrows
  109813. }, this.themeClasses);
  109814. }
  109815. },
  109816. watch: {
  109817. items: 'callSlider',
  109818. internalValue: 'callSlider',
  109819. $route: 'onRouteChange'
  109820. },
  109821. methods: {
  109822. callSlider: function callSlider() {
  109823. if (!this.isBooted) return;
  109824. this.$emit('call:slider');
  109825. },
  109826. genContent: function genContent() {
  109827. var render = _VSlideGroup_VSlideGroup__WEBPACK_IMPORTED_MODULE_0__["BaseSlideGroup"].options.methods.genContent.call(this);
  109828. render.data = render.data || {};
  109829. render.data.staticClass += ' v-tabs-bar__content';
  109830. return render;
  109831. },
  109832. onRouteChange: function onRouteChange(val, oldVal) {
  109833. var e_1, _a;
  109834. /* istanbul ignore next */
  109835. if (this.mandatory) return;
  109836. var items = this.items;
  109837. var newPath = val.path;
  109838. var oldPath = oldVal.path;
  109839. var hasNew = false;
  109840. var hasOld = false;
  109841. try {
  109842. for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
  109843. var item = items_1_1.value;
  109844. if (item.to === newPath) hasNew = true;else if (item.to === oldPath) hasOld = true;
  109845. if (hasNew && hasOld) break;
  109846. }
  109847. } catch (e_1_1) {
  109848. e_1 = {
  109849. error: e_1_1
  109850. };
  109851. } finally {
  109852. try {
  109853. if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
  109854. } finally {
  109855. if (e_1) throw e_1.error;
  109856. }
  109857. } // If we have an old item and not a new one
  109858. // it's assumed that the user navigated to
  109859. // a path that is not present in the items
  109860. if (!hasNew && hasOld) this.internalValue = undefined;
  109861. }
  109862. },
  109863. render: function render(h) {
  109864. var render = _VSlideGroup_VSlideGroup__WEBPACK_IMPORTED_MODULE_0__["BaseSlideGroup"].options.render.call(this, h);
  109865. render.data.attrs = {
  109866. role: 'tablist'
  109867. };
  109868. return render;
  109869. }
  109870. }));
  109871. /***/ }),
  109872. /***/ "./src/components/VTabs/VTabsItems.ts":
  109873. /*!********************************************!*\
  109874. !*** ./src/components/VTabs/VTabsItems.ts ***!
  109875. \********************************************/
  109876. /*! exports provided: default */
  109877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109878. "use strict";
  109879. __webpack_require__.r(__webpack_exports__);
  109880. /* harmony import */ var _VWindow_VWindow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VWindow/VWindow */ "./src/components/VWindow/VWindow.ts");
  109881. /* harmony import */ var _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../VItemGroup/VItemGroup */ "./src/components/VItemGroup/VItemGroup.ts");
  109882. var __assign = undefined && undefined.__assign || function () {
  109883. __assign = Object.assign || function (t) {
  109884. for (var s, i = 1, n = arguments.length; i < n; i++) {
  109885. s = arguments[i];
  109886. for (var p in s) {
  109887. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  109888. }
  109889. }
  109890. return t;
  109891. };
  109892. return __assign.apply(this, arguments);
  109893. }; // Extensions
  109894. // Types & Components
  109895. /* @vue/component */
  109896. /* harmony default export */ __webpack_exports__["default"] = (_VWindow_VWindow__WEBPACK_IMPORTED_MODULE_0__["default"].extend({
  109897. name: 'v-tabs-items',
  109898. props: {
  109899. mandatory: {
  109900. type: Boolean,
  109901. default: false
  109902. }
  109903. },
  109904. computed: {
  109905. classes: function classes() {
  109906. return __assign({}, _VWindow_VWindow__WEBPACK_IMPORTED_MODULE_0__["default"].options.computed.classes.call(this), {
  109907. 'v-tabs-items': true
  109908. });
  109909. },
  109910. isDark: function isDark() {
  109911. return this.rootIsDark;
  109912. }
  109913. },
  109914. methods: {
  109915. getValue: function getValue(item, i) {
  109916. return item.id || _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_1__["BaseItemGroup"].options.methods.getValue.call(this, item, i);
  109917. }
  109918. }
  109919. }));
  109920. /***/ }),
  109921. /***/ "./src/components/VTabs/VTabsSlider.ts":
  109922. /*!*********************************************!*\
  109923. !*** ./src/components/VTabs/VTabsSlider.ts ***!
  109924. \*********************************************/
  109925. /*! exports provided: default */
  109926. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109927. "use strict";
  109928. __webpack_require__.r(__webpack_exports__);
  109929. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  109930. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  109931. // Mixins
  109932. // Utilities
  109933. /* @vue/component */
  109934. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_0__["default"]).extend({
  109935. name: 'v-tabs-slider',
  109936. render: function render(h) {
  109937. return h('div', this.setBackgroundColor(this.color, {
  109938. staticClass: 'v-tabs-slider'
  109939. }));
  109940. }
  109941. }));
  109942. /***/ }),
  109943. /***/ "./src/components/VTabs/index.ts":
  109944. /*!***************************************!*\
  109945. !*** ./src/components/VTabs/index.ts ***!
  109946. \***************************************/
  109947. /*! exports provided: VTabs, VTab, VTabItem, VTabsItems, VTabsSlider, default */
  109948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109949. "use strict";
  109950. __webpack_require__.r(__webpack_exports__);
  109951. /* harmony import */ var _VTabs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTabs */ "./src/components/VTabs/VTabs.ts");
  109952. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabs", function() { return _VTabs__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  109953. /* harmony import */ var _VTab__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTab */ "./src/components/VTabs/VTab.ts");
  109954. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTab", function() { return _VTab__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  109955. /* harmony import */ var _VTabsItems__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VTabsItems */ "./src/components/VTabs/VTabsItems.ts");
  109956. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabsItems", function() { return _VTabsItems__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  109957. /* harmony import */ var _VTabItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VTabItem */ "./src/components/VTabs/VTabItem.ts");
  109958. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabItem", function() { return _VTabItem__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  109959. /* harmony import */ var _VTabsSlider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VTabsSlider */ "./src/components/VTabs/VTabsSlider.ts");
  109960. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabsSlider", function() { return _VTabsSlider__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  109961. /* harmony default export */ __webpack_exports__["default"] = ({
  109962. $_vuetify_subcomponents: {
  109963. VTabs: _VTabs__WEBPACK_IMPORTED_MODULE_0__["default"],
  109964. VTab: _VTab__WEBPACK_IMPORTED_MODULE_1__["default"],
  109965. VTabsItems: _VTabsItems__WEBPACK_IMPORTED_MODULE_2__["default"],
  109966. VTabItem: _VTabItem__WEBPACK_IMPORTED_MODULE_3__["default"],
  109967. VTabsSlider: _VTabsSlider__WEBPACK_IMPORTED_MODULE_4__["default"]
  109968. }
  109969. });
  109970. /***/ }),
  109971. /***/ "./src/components/VTextField/VTextField.sass":
  109972. /*!***************************************************!*\
  109973. !*** ./src/components/VTextField/VTextField.sass ***!
  109974. \***************************************************/
  109975. /*! no static exports found */
  109976. /***/ (function(module, exports, __webpack_require__) {
  109977. // extracted by mini-css-extract-plugin
  109978. /***/ }),
  109979. /***/ "./src/components/VTextField/VTextField.ts":
  109980. /*!*************************************************!*\
  109981. !*** ./src/components/VTextField/VTextField.ts ***!
  109982. \*************************************************/
  109983. /*! exports provided: default */
  109984. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109985. "use strict";
  109986. __webpack_require__.r(__webpack_exports__);
  109987. /* harmony import */ var _VTextField_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTextField.sass */ "./src/components/VTextField/VTextField.sass");
  109988. /* harmony import */ var _VTextField_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VTextField_sass__WEBPACK_IMPORTED_MODULE_0__);
  109989. /* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.ts");
  109990. /* harmony import */ var _VCounter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VCounter */ "./src/components/VCounter/index.ts");
  109991. /* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VLabel */ "./src/components/VLabel/index.ts");
  109992. /* harmony import */ var _mixins_intersectable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/intersectable */ "./src/mixins/intersectable/index.ts");
  109993. /* harmony import */ var _mixins_loadable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/loadable */ "./src/mixins/loadable/index.ts");
  109994. /* harmony import */ var _mixins_validatable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/validatable */ "./src/mixins/validatable/index.ts");
  109995. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  109996. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  109997. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  109998. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  109999. var __assign = undefined && undefined.__assign || function () {
  110000. __assign = Object.assign || function (t) {
  110001. for (var s, i = 1, n = arguments.length; i < n; i++) {
  110002. s = arguments[i];
  110003. for (var p in s) {
  110004. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  110005. }
  110006. }
  110007. return t;
  110008. };
  110009. return __assign.apply(this, arguments);
  110010. }; // Styles
  110011. // Extensions
  110012. // Components
  110013. // Mixins
  110014. // Directives
  110015. // Utilities
  110016. // Types
  110017. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_10__["default"])(_VInput__WEBPACK_IMPORTED_MODULE_1__["default"], Object(_mixins_intersectable__WEBPACK_IMPORTED_MODULE_4__["default"])({
  110018. onVisible: ['setLabelWidth', 'setPrefixWidth', 'setPrependWidth', 'tryAutofocus']
  110019. }), _mixins_loadable__WEBPACK_IMPORTED_MODULE_5__["default"]);
  110020. var dirtyTypes = ['color', 'file', 'time', 'date', 'datetime-local', 'week', 'month'];
  110021. /* @vue/component */
  110022. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  110023. name: 'v-text-field',
  110024. directives: {
  110025. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_7__["default"]
  110026. },
  110027. inheritAttrs: false,
  110028. props: {
  110029. appendOuterIcon: String,
  110030. autofocus: Boolean,
  110031. clearable: Boolean,
  110032. clearIcon: {
  110033. type: String,
  110034. default: '$clear'
  110035. },
  110036. counter: [Boolean, Number, String],
  110037. counterValue: Function,
  110038. filled: Boolean,
  110039. flat: Boolean,
  110040. fullWidth: Boolean,
  110041. label: String,
  110042. outlined: Boolean,
  110043. placeholder: String,
  110044. prefix: String,
  110045. prependInnerIcon: String,
  110046. reverse: Boolean,
  110047. rounded: Boolean,
  110048. shaped: Boolean,
  110049. singleLine: Boolean,
  110050. solo: Boolean,
  110051. soloInverted: Boolean,
  110052. suffix: String,
  110053. type: {
  110054. type: String,
  110055. default: 'text'
  110056. }
  110057. },
  110058. data: function data() {
  110059. return {
  110060. badInput: false,
  110061. labelWidth: 0,
  110062. prefixWidth: 0,
  110063. prependWidth: 0,
  110064. initialValue: null,
  110065. isBooted: false,
  110066. isClearing: false
  110067. };
  110068. },
  110069. computed: {
  110070. classes: function classes() {
  110071. return __assign({}, _VInput__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  110072. 'v-text-field': true,
  110073. 'v-text-field--full-width': this.fullWidth,
  110074. 'v-text-field--prefix': this.prefix,
  110075. 'v-text-field--single-line': this.isSingle,
  110076. 'v-text-field--solo': this.isSolo,
  110077. 'v-text-field--solo-inverted': this.soloInverted,
  110078. 'v-text-field--solo-flat': this.flat,
  110079. 'v-text-field--filled': this.filled,
  110080. 'v-text-field--is-booted': this.isBooted,
  110081. 'v-text-field--enclosed': this.isEnclosed,
  110082. 'v-text-field--reverse': this.reverse,
  110083. 'v-text-field--outlined': this.outlined,
  110084. 'v-text-field--placeholder': this.placeholder,
  110085. 'v-text-field--rounded': this.rounded,
  110086. 'v-text-field--shaped': this.shaped
  110087. });
  110088. },
  110089. computedColor: function computedColor() {
  110090. var computedColor = _mixins_validatable__WEBPACK_IMPORTED_MODULE_6__["default"].options.computed.computedColor.call(this);
  110091. if (!this.soloInverted || !this.isFocused) return computedColor;
  110092. return this.color || 'primary';
  110093. },
  110094. computedCounterValue: function computedCounterValue() {
  110095. if (typeof this.counterValue === 'function') {
  110096. return this.counterValue(this.internalValue);
  110097. }
  110098. return (this.internalValue || '').toString().length;
  110099. },
  110100. hasCounter: function hasCounter() {
  110101. return this.counter !== false && this.counter != null;
  110102. },
  110103. hasDetails: function hasDetails() {
  110104. return _VInput__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.hasDetails.call(this) || this.hasCounter;
  110105. },
  110106. internalValue: {
  110107. get: function get() {
  110108. return this.lazyValue;
  110109. },
  110110. set: function set(val) {
  110111. this.lazyValue = val;
  110112. this.$emit('input', this.lazyValue);
  110113. }
  110114. },
  110115. isDirty: function isDirty() {
  110116. return this.lazyValue != null && this.lazyValue.toString().length > 0 || this.badInput;
  110117. },
  110118. isEnclosed: function isEnclosed() {
  110119. return this.filled || this.isSolo || this.outlined;
  110120. },
  110121. isLabelActive: function isLabelActive() {
  110122. return this.isDirty || dirtyTypes.includes(this.type);
  110123. },
  110124. isSingle: function isSingle() {
  110125. return this.isSolo || this.singleLine || this.fullWidth || // https://material.io/components/text-fields/#filled-text-field
  110126. this.filled && !this.hasLabel;
  110127. },
  110128. isSolo: function isSolo() {
  110129. return this.solo || this.soloInverted;
  110130. },
  110131. labelPosition: function labelPosition() {
  110132. var offset = this.prefix && !this.labelValue ? this.prefixWidth : 0;
  110133. if (this.labelValue && this.prependWidth) offset -= this.prependWidth;
  110134. return this.$vuetify.rtl === this.reverse ? {
  110135. left: offset,
  110136. right: 'auto'
  110137. } : {
  110138. left: 'auto',
  110139. right: offset
  110140. };
  110141. },
  110142. showLabel: function showLabel() {
  110143. return this.hasLabel && (!this.isSingle || !this.isLabelActive && !this.placeholder);
  110144. },
  110145. labelValue: function labelValue() {
  110146. return !this.isSingle && Boolean(this.isFocused || this.isLabelActive || this.placeholder);
  110147. }
  110148. },
  110149. watch: {
  110150. labelValue: 'setLabelWidth',
  110151. outlined: 'setLabelWidth',
  110152. label: function label() {
  110153. this.$nextTick(this.setLabelWidth);
  110154. },
  110155. prefix: function prefix() {
  110156. this.$nextTick(this.setPrefixWidth);
  110157. },
  110158. isFocused: 'updateValue',
  110159. value: function value(val) {
  110160. this.lazyValue = val;
  110161. }
  110162. },
  110163. created: function created() {
  110164. /* istanbul ignore next */
  110165. if (this.$attrs.hasOwnProperty('box')) {
  110166. Object(_util_console__WEBPACK_IMPORTED_MODULE_9__["breaking"])('box', 'filled', this);
  110167. }
  110168. /* istanbul ignore next */
  110169. if (this.$attrs.hasOwnProperty('browser-autocomplete')) {
  110170. Object(_util_console__WEBPACK_IMPORTED_MODULE_9__["breaking"])('browser-autocomplete', 'autocomplete', this);
  110171. }
  110172. /* istanbul ignore if */
  110173. if (this.shaped && !(this.filled || this.outlined || this.isSolo)) {
  110174. Object(_util_console__WEBPACK_IMPORTED_MODULE_9__["consoleWarn"])('shaped should be used with either filled or outlined', this);
  110175. }
  110176. },
  110177. mounted: function mounted() {
  110178. var _this = this;
  110179. this.autofocus && this.tryAutofocus();
  110180. this.setLabelWidth();
  110181. this.setPrefixWidth();
  110182. this.setPrependWidth();
  110183. requestAnimationFrame(function () {
  110184. return _this.isBooted = true;
  110185. });
  110186. },
  110187. methods: {
  110188. /** @public */
  110189. focus: function focus() {
  110190. this.onFocus();
  110191. },
  110192. /** @public */
  110193. blur: function blur(e) {
  110194. var _this = this; // https://github.com/vuetifyjs/vuetify/issues/5913
  110195. // Safari tab order gets broken if called synchronous
  110196. window.requestAnimationFrame(function () {
  110197. _this.$refs.input && _this.$refs.input.blur();
  110198. });
  110199. },
  110200. clearableCallback: function clearableCallback() {
  110201. var _this = this;
  110202. this.$refs.input && this.$refs.input.focus();
  110203. this.$nextTick(function () {
  110204. return _this.internalValue = null;
  110205. });
  110206. },
  110207. genAppendSlot: function genAppendSlot() {
  110208. var slot = [];
  110209. if (this.$slots['append-outer']) {
  110210. slot.push(this.$slots['append-outer']);
  110211. } else if (this.appendOuterIcon) {
  110212. slot.push(this.genIcon('appendOuter'));
  110213. }
  110214. return this.genSlot('append', 'outer', slot);
  110215. },
  110216. genPrependInnerSlot: function genPrependInnerSlot() {
  110217. var slot = [];
  110218. if (this.$slots['prepend-inner']) {
  110219. slot.push(this.$slots['prepend-inner']);
  110220. } else if (this.prependInnerIcon) {
  110221. slot.push(this.genIcon('prependInner'));
  110222. }
  110223. return this.genSlot('prepend', 'inner', slot);
  110224. },
  110225. genIconSlot: function genIconSlot() {
  110226. var slot = [];
  110227. if (this.$slots['append']) {
  110228. slot.push(this.$slots['append']);
  110229. } else if (this.appendIcon) {
  110230. slot.push(this.genIcon('append'));
  110231. }
  110232. return this.genSlot('append', 'inner', slot);
  110233. },
  110234. genInputSlot: function genInputSlot() {
  110235. var input = _VInput__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genInputSlot.call(this);
  110236. var prepend = this.genPrependInnerSlot();
  110237. if (prepend) {
  110238. input.children = input.children || [];
  110239. input.children.unshift(prepend);
  110240. }
  110241. return input;
  110242. },
  110243. genClearIcon: function genClearIcon() {
  110244. if (!this.clearable) return null;
  110245. var data = this.isDirty ? undefined : {
  110246. attrs: {
  110247. disabled: true
  110248. }
  110249. };
  110250. return this.genSlot('append', 'inner', [this.genIcon('clear', this.clearableCallback, data)]);
  110251. },
  110252. genCounter: function genCounter() {
  110253. if (!this.hasCounter) return null;
  110254. var max = this.counter === true ? this.attrs$.maxlength : this.counter;
  110255. return this.$createElement(_VCounter__WEBPACK_IMPORTED_MODULE_2__["default"], {
  110256. props: {
  110257. dark: this.dark,
  110258. light: this.light,
  110259. max: max,
  110260. value: this.computedCounterValue
  110261. }
  110262. });
  110263. },
  110264. genDefaultSlot: function genDefaultSlot() {
  110265. return [this.genFieldset(), this.genTextFieldSlot(), this.genClearIcon(), this.genIconSlot(), this.genProgress()];
  110266. },
  110267. genFieldset: function genFieldset() {
  110268. if (!this.outlined) return null;
  110269. return this.$createElement('fieldset', {
  110270. attrs: {
  110271. 'aria-hidden': true
  110272. }
  110273. }, [this.genLegend()]);
  110274. },
  110275. genLabel: function genLabel() {
  110276. if (!this.showLabel) return null;
  110277. var data = {
  110278. props: {
  110279. absolute: true,
  110280. color: this.validationState,
  110281. dark: this.dark,
  110282. disabled: this.disabled,
  110283. focused: !this.isSingle && (this.isFocused || !!this.validationState),
  110284. for: this.computedId,
  110285. left: this.labelPosition.left,
  110286. light: this.light,
  110287. right: this.labelPosition.right,
  110288. value: this.labelValue
  110289. }
  110290. };
  110291. return this.$createElement(_VLabel__WEBPACK_IMPORTED_MODULE_3__["default"], data, this.$slots.label || this.label);
  110292. },
  110293. genLegend: function genLegend() {
  110294. var width = !this.singleLine && (this.labelValue || this.isDirty) ? this.labelWidth : 0;
  110295. var span = this.$createElement('span', {
  110296. domProps: {
  110297. innerHTML: '&#8203;'
  110298. }
  110299. });
  110300. return this.$createElement('legend', {
  110301. style: {
  110302. width: !this.isSingle ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(width) : undefined
  110303. }
  110304. }, [span]);
  110305. },
  110306. genInput: function genInput() {
  110307. var listeners = Object.assign({}, this.listeners$);
  110308. delete listeners['change']; // Change should not be bound externally
  110309. return this.$createElement('input', {
  110310. style: {},
  110311. domProps: {
  110312. value: this.lazyValue
  110313. },
  110314. attrs: __assign({}, this.attrs$, {
  110315. autofocus: this.autofocus,
  110316. disabled: this.disabled,
  110317. id: this.computedId,
  110318. placeholder: this.placeholder,
  110319. readonly: this.readonly,
  110320. type: this.type
  110321. }),
  110322. on: Object.assign(listeners, {
  110323. blur: this.onBlur,
  110324. input: this.onInput,
  110325. focus: this.onFocus,
  110326. keydown: this.onKeyDown
  110327. }),
  110328. ref: 'input'
  110329. });
  110330. },
  110331. genMessages: function genMessages() {
  110332. if (!this.showDetails) return null;
  110333. var messagesNode = _VInput__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genMessages.call(this);
  110334. var counterNode = this.genCounter();
  110335. return this.$createElement('div', {
  110336. staticClass: 'v-text-field__details'
  110337. }, [messagesNode, counterNode]);
  110338. },
  110339. genTextFieldSlot: function genTextFieldSlot() {
  110340. return this.$createElement('div', {
  110341. staticClass: 'v-text-field__slot'
  110342. }, [this.genLabel(), this.prefix ? this.genAffix('prefix') : null, this.genInput(), this.suffix ? this.genAffix('suffix') : null]);
  110343. },
  110344. genAffix: function genAffix(type) {
  110345. return this.$createElement('div', {
  110346. class: "v-text-field__" + type,
  110347. ref: type
  110348. }, this[type]);
  110349. },
  110350. onBlur: function onBlur(e) {
  110351. var _this = this;
  110352. this.isFocused = false;
  110353. e && this.$nextTick(function () {
  110354. return _this.$emit('blur', e);
  110355. });
  110356. },
  110357. onClick: function onClick() {
  110358. if (this.isFocused || this.disabled || !this.$refs.input) return;
  110359. this.$refs.input.focus();
  110360. },
  110361. onFocus: function onFocus(e) {
  110362. if (!this.$refs.input) return;
  110363. if (document.activeElement !== this.$refs.input) {
  110364. return this.$refs.input.focus();
  110365. }
  110366. if (!this.isFocused) {
  110367. this.isFocused = true;
  110368. e && this.$emit('focus', e);
  110369. }
  110370. },
  110371. onInput: function onInput(e) {
  110372. var target = e.target;
  110373. this.internalValue = target.value;
  110374. this.badInput = target.validity && target.validity.badInput;
  110375. },
  110376. onKeyDown: function onKeyDown(e) {
  110377. if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_8__["keyCodes"].enter) this.$emit('change', this.internalValue);
  110378. this.$emit('keydown', e);
  110379. },
  110380. onMouseDown: function onMouseDown(e) {
  110381. // Prevent input from being blurred
  110382. if (e.target !== this.$refs.input) {
  110383. e.preventDefault();
  110384. e.stopPropagation();
  110385. }
  110386. _VInput__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.onMouseDown.call(this, e);
  110387. },
  110388. onMouseUp: function onMouseUp(e) {
  110389. if (this.hasMouseDown) this.focus();
  110390. _VInput__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.onMouseUp.call(this, e);
  110391. },
  110392. setLabelWidth: function setLabelWidth() {
  110393. if (!this.outlined) return;
  110394. this.labelWidth = this.$refs.label ? Math.min(this.$refs.label.scrollWidth * 0.75 + 6, this.$el.offsetWidth - 24) : 0;
  110395. },
  110396. setPrefixWidth: function setPrefixWidth() {
  110397. if (!this.$refs.prefix) return;
  110398. this.prefixWidth = this.$refs.prefix.offsetWidth;
  110399. },
  110400. setPrependWidth: function setPrependWidth() {
  110401. if (!this.outlined || !this.$refs['prepend-inner']) return;
  110402. this.prependWidth = this.$refs['prepend-inner'].offsetWidth;
  110403. },
  110404. tryAutofocus: function tryAutofocus() {
  110405. if (!this.autofocus || typeof document === 'undefined' || !this.$refs.input || document.activeElement === this.$refs.input) return false;
  110406. this.$refs.input.focus();
  110407. return true;
  110408. },
  110409. updateValue: function updateValue(val) {
  110410. // Sets validationState from validatable
  110411. this.hasColor = val;
  110412. if (val) {
  110413. this.initialValue = this.lazyValue;
  110414. } else if (this.initialValue !== this.lazyValue) {
  110415. this.$emit('change', this.lazyValue);
  110416. }
  110417. }
  110418. }
  110419. }));
  110420. /***/ }),
  110421. /***/ "./src/components/VTextField/index.ts":
  110422. /*!********************************************!*\
  110423. !*** ./src/components/VTextField/index.ts ***!
  110424. \********************************************/
  110425. /*! exports provided: VTextField, default */
  110426. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110427. "use strict";
  110428. __webpack_require__.r(__webpack_exports__);
  110429. /* harmony import */ var _VTextField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTextField */ "./src/components/VTextField/VTextField.ts");
  110430. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTextField", function() { return _VTextField__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110431. /* harmony default export */ __webpack_exports__["default"] = (_VTextField__WEBPACK_IMPORTED_MODULE_0__["default"]);
  110432. /***/ }),
  110433. /***/ "./src/components/VTextarea/VTextarea.sass":
  110434. /*!*************************************************!*\
  110435. !*** ./src/components/VTextarea/VTextarea.sass ***!
  110436. \*************************************************/
  110437. /*! no static exports found */
  110438. /***/ (function(module, exports, __webpack_require__) {
  110439. // extracted by mini-css-extract-plugin
  110440. /***/ }),
  110441. /***/ "./src/components/VTextarea/VTextarea.ts":
  110442. /*!***********************************************!*\
  110443. !*** ./src/components/VTextarea/VTextarea.ts ***!
  110444. \***********************************************/
  110445. /*! exports provided: default */
  110446. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110447. "use strict";
  110448. __webpack_require__.r(__webpack_exports__);
  110449. /* harmony import */ var _VTextarea_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTextarea.sass */ "./src/components/VTextarea/VTextarea.sass");
  110450. /* harmony import */ var _VTextarea_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VTextarea_sass__WEBPACK_IMPORTED_MODULE_0__);
  110451. /* harmony import */ var _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VTextField/VTextField */ "./src/components/VTextField/VTextField.ts");
  110452. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  110453. var __assign = undefined && undefined.__assign || function () {
  110454. __assign = Object.assign || function (t) {
  110455. for (var s, i = 1, n = arguments.length; i < n; i++) {
  110456. s = arguments[i];
  110457. for (var p in s) {
  110458. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  110459. }
  110460. }
  110461. return t;
  110462. };
  110463. return __assign.apply(this, arguments);
  110464. }; // Styles
  110465. // Extensions
  110466. // Utilities
  110467. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"]);
  110468. /* @vue/component */
  110469. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  110470. name: 'v-textarea',
  110471. props: {
  110472. autoGrow: Boolean,
  110473. noResize: Boolean,
  110474. rowHeight: {
  110475. type: [Number, String],
  110476. default: 24,
  110477. validator: function validator(v) {
  110478. return !isNaN(parseFloat(v));
  110479. }
  110480. },
  110481. rows: {
  110482. type: [Number, String],
  110483. default: 5,
  110484. validator: function validator(v) {
  110485. return !isNaN(parseInt(v, 10));
  110486. }
  110487. }
  110488. },
  110489. computed: {
  110490. classes: function classes() {
  110491. return __assign({
  110492. 'v-textarea': true,
  110493. 'v-textarea--auto-grow': this.autoGrow,
  110494. 'v-textarea--no-resize': this.noResizeHandle
  110495. }, _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this));
  110496. },
  110497. noResizeHandle: function noResizeHandle() {
  110498. return this.noResize || this.autoGrow;
  110499. }
  110500. },
  110501. watch: {
  110502. lazyValue: function lazyValue() {
  110503. this.autoGrow && this.$nextTick(this.calculateInputHeight);
  110504. },
  110505. rowHeight: function rowHeight() {
  110506. this.autoGrow && this.$nextTick(this.calculateInputHeight);
  110507. }
  110508. },
  110509. mounted: function mounted() {
  110510. var _this = this;
  110511. setTimeout(function () {
  110512. _this.autoGrow && _this.calculateInputHeight();
  110513. }, 0);
  110514. },
  110515. methods: {
  110516. calculateInputHeight: function calculateInputHeight() {
  110517. var input = this.$refs.input;
  110518. if (!input) return;
  110519. input.style.height = '0';
  110520. var height = input.scrollHeight;
  110521. var minHeight = parseInt(this.rows, 10) * parseFloat(this.rowHeight); // This has to be done ASAP, waiting for Vue
  110522. // to update the DOM causes ugly layout jumping
  110523. input.style.height = Math.max(minHeight, height) + 'px';
  110524. },
  110525. genInput: function genInput() {
  110526. var input = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genInput.call(this);
  110527. input.tag = 'textarea';
  110528. delete input.data.attrs.type;
  110529. input.data.attrs.rows = this.rows;
  110530. return input;
  110531. },
  110532. onInput: function onInput(e) {
  110533. _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.onInput.call(this, e);
  110534. this.autoGrow && this.calculateInputHeight();
  110535. },
  110536. onKeyDown: function onKeyDown(e) {
  110537. // Prevents closing of a
  110538. // dialog when pressing
  110539. // enter
  110540. if (this.isFocused && e.keyCode === 13) {
  110541. e.stopPropagation();
  110542. }
  110543. this.$emit('keydown', e);
  110544. }
  110545. }
  110546. }));
  110547. /***/ }),
  110548. /***/ "./src/components/VTextarea/index.ts":
  110549. /*!*******************************************!*\
  110550. !*** ./src/components/VTextarea/index.ts ***!
  110551. \*******************************************/
  110552. /*! exports provided: VTextarea, default */
  110553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110554. "use strict";
  110555. __webpack_require__.r(__webpack_exports__);
  110556. /* harmony import */ var _VTextarea__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTextarea */ "./src/components/VTextarea/VTextarea.ts");
  110557. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTextarea", function() { return _VTextarea__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110558. /* harmony default export */ __webpack_exports__["default"] = (_VTextarea__WEBPACK_IMPORTED_MODULE_0__["default"]);
  110559. /***/ }),
  110560. /***/ "./src/components/VThemeProvider/VThemeProvider.ts":
  110561. /*!*********************************************************!*\
  110562. !*** ./src/components/VThemeProvider/VThemeProvider.ts ***!
  110563. \*********************************************************/
  110564. /*! exports provided: default */
  110565. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110566. "use strict";
  110567. __webpack_require__.r(__webpack_exports__);
  110568. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  110569. // Mixins
  110570. /* @vue/component */
  110571. /* harmony default export */ __webpack_exports__["default"] = (_mixins_themeable__WEBPACK_IMPORTED_MODULE_0__["default"].extend({
  110572. name: 'v-theme-provider',
  110573. props: {
  110574. root: Boolean
  110575. },
  110576. computed: {
  110577. isDark: function isDark() {
  110578. return this.root ? this.rootIsDark : _mixins_themeable__WEBPACK_IMPORTED_MODULE_0__["default"].options.computed.isDark.call(this);
  110579. }
  110580. },
  110581. render: function render() {
  110582. /* istanbul ignore next */
  110583. return this.$slots.default && this.$slots.default.find(function (node) {
  110584. return !node.isComment && node.text !== ' ';
  110585. });
  110586. }
  110587. }));
  110588. /***/ }),
  110589. /***/ "./src/components/VThemeProvider/index.ts":
  110590. /*!************************************************!*\
  110591. !*** ./src/components/VThemeProvider/index.ts ***!
  110592. \************************************************/
  110593. /*! exports provided: VThemeProvider, default */
  110594. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110595. "use strict";
  110596. __webpack_require__.r(__webpack_exports__);
  110597. /* harmony import */ var _VThemeProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VThemeProvider */ "./src/components/VThemeProvider/VThemeProvider.ts");
  110598. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VThemeProvider", function() { return _VThemeProvider__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110599. /* harmony default export */ __webpack_exports__["default"] = (_VThemeProvider__WEBPACK_IMPORTED_MODULE_0__["default"]);
  110600. /***/ }),
  110601. /***/ "./src/components/VTimePicker/SelectingTimes.ts":
  110602. /*!******************************************************!*\
  110603. !*** ./src/components/VTimePicker/SelectingTimes.ts ***!
  110604. \******************************************************/
  110605. /*! exports provided: SelectingTimes */
  110606. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110607. "use strict";
  110608. __webpack_require__.r(__webpack_exports__);
  110609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectingTimes", function() { return SelectingTimes; });
  110610. var SelectingTimes;
  110611. (function (SelectingTimes) {
  110612. SelectingTimes[SelectingTimes["Hour"] = 1] = "Hour";
  110613. SelectingTimes[SelectingTimes["Minute"] = 2] = "Minute";
  110614. SelectingTimes[SelectingTimes["Second"] = 3] = "Second";
  110615. })(SelectingTimes || (SelectingTimes = {}));
  110616. /***/ }),
  110617. /***/ "./src/components/VTimePicker/VTimePicker.ts":
  110618. /*!***************************************************!*\
  110619. !*** ./src/components/VTimePicker/VTimePicker.ts ***!
  110620. \***************************************************/
  110621. /*! exports provided: SelectingTimes, default */
  110622. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110623. "use strict";
  110624. __webpack_require__.r(__webpack_exports__);
  110625. /* harmony import */ var _VTimePickerTitle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTimePickerTitle */ "./src/components/VTimePicker/VTimePickerTitle.ts");
  110626. /* harmony import */ var _VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTimePickerClock */ "./src/components/VTimePicker/VTimePickerClock.ts");
  110627. /* harmony import */ var _mixins_picker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/picker */ "./src/mixins/picker/index.ts");
  110628. /* harmony import */ var _mixins_picker_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/picker-button */ "./src/mixins/picker-button/index.ts");
  110629. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  110630. /* harmony import */ var _VDatePicker_util_pad__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../VDatePicker/util/pad */ "./src/components/VDatePicker/util/pad.ts");
  110631. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  110632. /* harmony import */ var _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectingTimes */ "./src/components/VTimePicker/SelectingTimes.ts");
  110633. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectingTimes", function() { return _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"]; });
  110634. var __read = undefined && undefined.__read || function (o, n) {
  110635. var m = typeof Symbol === "function" && o[Symbol.iterator];
  110636. if (!m) return o;
  110637. var i = m.call(o),
  110638. r,
  110639. ar = [],
  110640. e;
  110641. try {
  110642. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  110643. ar.push(r.value);
  110644. }
  110645. } catch (error) {
  110646. e = {
  110647. error: error
  110648. };
  110649. } finally {
  110650. try {
  110651. if (r && !r.done && (m = i["return"])) m.call(i);
  110652. } finally {
  110653. if (e) throw e.error;
  110654. }
  110655. }
  110656. return ar;
  110657. }; // Components
  110658. // Mixins
  110659. // Utils
  110660. var rangeHours24 = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["createRange"])(24);
  110661. var rangeHours12am = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["createRange"])(12);
  110662. var rangeHours12pm = rangeHours12am.map(function (v) {
  110663. return v + 12;
  110664. });
  110665. var range60 = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["createRange"])(60);
  110666. var selectingNames = {
  110667. 1: 'hour',
  110668. 2: 'minute',
  110669. 3: 'second'
  110670. };
  110671. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_6__["default"])(_mixins_picker__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_picker_button__WEBPACK_IMPORTED_MODULE_3__["default"]
  110672. /* @vue/component */
  110673. ).extend({
  110674. name: 'v-time-picker',
  110675. props: {
  110676. allowedHours: [Function, Array],
  110677. allowedMinutes: [Function, Array],
  110678. allowedSeconds: [Function, Array],
  110679. disabled: Boolean,
  110680. format: {
  110681. type: String,
  110682. default: 'ampm',
  110683. validator: function validator(val) {
  110684. return ['ampm', '24hr'].includes(val);
  110685. }
  110686. },
  110687. min: String,
  110688. max: String,
  110689. readonly: Boolean,
  110690. scrollable: Boolean,
  110691. useSeconds: Boolean,
  110692. value: null,
  110693. ampmInTitle: Boolean
  110694. },
  110695. data: function data() {
  110696. return {
  110697. inputHour: null,
  110698. inputMinute: null,
  110699. inputSecond: null,
  110700. lazyInputHour: null,
  110701. lazyInputMinute: null,
  110702. lazyInputSecond: null,
  110703. period: 'am',
  110704. selecting: _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour
  110705. };
  110706. },
  110707. computed: {
  110708. selectingHour: {
  110709. get: function get() {
  110710. return this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour;
  110711. },
  110712. set: function set(v) {
  110713. this.selecting = _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour;
  110714. }
  110715. },
  110716. selectingMinute: {
  110717. get: function get() {
  110718. return this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Minute;
  110719. },
  110720. set: function set(v) {
  110721. this.selecting = _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Minute;
  110722. }
  110723. },
  110724. selectingSecond: {
  110725. get: function get() {
  110726. return this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Second;
  110727. },
  110728. set: function set(v) {
  110729. this.selecting = _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Second;
  110730. }
  110731. },
  110732. isAllowedHourCb: function isAllowedHourCb() {
  110733. var _this = this;
  110734. var cb;
  110735. if (this.allowedHours instanceof Array) {
  110736. cb = function cb(val) {
  110737. return _this.allowedHours.includes(val);
  110738. };
  110739. } else {
  110740. cb = this.allowedHours;
  110741. }
  110742. if (!this.min && !this.max) return cb;
  110743. var minHour = this.min ? Number(this.min.split(':')[0]) : 0;
  110744. var maxHour = this.max ? Number(this.max.split(':')[0]) : 23;
  110745. return function (val) {
  110746. return val >= minHour * 1 && val <= maxHour * 1 && (!cb || cb(val));
  110747. };
  110748. },
  110749. isAllowedMinuteCb: function isAllowedMinuteCb() {
  110750. var _this = this;
  110751. var cb;
  110752. var isHourAllowed = !this.isAllowedHourCb || this.inputHour === null || this.isAllowedHourCb(this.inputHour);
  110753. if (this.allowedMinutes instanceof Array) {
  110754. cb = function cb(val) {
  110755. return _this.allowedMinutes.includes(val);
  110756. };
  110757. } else {
  110758. cb = this.allowedMinutes;
  110759. }
  110760. if (!this.min && !this.max) {
  110761. return isHourAllowed ? cb : function () {
  110762. return false;
  110763. };
  110764. }
  110765. var _a = __read(this.min ? this.min.split(':').map(Number) : [0, 0], 2),
  110766. minHour = _a[0],
  110767. minMinute = _a[1];
  110768. var _b = __read(this.max ? this.max.split(':').map(Number) : [23, 59], 2),
  110769. maxHour = _b[0],
  110770. maxMinute = _b[1];
  110771. var minTime = minHour * 60 + minMinute * 1;
  110772. var maxTime = maxHour * 60 + maxMinute * 1;
  110773. return function (val) {
  110774. var time = 60 * _this.inputHour + val;
  110775. return time >= minTime && time <= maxTime && isHourAllowed && (!cb || cb(val));
  110776. };
  110777. },
  110778. isAllowedSecondCb: function isAllowedSecondCb() {
  110779. var _this = this;
  110780. var cb;
  110781. var isHourAllowed = !this.isAllowedHourCb || this.inputHour === null || this.isAllowedHourCb(this.inputHour);
  110782. var isMinuteAllowed = isHourAllowed && (!this.isAllowedMinuteCb || this.inputMinute === null || this.isAllowedMinuteCb(this.inputMinute));
  110783. if (this.allowedSeconds instanceof Array) {
  110784. cb = function cb(val) {
  110785. return _this.allowedSeconds.includes(val);
  110786. };
  110787. } else {
  110788. cb = this.allowedSeconds;
  110789. }
  110790. if (!this.min && !this.max) {
  110791. return isMinuteAllowed ? cb : function () {
  110792. return false;
  110793. };
  110794. }
  110795. var _a = __read(this.min ? this.min.split(':').map(Number) : [0, 0, 0], 3),
  110796. minHour = _a[0],
  110797. minMinute = _a[1],
  110798. minSecond = _a[2];
  110799. var _b = __read(this.max ? this.max.split(':').map(Number) : [23, 59, 59], 3),
  110800. maxHour = _b[0],
  110801. maxMinute = _b[1],
  110802. maxSecond = _b[2];
  110803. var minTime = minHour * 3600 + minMinute * 60 + (minSecond || 0) * 1;
  110804. var maxTime = maxHour * 3600 + maxMinute * 60 + (maxSecond || 0) * 1;
  110805. return function (val) {
  110806. var time = 3600 * _this.inputHour + 60 * _this.inputMinute + val;
  110807. return time >= minTime && time <= maxTime && isMinuteAllowed && (!cb || cb(val));
  110808. };
  110809. },
  110810. isAmPm: function isAmPm() {
  110811. return this.format === 'ampm';
  110812. }
  110813. },
  110814. watch: {
  110815. value: 'setInputData'
  110816. },
  110817. mounted: function mounted() {
  110818. this.setInputData(this.value);
  110819. this.$on('update:period', this.setPeriod);
  110820. },
  110821. methods: {
  110822. genValue: function genValue() {
  110823. if (this.inputHour != null && this.inputMinute != null && (!this.useSeconds || this.inputSecond != null)) {
  110824. return Object(_VDatePicker_util_pad__WEBPACK_IMPORTED_MODULE_5__["default"])(this.inputHour) + ":" + Object(_VDatePicker_util_pad__WEBPACK_IMPORTED_MODULE_5__["default"])(this.inputMinute) + (this.useSeconds ? ":" + Object(_VDatePicker_util_pad__WEBPACK_IMPORTED_MODULE_5__["default"])(this.inputSecond) : '');
  110825. }
  110826. return null;
  110827. },
  110828. emitValue: function emitValue() {
  110829. var value = this.genValue();
  110830. if (value !== null) this.$emit('input', value);
  110831. },
  110832. setPeriod: function setPeriod(period) {
  110833. this.period = period;
  110834. if (this.inputHour != null) {
  110835. var newHour = this.inputHour + (period === 'am' ? -12 : 12);
  110836. this.inputHour = this.firstAllowed('hour', newHour);
  110837. this.emitValue();
  110838. }
  110839. },
  110840. setInputData: function setInputData(value) {
  110841. if (value == null || value === '') {
  110842. this.inputHour = null;
  110843. this.inputMinute = null;
  110844. this.inputSecond = null;
  110845. } else if (value instanceof Date) {
  110846. this.inputHour = value.getHours();
  110847. this.inputMinute = value.getMinutes();
  110848. this.inputSecond = value.getSeconds();
  110849. } else {
  110850. var _a = __read(value.trim().toLowerCase().match(/^(\d+):(\d+)(:(\d+))?([ap]m)?$/) || new Array(6), 6),
  110851. hour = _a[1],
  110852. minute = _a[2],
  110853. second = _a[4],
  110854. period = _a[5];
  110855. this.inputHour = period ? this.convert12to24(parseInt(hour, 10), period) : parseInt(hour, 10);
  110856. this.inputMinute = parseInt(minute, 10);
  110857. this.inputSecond = parseInt(second || 0, 10);
  110858. }
  110859. this.period = this.inputHour == null || this.inputHour < 12 ? 'am' : 'pm';
  110860. },
  110861. convert24to12: function convert24to12(hour) {
  110862. return hour ? (hour - 1) % 12 + 1 : 12;
  110863. },
  110864. convert12to24: function convert12to24(hour, period) {
  110865. return hour % 12 + (period === 'pm' ? 12 : 0);
  110866. },
  110867. onInput: function onInput(value) {
  110868. if (this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour) {
  110869. this.inputHour = this.isAmPm ? this.convert12to24(value, this.period) : value;
  110870. } else if (this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Minute) {
  110871. this.inputMinute = value;
  110872. } else {
  110873. this.inputSecond = value;
  110874. }
  110875. this.emitValue();
  110876. },
  110877. onChange: function onChange(value) {
  110878. this.$emit("click:" + selectingNames[this.selecting], value);
  110879. var emitChange = this.selecting === (this.useSeconds ? _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Second : _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Minute);
  110880. if (this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour) {
  110881. this.selecting = _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Minute;
  110882. } else if (this.useSeconds && this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Minute) {
  110883. this.selecting = _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Second;
  110884. }
  110885. if (this.inputHour === this.lazyInputHour && this.inputMinute === this.lazyInputMinute && (!this.useSeconds || this.inputSecond === this.lazyInputSecond)) return;
  110886. var time = this.genValue();
  110887. if (time === null) return;
  110888. this.lazyInputHour = this.inputHour;
  110889. this.lazyInputMinute = this.inputMinute;
  110890. this.useSeconds && (this.lazyInputSecond = this.inputSecond);
  110891. emitChange && this.$emit('change', time);
  110892. },
  110893. firstAllowed: function firstAllowed(type, value) {
  110894. var allowedFn = type === 'hour' ? this.isAllowedHourCb : type === 'minute' ? this.isAllowedMinuteCb : this.isAllowedSecondCb;
  110895. if (!allowedFn) return value; // TODO: clean up
  110896. var range = type === 'minute' ? range60 : type === 'second' ? range60 : this.isAmPm ? value < 12 ? rangeHours12am : rangeHours12pm : rangeHours24;
  110897. var first = range.find(function (v) {
  110898. return allowedFn((v + value) % range.length + range[0]);
  110899. });
  110900. return ((first || 0) + value) % range.length + range[0];
  110901. },
  110902. genClock: function genClock() {
  110903. return this.$createElement(_VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__["default"], {
  110904. props: {
  110905. allowedValues: this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour ? this.isAllowedHourCb : this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Minute ? this.isAllowedMinuteCb : this.isAllowedSecondCb,
  110906. color: this.color,
  110907. dark: this.dark,
  110908. disabled: this.disabled,
  110909. double: this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour && !this.isAmPm,
  110910. format: this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour ? this.isAmPm ? this.convert24to12 : function (val) {
  110911. return val;
  110912. } : function (val) {
  110913. return Object(_VDatePicker_util_pad__WEBPACK_IMPORTED_MODULE_5__["default"])(val, 2);
  110914. },
  110915. light: this.light,
  110916. max: this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour ? this.isAmPm && this.period === 'am' ? 11 : 23 : 59,
  110917. min: this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour && this.isAmPm && this.period === 'pm' ? 12 : 0,
  110918. readonly: this.readonly,
  110919. scrollable: this.scrollable,
  110920. size: Number(this.width) - (!this.fullWidth && this.landscape ? 80 : 20),
  110921. step: this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour ? 1 : 5,
  110922. value: this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Hour ? this.inputHour : this.selecting === _SelectingTimes__WEBPACK_IMPORTED_MODULE_7__["SelectingTimes"].Minute ? this.inputMinute : this.inputSecond
  110923. },
  110924. on: {
  110925. input: this.onInput,
  110926. change: this.onChange
  110927. },
  110928. ref: 'clock'
  110929. });
  110930. },
  110931. genClockAmPm: function genClockAmPm() {
  110932. return this.$createElement('div', this.setTextColor(this.color || 'primary', {
  110933. staticClass: 'v-time-picker-clock__ampm'
  110934. }), [this.genPickerButton('period', 'am', this.$vuetify.lang.t('$vuetify.timePicker.am'), this.disabled || this.readonly), this.genPickerButton('period', 'pm', this.$vuetify.lang.t('$vuetify.timePicker.pm'), this.disabled || this.readonly)]);
  110935. },
  110936. genPickerBody: function genPickerBody() {
  110937. return this.$createElement('div', {
  110938. staticClass: 'v-time-picker-clock__container',
  110939. key: this.selecting
  110940. }, [!this.ampmInTitle && this.isAmPm && this.genClockAmPm(), this.genClock()]);
  110941. },
  110942. genPickerTitle: function genPickerTitle() {
  110943. var _this = this;
  110944. return this.$createElement(_VTimePickerTitle__WEBPACK_IMPORTED_MODULE_0__["default"], {
  110945. props: {
  110946. ampm: this.isAmPm,
  110947. ampmReadonly: this.isAmPm && !this.ampmInTitle,
  110948. disabled: this.disabled,
  110949. hour: this.inputHour,
  110950. minute: this.inputMinute,
  110951. second: this.inputSecond,
  110952. period: this.period,
  110953. readonly: this.readonly,
  110954. useSeconds: this.useSeconds,
  110955. selecting: this.selecting
  110956. },
  110957. on: {
  110958. 'update:selecting': function updateSelecting(value) {
  110959. return _this.selecting = value;
  110960. },
  110961. 'update:period': function updatePeriod(period) {
  110962. return _this.$emit('update:period', period);
  110963. }
  110964. },
  110965. ref: 'title',
  110966. slot: 'title'
  110967. });
  110968. }
  110969. },
  110970. render: function render() {
  110971. return this.genPicker('v-picker--time');
  110972. }
  110973. }));
  110974. /***/ }),
  110975. /***/ "./src/components/VTimePicker/VTimePickerClock.sass":
  110976. /*!**********************************************************!*\
  110977. !*** ./src/components/VTimePicker/VTimePickerClock.sass ***!
  110978. \**********************************************************/
  110979. /*! no static exports found */
  110980. /***/ (function(module, exports, __webpack_require__) {
  110981. // extracted by mini-css-extract-plugin
  110982. /***/ }),
  110983. /***/ "./src/components/VTimePicker/VTimePickerClock.ts":
  110984. /*!********************************************************!*\
  110985. !*** ./src/components/VTimePicker/VTimePickerClock.ts ***!
  110986. \********************************************************/
  110987. /*! exports provided: default */
  110988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110989. "use strict";
  110990. __webpack_require__.r(__webpack_exports__);
  110991. /* harmony import */ var _VTimePickerClock_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTimePickerClock.sass */ "./src/components/VTimePicker/VTimePickerClock.sass");
  110992. /* harmony import */ var _VTimePickerClock_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VTimePickerClock_sass__WEBPACK_IMPORTED_MODULE_0__);
  110993. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  110994. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  110995. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  110996. var __assign = undefined && undefined.__assign || function () {
  110997. __assign = Object.assign || function (t) {
  110998. for (var s, i = 1, n = arguments.length; i < n; i++) {
  110999. s = arguments[i];
  111000. for (var p in s) {
  111001. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  111002. }
  111003. }
  111004. return t;
  111005. };
  111006. return __assign.apply(this, arguments);
  111007. };
  111008. // Mixins
  111009. // Types
  111010. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]
  111011. /* @vue/component */
  111012. ).extend({
  111013. name: 'v-time-picker-clock',
  111014. props: {
  111015. allowedValues: Function,
  111016. ampm: Boolean,
  111017. disabled: Boolean,
  111018. double: Boolean,
  111019. format: {
  111020. type: Function,
  111021. default: function _default(val) {
  111022. return val;
  111023. }
  111024. },
  111025. max: {
  111026. type: Number,
  111027. required: true
  111028. },
  111029. min: {
  111030. type: Number,
  111031. required: true
  111032. },
  111033. scrollable: Boolean,
  111034. readonly: Boolean,
  111035. rotate: {
  111036. type: Number,
  111037. default: 0
  111038. },
  111039. step: {
  111040. type: Number,
  111041. default: 1
  111042. },
  111043. value: Number
  111044. },
  111045. data: function data() {
  111046. return {
  111047. inputValue: this.value,
  111048. isDragging: false,
  111049. valueOnMouseDown: null,
  111050. valueOnMouseUp: null
  111051. };
  111052. },
  111053. computed: {
  111054. count: function count() {
  111055. return this.max - this.min + 1;
  111056. },
  111057. degreesPerUnit: function degreesPerUnit() {
  111058. return 360 / this.roundCount;
  111059. },
  111060. degrees: function degrees() {
  111061. return this.degreesPerUnit * Math.PI / 180;
  111062. },
  111063. displayedValue: function displayedValue() {
  111064. return this.value == null ? this.min : this.value;
  111065. },
  111066. innerRadiusScale: function innerRadiusScale() {
  111067. return 0.62;
  111068. },
  111069. roundCount: function roundCount() {
  111070. return this.double ? this.count / 2 : this.count;
  111071. }
  111072. },
  111073. watch: {
  111074. value: function value(_value) {
  111075. this.inputValue = _value;
  111076. }
  111077. },
  111078. methods: {
  111079. wheel: function wheel(e) {
  111080. e.preventDefault();
  111081. var delta = Math.sign(-e.deltaY || 1);
  111082. var value = this.displayedValue;
  111083. do {
  111084. value = value + delta;
  111085. value = (value - this.min + this.count) % this.count + this.min;
  111086. } while (!this.isAllowed(value) && value !== this.displayedValue);
  111087. if (value !== this.displayedValue) {
  111088. this.update(value);
  111089. }
  111090. },
  111091. isInner: function isInner(value) {
  111092. return this.double && value - this.min >= this.roundCount;
  111093. },
  111094. handScale: function handScale(value) {
  111095. return this.isInner(value) ? this.innerRadiusScale : 1;
  111096. },
  111097. isAllowed: function isAllowed(value) {
  111098. return !this.allowedValues || this.allowedValues(value);
  111099. },
  111100. genValues: function genValues() {
  111101. var children = [];
  111102. for (var value = this.min; value <= this.max; value = value + this.step) {
  111103. var color = value === this.value && (this.color || 'accent');
  111104. children.push(this.$createElement('span', this.setBackgroundColor(color, {
  111105. staticClass: 'v-time-picker-clock__item',
  111106. class: {
  111107. 'v-time-picker-clock__item--active': value === this.displayedValue,
  111108. 'v-time-picker-clock__item--disabled': this.disabled || !this.isAllowed(value)
  111109. },
  111110. style: this.getTransform(value),
  111111. domProps: {
  111112. innerHTML: "<span>" + this.format(value) + "</span>"
  111113. }
  111114. })));
  111115. }
  111116. return children;
  111117. },
  111118. genHand: function genHand() {
  111119. var scale = "scaleY(" + this.handScale(this.displayedValue) + ")";
  111120. var angle = this.rotate + this.degreesPerUnit * (this.displayedValue - this.min);
  111121. var color = this.value != null && (this.color || 'accent');
  111122. return this.$createElement('div', this.setBackgroundColor(color, {
  111123. staticClass: 'v-time-picker-clock__hand',
  111124. class: {
  111125. 'v-time-picker-clock__hand--inner': this.isInner(this.value)
  111126. },
  111127. style: {
  111128. transform: "rotate(" + angle + "deg) " + scale
  111129. }
  111130. }));
  111131. },
  111132. getTransform: function getTransform(i) {
  111133. var _a = this.getPosition(i),
  111134. x = _a.x,
  111135. y = _a.y;
  111136. return {
  111137. left: 50 + x * 50 + "%",
  111138. top: 50 + y * 50 + "%"
  111139. };
  111140. },
  111141. getPosition: function getPosition(value) {
  111142. var rotateRadians = this.rotate * Math.PI / 180;
  111143. return {
  111144. x: Math.sin((value - this.min) * this.degrees + rotateRadians) * this.handScale(value),
  111145. y: -Math.cos((value - this.min) * this.degrees + rotateRadians) * this.handScale(value)
  111146. };
  111147. },
  111148. onMouseDown: function onMouseDown(e) {
  111149. e.preventDefault();
  111150. this.valueOnMouseDown = null;
  111151. this.valueOnMouseUp = null;
  111152. this.isDragging = true;
  111153. this.onDragMove(e);
  111154. },
  111155. onMouseUp: function onMouseUp(e) {
  111156. e.stopPropagation();
  111157. this.isDragging = false;
  111158. if (this.valueOnMouseUp !== null && this.isAllowed(this.valueOnMouseUp)) {
  111159. this.$emit('change', this.valueOnMouseUp);
  111160. }
  111161. },
  111162. onDragMove: function onDragMove(e) {
  111163. e.preventDefault();
  111164. if (!this.isDragging && e.type !== 'click') return;
  111165. var _a = this.$refs.clock.getBoundingClientRect(),
  111166. width = _a.width,
  111167. top = _a.top,
  111168. left = _a.left;
  111169. var innerWidth = this.$refs.innerClock.getBoundingClientRect().width;
  111170. var _b = 'touches' in e ? e.touches[0] : e,
  111171. clientX = _b.clientX,
  111172. clientY = _b.clientY;
  111173. var center = {
  111174. x: width / 2,
  111175. y: -width / 2
  111176. };
  111177. var coords = {
  111178. x: clientX - left,
  111179. y: top - clientY
  111180. };
  111181. var handAngle = Math.round(this.angle(center, coords) - this.rotate + 360) % 360;
  111182. var insideClick = this.double && this.euclidean(center, coords) < (innerWidth + innerWidth * this.innerRadiusScale) / 4;
  111183. var checksCount = Math.ceil(15 / this.degreesPerUnit);
  111184. var value;
  111185. for (var i = 0; i < checksCount; i++) {
  111186. value = this.angleToValue(handAngle + i * this.degreesPerUnit, insideClick);
  111187. if (this.isAllowed(value)) return this.setMouseDownValue(value);
  111188. value = this.angleToValue(handAngle - i * this.degreesPerUnit, insideClick);
  111189. if (this.isAllowed(value)) return this.setMouseDownValue(value);
  111190. }
  111191. },
  111192. angleToValue: function angleToValue(angle, insideClick) {
  111193. var value = (Math.round(angle / this.degreesPerUnit) + (insideClick ? this.roundCount : 0)) % this.count + this.min; // Necessary to fix edge case when selecting left part of the value(s) at 12 o'clock
  111194. if (angle < 360 - this.degreesPerUnit / 2) return value;
  111195. return insideClick ? this.max - this.roundCount + 1 : this.min;
  111196. },
  111197. setMouseDownValue: function setMouseDownValue(value) {
  111198. if (this.valueOnMouseDown === null) {
  111199. this.valueOnMouseDown = value;
  111200. }
  111201. this.valueOnMouseUp = value;
  111202. this.update(value);
  111203. },
  111204. update: function update(value) {
  111205. if (this.inputValue !== value) {
  111206. this.inputValue = value;
  111207. this.$emit('input', value);
  111208. }
  111209. },
  111210. euclidean: function euclidean(p0, p1) {
  111211. var dx = p1.x - p0.x;
  111212. var dy = p1.y - p0.y;
  111213. return Math.sqrt(dx * dx + dy * dy);
  111214. },
  111215. angle: function angle(center, p1) {
  111216. var value = 2 * Math.atan2(p1.y - center.y - this.euclidean(center, p1), p1.x - center.x);
  111217. return Math.abs(value * 180 / Math.PI);
  111218. }
  111219. },
  111220. render: function render(h) {
  111221. var _this = this;
  111222. var data = {
  111223. staticClass: 'v-time-picker-clock',
  111224. class: __assign({
  111225. 'v-time-picker-clock--indeterminate': this.value == null
  111226. }, this.themeClasses),
  111227. on: this.readonly || this.disabled ? undefined : Object.assign({
  111228. mousedown: this.onMouseDown,
  111229. mouseup: this.onMouseUp,
  111230. mouseleave: function mouseleave(e) {
  111231. return _this.isDragging && _this.onMouseUp(e);
  111232. },
  111233. touchstart: this.onMouseDown,
  111234. touchend: this.onMouseUp,
  111235. mousemove: this.onDragMove,
  111236. touchmove: this.onDragMove
  111237. }, this.scrollable ? {
  111238. wheel: this.wheel
  111239. } : {}),
  111240. ref: 'clock'
  111241. };
  111242. return h('div', data, [h('div', {
  111243. staticClass: 'v-time-picker-clock__inner',
  111244. ref: 'innerClock'
  111245. }, [this.genHand(), this.genValues()])]);
  111246. }
  111247. }));
  111248. /***/ }),
  111249. /***/ "./src/components/VTimePicker/VTimePickerTitle.sass":
  111250. /*!**********************************************************!*\
  111251. !*** ./src/components/VTimePicker/VTimePickerTitle.sass ***!
  111252. \**********************************************************/
  111253. /*! no static exports found */
  111254. /***/ (function(module, exports, __webpack_require__) {
  111255. // extracted by mini-css-extract-plugin
  111256. /***/ }),
  111257. /***/ "./src/components/VTimePicker/VTimePickerTitle.ts":
  111258. /*!********************************************************!*\
  111259. !*** ./src/components/VTimePicker/VTimePickerTitle.ts ***!
  111260. \********************************************************/
  111261. /*! exports provided: default */
  111262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111263. "use strict";
  111264. __webpack_require__.r(__webpack_exports__);
  111265. /* harmony import */ var _VTimePickerTitle_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTimePickerTitle.sass */ "./src/components/VTimePicker/VTimePickerTitle.sass");
  111266. /* harmony import */ var _VTimePickerTitle_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VTimePickerTitle_sass__WEBPACK_IMPORTED_MODULE_0__);
  111267. /* harmony import */ var _mixins_picker_button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/picker-button */ "./src/mixins/picker-button/index.ts");
  111268. /* harmony import */ var _VDatePicker_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VDatePicker/util */ "./src/components/VDatePicker/util/index.ts");
  111269. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  111270. /* harmony import */ var _SelectingTimes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SelectingTimes */ "./src/components/VTimePicker/SelectingTimes.ts");
  111271. // Mixins
  111272. // Utils
  111273. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_picker_button__WEBPACK_IMPORTED_MODULE_1__["default"]
  111274. /* @vue/component */
  111275. ).extend({
  111276. name: 'v-time-picker-title',
  111277. props: {
  111278. ampm: Boolean,
  111279. ampmReadonly: Boolean,
  111280. disabled: Boolean,
  111281. hour: Number,
  111282. minute: Number,
  111283. second: Number,
  111284. period: {
  111285. type: String,
  111286. validator: function validator(period) {
  111287. return period === 'am' || period === 'pm';
  111288. }
  111289. },
  111290. readonly: Boolean,
  111291. useSeconds: Boolean,
  111292. selecting: Number
  111293. },
  111294. methods: {
  111295. genTime: function genTime() {
  111296. var hour = this.hour;
  111297. if (this.ampm) {
  111298. hour = hour ? (hour - 1) % 12 + 1 : 12;
  111299. }
  111300. var displayedHour = this.hour == null ? '--' : this.ampm ? String(hour) : Object(_VDatePicker_util__WEBPACK_IMPORTED_MODULE_2__["pad"])(hour);
  111301. var displayedMinute = this.minute == null ? '--' : Object(_VDatePicker_util__WEBPACK_IMPORTED_MODULE_2__["pad"])(this.minute);
  111302. var titleContent = [this.genPickerButton('selecting', _SelectingTimes__WEBPACK_IMPORTED_MODULE_4__["SelectingTimes"].Hour, displayedHour, this.disabled), this.$createElement('span', ':'), this.genPickerButton('selecting', _SelectingTimes__WEBPACK_IMPORTED_MODULE_4__["SelectingTimes"].Minute, displayedMinute, this.disabled)];
  111303. if (this.useSeconds) {
  111304. var displayedSecond = this.second == null ? '--' : Object(_VDatePicker_util__WEBPACK_IMPORTED_MODULE_2__["pad"])(this.second);
  111305. titleContent.push(this.$createElement('span', ':'));
  111306. titleContent.push(this.genPickerButton('selecting', _SelectingTimes__WEBPACK_IMPORTED_MODULE_4__["SelectingTimes"].Second, displayedSecond, this.disabled));
  111307. }
  111308. return this.$createElement('div', {
  111309. class: 'v-time-picker-title__time'
  111310. }, titleContent);
  111311. },
  111312. genAmPm: function genAmPm() {
  111313. return this.$createElement('div', {
  111314. staticClass: 'v-time-picker-title__ampm',
  111315. class: {
  111316. 'v-time-picker-title__ampm--readonly': this.ampmReadonly
  111317. }
  111318. }, [!this.ampmReadonly || this.period === 'am' ? this.genPickerButton('period', 'am', this.$vuetify.lang.t('$vuetify.timePicker.am'), this.disabled || this.readonly) : null, !this.ampmReadonly || this.period === 'pm' ? this.genPickerButton('period', 'pm', this.$vuetify.lang.t('$vuetify.timePicker.pm'), this.disabled || this.readonly) : null]);
  111319. }
  111320. },
  111321. render: function render(h) {
  111322. var children = [this.genTime()];
  111323. this.ampm && children.push(this.genAmPm());
  111324. return h('div', {
  111325. staticClass: 'v-time-picker-title'
  111326. }, children);
  111327. }
  111328. }));
  111329. /***/ }),
  111330. /***/ "./src/components/VTimePicker/index.ts":
  111331. /*!*********************************************!*\
  111332. !*** ./src/components/VTimePicker/index.ts ***!
  111333. \*********************************************/
  111334. /*! exports provided: VTimePicker, VTimePickerClock, VTimePickerTitle, default */
  111335. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111336. "use strict";
  111337. __webpack_require__.r(__webpack_exports__);
  111338. /* harmony import */ var _VTimePicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTimePicker */ "./src/components/VTimePicker/VTimePicker.ts");
  111339. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePicker", function() { return _VTimePicker__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  111340. /* harmony import */ var _VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTimePickerClock */ "./src/components/VTimePicker/VTimePickerClock.ts");
  111341. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePickerClock", function() { return _VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  111342. /* harmony import */ var _VTimePickerTitle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VTimePickerTitle */ "./src/components/VTimePicker/VTimePickerTitle.ts");
  111343. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePickerTitle", function() { return _VTimePickerTitle__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  111344. /* harmony default export */ __webpack_exports__["default"] = ({
  111345. $_vuetify_subcomponents: {
  111346. VTimePicker: _VTimePicker__WEBPACK_IMPORTED_MODULE_0__["default"],
  111347. VTimePickerClock: _VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__["default"],
  111348. VTimePickerTitle: _VTimePickerTitle__WEBPACK_IMPORTED_MODULE_2__["default"]
  111349. }
  111350. });
  111351. /***/ }),
  111352. /***/ "./src/components/VTimeline/VTimeline.sass":
  111353. /*!*************************************************!*\
  111354. !*** ./src/components/VTimeline/VTimeline.sass ***!
  111355. \*************************************************/
  111356. /*! no static exports found */
  111357. /***/ (function(module, exports, __webpack_require__) {
  111358. // extracted by mini-css-extract-plugin
  111359. /***/ }),
  111360. /***/ "./src/components/VTimeline/VTimeline.ts":
  111361. /*!***********************************************!*\
  111362. !*** ./src/components/VTimeline/VTimeline.ts ***!
  111363. \***********************************************/
  111364. /*! exports provided: default */
  111365. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111366. "use strict";
  111367. __webpack_require__.r(__webpack_exports__);
  111368. /* harmony import */ var _VTimeline_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTimeline.sass */ "./src/components/VTimeline/VTimeline.sass");
  111369. /* harmony import */ var _VTimeline_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VTimeline_sass__WEBPACK_IMPORTED_MODULE_0__);
  111370. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  111371. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  111372. var __assign = undefined && undefined.__assign || function () {
  111373. __assign = Object.assign || function (t) {
  111374. for (var s, i = 1, n = arguments.length; i < n; i++) {
  111375. s = arguments[i];
  111376. for (var p in s) {
  111377. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  111378. }
  111379. }
  111380. return t;
  111381. };
  111382. return __assign.apply(this, arguments);
  111383. }; // Styles
  111384. // Mixins
  111385. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]
  111386. /* @vue/component */
  111387. ).extend({
  111388. name: 'v-timeline',
  111389. provide: function provide() {
  111390. return {
  111391. timeline: this
  111392. };
  111393. },
  111394. props: {
  111395. alignTop: Boolean,
  111396. dense: Boolean,
  111397. reverse: Boolean
  111398. },
  111399. computed: {
  111400. classes: function classes() {
  111401. return __assign({
  111402. 'v-timeline--align-top': this.alignTop,
  111403. 'v-timeline--dense': this.dense,
  111404. 'v-timeline--reverse': this.reverse
  111405. }, this.themeClasses);
  111406. }
  111407. },
  111408. render: function render(h) {
  111409. return h('div', {
  111410. staticClass: 'v-timeline',
  111411. class: this.classes
  111412. }, this.$slots.default);
  111413. }
  111414. }));
  111415. /***/ }),
  111416. /***/ "./src/components/VTimeline/VTimelineItem.ts":
  111417. /*!***************************************************!*\
  111418. !*** ./src/components/VTimeline/VTimelineItem.ts ***!
  111419. \***************************************************/
  111420. /*! exports provided: default */
  111421. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111422. "use strict";
  111423. __webpack_require__.r(__webpack_exports__);
  111424. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  111425. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  111426. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  111427. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  111428. var __assign = undefined && undefined.__assign || function () {
  111429. __assign = Object.assign || function (t) {
  111430. for (var s, i = 1, n = arguments.length; i < n; i++) {
  111431. s = arguments[i];
  111432. for (var p in s) {
  111433. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  111434. }
  111435. }
  111436. return t;
  111437. };
  111438. return __assign.apply(this, arguments);
  111439. }; // Types
  111440. // Mixins
  111441. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_0__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]
  111442. /* @vue/component */
  111443. );
  111444. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  111445. name: 'v-timeline-item',
  111446. inject: ['timeline'],
  111447. props: {
  111448. color: {
  111449. type: String,
  111450. default: 'primary'
  111451. },
  111452. fillDot: Boolean,
  111453. hideDot: Boolean,
  111454. icon: String,
  111455. iconColor: String,
  111456. large: Boolean,
  111457. left: Boolean,
  111458. right: Boolean,
  111459. small: Boolean
  111460. },
  111461. computed: {
  111462. hasIcon: function hasIcon() {
  111463. return !!this.icon || !!this.$slots.icon;
  111464. }
  111465. },
  111466. methods: {
  111467. genBody: function genBody() {
  111468. return this.$createElement('div', {
  111469. staticClass: 'v-timeline-item__body'
  111470. }, this.$slots.default);
  111471. },
  111472. genIcon: function genIcon() {
  111473. if (this.$slots.icon) {
  111474. return this.$slots.icon;
  111475. }
  111476. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], {
  111477. props: {
  111478. color: this.iconColor,
  111479. dark: !this.theme.isDark,
  111480. small: this.small
  111481. }
  111482. }, this.icon);
  111483. },
  111484. genInnerDot: function genInnerDot() {
  111485. var data = this.setBackgroundColor(this.color);
  111486. return this.$createElement('div', __assign({
  111487. staticClass: 'v-timeline-item__inner-dot'
  111488. }, data), [this.hasIcon && this.genIcon()]);
  111489. },
  111490. genDot: function genDot() {
  111491. return this.$createElement('div', {
  111492. staticClass: 'v-timeline-item__dot',
  111493. class: {
  111494. 'v-timeline-item__dot--small': this.small,
  111495. 'v-timeline-item__dot--large': this.large
  111496. }
  111497. }, [this.genInnerDot()]);
  111498. },
  111499. genDivider: function genDivider() {
  111500. var children = [];
  111501. if (!this.hideDot) children.push(this.genDot());
  111502. return this.$createElement('div', {
  111503. staticClass: 'v-timeline-item__divider'
  111504. }, children);
  111505. },
  111506. genOpposite: function genOpposite() {
  111507. return this.$createElement('div', {
  111508. staticClass: 'v-timeline-item__opposite'
  111509. }, this.$slots.opposite);
  111510. }
  111511. },
  111512. render: function render(h) {
  111513. var children = [this.genBody(), this.genDivider()];
  111514. if (this.$slots.opposite) children.push(this.genOpposite());
  111515. return h('div', {
  111516. staticClass: 'v-timeline-item',
  111517. class: __assign({
  111518. 'v-timeline-item--fill-dot': this.fillDot,
  111519. 'v-timeline-item--before': this.timeline.reverse ? this.right : this.left,
  111520. 'v-timeline-item--after': this.timeline.reverse ? this.left : this.right
  111521. }, this.themeClasses)
  111522. }, children);
  111523. }
  111524. }));
  111525. /***/ }),
  111526. /***/ "./src/components/VTimeline/index.ts":
  111527. /*!*******************************************!*\
  111528. !*** ./src/components/VTimeline/index.ts ***!
  111529. \*******************************************/
  111530. /*! exports provided: VTimeline, VTimelineItem, default */
  111531. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111532. "use strict";
  111533. __webpack_require__.r(__webpack_exports__);
  111534. /* harmony import */ var _VTimeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTimeline */ "./src/components/VTimeline/VTimeline.ts");
  111535. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimeline", function() { return _VTimeline__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  111536. /* harmony import */ var _VTimelineItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTimelineItem */ "./src/components/VTimeline/VTimelineItem.ts");
  111537. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimelineItem", function() { return _VTimelineItem__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  111538. /* harmony default export */ __webpack_exports__["default"] = ({
  111539. $_vuetify_subcomponents: {
  111540. VTimeline: _VTimeline__WEBPACK_IMPORTED_MODULE_0__["default"],
  111541. VTimelineItem: _VTimelineItem__WEBPACK_IMPORTED_MODULE_1__["default"]
  111542. }
  111543. });
  111544. /***/ }),
  111545. /***/ "./src/components/VToolbar/VToolbar.sass":
  111546. /*!***********************************************!*\
  111547. !*** ./src/components/VToolbar/VToolbar.sass ***!
  111548. \***********************************************/
  111549. /*! no static exports found */
  111550. /***/ (function(module, exports, __webpack_require__) {
  111551. // extracted by mini-css-extract-plugin
  111552. /***/ }),
  111553. /***/ "./src/components/VToolbar/VToolbar.ts":
  111554. /*!*********************************************!*\
  111555. !*** ./src/components/VToolbar/VToolbar.ts ***!
  111556. \*********************************************/
  111557. /*! exports provided: default */
  111558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111559. "use strict";
  111560. __webpack_require__.r(__webpack_exports__);
  111561. /* harmony import */ var _VToolbar_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VToolbar.sass */ "./src/components/VToolbar/VToolbar.sass");
  111562. /* harmony import */ var _VToolbar_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VToolbar_sass__WEBPACK_IMPORTED_MODULE_0__);
  111563. /* harmony import */ var _VSheet_VSheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSheet/VSheet */ "./src/components/VSheet/VSheet.ts");
  111564. /* harmony import */ var _VImg_VImg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VImg/VImg */ "./src/components/VImg/VImg.ts");
  111565. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  111566. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  111567. var __assign = undefined && undefined.__assign || function () {
  111568. __assign = Object.assign || function (t) {
  111569. for (var s, i = 1, n = arguments.length; i < n; i++) {
  111570. s = arguments[i];
  111571. for (var p in s) {
  111572. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  111573. }
  111574. }
  111575. return t;
  111576. };
  111577. return __assign.apply(this, arguments);
  111578. };
  111579. var __read = undefined && undefined.__read || function (o, n) {
  111580. var m = typeof Symbol === "function" && o[Symbol.iterator];
  111581. if (!m) return o;
  111582. var i = m.call(o),
  111583. r,
  111584. ar = [],
  111585. e;
  111586. try {
  111587. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  111588. ar.push(r.value);
  111589. }
  111590. } catch (error) {
  111591. e = {
  111592. error: error
  111593. };
  111594. } finally {
  111595. try {
  111596. if (r && !r.done && (m = i["return"])) m.call(i);
  111597. } finally {
  111598. if (e) throw e.error;
  111599. }
  111600. }
  111601. return ar;
  111602. }; // Styles
  111603. // Extensions
  111604. // Components
  111605. // Utilities
  111606. /* @vue/component */
  111607. /* harmony default export */ __webpack_exports__["default"] = (_VSheet_VSheet__WEBPACK_IMPORTED_MODULE_1__["default"].extend({
  111608. name: 'v-toolbar',
  111609. props: {
  111610. absolute: Boolean,
  111611. bottom: Boolean,
  111612. collapse: Boolean,
  111613. dense: Boolean,
  111614. extended: Boolean,
  111615. extensionHeight: {
  111616. default: 48,
  111617. type: [Number, String]
  111618. },
  111619. flat: Boolean,
  111620. floating: Boolean,
  111621. prominent: Boolean,
  111622. short: Boolean,
  111623. src: {
  111624. type: [String, Object],
  111625. default: ''
  111626. },
  111627. tag: {
  111628. type: String,
  111629. default: 'header'
  111630. },
  111631. tile: {
  111632. type: Boolean,
  111633. default: true
  111634. }
  111635. },
  111636. data: function data() {
  111637. return {
  111638. isExtended: false
  111639. };
  111640. },
  111641. computed: {
  111642. computedHeight: function computedHeight() {
  111643. var height = this.computedContentHeight;
  111644. if (!this.isExtended) return height;
  111645. var extensionHeight = parseInt(this.extensionHeight);
  111646. return this.isCollapsed ? height : height + (!isNaN(extensionHeight) ? extensionHeight : 0);
  111647. },
  111648. computedContentHeight: function computedContentHeight() {
  111649. if (this.height) return parseInt(this.height);
  111650. if (this.isProminent && this.dense) return 96;
  111651. if (this.isProminent && this.short) return 112;
  111652. if (this.isProminent) return 128;
  111653. if (this.dense) return 48;
  111654. if (this.short || this.$vuetify.breakpoint.smAndDown) return 56;
  111655. return 64;
  111656. },
  111657. classes: function classes() {
  111658. return __assign({}, _VSheet_VSheet__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.classes.call(this), {
  111659. 'v-toolbar': true,
  111660. 'v-toolbar--absolute': this.absolute,
  111661. 'v-toolbar--bottom': this.bottom,
  111662. 'v-toolbar--collapse': this.collapse,
  111663. 'v-toolbar--collapsed': this.isCollapsed,
  111664. 'v-toolbar--dense': this.dense,
  111665. 'v-toolbar--extended': this.isExtended,
  111666. 'v-toolbar--flat': this.flat,
  111667. 'v-toolbar--floating': this.floating,
  111668. 'v-toolbar--prominent': this.isProminent
  111669. });
  111670. },
  111671. isCollapsed: function isCollapsed() {
  111672. return this.collapse;
  111673. },
  111674. isProminent: function isProminent() {
  111675. return this.prominent;
  111676. },
  111677. styles: function styles() {
  111678. return __assign({}, this.measurableStyles, {
  111679. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.computedHeight)
  111680. });
  111681. }
  111682. },
  111683. created: function created() {
  111684. var _this = this;
  111685. var breakingProps = [['app', '<v-app-bar app>'], ['manual-scroll', '<v-app-bar :value="false">'], ['clipped-left', '<v-app-bar clipped-left>'], ['clipped-right', '<v-app-bar clipped-right>'], ['inverted-scroll', '<v-app-bar inverted-scroll>'], ['scroll-off-screen', '<v-app-bar scroll-off-screen>'], ['scroll-target', '<v-app-bar scroll-target>'], ['scroll-threshold', '<v-app-bar scroll-threshold>'], ['card', '<v-app-bar flat>']];
  111686. /* istanbul ignore next */
  111687. breakingProps.forEach(function (_a) {
  111688. var _b = __read(_a, 2),
  111689. original = _b[0],
  111690. replacement = _b[1];
  111691. if (_this.$attrs.hasOwnProperty(original)) Object(_util_console__WEBPACK_IMPORTED_MODULE_4__["breaking"])(original, replacement, _this);
  111692. });
  111693. },
  111694. methods: {
  111695. genBackground: function genBackground() {
  111696. var props = {
  111697. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.computedHeight),
  111698. src: this.src
  111699. };
  111700. var image = this.$scopedSlots.img ? this.$scopedSlots.img({
  111701. props: props
  111702. }) : this.$createElement(_VImg_VImg__WEBPACK_IMPORTED_MODULE_2__["default"], {
  111703. props: props
  111704. });
  111705. return this.$createElement('div', {
  111706. staticClass: 'v-toolbar__image'
  111707. }, [image]);
  111708. },
  111709. genContent: function genContent() {
  111710. return this.$createElement('div', {
  111711. staticClass: 'v-toolbar__content',
  111712. style: {
  111713. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.computedContentHeight)
  111714. }
  111715. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this));
  111716. },
  111717. genExtension: function genExtension() {
  111718. return this.$createElement('div', {
  111719. staticClass: 'v-toolbar__extension',
  111720. style: {
  111721. height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.extensionHeight)
  111722. }
  111723. }, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this, 'extension'));
  111724. }
  111725. },
  111726. render: function render(h) {
  111727. this.isExtended = this.extended || !!this.$scopedSlots.extension;
  111728. var children = [this.genContent()];
  111729. var data = this.setBackgroundColor(this.color, {
  111730. class: this.classes,
  111731. style: this.styles,
  111732. on: this.$listeners
  111733. });
  111734. if (this.isExtended) children.push(this.genExtension());
  111735. if (this.src || this.$scopedSlots.img) children.unshift(this.genBackground());
  111736. return h(this.tag, data, children);
  111737. }
  111738. }));
  111739. /***/ }),
  111740. /***/ "./src/components/VToolbar/index.ts":
  111741. /*!******************************************!*\
  111742. !*** ./src/components/VToolbar/index.ts ***!
  111743. \******************************************/
  111744. /*! exports provided: VToolbar, VToolbarItems, VToolbarTitle, default */
  111745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111746. "use strict";
  111747. __webpack_require__.r(__webpack_exports__);
  111748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VToolbarItems", function() { return VToolbarItems; });
  111749. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VToolbarTitle", function() { return VToolbarTitle; });
  111750. /* harmony import */ var _VToolbar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VToolbar */ "./src/components/VToolbar/VToolbar.ts");
  111751. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VToolbar", function() { return _VToolbar__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  111752. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  111753. // Components
  111754. // Utilities
  111755. var VToolbarTitle = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["createSimpleFunctional"])('v-toolbar__title');
  111756. var VToolbarItems = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["createSimpleFunctional"])('v-toolbar__items');
  111757. /* harmony default export */ __webpack_exports__["default"] = ({
  111758. $_vuetify_subcomponents: {
  111759. VToolbar: _VToolbar__WEBPACK_IMPORTED_MODULE_0__["default"],
  111760. VToolbarItems: VToolbarItems,
  111761. VToolbarTitle: VToolbarTitle
  111762. }
  111763. });
  111764. /***/ }),
  111765. /***/ "./src/components/VTooltip/VTooltip.sass":
  111766. /*!***********************************************!*\
  111767. !*** ./src/components/VTooltip/VTooltip.sass ***!
  111768. \***********************************************/
  111769. /*! no static exports found */
  111770. /***/ (function(module, exports, __webpack_require__) {
  111771. // extracted by mini-css-extract-plugin
  111772. /***/ }),
  111773. /***/ "./src/components/VTooltip/VTooltip.ts":
  111774. /*!*********************************************!*\
  111775. !*** ./src/components/VTooltip/VTooltip.ts ***!
  111776. \*********************************************/
  111777. /*! exports provided: default */
  111778. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111779. "use strict";
  111780. __webpack_require__.r(__webpack_exports__);
  111781. /* harmony import */ var _VTooltip_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTooltip.sass */ "./src/components/VTooltip/VTooltip.sass");
  111782. /* harmony import */ var _VTooltip_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VTooltip_sass__WEBPACK_IMPORTED_MODULE_0__);
  111783. /* harmony import */ var _mixins_activatable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/activatable */ "./src/mixins/activatable/index.ts");
  111784. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  111785. /* harmony import */ var _mixins_delayable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/delayable */ "./src/mixins/delayable/index.ts");
  111786. /* harmony import */ var _mixins_dependent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/dependent */ "./src/mixins/dependent/index.ts");
  111787. /* harmony import */ var _mixins_detachable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/detachable */ "./src/mixins/detachable/index.ts");
  111788. /* harmony import */ var _mixins_menuable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/menuable */ "./src/mixins/menuable/index.ts");
  111789. /* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable/index.ts");
  111790. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  111791. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  111792. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  111793. // Mixins
  111794. // Helpers
  111795. /* @vue/component */
  111796. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_10__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_delayable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_dependent__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_detachable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_menuable__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_7__["default"]).extend({
  111797. name: 'v-tooltip',
  111798. props: {
  111799. closeDelay: {
  111800. type: [Number, String],
  111801. default: 0
  111802. },
  111803. disabled: Boolean,
  111804. fixed: {
  111805. type: Boolean,
  111806. default: true
  111807. },
  111808. openDelay: {
  111809. type: [Number, String],
  111810. default: 0
  111811. },
  111812. openOnHover: {
  111813. type: Boolean,
  111814. default: true
  111815. },
  111816. tag: {
  111817. type: String,
  111818. default: 'span'
  111819. },
  111820. transition: String,
  111821. zIndex: {
  111822. default: null
  111823. }
  111824. },
  111825. data: function data() {
  111826. return {
  111827. calculatedMinWidth: 0,
  111828. closeDependents: false
  111829. };
  111830. },
  111831. computed: {
  111832. calculatedLeft: function calculatedLeft() {
  111833. var _a = this.dimensions,
  111834. activator = _a.activator,
  111835. content = _a.content;
  111836. var unknown = !this.bottom && !this.left && !this.top && !this.right;
  111837. var activatorLeft = this.attach !== false ? activator.offsetLeft : activator.left;
  111838. var left = 0;
  111839. if (this.top || this.bottom || unknown) {
  111840. left = activatorLeft + activator.width / 2 - content.width / 2;
  111841. } else if (this.left || this.right) {
  111842. left = activatorLeft + (this.right ? activator.width : -content.width) + (this.right ? 10 : -10);
  111843. }
  111844. if (this.nudgeLeft) left -= parseInt(this.nudgeLeft);
  111845. if (this.nudgeRight) left += parseInt(this.nudgeRight);
  111846. return this.calcXOverflow(left, this.dimensions.content.width) + "px";
  111847. },
  111848. calculatedTop: function calculatedTop() {
  111849. var _a = this.dimensions,
  111850. activator = _a.activator,
  111851. content = _a.content;
  111852. var activatorTop = this.attach !== false ? activator.offsetTop : activator.top;
  111853. var top = 0;
  111854. if (this.top || this.bottom) {
  111855. top = activatorTop + (this.bottom ? activator.height : -content.height) + (this.bottom ? 10 : -10);
  111856. } else if (this.left || this.right) {
  111857. top = activatorTop + activator.height / 2 - content.height / 2;
  111858. }
  111859. if (this.nudgeTop) top -= parseInt(this.nudgeTop);
  111860. if (this.nudgeBottom) top += parseInt(this.nudgeBottom);
  111861. return this.calcYOverflow(top + this.pageYOffset) + "px";
  111862. },
  111863. classes: function classes() {
  111864. return {
  111865. 'v-tooltip--top': this.top,
  111866. 'v-tooltip--right': this.right,
  111867. 'v-tooltip--bottom': this.bottom,
  111868. 'v-tooltip--left': this.left,
  111869. 'v-tooltip--attached': this.attach === '' || this.attach === true || this.attach === 'attach'
  111870. };
  111871. },
  111872. computedTransition: function computedTransition() {
  111873. if (this.transition) return this.transition;
  111874. return this.isActive ? 'scale-transition' : 'fade-transition';
  111875. },
  111876. offsetY: function offsetY() {
  111877. return this.top || this.bottom;
  111878. },
  111879. offsetX: function offsetX() {
  111880. return this.left || this.right;
  111881. },
  111882. styles: function styles() {
  111883. return {
  111884. left: this.calculatedLeft,
  111885. maxWidth: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.maxWidth),
  111886. minWidth: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.minWidth),
  111887. opacity: this.isActive ? 0.9 : 0,
  111888. top: this.calculatedTop,
  111889. zIndex: this.zIndex || this.activeZIndex
  111890. };
  111891. }
  111892. },
  111893. beforeMount: function beforeMount() {
  111894. var _this = this;
  111895. this.$nextTick(function () {
  111896. _this.value && _this.callActivate();
  111897. });
  111898. },
  111899. mounted: function mounted() {
  111900. if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["getSlotType"])(this, 'activator', true) === 'v-slot') {
  111901. Object(_util_console__WEBPACK_IMPORTED_MODULE_9__["consoleError"])("v-tooltip's activator slot must be bound, try '<template #activator=\"data\"><v-btn v-on=\"data.on>'", this);
  111902. }
  111903. },
  111904. methods: {
  111905. activate: function activate() {
  111906. // Update coordinates and dimensions of menu
  111907. // and its activator
  111908. this.updateDimensions(); // Start the transition
  111909. requestAnimationFrame(this.startTransition);
  111910. },
  111911. deactivate: function deactivate() {
  111912. this.runDelay('close');
  111913. },
  111914. genActivatorListeners: function genActivatorListeners() {
  111915. var _this = this;
  111916. var listeners = _mixins_activatable__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genActivatorListeners.call(this);
  111917. listeners.focus = function (e) {
  111918. _this.getActivator(e);
  111919. _this.runDelay('open');
  111920. };
  111921. listeners.blur = function (e) {
  111922. _this.getActivator(e);
  111923. _this.runDelay('close');
  111924. };
  111925. listeners.keydown = function (e) {
  111926. if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_8__["keyCodes"].esc) {
  111927. _this.getActivator(e);
  111928. _this.runDelay('close');
  111929. }
  111930. };
  111931. return listeners;
  111932. },
  111933. genTransition: function genTransition() {
  111934. var content = this.genContent();
  111935. if (!this.computedTransition) return content;
  111936. return this.$createElement('transition', {
  111937. props: {
  111938. name: this.computedTransition
  111939. }
  111940. }, [content]);
  111941. },
  111942. genContent: function genContent() {
  111943. var _a;
  111944. return this.$createElement('div', this.setBackgroundColor(this.color, {
  111945. staticClass: 'v-tooltip__content',
  111946. class: (_a = {}, _a[this.contentClass] = true, _a.menuable__content__active = this.isActive, _a['v-tooltip__content--fixed'] = this.activatorFixed, _a),
  111947. style: this.styles,
  111948. attrs: this.getScopeIdAttrs(),
  111949. directives: [{
  111950. name: 'show',
  111951. value: this.isContentActive
  111952. }],
  111953. ref: 'content'
  111954. }), this.getContentSlot());
  111955. }
  111956. },
  111957. render: function render(h) {
  111958. var _this = this;
  111959. return h(this.tag, {
  111960. staticClass: 'v-tooltip',
  111961. class: this.classes
  111962. }, [this.showLazyContent(function () {
  111963. return [_this.genTransition()];
  111964. }), this.genActivator()]);
  111965. }
  111966. }));
  111967. /***/ }),
  111968. /***/ "./src/components/VTooltip/index.ts":
  111969. /*!******************************************!*\
  111970. !*** ./src/components/VTooltip/index.ts ***!
  111971. \******************************************/
  111972. /*! exports provided: VTooltip, default */
  111973. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111974. "use strict";
  111975. __webpack_require__.r(__webpack_exports__);
  111976. /* harmony import */ var _VTooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTooltip */ "./src/components/VTooltip/VTooltip.ts");
  111977. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTooltip", function() { return _VTooltip__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  111978. /* harmony default export */ __webpack_exports__["default"] = (_VTooltip__WEBPACK_IMPORTED_MODULE_0__["default"]);
  111979. /***/ }),
  111980. /***/ "./src/components/VTreeview/VTreeview.sass":
  111981. /*!*************************************************!*\
  111982. !*** ./src/components/VTreeview/VTreeview.sass ***!
  111983. \*************************************************/
  111984. /*! no static exports found */
  111985. /***/ (function(module, exports, __webpack_require__) {
  111986. // extracted by mini-css-extract-plugin
  111987. /***/ }),
  111988. /***/ "./src/components/VTreeview/VTreeview.ts":
  111989. /*!***********************************************!*\
  111990. !*** ./src/components/VTreeview/VTreeview.ts ***!
  111991. \***********************************************/
  111992. /*! exports provided: default */
  111993. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111994. "use strict";
  111995. __webpack_require__.r(__webpack_exports__);
  111996. /* harmony import */ var _VTreeview_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTreeview.sass */ "./src/components/VTreeview/VTreeview.sass");
  111997. /* harmony import */ var _VTreeview_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VTreeview_sass__WEBPACK_IMPORTED_MODULE_0__);
  111998. /* harmony import */ var _VTreeviewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTreeviewNode */ "./src/components/VTreeview/VTreeviewNode.ts");
  111999. /* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable/index.ts");
  112000. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  112001. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  112002. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  112003. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  112004. /* harmony import */ var _util_filterTreeItems__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/filterTreeItems */ "./src/components/VTreeview/util/filterTreeItems.ts");
  112005. var __assign = undefined && undefined.__assign || function () {
  112006. __assign = Object.assign || function (t) {
  112007. for (var s, i = 1, n = arguments.length; i < n; i++) {
  112008. s = arguments[i];
  112009. for (var p in s) {
  112010. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  112011. }
  112012. }
  112013. return t;
  112014. };
  112015. return __assign.apply(this, arguments);
  112016. };
  112017. var __read = undefined && undefined.__read || function (o, n) {
  112018. var m = typeof Symbol === "function" && o[Symbol.iterator];
  112019. if (!m) return o;
  112020. var i = m.call(o),
  112021. r,
  112022. ar = [],
  112023. e;
  112024. try {
  112025. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  112026. ar.push(r.value);
  112027. }
  112028. } catch (error) {
  112029. e = {
  112030. error: error
  112031. };
  112032. } finally {
  112033. try {
  112034. if (r && !r.done && (m = i["return"])) m.call(i);
  112035. } finally {
  112036. if (e) throw e.error;
  112037. }
  112038. }
  112039. return ar;
  112040. };
  112041. var __spread = undefined && undefined.__spread || function () {
  112042. for (var ar = [], i = 0; i < arguments.length; i++) {
  112043. ar = ar.concat(__read(arguments[i]));
  112044. }
  112045. return ar;
  112046. };
  112047. var __values = undefined && undefined.__values || function (o) {
  112048. var m = typeof Symbol === "function" && o[Symbol.iterator],
  112049. i = 0;
  112050. if (m) return m.call(o);
  112051. return {
  112052. next: function next() {
  112053. if (o && i >= o.length) o = void 0;
  112054. return {
  112055. value: o && o[i++],
  112056. done: !o
  112057. };
  112058. }
  112059. };
  112060. }; // Styles
  112061. // Components
  112062. // Mixins
  112063. // Utils
  112064. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_3__["provide"])('treeview'), _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]
  112065. /* @vue/component */
  112066. ).extend({
  112067. name: 'v-treeview',
  112068. provide: function provide() {
  112069. return {
  112070. treeview: this
  112071. };
  112072. },
  112073. props: __assign({
  112074. active: {
  112075. type: Array,
  112076. default: function _default() {
  112077. return [];
  112078. }
  112079. },
  112080. dense: Boolean,
  112081. filter: Function,
  112082. hoverable: Boolean,
  112083. items: {
  112084. type: Array,
  112085. default: function _default() {
  112086. return [];
  112087. }
  112088. },
  112089. multipleActive: Boolean,
  112090. open: {
  112091. type: Array,
  112092. default: function _default() {
  112093. return [];
  112094. }
  112095. },
  112096. openAll: Boolean,
  112097. returnObject: {
  112098. type: Boolean,
  112099. default: false
  112100. },
  112101. search: String,
  112102. value: {
  112103. type: Array,
  112104. default: function _default() {
  112105. return [];
  112106. }
  112107. }
  112108. }, _VTreeviewNode__WEBPACK_IMPORTED_MODULE_1__["VTreeviewNodeProps"]),
  112109. data: function data() {
  112110. return {
  112111. level: -1,
  112112. activeCache: new Set(),
  112113. nodes: {},
  112114. openCache: new Set(),
  112115. selectedCache: new Set()
  112116. };
  112117. },
  112118. computed: {
  112119. excludedItems: function excludedItems() {
  112120. var excluded = new Set();
  112121. if (!this.search) return excluded;
  112122. for (var i = 0; i < this.items.length; i++) {
  112123. Object(_util_filterTreeItems__WEBPACK_IMPORTED_MODULE_7__["filterTreeItems"])(this.filter || _util_filterTreeItems__WEBPACK_IMPORTED_MODULE_7__["filterTreeItem"], this.items[i], this.search, this.itemKey, this.itemText, this.itemChildren, excluded);
  112124. }
  112125. return excluded;
  112126. }
  112127. },
  112128. watch: {
  112129. items: {
  112130. handler: function handler() {
  112131. var _this = this;
  112132. var oldKeys = Object.keys(this.nodes).map(function (k) {
  112133. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(_this.nodes[k].item, _this.itemKey);
  112134. });
  112135. var newKeys = this.getKeys(this.items);
  112136. var diff = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["arrayDiff"])(newKeys, oldKeys); // We only want to do stuff if items have changed
  112137. if (!diff.length && newKeys.length < oldKeys.length) return; // If nodes are removed we need to clear them from this.nodes
  112138. diff.forEach(function (k) {
  112139. return delete _this.nodes[k];
  112140. });
  112141. var oldSelectedCache = __spread(this.selectedCache);
  112142. this.selectedCache = new Set();
  112143. this.activeCache = new Set();
  112144. this.openCache = new Set();
  112145. this.buildTree(this.items); // Only emit selected if selection has changed
  112146. // as a result of items changing. This fixes a
  112147. // potential double emit when selecting a node
  112148. // with dynamic children
  112149. if (!Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["deepEqual"])(oldSelectedCache, __spread(this.selectedCache))) this.emitSelected();
  112150. },
  112151. deep: true
  112152. },
  112153. active: function active(value) {
  112154. this.handleNodeCacheWatcher(value, this.activeCache, this.updateActive, this.emitActive);
  112155. },
  112156. value: function value(_value) {
  112157. this.handleNodeCacheWatcher(_value, this.selectedCache, this.updateSelected, this.emitSelected);
  112158. },
  112159. open: function open(value) {
  112160. this.handleNodeCacheWatcher(value, this.openCache, this.updateOpen, this.emitOpen);
  112161. }
  112162. },
  112163. created: function created() {
  112164. var e_1, _a, e_2, _b;
  112165. var _this = this;
  112166. var getValue = function getValue(key) {
  112167. return _this.returnObject ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(key, _this.itemKey) : key;
  112168. };
  112169. this.buildTree(this.items);
  112170. try {
  112171. for (var _c = __values(this.value.map(getValue)), _d = _c.next(); !_d.done; _d = _c.next()) {
  112172. var value = _d.value;
  112173. this.updateSelected(value, true, true);
  112174. }
  112175. } catch (e_1_1) {
  112176. e_1 = {
  112177. error: e_1_1
  112178. };
  112179. } finally {
  112180. try {
  112181. if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
  112182. } finally {
  112183. if (e_1) throw e_1.error;
  112184. }
  112185. }
  112186. try {
  112187. for (var _e = __values(this.active.map(getValue)), _f = _e.next(); !_f.done; _f = _e.next()) {
  112188. var active = _f.value;
  112189. this.updateActive(active, true);
  112190. }
  112191. } catch (e_2_1) {
  112192. e_2 = {
  112193. error: e_2_1
  112194. };
  112195. } finally {
  112196. try {
  112197. if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
  112198. } finally {
  112199. if (e_2) throw e_2.error;
  112200. }
  112201. }
  112202. },
  112203. mounted: function mounted() {
  112204. var _this = this; // Save the developer from themselves
  112205. if (this.$slots.prepend || this.$slots.append) {
  112206. Object(_util_console__WEBPACK_IMPORTED_MODULE_6__["consoleWarn"])('The prepend and append slots require a slot-scope attribute', this);
  112207. }
  112208. if (this.openAll) {
  112209. this.updateAll(true);
  112210. } else {
  112211. this.open.forEach(function (key) {
  112212. return _this.updateOpen(_this.returnObject ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(key, _this.itemKey) : key, true);
  112213. });
  112214. this.emitOpen();
  112215. }
  112216. },
  112217. methods: {
  112218. /** @public */
  112219. updateAll: function updateAll(value) {
  112220. var _this = this;
  112221. Object.keys(this.nodes).forEach(function (key) {
  112222. return _this.updateOpen(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(_this.nodes[key].item, _this.itemKey), value);
  112223. });
  112224. this.emitOpen();
  112225. },
  112226. getKeys: function getKeys(items, keys) {
  112227. if (keys === void 0) {
  112228. keys = [];
  112229. }
  112230. for (var i = 0; i < items.length; i++) {
  112231. var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(items[i], this.itemKey);
  112232. keys.push(key);
  112233. var children = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(items[i], this.itemChildren);
  112234. if (children) {
  112235. keys.push.apply(keys, __spread(this.getKeys(children)));
  112236. }
  112237. }
  112238. return keys;
  112239. },
  112240. buildTree: function buildTree(items, parent) {
  112241. var _this = this;
  112242. if (parent === void 0) {
  112243. parent = null;
  112244. }
  112245. for (var i = 0; i < items.length; i++) {
  112246. var item = items[i];
  112247. var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(item, this.itemKey);
  112248. var children = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(item, this.itemChildren, []);
  112249. var oldNode = this.nodes.hasOwnProperty(key) ? this.nodes[key] : {
  112250. isSelected: false,
  112251. isIndeterminate: false,
  112252. isActive: false,
  112253. isOpen: false,
  112254. vnode: null
  112255. };
  112256. var node = {
  112257. vnode: oldNode.vnode,
  112258. parent: parent,
  112259. children: children.map(function (c) {
  112260. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(c, _this.itemKey);
  112261. }),
  112262. item: item
  112263. };
  112264. this.buildTree(children, key); // This fixed bug with dynamic children resetting selected parent state
  112265. if (!this.nodes.hasOwnProperty(key) && parent !== null && this.nodes.hasOwnProperty(parent)) {
  112266. node.isSelected = this.nodes[parent].isSelected;
  112267. } else {
  112268. node.isSelected = oldNode.isSelected;
  112269. node.isIndeterminate = oldNode.isIndeterminate;
  112270. }
  112271. node.isActive = oldNode.isActive;
  112272. node.isOpen = oldNode.isOpen;
  112273. this.nodes[key] = node;
  112274. if (children.length) {
  112275. var _a = this.calculateState(key, this.nodes),
  112276. isSelected = _a.isSelected,
  112277. isIndeterminate = _a.isIndeterminate;
  112278. node.isSelected = isSelected;
  112279. node.isIndeterminate = isIndeterminate;
  112280. } // Don't forget to rebuild cache
  112281. if (this.nodes[key].isSelected && (this.selectionType === 'independent' || node.children.length === 0)) this.selectedCache.add(key);
  112282. if (this.nodes[key].isActive) this.activeCache.add(key);
  112283. if (this.nodes[key].isOpen) this.openCache.add(key);
  112284. this.updateVnodeState(key);
  112285. }
  112286. },
  112287. calculateState: function calculateState(node, state) {
  112288. var children = state[node].children;
  112289. var counts = children.reduce(function (counts, child) {
  112290. counts[0] += +Boolean(state[child].isSelected);
  112291. counts[1] += +Boolean(state[child].isIndeterminate);
  112292. return counts;
  112293. }, [0, 0]);
  112294. var isSelected = !!children.length && counts[0] === children.length;
  112295. var isIndeterminate = !isSelected && (counts[0] > 0 || counts[1] > 0);
  112296. return {
  112297. isSelected: isSelected,
  112298. isIndeterminate: isIndeterminate
  112299. };
  112300. },
  112301. emitOpen: function emitOpen() {
  112302. this.emitNodeCache('update:open', this.openCache);
  112303. },
  112304. emitSelected: function emitSelected() {
  112305. this.emitNodeCache('input', this.selectedCache);
  112306. },
  112307. emitActive: function emitActive() {
  112308. this.emitNodeCache('update:active', this.activeCache);
  112309. },
  112310. emitNodeCache: function emitNodeCache(event, cache) {
  112311. var _this = this;
  112312. this.$emit(event, this.returnObject ? __spread(cache).map(function (key) {
  112313. return _this.nodes[key].item;
  112314. }) : __spread(cache));
  112315. },
  112316. handleNodeCacheWatcher: function handleNodeCacheWatcher(value, cache, updateFn, emitFn) {
  112317. var _this = this;
  112318. value = this.returnObject ? value.map(function (v) {
  112319. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(v, _this.itemKey);
  112320. }) : value;
  112321. var old = __spread(cache);
  112322. if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["deepEqual"])(old, value)) return;
  112323. old.forEach(function (key) {
  112324. return updateFn(key, false);
  112325. });
  112326. value.forEach(function (key) {
  112327. return updateFn(key, true);
  112328. });
  112329. emitFn();
  112330. },
  112331. getDescendants: function getDescendants(key, descendants) {
  112332. if (descendants === void 0) {
  112333. descendants = [];
  112334. }
  112335. var children = this.nodes[key].children;
  112336. descendants.push.apply(descendants, __spread(children));
  112337. for (var i = 0; i < children.length; i++) {
  112338. descendants = this.getDescendants(children[i], descendants);
  112339. }
  112340. return descendants;
  112341. },
  112342. getParents: function getParents(key) {
  112343. var parent = this.nodes[key].parent;
  112344. var parents = [];
  112345. while (parent !== null) {
  112346. parents.push(parent);
  112347. parent = this.nodes[parent].parent;
  112348. }
  112349. return parents;
  112350. },
  112351. register: function register(node) {
  112352. var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(node.item, this.itemKey);
  112353. this.nodes[key].vnode = node;
  112354. this.updateVnodeState(key);
  112355. },
  112356. unregister: function unregister(node) {
  112357. var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(node.item, this.itemKey);
  112358. if (this.nodes[key]) this.nodes[key].vnode = null;
  112359. },
  112360. isParent: function isParent(key) {
  112361. return this.nodes[key].children && this.nodes[key].children.length;
  112362. },
  112363. updateActive: function updateActive(key, isActive) {
  112364. var _this = this;
  112365. if (!this.nodes.hasOwnProperty(key)) return;
  112366. if (!this.multipleActive) {
  112367. this.activeCache.forEach(function (active) {
  112368. _this.nodes[active].isActive = false;
  112369. _this.updateVnodeState(active);
  112370. _this.activeCache.delete(active);
  112371. });
  112372. }
  112373. var node = this.nodes[key];
  112374. if (!node) return;
  112375. if (isActive) this.activeCache.add(key);else this.activeCache.delete(key);
  112376. node.isActive = isActive;
  112377. this.updateVnodeState(key);
  112378. },
  112379. updateSelected: function updateSelected(key, isSelected, isForced) {
  112380. var e_3, _a, e_4, _b, e_5, _c;
  112381. if (isForced === void 0) {
  112382. isForced = false;
  112383. }
  112384. if (!this.nodes.hasOwnProperty(key)) return;
  112385. var changed = new Map();
  112386. if (this.selectionType !== 'independent') {
  112387. try {
  112388. for (var _d = __values(this.getDescendants(key)), _e = _d.next(); !_e.done; _e = _d.next()) {
  112389. var descendant = _e.value;
  112390. if (!Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(this.nodes[descendant].item, this.itemDisabled) || isForced) {
  112391. this.nodes[descendant].isSelected = isSelected;
  112392. this.nodes[descendant].isIndeterminate = false;
  112393. changed.set(descendant, isSelected);
  112394. }
  112395. }
  112396. } catch (e_3_1) {
  112397. e_3 = {
  112398. error: e_3_1
  112399. };
  112400. } finally {
  112401. try {
  112402. if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
  112403. } finally {
  112404. if (e_3) throw e_3.error;
  112405. }
  112406. }
  112407. var calculated = this.calculateState(key, this.nodes);
  112408. this.nodes[key].isSelected = isSelected;
  112409. this.nodes[key].isIndeterminate = calculated.isIndeterminate;
  112410. changed.set(key, isSelected);
  112411. try {
  112412. for (var _f = __values(this.getParents(key)), _g = _f.next(); !_g.done; _g = _f.next()) {
  112413. var parent = _g.value;
  112414. var calculated_1 = this.calculateState(parent, this.nodes);
  112415. this.nodes[parent].isSelected = calculated_1.isSelected;
  112416. this.nodes[parent].isIndeterminate = calculated_1.isIndeterminate;
  112417. changed.set(parent, calculated_1.isSelected);
  112418. }
  112419. } catch (e_4_1) {
  112420. e_4 = {
  112421. error: e_4_1
  112422. };
  112423. } finally {
  112424. try {
  112425. if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
  112426. } finally {
  112427. if (e_4) throw e_4.error;
  112428. }
  112429. }
  112430. } else {
  112431. this.nodes[key].isSelected = isSelected;
  112432. this.nodes[key].isIndeterminate = false;
  112433. changed.set(key, isSelected);
  112434. }
  112435. try {
  112436. for (var _h = __values(changed.entries()), _j = _h.next(); !_j.done; _j = _h.next()) {
  112437. var _k = __read(_j.value, 2),
  112438. key_1 = _k[0],
  112439. value = _k[1];
  112440. this.updateVnodeState(key_1);
  112441. if (this.selectionType === 'leaf' && this.isParent(key_1)) continue;
  112442. value === true ? this.selectedCache.add(key_1) : this.selectedCache.delete(key_1);
  112443. }
  112444. } catch (e_5_1) {
  112445. e_5 = {
  112446. error: e_5_1
  112447. };
  112448. } finally {
  112449. try {
  112450. if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
  112451. } finally {
  112452. if (e_5) throw e_5.error;
  112453. }
  112454. }
  112455. },
  112456. updateOpen: function updateOpen(key, isOpen) {
  112457. var _this = this;
  112458. if (!this.nodes.hasOwnProperty(key)) return;
  112459. var node = this.nodes[key];
  112460. var children = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(node.item, this.itemChildren);
  112461. if (children && !children.length && node.vnode && !node.vnode.hasLoaded) {
  112462. node.vnode.checkChildren().then(function () {
  112463. return _this.updateOpen(key, isOpen);
  112464. });
  112465. } else if (children && children.length) {
  112466. node.isOpen = isOpen;
  112467. node.isOpen ? this.openCache.add(key) : this.openCache.delete(key);
  112468. this.updateVnodeState(key);
  112469. }
  112470. },
  112471. updateVnodeState: function updateVnodeState(key) {
  112472. var node = this.nodes[key];
  112473. if (node && node.vnode) {
  112474. node.vnode.isSelected = node.isSelected;
  112475. node.vnode.isIndeterminate = node.isIndeterminate;
  112476. node.vnode.isActive = node.isActive;
  112477. node.vnode.isOpen = node.isOpen;
  112478. }
  112479. },
  112480. isExcluded: function isExcluded(key) {
  112481. return !!this.search && this.excludedItems.has(key);
  112482. }
  112483. },
  112484. render: function render(h) {
  112485. var _this = this;
  112486. var children = this.items.length ? this.items.map(function (item) {
  112487. var genChild = _VTreeviewNode__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.genChild.bind(_this);
  112488. return genChild(item, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["getObjectValueByPath"])(item, _this.itemDisabled));
  112489. })
  112490. /* istanbul ignore next */
  112491. : this.$slots.default; // TODO: remove type annotation with TS 3.2
  112492. return h('div', {
  112493. staticClass: 'v-treeview',
  112494. class: __assign({
  112495. 'v-treeview--hoverable': this.hoverable,
  112496. 'v-treeview--dense': this.dense
  112497. }, this.themeClasses)
  112498. }, children);
  112499. }
  112500. }));
  112501. /***/ }),
  112502. /***/ "./src/components/VTreeview/VTreeviewNode.ts":
  112503. /*!***************************************************!*\
  112504. !*** ./src/components/VTreeview/VTreeviewNode.ts ***!
  112505. \***************************************************/
  112506. /*! exports provided: VTreeviewNodeProps, default */
  112507. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112508. "use strict";
  112509. __webpack_require__.r(__webpack_exports__);
  112510. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VTreeviewNodeProps", function() { return VTreeviewNodeProps; });
  112511. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.ts");
  112512. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  112513. /* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable/index.ts");
  112514. /* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable/index.ts");
  112515. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  112516. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  112517. var __assign = undefined && undefined.__assign || function () {
  112518. __assign = Object.assign || function (t) {
  112519. for (var s, i = 1, n = arguments.length; i < n; i++) {
  112520. s = arguments[i];
  112521. for (var p in s) {
  112522. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  112523. }
  112524. }
  112525. return t;
  112526. };
  112527. return __assign.apply(this, arguments);
  112528. };
  112529. var __read = undefined && undefined.__read || function (o, n) {
  112530. var m = typeof Symbol === "function" && o[Symbol.iterator];
  112531. if (!m) return o;
  112532. var i = m.call(o),
  112533. r,
  112534. ar = [],
  112535. e;
  112536. try {
  112537. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  112538. ar.push(r.value);
  112539. }
  112540. } catch (error) {
  112541. e = {
  112542. error: error
  112543. };
  112544. } finally {
  112545. try {
  112546. if (r && !r.done && (m = i["return"])) m.call(i);
  112547. } finally {
  112548. if (e) throw e.error;
  112549. }
  112550. }
  112551. return ar;
  112552. };
  112553. var __spread = undefined && undefined.__spread || function () {
  112554. for (var ar = [], i = 0; i < arguments.length; i++) {
  112555. ar = ar.concat(__read(arguments[i]));
  112556. }
  112557. return ar;
  112558. }; // Components
  112559. // Mixins
  112560. // Utils
  112561. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_2__["inject"])('treeview'));
  112562. var VTreeviewNodeProps = {
  112563. activatable: Boolean,
  112564. activeClass: {
  112565. type: String,
  112566. default: 'v-treeview-node--active'
  112567. },
  112568. color: {
  112569. type: String,
  112570. default: 'primary'
  112571. },
  112572. expandIcon: {
  112573. type: String,
  112574. default: '$subgroup'
  112575. },
  112576. indeterminateIcon: {
  112577. type: String,
  112578. default: '$checkboxIndeterminate'
  112579. },
  112580. itemChildren: {
  112581. type: String,
  112582. default: 'children'
  112583. },
  112584. itemDisabled: {
  112585. type: String,
  112586. default: 'disabled'
  112587. },
  112588. itemKey: {
  112589. type: String,
  112590. default: 'id'
  112591. },
  112592. itemText: {
  112593. type: String,
  112594. default: 'name'
  112595. },
  112596. loadChildren: Function,
  112597. loadingIcon: {
  112598. type: String,
  112599. default: '$loading'
  112600. },
  112601. offIcon: {
  112602. type: String,
  112603. default: '$checkboxOff'
  112604. },
  112605. onIcon: {
  112606. type: String,
  112607. default: '$checkboxOn'
  112608. },
  112609. openOnClick: Boolean,
  112610. rounded: Boolean,
  112611. selectable: Boolean,
  112612. selectedColor: {
  112613. type: String,
  112614. default: 'accent'
  112615. },
  112616. shaped: Boolean,
  112617. transition: Boolean,
  112618. selectionType: {
  112619. type: String,
  112620. default: 'leaf',
  112621. validator: function validator(v) {
  112622. return ['leaf', 'independent'].includes(v);
  112623. }
  112624. }
  112625. };
  112626. /* @vue/component */
  112627. var VTreeviewNode = baseMixins.extend().extend({
  112628. name: 'v-treeview-node',
  112629. inject: {
  112630. treeview: {
  112631. default: null
  112632. }
  112633. },
  112634. props: __assign({
  112635. level: Number,
  112636. item: {
  112637. type: Object,
  112638. default: function _default() {
  112639. return null;
  112640. }
  112641. },
  112642. parentIsDisabled: Boolean
  112643. }, VTreeviewNodeProps),
  112644. data: function data() {
  112645. return {
  112646. hasLoaded: false,
  112647. isActive: false,
  112648. isIndeterminate: false,
  112649. isLoading: false,
  112650. isOpen: false,
  112651. isSelected: false
  112652. };
  112653. },
  112654. computed: {
  112655. disabled: function disabled() {
  112656. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["getObjectValueByPath"])(this.item, this.itemDisabled) || this.parentIsDisabled && this.selectionType === 'leaf';
  112657. },
  112658. key: function key() {
  112659. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["getObjectValueByPath"])(this.item, this.itemKey);
  112660. },
  112661. children: function children() {
  112662. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["getObjectValueByPath"])(this.item, this.itemChildren);
  112663. },
  112664. text: function text() {
  112665. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["getObjectValueByPath"])(this.item, this.itemText);
  112666. },
  112667. scopedProps: function scopedProps() {
  112668. return {
  112669. item: this.item,
  112670. leaf: !this.children,
  112671. selected: this.isSelected,
  112672. indeterminate: this.isIndeterminate,
  112673. active: this.isActive,
  112674. open: this.isOpen
  112675. };
  112676. },
  112677. computedIcon: function computedIcon() {
  112678. if (this.isIndeterminate) return this.indeterminateIcon;else if (this.isSelected) return this.onIcon;else return this.offIcon;
  112679. },
  112680. hasChildren: function hasChildren() {
  112681. return !!this.children && (!!this.children.length || !!this.loadChildren);
  112682. }
  112683. },
  112684. created: function created() {
  112685. this.treeview.register(this);
  112686. },
  112687. beforeDestroy: function beforeDestroy() {
  112688. this.treeview.unregister(this);
  112689. },
  112690. methods: {
  112691. checkChildren: function checkChildren() {
  112692. var _this = this;
  112693. return new Promise(function (resolve) {
  112694. // TODO: Potential issue with always trying
  112695. // to load children if response is empty?
  112696. if (!_this.children || _this.children.length || !_this.loadChildren || _this.hasLoaded) return resolve();
  112697. _this.isLoading = true;
  112698. resolve(_this.loadChildren(_this.item));
  112699. }).then(function () {
  112700. _this.isLoading = false;
  112701. _this.hasLoaded = true;
  112702. });
  112703. },
  112704. open: function open() {
  112705. this.isOpen = !this.isOpen;
  112706. this.treeview.updateOpen(this.key, this.isOpen);
  112707. this.treeview.emitOpen();
  112708. },
  112709. genLabel: function genLabel() {
  112710. var children = [];
  112711. if (this.$scopedSlots.label) children.push(this.$scopedSlots.label(this.scopedProps));else children.push(this.text);
  112712. return this.$createElement('div', {
  112713. slot: 'label',
  112714. staticClass: 'v-treeview-node__label'
  112715. }, children);
  112716. },
  112717. genPrependSlot: function genPrependSlot() {
  112718. if (!this.$scopedSlots.prepend) return null;
  112719. return this.$createElement('div', {
  112720. staticClass: 'v-treeview-node__prepend'
  112721. }, this.$scopedSlots.prepend(this.scopedProps));
  112722. },
  112723. genAppendSlot: function genAppendSlot() {
  112724. if (!this.$scopedSlots.append) return null;
  112725. return this.$createElement('div', {
  112726. staticClass: 'v-treeview-node__append'
  112727. }, this.$scopedSlots.append(this.scopedProps));
  112728. },
  112729. genContent: function genContent() {
  112730. var children = [this.genPrependSlot(), this.genLabel(), this.genAppendSlot()];
  112731. return this.$createElement('div', {
  112732. staticClass: 'v-treeview-node__content'
  112733. }, children);
  112734. },
  112735. genToggle: function genToggle() {
  112736. var _this = this;
  112737. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["VIcon"], {
  112738. staticClass: 'v-treeview-node__toggle',
  112739. class: {
  112740. 'v-treeview-node__toggle--open': this.isOpen,
  112741. 'v-treeview-node__toggle--loading': this.isLoading
  112742. },
  112743. slot: 'prepend',
  112744. on: {
  112745. click: function click(e) {
  112746. e.stopPropagation();
  112747. if (_this.isLoading) return;
  112748. _this.checkChildren().then(function () {
  112749. return _this.open();
  112750. });
  112751. }
  112752. }
  112753. }, [this.isLoading ? this.loadingIcon : this.expandIcon]);
  112754. },
  112755. genCheckbox: function genCheckbox() {
  112756. var _this = this;
  112757. return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["VIcon"], {
  112758. staticClass: 'v-treeview-node__checkbox',
  112759. props: {
  112760. color: this.isSelected || this.isIndeterminate ? this.selectedColor : undefined,
  112761. disabled: this.disabled
  112762. },
  112763. on: {
  112764. click: function click(e) {
  112765. e.stopPropagation();
  112766. if (_this.isLoading) return;
  112767. _this.checkChildren().then(function () {
  112768. // We nextTick here so that items watch in VTreeview has a chance to run first
  112769. _this.$nextTick(function () {
  112770. _this.isSelected = !_this.isSelected;
  112771. _this.isIndeterminate = false;
  112772. _this.treeview.updateSelected(_this.key, _this.isSelected);
  112773. _this.treeview.emitSelected();
  112774. });
  112775. });
  112776. }
  112777. }
  112778. }, [this.computedIcon]);
  112779. },
  112780. genLevel: function genLevel(level) {
  112781. var _this = this;
  112782. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["createRange"])(level).map(function () {
  112783. return _this.$createElement('div', {
  112784. staticClass: 'v-treeview-node__level'
  112785. });
  112786. });
  112787. },
  112788. genNode: function genNode() {
  112789. var _a;
  112790. var _this = this;
  112791. var children = [this.genContent()];
  112792. if (this.selectable) children.unshift(this.genCheckbox());
  112793. if (this.hasChildren) {
  112794. children.unshift(this.genToggle());
  112795. } else {
  112796. children.unshift.apply(children, __spread(this.genLevel(1)));
  112797. }
  112798. children.unshift.apply(children, __spread(this.genLevel(this.level)));
  112799. return this.$createElement('div', this.setTextColor(this.isActive && this.color, {
  112800. staticClass: 'v-treeview-node__root',
  112801. class: (_a = {}, _a[this.activeClass] = this.isActive, _a),
  112802. on: {
  112803. click: function click() {
  112804. if (_this.openOnClick && _this.hasChildren) {
  112805. _this.checkChildren().then(_this.open);
  112806. } else if (_this.activatable && !_this.disabled) {
  112807. _this.isActive = !_this.isActive;
  112808. _this.treeview.updateActive(_this.key, _this.isActive);
  112809. _this.treeview.emitActive();
  112810. }
  112811. }
  112812. }
  112813. }), children);
  112814. },
  112815. genChild: function genChild(item, parentIsDisabled) {
  112816. return this.$createElement(VTreeviewNode, {
  112817. key: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_5__["getObjectValueByPath"])(item, this.itemKey),
  112818. props: {
  112819. activatable: this.activatable,
  112820. activeClass: this.activeClass,
  112821. item: item,
  112822. selectable: this.selectable,
  112823. selectedColor: this.selectedColor,
  112824. color: this.color,
  112825. expandIcon: this.expandIcon,
  112826. indeterminateIcon: this.indeterminateIcon,
  112827. offIcon: this.offIcon,
  112828. onIcon: this.onIcon,
  112829. loadingIcon: this.loadingIcon,
  112830. itemKey: this.itemKey,
  112831. itemText: this.itemText,
  112832. itemDisabled: this.itemDisabled,
  112833. itemChildren: this.itemChildren,
  112834. loadChildren: this.loadChildren,
  112835. transition: this.transition,
  112836. openOnClick: this.openOnClick,
  112837. rounded: this.rounded,
  112838. shaped: this.shaped,
  112839. level: this.level + 1,
  112840. selectionType: this.selectionType,
  112841. parentIsDisabled: parentIsDisabled
  112842. },
  112843. scopedSlots: this.$scopedSlots
  112844. });
  112845. },
  112846. genChildrenWrapper: function genChildrenWrapper() {
  112847. var _this = this;
  112848. if (!this.isOpen || !this.children) return null;
  112849. var children = [this.children.map(function (c) {
  112850. return _this.genChild(c, _this.disabled);
  112851. })];
  112852. return this.$createElement('div', {
  112853. staticClass: 'v-treeview-node__children'
  112854. }, children);
  112855. },
  112856. genTransition: function genTransition() {
  112857. return this.$createElement(_transitions__WEBPACK_IMPORTED_MODULE_0__["VExpandTransition"], [this.genChildrenWrapper()]);
  112858. }
  112859. },
  112860. render: function render(h) {
  112861. var children = [this.genNode()];
  112862. if (this.transition) children.push(this.genTransition());else children.push(this.genChildrenWrapper());
  112863. return h('div', {
  112864. staticClass: 'v-treeview-node',
  112865. class: {
  112866. 'v-treeview-node--leaf': !this.hasChildren,
  112867. 'v-treeview-node--click': this.openOnClick,
  112868. 'v-treeview-node--disabled': this.disabled,
  112869. 'v-treeview-node--rounded': this.rounded,
  112870. 'v-treeview-node--shaped': this.shaped,
  112871. 'v-treeview-node--selected': this.isSelected,
  112872. 'v-treeview-node--excluded': this.treeview.isExcluded(this.key)
  112873. },
  112874. attrs: {
  112875. 'aria-expanded': String(this.isOpen)
  112876. }
  112877. }, children);
  112878. }
  112879. });
  112880. /* harmony default export */ __webpack_exports__["default"] = (VTreeviewNode);
  112881. /***/ }),
  112882. /***/ "./src/components/VTreeview/index.ts":
  112883. /*!*******************************************!*\
  112884. !*** ./src/components/VTreeview/index.ts ***!
  112885. \*******************************************/
  112886. /*! exports provided: VTreeview, VTreeviewNode, default */
  112887. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112888. "use strict";
  112889. __webpack_require__.r(__webpack_exports__);
  112890. /* harmony import */ var _VTreeview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTreeview */ "./src/components/VTreeview/VTreeview.ts");
  112891. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTreeview", function() { return _VTreeview__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  112892. /* harmony import */ var _VTreeviewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTreeviewNode */ "./src/components/VTreeview/VTreeviewNode.ts");
  112893. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTreeviewNode", function() { return _VTreeviewNode__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  112894. /* harmony default export */ __webpack_exports__["default"] = ({
  112895. $_vuetify_subcomponents: {
  112896. VTreeview: _VTreeview__WEBPACK_IMPORTED_MODULE_0__["default"],
  112897. VTreeviewNode: _VTreeviewNode__WEBPACK_IMPORTED_MODULE_1__["default"]
  112898. }
  112899. });
  112900. /***/ }),
  112901. /***/ "./src/components/VTreeview/util/filterTreeItems.ts":
  112902. /*!**********************************************************!*\
  112903. !*** ./src/components/VTreeview/util/filterTreeItems.ts ***!
  112904. \**********************************************************/
  112905. /*! exports provided: filterTreeItem, filterTreeItems */
  112906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112907. "use strict";
  112908. __webpack_require__.r(__webpack_exports__);
  112909. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterTreeItem", function() { return filterTreeItem; });
  112910. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterTreeItems", function() { return filterTreeItems; });
  112911. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/helpers */ "./src/util/helpers.ts");
  112912. function filterTreeItem(item, search, textKey) {
  112913. var text = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["getObjectValueByPath"])(item, textKey);
  112914. return text.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1;
  112915. }
  112916. function filterTreeItems(filter, item, search, idKey, textKey, childrenKey, excluded) {
  112917. if (filter(item, search, textKey)) {
  112918. return true;
  112919. }
  112920. var children = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["getObjectValueByPath"])(item, childrenKey);
  112921. if (children) {
  112922. var match = false;
  112923. for (var i = 0; i < children.length; i++) {
  112924. if (filterTreeItems(filter, children[i], search, idKey, textKey, childrenKey, excluded)) {
  112925. match = true;
  112926. }
  112927. }
  112928. if (match) return true;
  112929. }
  112930. excluded.add(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["getObjectValueByPath"])(item, idKey));
  112931. return false;
  112932. }
  112933. /***/ }),
  112934. /***/ "./src/components/VWindow/VWindow.sass":
  112935. /*!*********************************************!*\
  112936. !*** ./src/components/VWindow/VWindow.sass ***!
  112937. \*********************************************/
  112938. /*! no static exports found */
  112939. /***/ (function(module, exports, __webpack_require__) {
  112940. // extracted by mini-css-extract-plugin
  112941. /***/ }),
  112942. /***/ "./src/components/VWindow/VWindow.ts":
  112943. /*!*******************************************!*\
  112944. !*** ./src/components/VWindow/VWindow.ts ***!
  112945. \*******************************************/
  112946. /*! exports provided: default */
  112947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112948. "use strict";
  112949. __webpack_require__.r(__webpack_exports__);
  112950. /* harmony import */ var _VWindow_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VWindow.sass */ "./src/components/VWindow/VWindow.sass");
  112951. /* harmony import */ var _VWindow_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VWindow_sass__WEBPACK_IMPORTED_MODULE_0__);
  112952. /* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch/index.ts");
  112953. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
  112954. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
  112955. /* harmony import */ var _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../VItemGroup/VItemGroup */ "./src/components/VItemGroup/VItemGroup.ts");
  112956. var __assign = undefined && undefined.__assign || function () {
  112957. __assign = Object.assign || function (t) {
  112958. for (var s, i = 1, n = arguments.length; i < n; i++) {
  112959. s = arguments[i];
  112960. for (var p in s) {
  112961. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  112962. }
  112963. }
  112964. return t;
  112965. };
  112966. return __assign.apply(this, arguments);
  112967. }; // Styles
  112968. // Directives
  112969. // Components
  112970. /* @vue/component */
  112971. /* harmony default export */ __webpack_exports__["default"] = (_VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_4__["BaseItemGroup"].extend({
  112972. name: 'v-window',
  112973. provide: function provide() {
  112974. return {
  112975. windowGroup: this
  112976. };
  112977. },
  112978. directives: {
  112979. Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_1__["default"]
  112980. },
  112981. props: {
  112982. activeClass: {
  112983. type: String,
  112984. default: 'v-window-item--active'
  112985. },
  112986. continuous: Boolean,
  112987. mandatory: {
  112988. type: Boolean,
  112989. default: true
  112990. },
  112991. nextIcon: {
  112992. type: [Boolean, String],
  112993. default: '$next'
  112994. },
  112995. prevIcon: {
  112996. type: [Boolean, String],
  112997. default: '$prev'
  112998. },
  112999. reverse: {
  113000. type: Boolean,
  113001. default: undefined
  113002. },
  113003. showArrows: Boolean,
  113004. showArrowsOnHover: Boolean,
  113005. touch: Object,
  113006. touchless: Boolean,
  113007. value: {
  113008. required: false
  113009. },
  113010. vertical: Boolean
  113011. },
  113012. data: function data() {
  113013. return {
  113014. changedByDelimiters: false,
  113015. internalHeight: undefined,
  113016. transitionHeight: undefined,
  113017. transitionCount: 0,
  113018. isBooted: false,
  113019. isReverse: false
  113020. };
  113021. },
  113022. computed: {
  113023. isActive: function isActive() {
  113024. return this.transitionCount > 0;
  113025. },
  113026. classes: function classes() {
  113027. return __assign({}, _VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_4__["BaseItemGroup"].options.computed.classes.call(this), {
  113028. 'v-window--show-arrows-on-hover': this.showArrowsOnHover
  113029. });
  113030. },
  113031. computedTransition: function computedTransition() {
  113032. if (!this.isBooted) return '';
  113033. var axis = this.vertical ? 'y' : 'x';
  113034. var reverse = this.$vuetify.rtl && axis === 'x' ? !this.internalReverse : this.internalReverse;
  113035. var direction = reverse ? '-reverse' : '';
  113036. return "v-window-" + axis + direction + "-transition";
  113037. },
  113038. hasActiveItems: function hasActiveItems() {
  113039. return Boolean(this.items.find(function (item) {
  113040. return !item.disabled;
  113041. }));
  113042. },
  113043. hasNext: function hasNext() {
  113044. return this.continuous || this.internalIndex < this.items.length - 1;
  113045. },
  113046. hasPrev: function hasPrev() {
  113047. return this.continuous || this.internalIndex > 0;
  113048. },
  113049. internalIndex: function internalIndex() {
  113050. var _this = this;
  113051. return this.items.findIndex(function (item, i) {
  113052. return _this.internalValue === _this.getValue(item, i);
  113053. });
  113054. },
  113055. internalReverse: function internalReverse() {
  113056. return this.reverse ? !this.isReverse : this.isReverse;
  113057. }
  113058. },
  113059. watch: {
  113060. internalIndex: 'updateReverse'
  113061. },
  113062. mounted: function mounted() {
  113063. var _this = this;
  113064. window.requestAnimationFrame(function () {
  113065. return _this.isBooted = true;
  113066. });
  113067. },
  113068. methods: {
  113069. genContainer: function genContainer() {
  113070. var children = [this.$slots.default];
  113071. if (this.showArrows) {
  113072. children.push(this.genControlIcons());
  113073. }
  113074. return this.$createElement('div', {
  113075. staticClass: 'v-window__container',
  113076. class: {
  113077. 'v-window__container--is-active': this.isActive
  113078. },
  113079. style: {
  113080. height: this.internalHeight || this.transitionHeight
  113081. }
  113082. }, children);
  113083. },
  113084. genIcon: function genIcon(direction, icon, fn) {
  113085. var _this = this;
  113086. return this.$createElement('div', {
  113087. staticClass: "v-window__" + direction
  113088. }, [this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_2__["default"], {
  113089. props: {
  113090. icon: true
  113091. },
  113092. attrs: {
  113093. 'aria-label': this.$vuetify.lang.t("$vuetify.carousel." + direction)
  113094. },
  113095. on: {
  113096. click: function click() {
  113097. _this.changedByDelimiters = true;
  113098. fn();
  113099. }
  113100. }
  113101. }, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_3__["default"], {
  113102. props: {
  113103. large: true
  113104. }
  113105. }, icon)])]);
  113106. },
  113107. genControlIcons: function genControlIcons() {
  113108. var icons = [];
  113109. var prevIcon = this.$vuetify.rtl ? this.nextIcon : this.prevIcon;
  113110. /* istanbul ignore else */
  113111. if (this.hasPrev && prevIcon && typeof prevIcon === 'string') {
  113112. var icon = this.genIcon('prev', prevIcon, this.prev);
  113113. icon && icons.push(icon);
  113114. }
  113115. var nextIcon = this.$vuetify.rtl ? this.prevIcon : this.nextIcon;
  113116. /* istanbul ignore else */
  113117. if (this.hasNext && nextIcon && typeof nextIcon === 'string') {
  113118. var icon = this.genIcon('next', nextIcon, this.next);
  113119. icon && icons.push(icon);
  113120. }
  113121. return icons;
  113122. },
  113123. getNextIndex: function getNextIndex(index) {
  113124. var nextIndex = (index + 1) % this.items.length;
  113125. var item = this.items[nextIndex];
  113126. if (item.disabled) return this.getNextIndex(nextIndex);
  113127. return nextIndex;
  113128. },
  113129. getPrevIndex: function getPrevIndex(index) {
  113130. var prevIndex = (index + this.items.length - 1) % this.items.length;
  113131. var item = this.items[prevIndex];
  113132. if (item.disabled) return this.getPrevIndex(prevIndex);
  113133. return prevIndex;
  113134. },
  113135. next: function next() {
  113136. this.isReverse = this.$vuetify.rtl;
  113137. /* istanbul ignore if */
  113138. if (!this.hasActiveItems || !this.hasNext) return;
  113139. var nextIndex = this.getNextIndex(this.internalIndex);
  113140. var item = this.items[nextIndex];
  113141. this.internalValue = this.getValue(item, nextIndex);
  113142. },
  113143. prev: function prev() {
  113144. this.isReverse = !this.$vuetify.rtl;
  113145. /* istanbul ignore if */
  113146. if (!this.hasActiveItems || !this.hasPrev) return;
  113147. var lastIndex = this.getPrevIndex(this.internalIndex);
  113148. var item = this.items[lastIndex];
  113149. this.internalValue = this.getValue(item, lastIndex);
  113150. },
  113151. updateReverse: function updateReverse(val, oldVal) {
  113152. if (this.changedByDelimiters) {
  113153. this.changedByDelimiters = false;
  113154. return;
  113155. }
  113156. this.isReverse = val < oldVal;
  113157. }
  113158. },
  113159. render: function render(h) {
  113160. var _this = this;
  113161. var data = {
  113162. staticClass: 'v-window',
  113163. class: this.classes,
  113164. directives: []
  113165. };
  113166. if (!this.touchless) {
  113167. var value = this.touch || {
  113168. left: function left() {
  113169. _this.$vuetify.rtl ? _this.prev() : _this.next();
  113170. },
  113171. right: function right() {
  113172. _this.$vuetify.rtl ? _this.next() : _this.prev();
  113173. },
  113174. end: function end(e) {
  113175. e.stopPropagation();
  113176. },
  113177. start: function start(e) {
  113178. e.stopPropagation();
  113179. }
  113180. };
  113181. data.directives.push({
  113182. name: 'touch',
  113183. value: value
  113184. });
  113185. }
  113186. return h('div', data, [this.genContainer()]);
  113187. }
  113188. }));
  113189. /***/ }),
  113190. /***/ "./src/components/VWindow/VWindowItem.ts":
  113191. /*!***********************************************!*\
  113192. !*** ./src/components/VWindow/VWindowItem.ts ***!
  113193. \***********************************************/
  113194. /*! exports provided: default */
  113195. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113196. "use strict";
  113197. __webpack_require__.r(__webpack_exports__);
  113198. /* harmony import */ var _mixins_bootable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/bootable */ "./src/mixins/bootable/index.ts");
  113199. /* harmony import */ var _mixins_groupable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/groupable */ "./src/mixins/groupable/index.ts");
  113200. /* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch/index.ts");
  113201. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  113202. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  113203. // Mixins
  113204. // Directives
  113205. // Utilities
  113206. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_bootable__WEBPACK_IMPORTED_MODULE_0__["default"], Object(_mixins_groupable__WEBPACK_IMPORTED_MODULE_1__["factory"])('windowGroup', 'v-window-item', 'v-window'));
  113207. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend().extend({
  113208. name: 'v-window-item',
  113209. directives: {
  113210. Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_2__["default"]
  113211. },
  113212. props: {
  113213. disabled: Boolean,
  113214. reverseTransition: {
  113215. type: [Boolean, String],
  113216. default: undefined
  113217. },
  113218. transition: {
  113219. type: [Boolean, String],
  113220. default: undefined
  113221. },
  113222. value: {
  113223. required: false
  113224. }
  113225. },
  113226. data: function data() {
  113227. return {
  113228. isActive: false,
  113229. inTransition: false
  113230. };
  113231. },
  113232. computed: {
  113233. classes: function classes() {
  113234. return this.groupClasses;
  113235. },
  113236. computedTransition: function computedTransition() {
  113237. if (!this.windowGroup.internalReverse) {
  113238. return typeof this.transition !== 'undefined' ? this.transition || '' : this.windowGroup.computedTransition;
  113239. }
  113240. return typeof this.reverseTransition !== 'undefined' ? this.reverseTransition || '' : this.windowGroup.computedTransition;
  113241. }
  113242. },
  113243. methods: {
  113244. genDefaultSlot: function genDefaultSlot() {
  113245. return this.$slots.default;
  113246. },
  113247. genWindowItem: function genWindowItem() {
  113248. return this.$createElement('div', {
  113249. staticClass: 'v-window-item',
  113250. class: this.classes,
  113251. directives: [{
  113252. name: 'show',
  113253. value: this.isActive
  113254. }],
  113255. on: this.$listeners
  113256. }, this.genDefaultSlot());
  113257. },
  113258. onAfterTransition: function onAfterTransition() {
  113259. if (!this.inTransition) {
  113260. return;
  113261. } // Finalize transition state.
  113262. this.inTransition = false;
  113263. if (this.windowGroup.transitionCount > 0) {
  113264. this.windowGroup.transitionCount--; // Remove container height if we are out of transition.
  113265. if (this.windowGroup.transitionCount === 0) {
  113266. this.windowGroup.transitionHeight = undefined;
  113267. }
  113268. }
  113269. },
  113270. onBeforeTransition: function onBeforeTransition() {
  113271. if (this.inTransition) {
  113272. return;
  113273. } // Initialize transition state here.
  113274. this.inTransition = true;
  113275. if (this.windowGroup.transitionCount === 0) {
  113276. // Set initial height for height transition.
  113277. this.windowGroup.transitionHeight = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(this.windowGroup.$el.clientHeight);
  113278. }
  113279. this.windowGroup.transitionCount++;
  113280. },
  113281. onTransitionCancelled: function onTransitionCancelled() {
  113282. this.onAfterTransition(); // This should have the same path as normal transition end.
  113283. },
  113284. onEnter: function onEnter(el) {
  113285. var _this = this;
  113286. if (!this.inTransition) {
  113287. return;
  113288. }
  113289. this.$nextTick(function () {
  113290. // Do not set height if no transition or cancelled.
  113291. if (!_this.computedTransition || !_this.inTransition) {
  113292. return;
  113293. } // Set transition target height.
  113294. _this.windowGroup.transitionHeight = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(el.clientHeight);
  113295. });
  113296. }
  113297. },
  113298. render: function render(h) {
  113299. var _this = this;
  113300. return h('transition', {
  113301. props: {
  113302. name: this.computedTransition
  113303. },
  113304. on: {
  113305. // Handlers for enter windows.
  113306. beforeEnter: this.onBeforeTransition,
  113307. afterEnter: this.onAfterTransition,
  113308. enterCancelled: this.onTransitionCancelled,
  113309. // Handlers for leave windows.
  113310. beforeLeave: this.onBeforeTransition,
  113311. afterLeave: this.onAfterTransition,
  113312. leaveCancelled: this.onTransitionCancelled,
  113313. // Enter handler for height transition.
  113314. enter: this.onEnter
  113315. }
  113316. }, this.showLazyContent(function () {
  113317. return [_this.genWindowItem()];
  113318. }));
  113319. }
  113320. }));
  113321. /***/ }),
  113322. /***/ "./src/components/VWindow/index.ts":
  113323. /*!*****************************************!*\
  113324. !*** ./src/components/VWindow/index.ts ***!
  113325. \*****************************************/
  113326. /*! exports provided: VWindow, VWindowItem, default */
  113327. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113328. "use strict";
  113329. __webpack_require__.r(__webpack_exports__);
  113330. /* harmony import */ var _VWindow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VWindow */ "./src/components/VWindow/VWindow.ts");
  113331. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VWindow", function() { return _VWindow__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  113332. /* harmony import */ var _VWindowItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VWindowItem */ "./src/components/VWindow/VWindowItem.ts");
  113333. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VWindowItem", function() { return _VWindowItem__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  113334. /* harmony default export */ __webpack_exports__["default"] = ({
  113335. $_vuetify_subcomponents: {
  113336. VWindow: _VWindow__WEBPACK_IMPORTED_MODULE_0__["default"],
  113337. VWindowItem: _VWindowItem__WEBPACK_IMPORTED_MODULE_1__["default"]
  113338. }
  113339. });
  113340. /***/ }),
  113341. /***/ "./src/components/index.ts":
  113342. /*!*********************************!*\
  113343. !*** ./src/components/index.ts ***!
  113344. \*********************************/
  113345. /*! exports provided: VApp, VAppBar, VAppBarNavIcon, VAlert, VAutocomplete, VAvatar, VBadge, VBanner, VBottomNavigation, VBottomSheet, VBreadcrumbs, VBreadcrumbsItem, VBreadcrumbsDivider, VBtn, VBtnToggle, VCalendar, VCalendarDaily, VCalendarWeekly, VCalendarMonthly, VCard, VCardActions, VCardSubtitle, VCardText, VCardTitle, VCarousel, VCarouselItem, VCheckbox, VSimpleCheckbox, VChip, VChipGroup, VColorPicker, VColorPickerSwatches, VColorPickerCanvas, VContent, VCombobox, VCounter, VData, VDataIterator, VDataFooter, VDataTable, VEditDialog, VTableOverflow, VDataTableHeader, VSimpleTable, VVirtualTable, VDatePicker, VDatePickerTitle, VDatePickerHeader, VDatePickerDateTable, VDatePickerMonthTable, VDatePickerYears, VDialog, VDivider, VExpansionPanels, VExpansionPanel, VExpansionPanelHeader, VExpansionPanelContent, VFileInput, VFooter, VForm, VContainer, VCol, VRow, VSpacer, VLayout, VFlex, VHover, VIcon, VImg, VInput, VItem, VItemGroup, VLabel, VLazy, VListItemActionText, VListItemContent, VListItemTitle, VListItemSubtitle, VList, VListGroup, VListItem, VListItemAction, VListItemAvatar, VListItemIcon, VListItemGroup, VMenu, VMessages, VNavigationDrawer, VOverflowBtn, VOverlay, VPagination, VSheet, VParallax, VPicker, VProgressCircular, VProgressLinear, VRadioGroup, VRadio, VRangeSlider, VRating, VResponsive, VSelect, VSkeletonLoader, VSlider, VSlideGroup, VSlideItem, VSnackbar, VSparkline, VSpeedDial, VStepper, VStepperContent, VStepperStep, VStepperHeader, VStepperItems, VSubheader, VSwitch, VSystemBar, VTabs, VTab, VTabItem, VTabsItems, VTabsSlider, VTextarea, VTextField, VThemeProvider, VTimeline, VTimelineItem, VTimePicker, VTimePickerClock, VTimePickerTitle, VToolbar, VToolbarItems, VToolbarTitle, VTooltip, VTreeview, VTreeviewNode, VWindow, VWindowItem, VCarouselTransition, VCarouselReverseTransition, VTabTransition, VTabReverseTransition, VMenuTransition, VFabTransition, VDialogTransition, VDialogBottomTransition, VFadeTransition, VScaleTransition, VScrollXTransition, VScrollXReverseTransition, VScrollYTransition, VScrollYReverseTransition, VSlideXTransition, VSlideXReverseTransition, VSlideYTransition, VSlideYReverseTransition, VExpandTransition, VExpandXTransition */
  113346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113347. "use strict";
  113348. __webpack_require__.r(__webpack_exports__);
  113349. /* harmony import */ var _VApp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VApp */ "./src/components/VApp/index.ts");
  113350. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VApp", function() { return _VApp__WEBPACK_IMPORTED_MODULE_0__["VApp"]; });
  113351. /* harmony import */ var _VAppBar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VAppBar */ "./src/components/VAppBar/index.ts");
  113352. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAppBar", function() { return _VAppBar__WEBPACK_IMPORTED_MODULE_1__["VAppBar"]; });
  113353. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAppBarNavIcon", function() { return _VAppBar__WEBPACK_IMPORTED_MODULE_1__["VAppBarNavIcon"]; });
  113354. /* harmony import */ var _VAlert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VAlert */ "./src/components/VAlert/index.ts");
  113355. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAlert", function() { return _VAlert__WEBPACK_IMPORTED_MODULE_2__["VAlert"]; });
  113356. /* harmony import */ var _VAutocomplete__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VAutocomplete */ "./src/components/VAutocomplete/index.ts");
  113357. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAutocomplete", function() { return _VAutocomplete__WEBPACK_IMPORTED_MODULE_3__["VAutocomplete"]; });
  113358. /* harmony import */ var _VAvatar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VAvatar */ "./src/components/VAvatar/index.ts");
  113359. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAvatar", function() { return _VAvatar__WEBPACK_IMPORTED_MODULE_4__["VAvatar"]; });
  113360. /* harmony import */ var _VBadge__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VBadge */ "./src/components/VBadge/index.ts");
  113361. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBadge", function() { return _VBadge__WEBPACK_IMPORTED_MODULE_5__["VBadge"]; });
  113362. /* harmony import */ var _VBanner__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./VBanner */ "./src/components/VBanner/index.ts");
  113363. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBanner", function() { return _VBanner__WEBPACK_IMPORTED_MODULE_6__["VBanner"]; });
  113364. /* harmony import */ var _VBottomNavigation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./VBottomNavigation */ "./src/components/VBottomNavigation/index.ts");
  113365. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBottomNavigation", function() { return _VBottomNavigation__WEBPACK_IMPORTED_MODULE_7__["VBottomNavigation"]; });
  113366. /* harmony import */ var _VBottomSheet__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./VBottomSheet */ "./src/components/VBottomSheet/index.ts");
  113367. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBottomSheet", function() { return _VBottomSheet__WEBPACK_IMPORTED_MODULE_8__["VBottomSheet"]; });
  113368. /* harmony import */ var _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./VBreadcrumbs */ "./src/components/VBreadcrumbs/index.ts");
  113369. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBreadcrumbs", function() { return _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_9__["VBreadcrumbs"]; });
  113370. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBreadcrumbsItem", function() { return _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_9__["VBreadcrumbsItem"]; });
  113371. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBreadcrumbsDivider", function() { return _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_9__["VBreadcrumbsDivider"]; });
  113372. /* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./VBtn */ "./src/components/VBtn/index.ts");
  113373. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBtn", function() { return _VBtn__WEBPACK_IMPORTED_MODULE_10__["VBtn"]; });
  113374. /* harmony import */ var _VBtnToggle__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./VBtnToggle */ "./src/components/VBtnToggle/index.ts");
  113375. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBtnToggle", function() { return _VBtnToggle__WEBPACK_IMPORTED_MODULE_11__["VBtnToggle"]; });
  113376. /* harmony import */ var _VCalendar__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./VCalendar */ "./src/components/VCalendar/index.ts");
  113377. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCalendar", function() { return _VCalendar__WEBPACK_IMPORTED_MODULE_12__["VCalendar"]; });
  113378. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCalendarDaily", function() { return _VCalendar__WEBPACK_IMPORTED_MODULE_12__["VCalendarDaily"]; });
  113379. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCalendarWeekly", function() { return _VCalendar__WEBPACK_IMPORTED_MODULE_12__["VCalendarWeekly"]; });
  113380. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCalendarMonthly", function() { return _VCalendar__WEBPACK_IMPORTED_MODULE_12__["VCalendarMonthly"]; });
  113381. /* harmony import */ var _VCard__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./VCard */ "./src/components/VCard/index.ts");
  113382. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCard", function() { return _VCard__WEBPACK_IMPORTED_MODULE_13__["VCard"]; });
  113383. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCardActions", function() { return _VCard__WEBPACK_IMPORTED_MODULE_13__["VCardActions"]; });
  113384. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCardSubtitle", function() { return _VCard__WEBPACK_IMPORTED_MODULE_13__["VCardSubtitle"]; });
  113385. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCardText", function() { return _VCard__WEBPACK_IMPORTED_MODULE_13__["VCardText"]; });
  113386. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCardTitle", function() { return _VCard__WEBPACK_IMPORTED_MODULE_13__["VCardTitle"]; });
  113387. /* harmony import */ var _VCarousel__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./VCarousel */ "./src/components/VCarousel/index.ts");
  113388. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCarousel", function() { return _VCarousel__WEBPACK_IMPORTED_MODULE_14__["VCarousel"]; });
  113389. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCarouselItem", function() { return _VCarousel__WEBPACK_IMPORTED_MODULE_14__["VCarouselItem"]; });
  113390. /* harmony import */ var _VCheckbox__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./VCheckbox */ "./src/components/VCheckbox/index.ts");
  113391. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCheckbox", function() { return _VCheckbox__WEBPACK_IMPORTED_MODULE_15__["VCheckbox"]; });
  113392. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSimpleCheckbox", function() { return _VCheckbox__WEBPACK_IMPORTED_MODULE_15__["VSimpleCheckbox"]; });
  113393. /* harmony import */ var _VChip__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./VChip */ "./src/components/VChip/index.ts");
  113394. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VChip", function() { return _VChip__WEBPACK_IMPORTED_MODULE_16__["VChip"]; });
  113395. /* harmony import */ var _VChipGroup__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./VChipGroup */ "./src/components/VChipGroup/index.ts");
  113396. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VChipGroup", function() { return _VChipGroup__WEBPACK_IMPORTED_MODULE_17__["VChipGroup"]; });
  113397. /* harmony import */ var _VColorPicker__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./VColorPicker */ "./src/components/VColorPicker/index.ts");
  113398. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VColorPicker", function() { return _VColorPicker__WEBPACK_IMPORTED_MODULE_18__["VColorPicker"]; });
  113399. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VColorPickerSwatches", function() { return _VColorPicker__WEBPACK_IMPORTED_MODULE_18__["VColorPickerSwatches"]; });
  113400. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VColorPickerCanvas", function() { return _VColorPicker__WEBPACK_IMPORTED_MODULE_18__["VColorPickerCanvas"]; });
  113401. /* harmony import */ var _VContent__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./VContent */ "./src/components/VContent/index.ts");
  113402. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VContent", function() { return _VContent__WEBPACK_IMPORTED_MODULE_19__["VContent"]; });
  113403. /* harmony import */ var _VCombobox__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./VCombobox */ "./src/components/VCombobox/index.ts");
  113404. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCombobox", function() { return _VCombobox__WEBPACK_IMPORTED_MODULE_20__["VCombobox"]; });
  113405. /* harmony import */ var _VCounter__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./VCounter */ "./src/components/VCounter/index.ts");
  113406. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCounter", function() { return _VCounter__WEBPACK_IMPORTED_MODULE_21__["VCounter"]; });
  113407. /* harmony import */ var _VData__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./VData */ "./src/components/VData/index.ts");
  113408. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VData", function() { return _VData__WEBPACK_IMPORTED_MODULE_22__["VData"]; });
  113409. /* harmony import */ var _VDataIterator__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./VDataIterator */ "./src/components/VDataIterator/index.ts");
  113410. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataIterator", function() { return _VDataIterator__WEBPACK_IMPORTED_MODULE_23__["VDataIterator"]; });
  113411. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataFooter", function() { return _VDataIterator__WEBPACK_IMPORTED_MODULE_23__["VDataFooter"]; });
  113412. /* harmony import */ var _VDataTable__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./VDataTable */ "./src/components/VDataTable/index.ts");
  113413. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataTable", function() { return _VDataTable__WEBPACK_IMPORTED_MODULE_24__["VDataTable"]; });
  113414. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VEditDialog", function() { return _VDataTable__WEBPACK_IMPORTED_MODULE_24__["VEditDialog"]; });
  113415. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTableOverflow", function() { return _VDataTable__WEBPACK_IMPORTED_MODULE_24__["VTableOverflow"]; });
  113416. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataTableHeader", function() { return _VDataTable__WEBPACK_IMPORTED_MODULE_24__["VDataTableHeader"]; });
  113417. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSimpleTable", function() { return _VDataTable__WEBPACK_IMPORTED_MODULE_24__["VSimpleTable"]; });
  113418. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VVirtualTable", function() { return _VDataTable__WEBPACK_IMPORTED_MODULE_24__["VVirtualTable"]; });
  113419. /* harmony import */ var _VDatePicker__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./VDatePicker */ "./src/components/VDatePicker/index.ts");
  113420. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePicker", function() { return _VDatePicker__WEBPACK_IMPORTED_MODULE_25__["VDatePicker"]; });
  113421. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerTitle", function() { return _VDatePicker__WEBPACK_IMPORTED_MODULE_25__["VDatePickerTitle"]; });
  113422. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerHeader", function() { return _VDatePicker__WEBPACK_IMPORTED_MODULE_25__["VDatePickerHeader"]; });
  113423. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerDateTable", function() { return _VDatePicker__WEBPACK_IMPORTED_MODULE_25__["VDatePickerDateTable"]; });
  113424. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerMonthTable", function() { return _VDatePicker__WEBPACK_IMPORTED_MODULE_25__["VDatePickerMonthTable"]; });
  113425. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerYears", function() { return _VDatePicker__WEBPACK_IMPORTED_MODULE_25__["VDatePickerYears"]; });
  113426. /* harmony import */ var _VDialog__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./VDialog */ "./src/components/VDialog/index.ts");
  113427. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDialog", function() { return _VDialog__WEBPACK_IMPORTED_MODULE_26__["VDialog"]; });
  113428. /* harmony import */ var _VDivider__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./VDivider */ "./src/components/VDivider/index.ts");
  113429. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDivider", function() { return _VDivider__WEBPACK_IMPORTED_MODULE_27__["VDivider"]; });
  113430. /* harmony import */ var _VExpansionPanel__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./VExpansionPanel */ "./src/components/VExpansionPanel/index.ts");
  113431. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanels", function() { return _VExpansionPanel__WEBPACK_IMPORTED_MODULE_28__["VExpansionPanels"]; });
  113432. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanel", function() { return _VExpansionPanel__WEBPACK_IMPORTED_MODULE_28__["VExpansionPanel"]; });
  113433. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanelHeader", function() { return _VExpansionPanel__WEBPACK_IMPORTED_MODULE_28__["VExpansionPanelHeader"]; });
  113434. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanelContent", function() { return _VExpansionPanel__WEBPACK_IMPORTED_MODULE_28__["VExpansionPanelContent"]; });
  113435. /* harmony import */ var _VFileInput__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./VFileInput */ "./src/components/VFileInput/index.ts");
  113436. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFileInput", function() { return _VFileInput__WEBPACK_IMPORTED_MODULE_29__["VFileInput"]; });
  113437. /* harmony import */ var _VFooter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./VFooter */ "./src/components/VFooter/index.ts");
  113438. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFooter", function() { return _VFooter__WEBPACK_IMPORTED_MODULE_30__["VFooter"]; });
  113439. /* harmony import */ var _VForm__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./VForm */ "./src/components/VForm/index.ts");
  113440. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VForm", function() { return _VForm__WEBPACK_IMPORTED_MODULE_31__["VForm"]; });
  113441. /* harmony import */ var _VGrid__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./VGrid */ "./src/components/VGrid/index.ts");
  113442. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VContainer", function() { return _VGrid__WEBPACK_IMPORTED_MODULE_32__["VContainer"]; });
  113443. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCol", function() { return _VGrid__WEBPACK_IMPORTED_MODULE_32__["VCol"]; });
  113444. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRow", function() { return _VGrid__WEBPACK_IMPORTED_MODULE_32__["VRow"]; });
  113445. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSpacer", function() { return _VGrid__WEBPACK_IMPORTED_MODULE_32__["VSpacer"]; });
  113446. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VLayout", function() { return _VGrid__WEBPACK_IMPORTED_MODULE_32__["VLayout"]; });
  113447. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFlex", function() { return _VGrid__WEBPACK_IMPORTED_MODULE_32__["VFlex"]; });
  113448. /* harmony import */ var _VHover__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./VHover */ "./src/components/VHover/index.ts");
  113449. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VHover", function() { return _VHover__WEBPACK_IMPORTED_MODULE_33__["VHover"]; });
  113450. /* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./VIcon */ "./src/components/VIcon/index.ts");
  113451. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VIcon", function() { return _VIcon__WEBPACK_IMPORTED_MODULE_34__["VIcon"]; });
  113452. /* harmony import */ var _VImg__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./VImg */ "./src/components/VImg/index.ts");
  113453. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VImg", function() { return _VImg__WEBPACK_IMPORTED_MODULE_35__["VImg"]; });
  113454. /* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./VInput */ "./src/components/VInput/index.ts");
  113455. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VInput", function() { return _VInput__WEBPACK_IMPORTED_MODULE_36__["VInput"]; });
  113456. /* harmony import */ var _VItemGroup__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./VItemGroup */ "./src/components/VItemGroup/index.ts");
  113457. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VItem", function() { return _VItemGroup__WEBPACK_IMPORTED_MODULE_37__["VItem"]; });
  113458. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VItemGroup", function() { return _VItemGroup__WEBPACK_IMPORTED_MODULE_37__["VItemGroup"]; });
  113459. /* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./VLabel */ "./src/components/VLabel/index.ts");
  113460. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VLabel", function() { return _VLabel__WEBPACK_IMPORTED_MODULE_38__["VLabel"]; });
  113461. /* harmony import */ var _VLazy__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./VLazy */ "./src/components/VLazy/index.ts");
  113462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VLazy", function() { return _VLazy__WEBPACK_IMPORTED_MODULE_39__["VLazy"]; });
  113463. /* harmony import */ var _VList__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./VList */ "./src/components/VList/index.ts");
  113464. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemActionText", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListItemActionText"]; });
  113465. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemContent", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListItemContent"]; });
  113466. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemTitle", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListItemTitle"]; });
  113467. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemSubtitle", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListItemSubtitle"]; });
  113468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VList", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VList"]; });
  113469. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListGroup", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListGroup"]; });
  113470. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItem", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListItem"]; });
  113471. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemAction", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListItemAction"]; });
  113472. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemAvatar", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListItemAvatar"]; });
  113473. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemIcon", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListItemIcon"]; });
  113474. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListItemGroup", function() { return _VList__WEBPACK_IMPORTED_MODULE_40__["VListItemGroup"]; });
  113475. /* harmony import */ var _VMenu__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./VMenu */ "./src/components/VMenu/index.ts");
  113476. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VMenu", function() { return _VMenu__WEBPACK_IMPORTED_MODULE_41__["VMenu"]; });
  113477. /* harmony import */ var _VMessages__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./VMessages */ "./src/components/VMessages/index.ts");
  113478. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VMessages", function() { return _VMessages__WEBPACK_IMPORTED_MODULE_42__["VMessages"]; });
  113479. /* harmony import */ var _VNavigationDrawer__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./VNavigationDrawer */ "./src/components/VNavigationDrawer/index.ts");
  113480. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VNavigationDrawer", function() { return _VNavigationDrawer__WEBPACK_IMPORTED_MODULE_43__["VNavigationDrawer"]; });
  113481. /* harmony import */ var _VOverflowBtn__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./VOverflowBtn */ "./src/components/VOverflowBtn/index.ts");
  113482. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VOverflowBtn", function() { return _VOverflowBtn__WEBPACK_IMPORTED_MODULE_44__["VOverflowBtn"]; });
  113483. /* harmony import */ var _VOverlay__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./VOverlay */ "./src/components/VOverlay/index.ts");
  113484. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VOverlay", function() { return _VOverlay__WEBPACK_IMPORTED_MODULE_45__["VOverlay"]; });
  113485. /* harmony import */ var _VPagination__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./VPagination */ "./src/components/VPagination/index.ts");
  113486. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VPagination", function() { return _VPagination__WEBPACK_IMPORTED_MODULE_46__["VPagination"]; });
  113487. /* harmony import */ var _VSheet__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./VSheet */ "./src/components/VSheet/index.ts");
  113488. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSheet", function() { return _VSheet__WEBPACK_IMPORTED_MODULE_47__["VSheet"]; });
  113489. /* harmony import */ var _VParallax__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./VParallax */ "./src/components/VParallax/index.ts");
  113490. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VParallax", function() { return _VParallax__WEBPACK_IMPORTED_MODULE_48__["VParallax"]; });
  113491. /* harmony import */ var _VPicker__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./VPicker */ "./src/components/VPicker/index.ts");
  113492. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VPicker", function() { return _VPicker__WEBPACK_IMPORTED_MODULE_49__["VPicker"]; });
  113493. /* harmony import */ var _VProgressCircular__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./VProgressCircular */ "./src/components/VProgressCircular/index.ts");
  113494. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VProgressCircular", function() { return _VProgressCircular__WEBPACK_IMPORTED_MODULE_50__["VProgressCircular"]; });
  113495. /* harmony import */ var _VProgressLinear__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./VProgressLinear */ "./src/components/VProgressLinear/index.ts");
  113496. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VProgressLinear", function() { return _VProgressLinear__WEBPACK_IMPORTED_MODULE_51__["VProgressLinear"]; });
  113497. /* harmony import */ var _VRadioGroup__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./VRadioGroup */ "./src/components/VRadioGroup/index.ts");
  113498. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRadioGroup", function() { return _VRadioGroup__WEBPACK_IMPORTED_MODULE_52__["VRadioGroup"]; });
  113499. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRadio", function() { return _VRadioGroup__WEBPACK_IMPORTED_MODULE_52__["VRadio"]; });
  113500. /* harmony import */ var _VRangeSlider__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./VRangeSlider */ "./src/components/VRangeSlider/index.ts");
  113501. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRangeSlider", function() { return _VRangeSlider__WEBPACK_IMPORTED_MODULE_53__["VRangeSlider"]; });
  113502. /* harmony import */ var _VRating__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./VRating */ "./src/components/VRating/index.ts");
  113503. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRating", function() { return _VRating__WEBPACK_IMPORTED_MODULE_54__["VRating"]; });
  113504. /* harmony import */ var _VResponsive__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./VResponsive */ "./src/components/VResponsive/index.ts");
  113505. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VResponsive", function() { return _VResponsive__WEBPACK_IMPORTED_MODULE_55__["VResponsive"]; });
  113506. /* harmony import */ var _VSelect__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./VSelect */ "./src/components/VSelect/index.ts");
  113507. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSelect", function() { return _VSelect__WEBPACK_IMPORTED_MODULE_56__["VSelect"]; });
  113508. /* harmony import */ var _VSkeletonLoader__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./VSkeletonLoader */ "./src/components/VSkeletonLoader/index.ts");
  113509. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSkeletonLoader", function() { return _VSkeletonLoader__WEBPACK_IMPORTED_MODULE_57__["VSkeletonLoader"]; });
  113510. /* harmony import */ var _VSlider__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./VSlider */ "./src/components/VSlider/index.ts");
  113511. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlider", function() { return _VSlider__WEBPACK_IMPORTED_MODULE_58__["VSlider"]; });
  113512. /* harmony import */ var _VSlideGroup__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./VSlideGroup */ "./src/components/VSlideGroup/index.ts");
  113513. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlideGroup", function() { return _VSlideGroup__WEBPACK_IMPORTED_MODULE_59__["VSlideGroup"]; });
  113514. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlideItem", function() { return _VSlideGroup__WEBPACK_IMPORTED_MODULE_59__["VSlideItem"]; });
  113515. /* harmony import */ var _VSnackbar__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./VSnackbar */ "./src/components/VSnackbar/index.ts");
  113516. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSnackbar", function() { return _VSnackbar__WEBPACK_IMPORTED_MODULE_60__["VSnackbar"]; });
  113517. /* harmony import */ var _VSparkline__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./VSparkline */ "./src/components/VSparkline/index.ts");
  113518. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSparkline", function() { return _VSparkline__WEBPACK_IMPORTED_MODULE_61__["VSparkline"]; });
  113519. /* harmony import */ var _VSpeedDial__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./VSpeedDial */ "./src/components/VSpeedDial/index.ts");
  113520. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSpeedDial", function() { return _VSpeedDial__WEBPACK_IMPORTED_MODULE_62__["VSpeedDial"]; });
  113521. /* harmony import */ var _VStepper__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./VStepper */ "./src/components/VStepper/index.ts");
  113522. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepper", function() { return _VStepper__WEBPACK_IMPORTED_MODULE_63__["VStepper"]; });
  113523. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepperContent", function() { return _VStepper__WEBPACK_IMPORTED_MODULE_63__["VStepperContent"]; });
  113524. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepperStep", function() { return _VStepper__WEBPACK_IMPORTED_MODULE_63__["VStepperStep"]; });
  113525. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepperHeader", function() { return _VStepper__WEBPACK_IMPORTED_MODULE_63__["VStepperHeader"]; });
  113526. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepperItems", function() { return _VStepper__WEBPACK_IMPORTED_MODULE_63__["VStepperItems"]; });
  113527. /* harmony import */ var _VSubheader__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./VSubheader */ "./src/components/VSubheader/index.ts");
  113528. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSubheader", function() { return _VSubheader__WEBPACK_IMPORTED_MODULE_64__["VSubheader"]; });
  113529. /* harmony import */ var _VSwitch__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./VSwitch */ "./src/components/VSwitch/index.ts");
  113530. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSwitch", function() { return _VSwitch__WEBPACK_IMPORTED_MODULE_65__["VSwitch"]; });
  113531. /* harmony import */ var _VSystemBar__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./VSystemBar */ "./src/components/VSystemBar/index.ts");
  113532. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSystemBar", function() { return _VSystemBar__WEBPACK_IMPORTED_MODULE_66__["VSystemBar"]; });
  113533. /* harmony import */ var _VTabs__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./VTabs */ "./src/components/VTabs/index.ts");
  113534. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabs", function() { return _VTabs__WEBPACK_IMPORTED_MODULE_67__["VTabs"]; });
  113535. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTab", function() { return _VTabs__WEBPACK_IMPORTED_MODULE_67__["VTab"]; });
  113536. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabItem", function() { return _VTabs__WEBPACK_IMPORTED_MODULE_67__["VTabItem"]; });
  113537. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabsItems", function() { return _VTabs__WEBPACK_IMPORTED_MODULE_67__["VTabsItems"]; });
  113538. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabsSlider", function() { return _VTabs__WEBPACK_IMPORTED_MODULE_67__["VTabsSlider"]; });
  113539. /* harmony import */ var _VTextarea__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./VTextarea */ "./src/components/VTextarea/index.ts");
  113540. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTextarea", function() { return _VTextarea__WEBPACK_IMPORTED_MODULE_68__["VTextarea"]; });
  113541. /* harmony import */ var _VTextField__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./VTextField */ "./src/components/VTextField/index.ts");
  113542. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTextField", function() { return _VTextField__WEBPACK_IMPORTED_MODULE_69__["VTextField"]; });
  113543. /* harmony import */ var _VThemeProvider__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./VThemeProvider */ "./src/components/VThemeProvider/index.ts");
  113544. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VThemeProvider", function() { return _VThemeProvider__WEBPACK_IMPORTED_MODULE_70__["VThemeProvider"]; });
  113545. /* harmony import */ var _VTimeline__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./VTimeline */ "./src/components/VTimeline/index.ts");
  113546. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimeline", function() { return _VTimeline__WEBPACK_IMPORTED_MODULE_71__["VTimeline"]; });
  113547. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimelineItem", function() { return _VTimeline__WEBPACK_IMPORTED_MODULE_71__["VTimelineItem"]; });
  113548. /* harmony import */ var _VTimePicker__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./VTimePicker */ "./src/components/VTimePicker/index.ts");
  113549. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePicker", function() { return _VTimePicker__WEBPACK_IMPORTED_MODULE_72__["VTimePicker"]; });
  113550. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePickerClock", function() { return _VTimePicker__WEBPACK_IMPORTED_MODULE_72__["VTimePickerClock"]; });
  113551. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePickerTitle", function() { return _VTimePicker__WEBPACK_IMPORTED_MODULE_72__["VTimePickerTitle"]; });
  113552. /* harmony import */ var _VToolbar__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./VToolbar */ "./src/components/VToolbar/index.ts");
  113553. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VToolbar", function() { return _VToolbar__WEBPACK_IMPORTED_MODULE_73__["VToolbar"]; });
  113554. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VToolbarItems", function() { return _VToolbar__WEBPACK_IMPORTED_MODULE_73__["VToolbarItems"]; });
  113555. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VToolbarTitle", function() { return _VToolbar__WEBPACK_IMPORTED_MODULE_73__["VToolbarTitle"]; });
  113556. /* harmony import */ var _VTooltip__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./VTooltip */ "./src/components/VTooltip/index.ts");
  113557. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTooltip", function() { return _VTooltip__WEBPACK_IMPORTED_MODULE_74__["VTooltip"]; });
  113558. /* harmony import */ var _VTreeview__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./VTreeview */ "./src/components/VTreeview/index.ts");
  113559. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTreeview", function() { return _VTreeview__WEBPACK_IMPORTED_MODULE_75__["VTreeview"]; });
  113560. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTreeviewNode", function() { return _VTreeview__WEBPACK_IMPORTED_MODULE_75__["VTreeviewNode"]; });
  113561. /* harmony import */ var _VWindow__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./VWindow */ "./src/components/VWindow/index.ts");
  113562. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VWindow", function() { return _VWindow__WEBPACK_IMPORTED_MODULE_76__["VWindow"]; });
  113563. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VWindowItem", function() { return _VWindow__WEBPACK_IMPORTED_MODULE_76__["VWindowItem"]; });
  113564. /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./transitions */ "./src/components/transitions/index.ts");
  113565. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCarouselTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VCarouselTransition"]; });
  113566. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCarouselReverseTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VCarouselReverseTransition"]; });
  113567. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VTabTransition"]; });
  113568. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabReverseTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VTabReverseTransition"]; });
  113569. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VMenuTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VMenuTransition"]; });
  113570. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFabTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VFabTransition"]; });
  113571. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDialogTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VDialogTransition"]; });
  113572. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDialogBottomTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VDialogBottomTransition"]; });
  113573. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFadeTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VFadeTransition"]; });
  113574. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VScaleTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VScaleTransition"]; });
  113575. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VScrollXTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VScrollXTransition"]; });
  113576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VScrollXReverseTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VScrollXReverseTransition"]; });
  113577. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VScrollYTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VScrollYTransition"]; });
  113578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VScrollYReverseTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VScrollYReverseTransition"]; });
  113579. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlideXTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VSlideXTransition"]; });
  113580. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlideXReverseTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VSlideXReverseTransition"]; });
  113581. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlideYTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VSlideYTransition"]; });
  113582. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlideYReverseTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VSlideYReverseTransition"]; });
  113583. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpandTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VExpandTransition"]; });
  113584. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpandXTransition", function() { return _transitions__WEBPACK_IMPORTED_MODULE_77__["VExpandXTransition"]; });
  113585. /***/ }),
  113586. /***/ "./src/components/transitions/createTransition.ts":
  113587. /*!********************************************************!*\
  113588. !*** ./src/components/transitions/createTransition.ts ***!
  113589. \********************************************************/
  113590. /*! exports provided: createSimpleTransition, createJavascriptTransition */
  113591. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113592. "use strict";
  113593. __webpack_require__.r(__webpack_exports__);
  113594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleTransition", function() { return createSimpleTransition; });
  113595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createJavascriptTransition", function() { return createJavascriptTransition; });
  113596. /* harmony import */ var _util_mergeData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/mergeData */ "./src/util/mergeData.ts");
  113597. var __read = undefined && undefined.__read || function (o, n) {
  113598. var m = typeof Symbol === "function" && o[Symbol.iterator];
  113599. if (!m) return o;
  113600. var i = m.call(o),
  113601. r,
  113602. ar = [],
  113603. e;
  113604. try {
  113605. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  113606. ar.push(r.value);
  113607. }
  113608. } catch (error) {
  113609. e = {
  113610. error: error
  113611. };
  113612. } finally {
  113613. try {
  113614. if (r && !r.done && (m = i["return"])) m.call(i);
  113615. } finally {
  113616. if (e) throw e.error;
  113617. }
  113618. }
  113619. return ar;
  113620. };
  113621. var __spread = undefined && undefined.__spread || function () {
  113622. for (var ar = [], i = 0; i < arguments.length; i++) {
  113623. ar = ar.concat(__read(arguments[i]));
  113624. }
  113625. return ar;
  113626. };
  113627. function mergeTransitions(dest) {
  113628. var _a;
  113629. if (dest === void 0) {
  113630. dest = [];
  113631. }
  113632. var transitions = [];
  113633. for (var _i = 1; _i < arguments.length; _i++) {
  113634. transitions[_i - 1] = arguments[_i];
  113635. }
  113636. /* eslint-disable-next-line no-array-constructor */
  113637. return (_a = Array()).concat.apply(_a, __spread([dest], transitions));
  113638. }
  113639. function createSimpleTransition(name, origin, mode) {
  113640. if (origin === void 0) {
  113641. origin = 'top center 0';
  113642. }
  113643. return {
  113644. name: name,
  113645. functional: true,
  113646. props: {
  113647. group: {
  113648. type: Boolean,
  113649. default: false
  113650. },
  113651. hideOnLeave: {
  113652. type: Boolean,
  113653. default: false
  113654. },
  113655. leaveAbsolute: {
  113656. type: Boolean,
  113657. default: false
  113658. },
  113659. mode: {
  113660. type: String,
  113661. default: mode
  113662. },
  113663. origin: {
  113664. type: String,
  113665. default: origin
  113666. }
  113667. },
  113668. render: function render(h, context) {
  113669. var tag = "transition" + (context.props.group ? '-group' : '');
  113670. var data = {
  113671. props: {
  113672. name: name,
  113673. mode: context.props.mode
  113674. },
  113675. on: {
  113676. beforeEnter: function beforeEnter(el) {
  113677. el.style.transformOrigin = context.props.origin;
  113678. el.style.webkitTransformOrigin = context.props.origin;
  113679. }
  113680. }
  113681. };
  113682. if (context.props.leaveAbsolute) {
  113683. data.on.leave = mergeTransitions(data.on.leave, function (el) {
  113684. return el.style.position = 'absolute';
  113685. });
  113686. }
  113687. if (context.props.hideOnLeave) {
  113688. data.on.leave = mergeTransitions(data.on.leave, function (el) {
  113689. return el.style.display = 'none';
  113690. });
  113691. }
  113692. return h(tag, Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_0__["default"])(context.data, data), context.children);
  113693. }
  113694. };
  113695. }
  113696. function createJavascriptTransition(name, functions, mode) {
  113697. if (mode === void 0) {
  113698. mode = 'in-out';
  113699. }
  113700. return {
  113701. name: name,
  113702. functional: true,
  113703. props: {
  113704. mode: {
  113705. type: String,
  113706. default: mode
  113707. }
  113708. },
  113709. render: function render(h, context) {
  113710. return h('transition', Object(_util_mergeData__WEBPACK_IMPORTED_MODULE_0__["default"])(context.data, {
  113711. props: {
  113712. name: name
  113713. },
  113714. on: functions
  113715. }), context.children);
  113716. }
  113717. };
  113718. }
  113719. /***/ }),
  113720. /***/ "./src/components/transitions/expand-transition.ts":
  113721. /*!*********************************************************!*\
  113722. !*** ./src/components/transitions/expand-transition.ts ***!
  113723. \*********************************************************/
  113724. /*! exports provided: default */
  113725. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113726. "use strict";
  113727. __webpack_require__.r(__webpack_exports__);
  113728. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  113729. /* harmony default export */ __webpack_exports__["default"] = (function (expandedParentClass, x) {
  113730. if (expandedParentClass === void 0) {
  113731. expandedParentClass = '';
  113732. }
  113733. if (x === void 0) {
  113734. x = false;
  113735. }
  113736. var sizeProperty = x ? 'width' : 'height';
  113737. var offsetProperty = "offset" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["upperFirst"])(sizeProperty);
  113738. return {
  113739. beforeEnter: function beforeEnter(el) {
  113740. var _a;
  113741. el._parent = el.parentNode;
  113742. el._initialStyle = (_a = {
  113743. transition: el.style.transition,
  113744. visibility: el.style.visibility,
  113745. overflow: el.style.overflow
  113746. }, _a[sizeProperty] = el.style[sizeProperty], _a);
  113747. },
  113748. enter: function enter(el) {
  113749. var initialStyle = el._initialStyle;
  113750. var offset = el[offsetProperty] + "px";
  113751. el.style.setProperty('transition', 'none', 'important');
  113752. el.style.visibility = 'hidden';
  113753. el.style.visibility = initialStyle.visibility;
  113754. el.style.overflow = 'hidden';
  113755. el.style[sizeProperty] = '0';
  113756. void el.offsetHeight; // force reflow
  113757. el.style.transition = initialStyle.transition;
  113758. if (expandedParentClass && el._parent) {
  113759. el._parent.classList.add(expandedParentClass);
  113760. }
  113761. requestAnimationFrame(function () {
  113762. el.style[sizeProperty] = offset;
  113763. });
  113764. },
  113765. afterEnter: resetStyles,
  113766. enterCancelled: resetStyles,
  113767. leave: function leave(el) {
  113768. var _a;
  113769. el._initialStyle = (_a = {
  113770. transition: '',
  113771. visibility: '',
  113772. overflow: el.style.overflow
  113773. }, _a[sizeProperty] = el.style[sizeProperty], _a);
  113774. el.style.overflow = 'hidden';
  113775. el.style[sizeProperty] = el[offsetProperty] + "px";
  113776. void el.offsetHeight; // force reflow
  113777. requestAnimationFrame(function () {
  113778. return el.style[sizeProperty] = '0';
  113779. });
  113780. },
  113781. afterLeave: afterLeave,
  113782. leaveCancelled: afterLeave
  113783. };
  113784. function afterLeave(el) {
  113785. if (expandedParentClass && el._parent) {
  113786. el._parent.classList.remove(expandedParentClass);
  113787. }
  113788. resetStyles(el);
  113789. }
  113790. function resetStyles(el) {
  113791. var size = el._initialStyle[sizeProperty];
  113792. el.style.overflow = el._initialStyle.overflow;
  113793. if (size != null) el.style[sizeProperty] = size;
  113794. delete el._initialStyle;
  113795. }
  113796. });
  113797. /***/ }),
  113798. /***/ "./src/components/transitions/index.ts":
  113799. /*!*********************************************!*\
  113800. !*** ./src/components/transitions/index.ts ***!
  113801. \*********************************************/
  113802. /*! exports provided: VCarouselTransition, VCarouselReverseTransition, VTabTransition, VTabReverseTransition, VMenuTransition, VFabTransition, VDialogTransition, VDialogBottomTransition, VFadeTransition, VScaleTransition, VScrollXTransition, VScrollXReverseTransition, VScrollYTransition, VScrollYReverseTransition, VSlideXTransition, VSlideXReverseTransition, VSlideYTransition, VSlideYReverseTransition, VExpandTransition, VExpandXTransition, default */
  113803. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113804. "use strict";
  113805. __webpack_require__.r(__webpack_exports__);
  113806. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCarouselTransition", function() { return VCarouselTransition; });
  113807. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCarouselReverseTransition", function() { return VCarouselReverseTransition; });
  113808. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VTabTransition", function() { return VTabTransition; });
  113809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VTabReverseTransition", function() { return VTabReverseTransition; });
  113810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VMenuTransition", function() { return VMenuTransition; });
  113811. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VFabTransition", function() { return VFabTransition; });
  113812. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VDialogTransition", function() { return VDialogTransition; });
  113813. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VDialogBottomTransition", function() { return VDialogBottomTransition; });
  113814. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VFadeTransition", function() { return VFadeTransition; });
  113815. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VScaleTransition", function() { return VScaleTransition; });
  113816. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VScrollXTransition", function() { return VScrollXTransition; });
  113817. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VScrollXReverseTransition", function() { return VScrollXReverseTransition; });
  113818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VScrollYTransition", function() { return VScrollYTransition; });
  113819. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VScrollYReverseTransition", function() { return VScrollYReverseTransition; });
  113820. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSlideXTransition", function() { return VSlideXTransition; });
  113821. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSlideXReverseTransition", function() { return VSlideXReverseTransition; });
  113822. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSlideYTransition", function() { return VSlideYTransition; });
  113823. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSlideYReverseTransition", function() { return VSlideYReverseTransition; });
  113824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VExpandTransition", function() { return VExpandTransition; });
  113825. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VExpandXTransition", function() { return VExpandXTransition; });
  113826. /* harmony import */ var _createTransition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createTransition */ "./src/components/transitions/createTransition.ts");
  113827. /* harmony import */ var _expand_transition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./expand-transition */ "./src/components/transitions/expand-transition.ts");
  113828. // Component specific transitions
  113829. var VCarouselTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('carousel-transition');
  113830. var VCarouselReverseTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('carousel-reverse-transition');
  113831. var VTabTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('tab-transition');
  113832. var VTabReverseTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('tab-reverse-transition');
  113833. var VMenuTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('menu-transition');
  113834. var VFabTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('fab-transition', 'center center', 'out-in'); // Generic transitions
  113835. var VDialogTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('dialog-transition');
  113836. var VDialogBottomTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('dialog-bottom-transition');
  113837. var VFadeTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('fade-transition');
  113838. var VScaleTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('scale-transition');
  113839. var VScrollXTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('scroll-x-transition');
  113840. var VScrollXReverseTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('scroll-x-reverse-transition');
  113841. var VScrollYTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('scroll-y-transition');
  113842. var VScrollYReverseTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('scroll-y-reverse-transition');
  113843. var VSlideXTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('slide-x-transition');
  113844. var VSlideXReverseTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('slide-x-reverse-transition');
  113845. var VSlideYTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('slide-y-transition');
  113846. var VSlideYReverseTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('slide-y-reverse-transition'); // Javascript transitions
  113847. var VExpandTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createJavascriptTransition"])('expand-transition', Object(_expand_transition__WEBPACK_IMPORTED_MODULE_1__["default"])());
  113848. var VExpandXTransition = Object(_createTransition__WEBPACK_IMPORTED_MODULE_0__["createJavascriptTransition"])('expand-x-transition', Object(_expand_transition__WEBPACK_IMPORTED_MODULE_1__["default"])('', true));
  113849. /* harmony default export */ __webpack_exports__["default"] = ({
  113850. $_vuetify_subcomponents: {
  113851. VCarouselTransition: VCarouselTransition,
  113852. VCarouselReverseTransition: VCarouselReverseTransition,
  113853. VDialogTransition: VDialogTransition,
  113854. VDialogBottomTransition: VDialogBottomTransition,
  113855. VFabTransition: VFabTransition,
  113856. VFadeTransition: VFadeTransition,
  113857. VMenuTransition: VMenuTransition,
  113858. VScaleTransition: VScaleTransition,
  113859. VScrollXTransition: VScrollXTransition,
  113860. VScrollXReverseTransition: VScrollXReverseTransition,
  113861. VScrollYTransition: VScrollYTransition,
  113862. VScrollYReverseTransition: VScrollYReverseTransition,
  113863. VSlideXTransition: VSlideXTransition,
  113864. VSlideXReverseTransition: VSlideXReverseTransition,
  113865. VSlideYTransition: VSlideYTransition,
  113866. VSlideYReverseTransition: VSlideYReverseTransition,
  113867. VTabReverseTransition: VTabReverseTransition,
  113868. VTabTransition: VTabTransition,
  113869. VExpandTransition: VExpandTransition,
  113870. VExpandXTransition: VExpandXTransition
  113871. }
  113872. });
  113873. /***/ }),
  113874. /***/ "./src/directives/click-outside/index.ts":
  113875. /*!***********************************************!*\
  113876. !*** ./src/directives/click-outside/index.ts ***!
  113877. \***********************************************/
  113878. /*! exports provided: ClickOutside, default */
  113879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113880. "use strict";
  113881. __webpack_require__.r(__webpack_exports__);
  113882. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClickOutside", function() { return ClickOutside; });
  113883. function closeConditional() {
  113884. return false;
  113885. }
  113886. function directive(e, el, binding) {
  113887. // Args may not always be supplied
  113888. binding.args = binding.args || {}; // If no closeConditional was supplied assign a default
  113889. var isActive = binding.args.closeConditional || closeConditional; // The include element callbacks below can be expensive
  113890. // so we should avoid calling them when we're not active.
  113891. // Explicitly check for false to allow fallback compatibility
  113892. // with non-toggleable components
  113893. if (!e || isActive(e) === false) return; // If click was triggered programmaticaly (domEl.click()) then
  113894. // it shouldn't be treated as click-outside
  113895. // Chrome/Firefox support isTrusted property
  113896. // IE/Edge support pointerType property (empty if not triggered
  113897. // by pointing device)
  113898. if ('isTrusted' in e && !e.isTrusted || 'pointerType' in e && !e.pointerType) return; // Check if additional elements were passed to be included in check
  113899. // (click must be outside all included elements, if any)
  113900. var elements = (binding.args.include || function () {
  113901. return [];
  113902. })(); // Add the root element for the component this directive was defined on
  113903. elements.push(el); // Check if it's a click outside our elements, and then if our callback returns true.
  113904. // Non-toggleable components should take action in their callback and return falsy.
  113905. // Toggleable can return true if it wants to deactivate.
  113906. // Note that, because we're in the capture phase, this callback will occur before
  113907. // the bubbling click event on any outside elements.
  113908. !elements.some(function (el) {
  113909. return el.contains(e.target);
  113910. }) && setTimeout(function () {
  113911. isActive(e) && binding.value && binding.value(e);
  113912. }, 0);
  113913. }
  113914. var ClickOutside = {
  113915. // [data-app] may not be found
  113916. // if using bind, inserted makes
  113917. // sure that the root element is
  113918. // available, iOS does not support
  113919. // clicks on body
  113920. inserted: function inserted(el, binding) {
  113921. var onClick = function onClick(e) {
  113922. return directive(e, el, binding);
  113923. }; // iOS does not recognize click events on document
  113924. // or body, this is the entire purpose of the v-app
  113925. // component and [data-app], stop removing this
  113926. var app = document.querySelector('[data-app]') || document.body; // This is only for unit tests
  113927. app.addEventListener('click', onClick, true);
  113928. el._clickOutside = onClick;
  113929. },
  113930. unbind: function unbind(el) {
  113931. if (!el._clickOutside) return;
  113932. var app = document.querySelector('[data-app]') || document.body; // This is only for unit tests
  113933. app && app.removeEventListener('click', el._clickOutside, true);
  113934. delete el._clickOutside;
  113935. }
  113936. };
  113937. /* harmony default export */ __webpack_exports__["default"] = (ClickOutside);
  113938. /***/ }),
  113939. /***/ "./src/directives/index.ts":
  113940. /*!*********************************!*\
  113941. !*** ./src/directives/index.ts ***!
  113942. \*********************************/
  113943. /*! exports provided: ClickOutside, Intersect, Mutate, Resize, Ripple, Scroll, Touch */
  113944. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113945. "use strict";
  113946. __webpack_require__.r(__webpack_exports__);
  113947. /* harmony import */ var _click_outside__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./click-outside */ "./src/directives/click-outside/index.ts");
  113948. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClickOutside", function() { return _click_outside__WEBPACK_IMPORTED_MODULE_0__["ClickOutside"]; });
  113949. /* harmony import */ var _intersect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./intersect */ "./src/directives/intersect/index.ts");
  113950. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Intersect", function() { return _intersect__WEBPACK_IMPORTED_MODULE_1__["Intersect"]; });
  113951. /* harmony import */ var _mutate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mutate */ "./src/directives/mutate/index.ts");
  113952. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Mutate", function() { return _mutate__WEBPACK_IMPORTED_MODULE_2__["Mutate"]; });
  113953. /* harmony import */ var _resize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./resize */ "./src/directives/resize/index.ts");
  113954. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Resize", function() { return _resize__WEBPACK_IMPORTED_MODULE_3__["Resize"]; });
  113955. /* harmony import */ var _ripple__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ripple */ "./src/directives/ripple/index.ts");
  113956. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Ripple", function() { return _ripple__WEBPACK_IMPORTED_MODULE_4__["Ripple"]; });
  113957. /* harmony import */ var _scroll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./scroll */ "./src/directives/scroll/index.ts");
  113958. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scroll", function() { return _scroll__WEBPACK_IMPORTED_MODULE_5__["Scroll"]; });
  113959. /* harmony import */ var _touch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./touch */ "./src/directives/touch/index.ts");
  113960. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return _touch__WEBPACK_IMPORTED_MODULE_6__["Touch"]; });
  113961. /***/ }),
  113962. /***/ "./src/directives/intersect/index.ts":
  113963. /*!*******************************************!*\
  113964. !*** ./src/directives/intersect/index.ts ***!
  113965. \*******************************************/
  113966. /*! exports provided: Intersect, default */
  113967. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113968. "use strict";
  113969. __webpack_require__.r(__webpack_exports__);
  113970. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Intersect", function() { return Intersect; });
  113971. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  113972. function inserted(el, binding) {
  113973. var modifiers = binding.modifiers || {};
  113974. var value = binding.value;
  113975. var _a = _typeof(value) === 'object' ? value : {
  113976. handler: value,
  113977. options: {}
  113978. },
  113979. handler = _a.handler,
  113980. options = _a.options;
  113981. var observer = new IntersectionObserver(function (entries, observer) {
  113982. if (entries === void 0) {
  113983. entries = [];
  113984. }
  113985. /* istanbul ignore if */
  113986. if (!el._observe) return; // Just in case, should never fire
  113987. // If is not quiet or has already been
  113988. // initted, invoke the user callback
  113989. if (handler && (!modifiers.quiet || el._observe.init)) {
  113990. var isIntersecting = Boolean(entries.find(function (entry) {
  113991. return entry.isIntersecting;
  113992. }));
  113993. handler(entries, observer, isIntersecting);
  113994. } // If has already been initted and
  113995. // has the once modifier, unbind
  113996. if (el._observe.init && modifiers.once) unbind(el); // Otherwise, mark the observer as initted
  113997. else el._observe.init = true;
  113998. }, options);
  113999. el._observe = {
  114000. init: false,
  114001. observer: observer
  114002. };
  114003. observer.observe(el);
  114004. }
  114005. function unbind(el) {
  114006. /* istanbul ignore if */
  114007. if (!el._observe) return;
  114008. el._observe.observer.unobserve(el);
  114009. delete el._observe;
  114010. }
  114011. var Intersect = {
  114012. inserted: inserted,
  114013. unbind: unbind
  114014. };
  114015. /* harmony default export */ __webpack_exports__["default"] = (Intersect);
  114016. /***/ }),
  114017. /***/ "./src/directives/mutate/index.ts":
  114018. /*!****************************************!*\
  114019. !*** ./src/directives/mutate/index.ts ***!
  114020. \****************************************/
  114021. /*! exports provided: Mutate, default */
  114022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114023. "use strict";
  114024. __webpack_require__.r(__webpack_exports__);
  114025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mutate", function() { return Mutate; });
  114026. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  114027. var __rest = undefined && undefined.__rest || function (s, e) {
  114028. var t = {};
  114029. for (var p in s) {
  114030. if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  114031. }
  114032. if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  114033. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  114034. }
  114035. return t;
  114036. };
  114037. function inserted(el, binding) {
  114038. var modifiers = binding.modifiers ||
  114039. /* istanbul ignore next */
  114040. {};
  114041. var value = binding.value;
  114042. var isObject = _typeof(value) === 'object';
  114043. var callback = isObject ? value.handler : value;
  114044. var once = modifiers.once,
  114045. modifierKeys = __rest(modifiers, ["once"]);
  114046. var hasModifiers = Object.keys(modifierKeys).length > 0;
  114047. var hasOptions = isObject && value.options; // Options take top priority
  114048. var options = hasOptions ? value.options : hasModifiers // If we have modifiers, use only those provided
  114049. ? {
  114050. attributes: modifierKeys.attr,
  114051. childList: modifierKeys.child,
  114052. subtree: modifierKeys.sub,
  114053. characterData: modifierKeys.char // Defaults to everything on
  114054. } : {
  114055. attributes: true,
  114056. childList: true,
  114057. subtree: true,
  114058. characterData: true
  114059. };
  114060. var observer = new MutationObserver(function (mutationsList, observer) {
  114061. /* istanbul ignore if */
  114062. if (!el._mutate) return; // Just in case, should never fire
  114063. callback(mutationsList, observer); // If has the once modifier, unbind
  114064. once && unbind(el);
  114065. });
  114066. observer.observe(el, options);
  114067. el._mutate = {
  114068. observer: observer
  114069. };
  114070. }
  114071. function unbind(el) {
  114072. /* istanbul ignore if */
  114073. if (!el._mutate) return;
  114074. el._mutate.observer.disconnect();
  114075. delete el._mutate;
  114076. }
  114077. var Mutate = {
  114078. inserted: inserted,
  114079. unbind: unbind
  114080. };
  114081. /* harmony default export */ __webpack_exports__["default"] = (Mutate);
  114082. /***/ }),
  114083. /***/ "./src/directives/resize/index.ts":
  114084. /*!****************************************!*\
  114085. !*** ./src/directives/resize/index.ts ***!
  114086. \****************************************/
  114087. /*! exports provided: Resize, default */
  114088. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114089. "use strict";
  114090. __webpack_require__.r(__webpack_exports__);
  114091. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Resize", function() { return Resize; });
  114092. function inserted(el, binding) {
  114093. var callback = binding.value;
  114094. var options = binding.options || {
  114095. passive: true
  114096. };
  114097. window.addEventListener('resize', callback, options);
  114098. el._onResize = {
  114099. callback: callback,
  114100. options: options
  114101. };
  114102. if (!binding.modifiers || !binding.modifiers.quiet) {
  114103. callback();
  114104. }
  114105. }
  114106. function unbind(el) {
  114107. if (!el._onResize) return;
  114108. var _a = el._onResize,
  114109. callback = _a.callback,
  114110. options = _a.options;
  114111. window.removeEventListener('resize', callback, options);
  114112. delete el._onResize;
  114113. }
  114114. var Resize = {
  114115. inserted: inserted,
  114116. unbind: unbind
  114117. };
  114118. /* harmony default export */ __webpack_exports__["default"] = (Resize);
  114119. /***/ }),
  114120. /***/ "./src/directives/ripple/VRipple.sass":
  114121. /*!********************************************!*\
  114122. !*** ./src/directives/ripple/VRipple.sass ***!
  114123. \********************************************/
  114124. /*! no static exports found */
  114125. /***/ (function(module, exports, __webpack_require__) {
  114126. // extracted by mini-css-extract-plugin
  114127. /***/ }),
  114128. /***/ "./src/directives/ripple/index.ts":
  114129. /*!****************************************!*\
  114130. !*** ./src/directives/ripple/index.ts ***!
  114131. \****************************************/
  114132. /*! exports provided: Ripple, default */
  114133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114134. "use strict";
  114135. __webpack_require__.r(__webpack_exports__);
  114136. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ripple", function() { return Ripple; });
  114137. /* harmony import */ var _VRipple_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VRipple.sass */ "./src/directives/ripple/VRipple.sass");
  114138. /* harmony import */ var _VRipple_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_VRipple_sass__WEBPACK_IMPORTED_MODULE_0__);
  114139. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  114140. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  114141. var __read = undefined && undefined.__read || function (o, n) {
  114142. var m = typeof Symbol === "function" && o[Symbol.iterator];
  114143. if (!m) return o;
  114144. var i = m.call(o),
  114145. r,
  114146. ar = [],
  114147. e;
  114148. try {
  114149. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  114150. ar.push(r.value);
  114151. }
  114152. } catch (error) {
  114153. e = {
  114154. error: error
  114155. };
  114156. } finally {
  114157. try {
  114158. if (r && !r.done && (m = i["return"])) m.call(i);
  114159. } finally {
  114160. if (e) throw e.error;
  114161. }
  114162. }
  114163. return ar;
  114164. };
  114165. var __spread = undefined && undefined.__spread || function () {
  114166. for (var ar = [], i = 0; i < arguments.length; i++) {
  114167. ar = ar.concat(__read(arguments[i]));
  114168. }
  114169. return ar;
  114170. }; // Styles
  114171. // Utilities
  114172. function transform(el, value) {
  114173. el.style['transform'] = value;
  114174. el.style['webkitTransform'] = value;
  114175. }
  114176. function opacity(el, value) {
  114177. el.style['opacity'] = value.toString();
  114178. }
  114179. function isTouchEvent(e) {
  114180. return e.constructor.name === 'TouchEvent';
  114181. }
  114182. function isKeyboardEvent(e) {
  114183. return e.constructor.name === 'KeyboardEvent';
  114184. }
  114185. var calculate = function calculate(e, el, value) {
  114186. if (value === void 0) {
  114187. value = {};
  114188. }
  114189. var localX = 0;
  114190. var localY = 0;
  114191. if (!isKeyboardEvent(e)) {
  114192. var offset = el.getBoundingClientRect();
  114193. var target = isTouchEvent(e) ? e.touches[e.touches.length - 1] : e;
  114194. localX = target.clientX - offset.left;
  114195. localY = target.clientY - offset.top;
  114196. }
  114197. var radius = 0;
  114198. var scale = 0.3;
  114199. if (el._ripple && el._ripple.circle) {
  114200. scale = 0.15;
  114201. radius = el.clientWidth / 2;
  114202. radius = value.center ? radius : radius + Math.sqrt(Math.pow(localX - radius, 2) + Math.pow(localY - radius, 2)) / 4;
  114203. } else {
  114204. radius = Math.sqrt(Math.pow(el.clientWidth, 2) + Math.pow(el.clientHeight, 2)) / 2;
  114205. }
  114206. var centerX = (el.clientWidth - radius * 2) / 2 + "px";
  114207. var centerY = (el.clientHeight - radius * 2) / 2 + "px";
  114208. var x = value.center ? centerX : localX - radius + "px";
  114209. var y = value.center ? centerY : localY - radius + "px";
  114210. return {
  114211. radius: radius,
  114212. scale: scale,
  114213. x: x,
  114214. y: y,
  114215. centerX: centerX,
  114216. centerY: centerY
  114217. };
  114218. };
  114219. var ripples = {
  114220. /* eslint-disable max-statements */
  114221. show: function show(e, el, value) {
  114222. if (value === void 0) {
  114223. value = {};
  114224. }
  114225. if (!el._ripple || !el._ripple.enabled) {
  114226. return;
  114227. }
  114228. var container = document.createElement('span');
  114229. var animation = document.createElement('span');
  114230. container.appendChild(animation);
  114231. container.className = 'v-ripple__container';
  114232. if (value.class) {
  114233. container.className += " " + value.class;
  114234. }
  114235. var _a = calculate(e, el, value),
  114236. radius = _a.radius,
  114237. scale = _a.scale,
  114238. x = _a.x,
  114239. y = _a.y,
  114240. centerX = _a.centerX,
  114241. centerY = _a.centerY;
  114242. var size = radius * 2 + "px";
  114243. animation.className = 'v-ripple__animation';
  114244. animation.style.width = size;
  114245. animation.style.height = size;
  114246. el.appendChild(container);
  114247. var computed = window.getComputedStyle(el);
  114248. if (computed && computed.position === 'static') {
  114249. el.style.position = 'relative';
  114250. el.dataset.previousPosition = 'static';
  114251. }
  114252. animation.classList.add('v-ripple__animation--enter');
  114253. animation.classList.add('v-ripple__animation--visible');
  114254. transform(animation, "translate(" + x + ", " + y + ") scale3d(" + scale + "," + scale + "," + scale + ")");
  114255. opacity(animation, 0);
  114256. animation.dataset.activated = String(performance.now());
  114257. setTimeout(function () {
  114258. animation.classList.remove('v-ripple__animation--enter');
  114259. animation.classList.add('v-ripple__animation--in');
  114260. transform(animation, "translate(" + centerX + ", " + centerY + ") scale3d(1,1,1)");
  114261. opacity(animation, 0.25);
  114262. }, 0);
  114263. },
  114264. hide: function hide(el) {
  114265. if (!el || !el._ripple || !el._ripple.enabled) return;
  114266. var ripples = el.getElementsByClassName('v-ripple__animation');
  114267. if (ripples.length === 0) return;
  114268. var animation = ripples[ripples.length - 1];
  114269. if (animation.dataset.isHiding) return;else animation.dataset.isHiding = 'true';
  114270. var diff = performance.now() - Number(animation.dataset.activated);
  114271. var delay = Math.max(250 - diff, 0);
  114272. setTimeout(function () {
  114273. animation.classList.remove('v-ripple__animation--in');
  114274. animation.classList.add('v-ripple__animation--out');
  114275. opacity(animation, 0);
  114276. setTimeout(function () {
  114277. var ripples = el.getElementsByClassName('v-ripple__animation');
  114278. if (ripples.length === 1 && el.dataset.previousPosition) {
  114279. el.style.position = el.dataset.previousPosition;
  114280. delete el.dataset.previousPosition;
  114281. }
  114282. animation.parentNode && el.removeChild(animation.parentNode);
  114283. }, 300);
  114284. }, delay);
  114285. }
  114286. };
  114287. function isRippleEnabled(value) {
  114288. return typeof value === 'undefined' || !!value;
  114289. }
  114290. function rippleShow(e) {
  114291. var value = {};
  114292. var element = e.currentTarget;
  114293. if (!element || !element._ripple || element._ripple.touched) return;
  114294. if (isTouchEvent(e)) {
  114295. element._ripple.touched = true;
  114296. element._ripple.isTouch = true;
  114297. } else {
  114298. // It's possible for touch events to fire
  114299. // as mouse events on Android/iOS, this
  114300. // will skip the event call if it has
  114301. // already been registered as touch
  114302. if (element._ripple.isTouch) return;
  114303. }
  114304. value.center = element._ripple.centered || isKeyboardEvent(e);
  114305. if (element._ripple.class) {
  114306. value.class = element._ripple.class;
  114307. }
  114308. ripples.show(e, element, value);
  114309. }
  114310. function rippleHide(e) {
  114311. var element = e.currentTarget;
  114312. if (!element) return;
  114313. window.setTimeout(function () {
  114314. if (element._ripple) {
  114315. element._ripple.touched = false;
  114316. }
  114317. });
  114318. ripples.hide(element);
  114319. }
  114320. var keyboardRipple = false;
  114321. function keyboardRippleShow(e) {
  114322. if (!keyboardRipple && (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].enter || e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].space)) {
  114323. keyboardRipple = true;
  114324. rippleShow(e);
  114325. }
  114326. }
  114327. function keyboardRippleHide(e) {
  114328. keyboardRipple = false;
  114329. rippleHide(e);
  114330. }
  114331. function updateRipple(el, binding, wasEnabled) {
  114332. var enabled = isRippleEnabled(binding.value);
  114333. if (!enabled) {
  114334. ripples.hide(el);
  114335. }
  114336. el._ripple = el._ripple || {};
  114337. el._ripple.enabled = enabled;
  114338. var value = binding.value || {};
  114339. if (value.center) {
  114340. el._ripple.centered = true;
  114341. }
  114342. if (value.class) {
  114343. el._ripple.class = binding.value.class;
  114344. }
  114345. if (value.circle) {
  114346. el._ripple.circle = value.circle;
  114347. }
  114348. if (enabled && !wasEnabled) {
  114349. el.addEventListener('touchstart', rippleShow, {
  114350. passive: true
  114351. });
  114352. el.addEventListener('touchend', rippleHide, {
  114353. passive: true
  114354. });
  114355. el.addEventListener('touchcancel', rippleHide);
  114356. el.addEventListener('mousedown', rippleShow);
  114357. el.addEventListener('mouseup', rippleHide);
  114358. el.addEventListener('mouseleave', rippleHide);
  114359. el.addEventListener('keydown', keyboardRippleShow);
  114360. el.addEventListener('keyup', keyboardRippleHide); // Anchor tags can be dragged, causes other hides to fail - #1537
  114361. el.addEventListener('dragstart', rippleHide, {
  114362. passive: true
  114363. });
  114364. } else if (!enabled && wasEnabled) {
  114365. removeListeners(el);
  114366. }
  114367. }
  114368. function removeListeners(el) {
  114369. el.removeEventListener('mousedown', rippleShow);
  114370. el.removeEventListener('touchstart', rippleShow);
  114371. el.removeEventListener('touchend', rippleHide);
  114372. el.removeEventListener('touchcancel', rippleHide);
  114373. el.removeEventListener('mouseup', rippleHide);
  114374. el.removeEventListener('mouseleave', rippleHide);
  114375. el.removeEventListener('keydown', keyboardRippleShow);
  114376. el.removeEventListener('keyup', keyboardRippleHide);
  114377. el.removeEventListener('dragstart', rippleHide);
  114378. }
  114379. function directive(el, binding, node) {
  114380. updateRipple(el, binding, false);
  114381. if (true) {
  114382. // warn if an inline element is used, waiting for el to be in the DOM first
  114383. node.context && node.context.$nextTick(function () {
  114384. var computed = window.getComputedStyle(el);
  114385. if (computed && computed.display === 'inline') {
  114386. var context = node.fnOptions ? [node.fnOptions, node.context] : [node.componentInstance];
  114387. _util_console__WEBPACK_IMPORTED_MODULE_1__["consoleWarn"].apply(void 0, __spread(['v-ripple can only be used on block-level elements'], context));
  114388. }
  114389. });
  114390. }
  114391. }
  114392. function unbind(el) {
  114393. delete el._ripple;
  114394. removeListeners(el);
  114395. }
  114396. function update(el, binding) {
  114397. if (binding.value === binding.oldValue) {
  114398. return;
  114399. }
  114400. var wasEnabled = isRippleEnabled(binding.oldValue);
  114401. updateRipple(el, binding, wasEnabled);
  114402. }
  114403. var Ripple = {
  114404. bind: directive,
  114405. unbind: unbind,
  114406. update: update
  114407. };
  114408. /* harmony default export */ __webpack_exports__["default"] = (Ripple);
  114409. /***/ }),
  114410. /***/ "./src/directives/scroll/index.ts":
  114411. /*!****************************************!*\
  114412. !*** ./src/directives/scroll/index.ts ***!
  114413. \****************************************/
  114414. /*! exports provided: Scroll, default */
  114415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114416. "use strict";
  114417. __webpack_require__.r(__webpack_exports__);
  114418. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scroll", function() { return Scroll; });
  114419. function inserted(el, binding) {
  114420. var callback = binding.value;
  114421. var options = binding.options || {
  114422. passive: true
  114423. };
  114424. var target = binding.arg ? document.querySelector(binding.arg) : window;
  114425. if (!target) return;
  114426. target.addEventListener('scroll', callback, options);
  114427. el._onScroll = {
  114428. callback: callback,
  114429. options: options,
  114430. target: target
  114431. };
  114432. }
  114433. function unbind(el) {
  114434. if (!el._onScroll) return;
  114435. var _a = el._onScroll,
  114436. callback = _a.callback,
  114437. options = _a.options,
  114438. target = _a.target;
  114439. target.removeEventListener('scroll', callback, options);
  114440. delete el._onScroll;
  114441. }
  114442. var Scroll = {
  114443. inserted: inserted,
  114444. unbind: unbind
  114445. };
  114446. /* harmony default export */ __webpack_exports__["default"] = (Scroll);
  114447. /***/ }),
  114448. /***/ "./src/directives/touch/index.ts":
  114449. /*!***************************************!*\
  114450. !*** ./src/directives/touch/index.ts ***!
  114451. \***************************************/
  114452. /*! exports provided: Touch, default */
  114453. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114454. "use strict";
  114455. __webpack_require__.r(__webpack_exports__);
  114456. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return Touch; });
  114457. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  114458. var handleGesture = function handleGesture(wrapper) {
  114459. var touchstartX = wrapper.touchstartX,
  114460. touchendX = wrapper.touchendX,
  114461. touchstartY = wrapper.touchstartY,
  114462. touchendY = wrapper.touchendY;
  114463. var dirRatio = 0.5;
  114464. var minDistance = 16;
  114465. wrapper.offsetX = touchendX - touchstartX;
  114466. wrapper.offsetY = touchendY - touchstartY;
  114467. if (Math.abs(wrapper.offsetY) < dirRatio * Math.abs(wrapper.offsetX)) {
  114468. wrapper.left && touchendX < touchstartX - minDistance && wrapper.left(wrapper);
  114469. wrapper.right && touchendX > touchstartX + minDistance && wrapper.right(wrapper);
  114470. }
  114471. if (Math.abs(wrapper.offsetX) < dirRatio * Math.abs(wrapper.offsetY)) {
  114472. wrapper.up && touchendY < touchstartY - minDistance && wrapper.up(wrapper);
  114473. wrapper.down && touchendY > touchstartY + minDistance && wrapper.down(wrapper);
  114474. }
  114475. };
  114476. function _touchstart(event, wrapper) {
  114477. var touch = event.changedTouches[0];
  114478. wrapper.touchstartX = touch.clientX;
  114479. wrapper.touchstartY = touch.clientY;
  114480. wrapper.start && wrapper.start(Object.assign(event, wrapper));
  114481. }
  114482. function _touchend(event, wrapper) {
  114483. var touch = event.changedTouches[0];
  114484. wrapper.touchendX = touch.clientX;
  114485. wrapper.touchendY = touch.clientY;
  114486. wrapper.end && wrapper.end(Object.assign(event, wrapper));
  114487. handleGesture(wrapper);
  114488. }
  114489. function _touchmove(event, wrapper) {
  114490. var touch = event.changedTouches[0];
  114491. wrapper.touchmoveX = touch.clientX;
  114492. wrapper.touchmoveY = touch.clientY;
  114493. wrapper.move && wrapper.move(Object.assign(event, wrapper));
  114494. }
  114495. function createHandlers(value) {
  114496. var wrapper = {
  114497. touchstartX: 0,
  114498. touchstartY: 0,
  114499. touchendX: 0,
  114500. touchendY: 0,
  114501. touchmoveX: 0,
  114502. touchmoveY: 0,
  114503. offsetX: 0,
  114504. offsetY: 0,
  114505. left: value.left,
  114506. right: value.right,
  114507. up: value.up,
  114508. down: value.down,
  114509. start: value.start,
  114510. move: value.move,
  114511. end: value.end
  114512. };
  114513. return {
  114514. touchstart: function touchstart(e) {
  114515. return _touchstart(e, wrapper);
  114516. },
  114517. touchend: function touchend(e) {
  114518. return _touchend(e, wrapper);
  114519. },
  114520. touchmove: function touchmove(e) {
  114521. return _touchmove(e, wrapper);
  114522. }
  114523. };
  114524. }
  114525. function inserted(el, binding, vnode) {
  114526. var value = binding.value;
  114527. var target = value.parent ? el.parentElement : el;
  114528. var options = value.options || {
  114529. passive: true
  114530. }; // Needed to pass unit tests
  114531. if (!target) return;
  114532. var handlers = createHandlers(binding.value);
  114533. target._touchHandlers = Object(target._touchHandlers);
  114534. target._touchHandlers[vnode.context._uid] = handlers;
  114535. Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["keys"])(handlers).forEach(function (eventName) {
  114536. target.addEventListener(eventName, handlers[eventName], options);
  114537. });
  114538. }
  114539. function unbind(el, binding, vnode) {
  114540. var target = binding.value.parent ? el.parentElement : el;
  114541. if (!target || !target._touchHandlers) return;
  114542. var handlers = target._touchHandlers[vnode.context._uid];
  114543. Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["keys"])(handlers).forEach(function (eventName) {
  114544. target.removeEventListener(eventName, handlers[eventName]);
  114545. });
  114546. delete target._touchHandlers[vnode.context._uid];
  114547. }
  114548. var Touch = {
  114549. inserted: inserted,
  114550. unbind: unbind
  114551. };
  114552. /* harmony default export */ __webpack_exports__["default"] = (Touch);
  114553. /***/ }),
  114554. /***/ "./src/framework.ts":
  114555. /*!**************************!*\
  114556. !*** ./src/framework.ts ***!
  114557. \**************************/
  114558. /*! exports provided: default */
  114559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114560. "use strict";
  114561. __webpack_require__.r(__webpack_exports__);
  114562. /* harmony import */ var _install__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./install */ "./src/install.ts");
  114563. /* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services */ "./src/services/index.ts");
  114564. // Services
  114565. var Vuetify =
  114566. /** @class */
  114567. function () {
  114568. function Vuetify(userPreset) {
  114569. if (userPreset === void 0) {
  114570. userPreset = {};
  114571. }
  114572. this.framework = {};
  114573. this.installed = [];
  114574. this.preset = {};
  114575. this.userPreset = {};
  114576. this.userPreset = userPreset;
  114577. this.use(_services__WEBPACK_IMPORTED_MODULE_1__["Presets"]);
  114578. this.use(_services__WEBPACK_IMPORTED_MODULE_1__["Application"]);
  114579. this.use(_services__WEBPACK_IMPORTED_MODULE_1__["Breakpoint"]);
  114580. this.use(_services__WEBPACK_IMPORTED_MODULE_1__["Goto"]);
  114581. this.use(_services__WEBPACK_IMPORTED_MODULE_1__["Icons"]);
  114582. this.use(_services__WEBPACK_IMPORTED_MODULE_1__["Lang"]);
  114583. this.use(_services__WEBPACK_IMPORTED_MODULE_1__["Theme"]);
  114584. } // Called on the new vuetify instance
  114585. // bootstrap in install beforeCreate
  114586. // Exposes ssrContext if available
  114587. Vuetify.prototype.init = function (root, ssrContext) {
  114588. var _this = this;
  114589. this.installed.forEach(function (property) {
  114590. var service = _this.framework[property];
  114591. service.framework = _this.framework;
  114592. service.init(root, ssrContext);
  114593. }); // rtl is not installed and
  114594. // will never be called by
  114595. // the init process
  114596. this.framework.rtl = Boolean(this.preset.rtl);
  114597. }; // Instantiate a VuetifyService
  114598. Vuetify.prototype.use = function (Service) {
  114599. var property = Service.property;
  114600. if (this.installed.includes(property)) return; // TODO maybe a specific type for arg 2?
  114601. this.framework[property] = new Service(this.preset, this);
  114602. this.installed.push(property);
  114603. };
  114604. Vuetify.install = _install__WEBPACK_IMPORTED_MODULE_0__["install"];
  114605. Vuetify.installed = false;
  114606. Vuetify.version = "2.2.30";
  114607. return Vuetify;
  114608. }();
  114609. /* harmony default export */ __webpack_exports__["default"] = (Vuetify);
  114610. /***/ }),
  114611. /***/ "./src/index.ts":
  114612. /*!**********************!*\
  114613. !*** ./src/index.ts ***!
  114614. \**********************/
  114615. /*! exports provided: default */
  114616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114617. "use strict";
  114618. __webpack_require__.r(__webpack_exports__);
  114619. /* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components */ "./src/components/index.ts");
  114620. /* harmony import */ var _directives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./directives */ "./src/directives/index.ts");
  114621. /* harmony import */ var _framework__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./framework */ "./src/framework.ts");
  114622. var __assign = undefined && undefined.__assign || function () {
  114623. __assign = Object.assign || function (t) {
  114624. for (var s, i = 1, n = arguments.length; i < n; i++) {
  114625. s = arguments[i];
  114626. for (var p in s) {
  114627. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  114628. }
  114629. }
  114630. return t;
  114631. };
  114632. return __assign.apply(this, arguments);
  114633. };
  114634. /* harmony default export */ __webpack_exports__["default"] = (_framework__WEBPACK_IMPORTED_MODULE_2__["default"]);
  114635. var install = _framework__WEBPACK_IMPORTED_MODULE_2__["default"].install;
  114636. _framework__WEBPACK_IMPORTED_MODULE_2__["default"].install = function (Vue, args) {
  114637. install.call(_framework__WEBPACK_IMPORTED_MODULE_2__["default"], Vue, __assign({
  114638. components: _components__WEBPACK_IMPORTED_MODULE_0__,
  114639. directives: _directives__WEBPACK_IMPORTED_MODULE_1__
  114640. }, args));
  114641. };
  114642. if (typeof window !== 'undefined' && window.Vue) {
  114643. window.Vue.use(_framework__WEBPACK_IMPORTED_MODULE_2__["default"]);
  114644. }
  114645. /***/ }),
  114646. /***/ "./src/install.ts":
  114647. /*!************************!*\
  114648. !*** ./src/install.ts ***!
  114649. \************************/
  114650. /*! exports provided: install */
  114651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114652. "use strict";
  114653. __webpack_require__.r(__webpack_exports__);
  114654. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  114655. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  114656. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  114657. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/console */ "./src/util/console.ts");
  114658. function install(Vue, args) {
  114659. if (args === void 0) {
  114660. args = {};
  114661. }
  114662. if (install.installed) return;
  114663. install.installed = true;
  114664. if (vue__WEBPACK_IMPORTED_MODULE_0___default.a !== Vue) {
  114665. Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleError"])('Multiple instances of Vue detected\nSee https://github.com/vuetifyjs/vuetify/issues/4068\n\nIf you\'re seeing "$attrs is readonly", it\'s caused by this');
  114666. }
  114667. var components = args.components || {};
  114668. var directives = args.directives || {};
  114669. for (var name in directives) {
  114670. var directive = directives[name];
  114671. Vue.directive(name, directive);
  114672. }
  114673. (function registerComponents(components) {
  114674. if (components) {
  114675. for (var key in components) {
  114676. var component = components[key];
  114677. if (component && !registerComponents(component.$_vuetify_subcomponents)) {
  114678. Vue.component(key, component);
  114679. }
  114680. }
  114681. return true;
  114682. }
  114683. return false;
  114684. })(components); // Used to avoid multiple mixins being setup
  114685. // when in dev mode and hot module reload
  114686. // https://github.com/vuejs/vue/issues/5089#issuecomment-284260111
  114687. if (Vue.$_vuetify_installed) return;
  114688. Vue.$_vuetify_installed = true;
  114689. Vue.mixin({
  114690. beforeCreate: function beforeCreate() {
  114691. var options = this.$options;
  114692. if (options.vuetify) {
  114693. options.vuetify.init(this, options.ssrContext);
  114694. this.$vuetify = Vue.observable(options.vuetify.framework);
  114695. } else {
  114696. this.$vuetify = options.parent && options.parent.$vuetify || this;
  114697. }
  114698. }
  114699. });
  114700. }
  114701. /***/ }),
  114702. /***/ "./src/locale/af.ts":
  114703. /*!**************************!*\
  114704. !*** ./src/locale/af.ts ***!
  114705. \**************************/
  114706. /*! exports provided: default */
  114707. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114708. "use strict";
  114709. __webpack_require__.r(__webpack_exports__);
  114710. /* harmony default export */ __webpack_exports__["default"] = ({
  114711. badge: 'badge',
  114712. close: 'Close',
  114713. dataIterator: {
  114714. noResultsText: 'Geen ooreenstemmende resultate is gevind nie',
  114715. loadingText: 'Loading item...'
  114716. },
  114717. dataTable: {
  114718. itemsPerPageText: 'Rye per bladsy:',
  114719. ariaLabel: {
  114720. sortDescending: 'Sorted descending.',
  114721. sortAscending: 'Sorted ascending..',
  114722. sortNone: 'Not sorted.',
  114723. activateNone: 'Activate to remove sorting.',
  114724. activateDescending: 'Activate to sort descending.',
  114725. activateAscending: 'Activate to sort ascending.'
  114726. },
  114727. sortBy: 'Sort by'
  114728. },
  114729. dataFooter: {
  114730. itemsPerPageText: 'Aantal per bladsy:',
  114731. itemsPerPageAll: 'Alles',
  114732. nextPage: 'Volgende bladsy',
  114733. prevPage: 'Vorige bladsy',
  114734. firstPage: 'Eerste bladsy',
  114735. lastPage: 'Laaste bladsy',
  114736. pageText: '{0}-{1} van {2}'
  114737. },
  114738. datePicker: {
  114739. itemsSelected: '{0} gekies'
  114740. },
  114741. noDataText: 'Geen data is beskikbaar nie',
  114742. carousel: {
  114743. prev: 'Vorige visuele',
  114744. next: 'Volgende visuele',
  114745. ariaLabel: {
  114746. delimiter: 'Carousel slide {0} of {1}'
  114747. }
  114748. },
  114749. calendar: {
  114750. moreEvents: '{0} meer'
  114751. },
  114752. fileInput: {
  114753. counter: '{0} files',
  114754. counterSize: '{0} files ({1} in total)'
  114755. },
  114756. timePicker: {
  114757. am: 'AM',
  114758. pm: 'PM'
  114759. }
  114760. });
  114761. /***/ }),
  114762. /***/ "./src/locale/ar.ts":
  114763. /*!**************************!*\
  114764. !*** ./src/locale/ar.ts ***!
  114765. \**************************/
  114766. /*! exports provided: default */
  114767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114768. "use strict";
  114769. __webpack_require__.r(__webpack_exports__);
  114770. /* harmony default export */ __webpack_exports__["default"] = ({
  114771. badge: 'شارة',
  114772. close: 'إغلاق',
  114773. dataIterator: {
  114774. noResultsText: 'لا توجد سجلات مطابقة',
  114775. loadingText: 'تحميل العنصر...'
  114776. },
  114777. dataTable: {
  114778. itemsPerPageText: 'الصفوف لكل صفحة:',
  114779. ariaLabel: {
  114780. sortDescending: 'مفروز تنازلي. تنشيط لإزالة الفرز.',
  114781. sortAscending: 'مفروز تصاعدي. تنشيط للفرز التنازلي.',
  114782. sortNone: 'غير مفروزة. تفعيل لفرز تصاعدي.',
  114783. activateNone: 'Activate to remove sorting.',
  114784. activateDescending: 'Activate to sort descending.',
  114785. activateAscending: 'Activate to sort ascending.'
  114786. },
  114787. sortBy: 'مفروزة حسب'
  114788. },
  114789. dataFooter: {
  114790. itemsPerPageText: 'العناصر لكل صفحة:',
  114791. itemsPerPageAll: 'الكل',
  114792. nextPage: 'الصفحة التالية',
  114793. prevPage: 'الصفحة السابقة',
  114794. firstPage: 'الصفحة الأولى',
  114795. lastPage: 'الصفحة الأخيرة',
  114796. pageText: '{0}-{1} من {2}'
  114797. },
  114798. datePicker: {
  114799. itemsSelected: '{0} مختارة'
  114800. },
  114801. noDataText: 'لا توجد بيانات متاحة',
  114802. carousel: {
  114803. prev: 'البصري السابق',
  114804. next: 'البصري التالي',
  114805. ariaLabel: {
  114806. delimiter: 'Carousel slide {0} of {1}'
  114807. }
  114808. },
  114809. calendar: {
  114810. moreEvents: '{0} أكثر'
  114811. },
  114812. fileInput: {
  114813. counter: '{0} ملفات',
  114814. counterSize: '{0} ملفات ({1} في المجموع)'
  114815. },
  114816. timePicker: {
  114817. am: 'صباحاً',
  114818. pm: 'مساءً'
  114819. }
  114820. });
  114821. /***/ }),
  114822. /***/ "./src/locale/ca.ts":
  114823. /*!**************************!*\
  114824. !*** ./src/locale/ca.ts ***!
  114825. \**************************/
  114826. /*! exports provided: default */
  114827. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114828. "use strict";
  114829. __webpack_require__.r(__webpack_exports__);
  114830. /* harmony default export */ __webpack_exports__["default"] = ({
  114831. badge: 'Insígnia',
  114832. close: 'Tancar',
  114833. dataIterator: {
  114834. noResultsText: 'Sense dades per mostrar',
  114835. loadingText: 'Carregant...'
  114836. },
  114837. dataTable: {
  114838. itemsPerPageText: 'Files per pàgina:',
  114839. ariaLabel: {
  114840. sortDescending: 'Ordre descendent. Premi per treure la ordenació.',
  114841. sortAscending: 'Ordre ascendent. Premi per ordenar descendent.',
  114842. sortNone: 'Sense ordenar. Premi per ordenar ascendent.',
  114843. activateNone: 'Activate to remove sorting.',
  114844. activateDescending: 'Activate to sort descending.',
  114845. activateAscending: 'Activate to sort ascending.'
  114846. },
  114847. sortBy: 'Ordenat per'
  114848. },
  114849. dataFooter: {
  114850. itemsPerPageText: 'Elements per pàgina:',
  114851. itemsPerPageAll: 'Tot',
  114852. nextPage: 'Pàgina següent',
  114853. prevPage: 'Pàgina anterior',
  114854. firstPage: 'Primera pàgina',
  114855. lastPage: 'Última pàgina',
  114856. pageText: '{0}-{1} de {2}'
  114857. },
  114858. datePicker: {
  114859. itemsSelected: '{0} seleccionats'
  114860. },
  114861. noDataText: 'Sense dades',
  114862. carousel: {
  114863. prev: 'Visualització prèvia',
  114864. next: 'Visualització següent',
  114865. ariaLabel: {
  114866. delimiter: 'Diapositiva {0} of {1}'
  114867. }
  114868. },
  114869. calendar: {
  114870. moreEvents: '{0} més'
  114871. },
  114872. fileInput: {
  114873. counter: '{0} fitxers',
  114874. counterSize: '{0} fitxers ({1} en total)'
  114875. },
  114876. timePicker: {
  114877. am: 'AM',
  114878. pm: 'PM'
  114879. }
  114880. });
  114881. /***/ }),
  114882. /***/ "./src/locale/cs.ts":
  114883. /*!**************************!*\
  114884. !*** ./src/locale/cs.ts ***!
  114885. \**************************/
  114886. /*! exports provided: default */
  114887. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114888. "use strict";
  114889. __webpack_require__.r(__webpack_exports__);
  114890. /* harmony default export */ __webpack_exports__["default"] = ({
  114891. badge: 'Odznak',
  114892. close: 'Zavřít',
  114893. dataIterator: {
  114894. noResultsText: 'Nenalezeny žádné záznamy',
  114895. loadingText: 'Načítám položky...'
  114896. },
  114897. dataTable: {
  114898. itemsPerPageText: 'Řádků na stránku:',
  114899. ariaLabel: {
  114900. sortDescending: 'Řazeno sestupně.',
  114901. sortAscending: 'Řazeno vzestupně.',
  114902. sortNone: 'Neseřazeno.',
  114903. activateNone: 'Aktivováním vypnete řazení.',
  114904. activateDescending: 'Aktivováním se bude řadit sestupně.',
  114905. activateAscending: 'Aktivováním se bude řadit vzestupně.'
  114906. },
  114907. sortBy: 'Řadit dle'
  114908. },
  114909. dataFooter: {
  114910. itemsPerPageText: 'Položek na stránku:',
  114911. itemsPerPageAll: 'Vše',
  114912. nextPage: 'Další strana',
  114913. prevPage: 'Předchozí strana',
  114914. firstPage: 'První strana',
  114915. lastPage: 'Poslední strana',
  114916. pageText: '{0}-{1} z {2}'
  114917. },
  114918. datePicker: {
  114919. itemsSelected: '{0} vybráno'
  114920. },
  114921. noDataText: 'Nejsou dostupná žádná data',
  114922. carousel: {
  114923. prev: 'Předchozí obrázek',
  114924. next: 'Další obrázek',
  114925. ariaLabel: {
  114926. delimiter: 'Carousel slide {0} of {1}'
  114927. }
  114928. },
  114929. calendar: {
  114930. moreEvents: '{0} dalších'
  114931. },
  114932. fileInput: {
  114933. counter: '{0} souborů',
  114934. counterSize: '{0} souborů ({1} celkem)'
  114935. },
  114936. timePicker: {
  114937. am: 'AM',
  114938. pm: 'PM'
  114939. }
  114940. });
  114941. /***/ }),
  114942. /***/ "./src/locale/de.ts":
  114943. /*!**************************!*\
  114944. !*** ./src/locale/de.ts ***!
  114945. \**************************/
  114946. /*! exports provided: default */
  114947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114948. "use strict";
  114949. __webpack_require__.r(__webpack_exports__);
  114950. /* harmony default export */ __webpack_exports__["default"] = ({
  114951. badge: 'Abzeichen',
  114952. close: 'Schließen',
  114953. dataIterator: {
  114954. noResultsText: 'Keine Elemente gefunden',
  114955. loadingText: 'Lade Elemente...'
  114956. },
  114957. dataTable: {
  114958. itemsPerPageText: 'Zeilen pro Seite:',
  114959. ariaLabel: {
  114960. sortDescending: 'Absteigend sortiert.',
  114961. sortAscending: 'Aufsteigend sortiert.',
  114962. sortNone: 'Nicht sortiert.',
  114963. activateNone: 'Aktivieren um Sortierung zu entfernen.',
  114964. activateDescending: 'Aktivieren um absteigend zu sortieren.',
  114965. activateAscending: 'Aktivieren um aufsteigend zu sortieren.'
  114966. },
  114967. sortBy: 'Sortiere nach'
  114968. },
  114969. dataFooter: {
  114970. itemsPerPageText: 'Elemente pro Seite:',
  114971. itemsPerPageAll: 'Alle',
  114972. nextPage: 'Nächste Seite',
  114973. prevPage: 'Vorherige Seite',
  114974. firstPage: 'Erste Seite',
  114975. lastPage: 'Letzte Seite',
  114976. pageText: '{0}-{1} von {2}'
  114977. },
  114978. datePicker: {
  114979. itemsSelected: '{0} ausgewählt'
  114980. },
  114981. noDataText: 'Keine Daten vorhanden',
  114982. carousel: {
  114983. prev: 'Vorheriges Bild',
  114984. next: 'Nächstes Bild',
  114985. ariaLabel: {
  114986. delimiter: 'Element {0} von {1}'
  114987. }
  114988. },
  114989. calendar: {
  114990. moreEvents: '{0} mehr'
  114991. },
  114992. fileInput: {
  114993. counter: '{0} Dateien',
  114994. counterSize: '{0} Dateien ({1} gesamt)'
  114995. },
  114996. timePicker: {
  114997. am: 'AM',
  114998. pm: 'PM'
  114999. }
  115000. });
  115001. /***/ }),
  115002. /***/ "./src/locale/el.ts":
  115003. /*!**************************!*\
  115004. !*** ./src/locale/el.ts ***!
  115005. \**************************/
  115006. /*! exports provided: default */
  115007. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115008. "use strict";
  115009. __webpack_require__.r(__webpack_exports__);
  115010. /* harmony default export */ __webpack_exports__["default"] = ({
  115011. badge: 'Σήμα',
  115012. close: 'Close',
  115013. dataIterator: {
  115014. noResultsText: 'Δε βρέθηκαν αποτελέσματα',
  115015. loadingText: 'Loading item...'
  115016. },
  115017. dataTable: {
  115018. itemsPerPageText: 'Γραμμές ανά σελίδα:',
  115019. ariaLabel: {
  115020. sortDescending: 'Sorted descending.',
  115021. sortAscending: 'Sorted ascending.',
  115022. sortNone: 'Not sorted.',
  115023. activateNone: 'Activate to remove sorting.',
  115024. activateDescending: 'Activate to sort descending.',
  115025. activateAscending: 'Activate to sort ascending.'
  115026. },
  115027. sortBy: 'Sort by'
  115028. },
  115029. dataFooter: {
  115030. itemsPerPageText: 'Αντικείμενα ανά σελίδα:',
  115031. itemsPerPageAll: 'Όλα',
  115032. nextPage: 'Επόμενη σελίδα',
  115033. prevPage: 'Προηγούμενη σελίδα',
  115034. firstPage: 'Πρώτη σελίδα',
  115035. lastPage: 'Τελευταία σελίδα',
  115036. pageText: '{0}-{1} από {2}'
  115037. },
  115038. datePicker: {
  115039. itemsSelected: '{0} επιλεγμένα'
  115040. },
  115041. noDataText: 'Χωρίς δεδομένα',
  115042. carousel: {
  115043. prev: 'הקודם חזותי',
  115044. next: 'הבא חזותי',
  115045. ariaLabel: {
  115046. delimiter: 'Carousel slide {0} of {1}'
  115047. }
  115048. },
  115049. calendar: {
  115050. moreEvents: '{0} ακόμη'
  115051. },
  115052. fileInput: {
  115053. counter: '{0} files',
  115054. counterSize: '{0} files ({1} in total)'
  115055. },
  115056. timePicker: {
  115057. am: 'AM',
  115058. pm: 'PM'
  115059. }
  115060. });
  115061. /***/ }),
  115062. /***/ "./src/locale/en.ts":
  115063. /*!**************************!*\
  115064. !*** ./src/locale/en.ts ***!
  115065. \**************************/
  115066. /*! exports provided: default */
  115067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115068. "use strict";
  115069. __webpack_require__.r(__webpack_exports__);
  115070. /* harmony default export */ __webpack_exports__["default"] = ({
  115071. badge: 'Badge',
  115072. close: 'Close',
  115073. dataIterator: {
  115074. noResultsText: 'No matching records found',
  115075. loadingText: 'Loading items...'
  115076. },
  115077. dataTable: {
  115078. itemsPerPageText: 'Rows per page:',
  115079. ariaLabel: {
  115080. sortDescending: 'Sorted descending.',
  115081. sortAscending: 'Sorted ascending.',
  115082. sortNone: 'Not sorted.',
  115083. activateNone: 'Activate to remove sorting.',
  115084. activateDescending: 'Activate to sort descending.',
  115085. activateAscending: 'Activate to sort ascending.'
  115086. },
  115087. sortBy: 'Sort by'
  115088. },
  115089. dataFooter: {
  115090. itemsPerPageText: 'Items per page:',
  115091. itemsPerPageAll: 'All',
  115092. nextPage: 'Next page',
  115093. prevPage: 'Previous page',
  115094. firstPage: 'First page',
  115095. lastPage: 'Last page',
  115096. pageText: '{0}-{1} of {2}'
  115097. },
  115098. datePicker: {
  115099. itemsSelected: '{0} selected'
  115100. },
  115101. noDataText: 'No data available',
  115102. carousel: {
  115103. prev: 'Previous visual',
  115104. next: 'Next visual',
  115105. ariaLabel: {
  115106. delimiter: 'Carousel slide {0} of {1}'
  115107. }
  115108. },
  115109. calendar: {
  115110. moreEvents: '{0} more'
  115111. },
  115112. fileInput: {
  115113. counter: '{0} files',
  115114. counterSize: '{0} files ({1} in total)'
  115115. },
  115116. timePicker: {
  115117. am: 'AM',
  115118. pm: 'PM'
  115119. }
  115120. });
  115121. /***/ }),
  115122. /***/ "./src/locale/es.ts":
  115123. /*!**************************!*\
  115124. !*** ./src/locale/es.ts ***!
  115125. \**************************/
  115126. /*! exports provided: default */
  115127. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115128. "use strict";
  115129. __webpack_require__.r(__webpack_exports__);
  115130. /* harmony default export */ __webpack_exports__["default"] = ({
  115131. badge: 'Placa',
  115132. close: 'Cerrar',
  115133. dataIterator: {
  115134. noResultsText: 'Ningún elemento coincide con la búsqueda',
  115135. loadingText: 'Cargando...'
  115136. },
  115137. dataTable: {
  115138. itemsPerPageText: 'Filas por página:',
  115139. ariaLabel: {
  115140. sortDescending: 'Orden descendente.',
  115141. sortAscending: 'Orden ascendente.',
  115142. sortNone: 'Sin ordenar.',
  115143. activateNone: 'Pulse para quitar orden.',
  115144. activateDescending: 'Pulse para ordenar descendente.',
  115145. activateAscending: 'Pulse para ordenar ascendente.'
  115146. },
  115147. sortBy: 'Ordenado por'
  115148. },
  115149. dataFooter: {
  115150. itemsPerPageText: 'Elementos por página:',
  115151. itemsPerPageAll: 'Todos',
  115152. nextPage: 'Página siguiente',
  115153. prevPage: 'Página anterior',
  115154. firstPage: 'Primer página',
  115155. lastPage: 'Última página',
  115156. pageText: '{0}-{1} de {2}'
  115157. },
  115158. datePicker: {
  115159. itemsSelected: '{0} seleccionados'
  115160. },
  115161. noDataText: 'No hay datos disponibles',
  115162. carousel: {
  115163. prev: 'Visual anterior',
  115164. next: 'Visual siguiente',
  115165. ariaLabel: {
  115166. delimiter: 'Carousel slide {0} of {1}'
  115167. }
  115168. },
  115169. calendar: {
  115170. moreEvents: '{0} más'
  115171. },
  115172. fileInput: {
  115173. counter: '{0} archivos',
  115174. counterSize: '{0} archivos ({1} en total)'
  115175. },
  115176. timePicker: {
  115177. am: 'AM',
  115178. pm: 'PM'
  115179. }
  115180. });
  115181. /***/ }),
  115182. /***/ "./src/locale/et.ts":
  115183. /*!**************************!*\
  115184. !*** ./src/locale/et.ts ***!
  115185. \**************************/
  115186. /*! exports provided: default */
  115187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115188. "use strict";
  115189. __webpack_require__.r(__webpack_exports__);
  115190. /* harmony default export */ __webpack_exports__["default"] = ({
  115191. badge: 'Märk',
  115192. close: 'Sulge',
  115193. dataIterator: {
  115194. noResultsText: 'Vastavaid kirjeid ei leitud',
  115195. loadingText: 'Andmeid laaditakse...'
  115196. },
  115197. dataTable: {
  115198. itemsPerPageText: 'Ridu leheküljel:',
  115199. ariaLabel: {
  115200. sortDescending: 'Kahanevalt sorteeritud.',
  115201. sortAscending: 'Kasvavalt sorteeritud.',
  115202. sortNone: 'Ei ole sorteeritud.',
  115203. activateNone: 'Vajuta uuesti sorteerimise eemaldamiseks.',
  115204. activateDescending: 'Vajuta uuesti, et sorteerida kahanevalt.',
  115205. activateAscending: 'Vajuta kasvavalt sorteerimiseks.'
  115206. },
  115207. sortBy: 'Sorteerimise alus'
  115208. },
  115209. dataFooter: {
  115210. itemsPerPageText: 'Kirjeid leheküljel:',
  115211. itemsPerPageAll: 'Kõik',
  115212. nextPage: 'Järgmine lehekülg',
  115213. prevPage: 'Eelmine lehekülg',
  115214. firstPage: 'Esimene lehekülg',
  115215. lastPage: 'Viimane lehekülg',
  115216. pageText: '{0}-{1} {2}st'
  115217. },
  115218. datePicker: {
  115219. itemsSelected: '{0} valitud'
  115220. },
  115221. noDataText: 'Andmed puuduvad',
  115222. carousel: {
  115223. prev: 'Eelmine visuaalne',
  115224. next: 'Järgmine visuaalne',
  115225. ariaLabel: {
  115226. delimiter: 'Carousel slide {0} of {1}'
  115227. }
  115228. },
  115229. calendar: {
  115230. moreEvents: '{0} veel'
  115231. },
  115232. fileInput: {
  115233. counter: '{0} faili',
  115234. counterSize: '{0} faili (kokku {1})'
  115235. },
  115236. timePicker: {
  115237. am: 'AM',
  115238. pm: 'PM'
  115239. }
  115240. });
  115241. /***/ }),
  115242. /***/ "./src/locale/fa.ts":
  115243. /*!**************************!*\
  115244. !*** ./src/locale/fa.ts ***!
  115245. \**************************/
  115246. /*! exports provided: default */
  115247. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115248. "use strict";
  115249. __webpack_require__.r(__webpack_exports__);
  115250. /* harmony default export */ __webpack_exports__["default"] = ({
  115251. badge: 'نشان',
  115252. close: 'بستن',
  115253. dataIterator: {
  115254. noResultsText: 'نتیجه‌ای یافت نشد',
  115255. loadingText: 'در حال بارگذاری...'
  115256. },
  115257. dataTable: {
  115258. itemsPerPageText: 'ردیف در صفحه:',
  115259. ariaLabel: {
  115260. sortDescending: 'نزولی مرتب شده است. فعال‌سازی برای حذف مرتب‌سازی.',
  115261. sortAscending: 'صعودی مرتب شده است. فعال‌سازی برای مرتب‌سازی نزولی.',
  115262. sortNone: 'مرتب نشده است. فعال‌سازی برای مرتب‌سازی صعودی.',
  115263. activateNone: 'Activate to remove sorting.',
  115264. activateDescending: 'Activate to sort descending.',
  115265. activateAscending: 'Activate to sort ascending.'
  115266. },
  115267. sortBy: 'مرتب‌سازی براساس'
  115268. },
  115269. dataFooter: {
  115270. itemsPerPageText: 'ردیف در صفحه:',
  115271. itemsPerPageAll: 'همه',
  115272. nextPage: 'صفحه‌ی بعد',
  115273. prevPage: 'صفحه‌ی قبل',
  115274. firstPage: 'صفحه‌ی اول',
  115275. lastPage: 'صفحه‌ی آخر',
  115276. pageText: '{0} تا {1} از {2}'
  115277. },
  115278. datePicker: {
  115279. itemsSelected: '{0} انتخاب شده است'
  115280. },
  115281. noDataText: 'اطلاعاتی یافت نشد',
  115282. carousel: {
  115283. prev: 'اسلاید قبلی',
  115284. next: 'اسلاید بعدی',
  115285. ariaLabel: {
  115286. delimiter: 'Carousel slide {0} of {1}'
  115287. }
  115288. },
  115289. calendar: {
  115290. moreEvents: '{بیشتر {0'
  115291. },
  115292. fileInput: {
  115293. counter: '{0} پرونده',
  115294. counterSize: '{0} پرونده ({1} در کل)'
  115295. },
  115296. timePicker: {
  115297. am: 'قبل از ظهر',
  115298. pm: 'بعد از ظهر'
  115299. }
  115300. });
  115301. /***/ }),
  115302. /***/ "./src/locale/fr.ts":
  115303. /*!**************************!*\
  115304. !*** ./src/locale/fr.ts ***!
  115305. \**************************/
  115306. /*! exports provided: default */
  115307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115308. "use strict";
  115309. __webpack_require__.r(__webpack_exports__);
  115310. /* harmony default export */ __webpack_exports__["default"] = ({
  115311. badge: 'Badge',
  115312. close: 'Fermer',
  115313. dataIterator: {
  115314. noResultsText: 'Aucun enregistrement correspondant trouvé',
  115315. loadingText: "Chargement de l'élément..."
  115316. },
  115317. dataTable: {
  115318. itemsPerPageText: 'Lignes par page:',
  115319. ariaLabel: {
  115320. sortDescending: 'Tri décroissant.',
  115321. sortAscending: 'Tri croissant.',
  115322. sortNone: 'Non trié.',
  115323. activateNone: 'Activer pour supprimer le tri.',
  115324. activateDescending: 'Activer pour trier par ordre décroissant.',
  115325. activateAscending: 'Activer pour trier par ordre croissant.'
  115326. },
  115327. sortBy: 'Trier par'
  115328. },
  115329. dataFooter: {
  115330. itemsPerPageText: 'Élements par page:',
  115331. itemsPerPageAll: 'Tous',
  115332. nextPage: 'Page suivante',
  115333. prevPage: 'Page précédente',
  115334. firstPage: 'Première page',
  115335. lastPage: 'Dernière page',
  115336. pageText: '{0}-{1} de {2}'
  115337. },
  115338. datePicker: {
  115339. itemsSelected: '{0} sélectionnés'
  115340. },
  115341. noDataText: 'Aucune donnée disponible',
  115342. carousel: {
  115343. prev: 'Visuel précédent',
  115344. next: 'Visuel suivant',
  115345. ariaLabel: {
  115346. delimiter: 'Carousel slide {0} of {1}'
  115347. }
  115348. },
  115349. calendar: {
  115350. moreEvents: '{0} plus'
  115351. },
  115352. fileInput: {
  115353. counter: '{0} fichiers',
  115354. counterSize: '{0} fichiers ({1} au total)'
  115355. },
  115356. timePicker: {
  115357. am: 'AM',
  115358. pm: 'PM'
  115359. }
  115360. });
  115361. /***/ }),
  115362. /***/ "./src/locale/he.ts":
  115363. /*!**************************!*\
  115364. !*** ./src/locale/he.ts ***!
  115365. \**************************/
  115366. /*! exports provided: default */
  115367. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115368. "use strict";
  115369. __webpack_require__.r(__webpack_exports__);
  115370. /* harmony default export */ __webpack_exports__["default"] = ({
  115371. badge: 'תג',
  115372. close: 'סגור',
  115373. dataIterator: {
  115374. noResultsText: 'לא נמצאו תוצאות מתאימות',
  115375. loadingText: 'טוען פריט...'
  115376. },
  115377. dataTable: {
  115378. itemsPerPageText: 'שורות לעמוד:',
  115379. ariaLabel: {
  115380. sortDescending: 'ממוין לפי סדר עולה. לחץ להספקת המיון.',
  115381. sortAscending: 'ממוין לפי סדר יורד. לחץ למיון לפי סדר עולה.',
  115382. sortNone: 'לא ממוין. לחץ למיון לפי סדר עולה.',
  115383. activateNone: 'הפעל להסרת המיון.',
  115384. activateDescending: 'הפעל למיון יורד.',
  115385. activateAscending: 'הפעל למיון עולה.'
  115386. },
  115387. sortBy: 'סדר לפי'
  115388. },
  115389. dataFooter: {
  115390. itemsPerPageText: 'פריטים לדף:',
  115391. itemsPerPageAll: 'הכל',
  115392. nextPage: 'עמוד הבא',
  115393. prevPage: 'עמוד הקודם',
  115394. firstPage: 'עמוד ראשון',
  115395. lastPage: 'עמוד אחרון',
  115396. pageText: '{0}-{1} מתוך {2}'
  115397. },
  115398. datePicker: {
  115399. itemsSelected: '{0} נבחרו'
  115400. },
  115401. noDataText: 'אין נתונים זמינים',
  115402. carousel: {
  115403. prev: 'מצג קודם',
  115404. next: 'מצג הבא',
  115405. ariaLabel: {
  115406. delimiter: 'Carousel slide {0} of {1}'
  115407. }
  115408. },
  115409. calendar: {
  115410. moreEvents: '{0} נוספים'
  115411. },
  115412. fileInput: {
  115413. counter: '{0} קבצים',
  115414. counterSize: '{0} קבצים ({1} בסך הכל)'
  115415. },
  115416. timePicker: {
  115417. am: 'AM',
  115418. pm: 'PM'
  115419. }
  115420. });
  115421. /***/ }),
  115422. /***/ "./src/locale/hr.ts":
  115423. /*!**************************!*\
  115424. !*** ./src/locale/hr.ts ***!
  115425. \**************************/
  115426. /*! exports provided: default */
  115427. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115428. "use strict";
  115429. __webpack_require__.r(__webpack_exports__);
  115430. /* harmony default export */ __webpack_exports__["default"] = ({
  115431. badge: 'Bedž',
  115432. close: 'Zatvori',
  115433. dataIterator: {
  115434. noResultsText: 'Nisu pronađene odgovarajuće stavke',
  115435. loadingText: 'Učitavanje...'
  115436. },
  115437. dataTable: {
  115438. itemsPerPageText: 'Redaka po stranici:',
  115439. ariaLabel: {
  115440. sortDescending: 'Sortirano silazno.',
  115441. sortAscending: 'Sortirano uzlazno.',
  115442. sortNone: 'Nije sortirano.',
  115443. activateNone: 'Odaberite za uklanjanje sortiranja.',
  115444. activateDescending: 'Odaberite za silazno sortiranje.',
  115445. activateAscending: 'Odaberite za uzlazno sortiranje.'
  115446. },
  115447. sortBy: 'Sortirajte po'
  115448. },
  115449. dataFooter: {
  115450. itemsPerPageText: 'Stavki po stranici:',
  115451. itemsPerPageAll: 'Sve',
  115452. nextPage: 'Sljedeća stranica',
  115453. prevPage: 'Prethodna stranica',
  115454. firstPage: 'Prva stranica',
  115455. lastPage: 'Posljednja stranica',
  115456. pageText: '{0}-{1} od {2}'
  115457. },
  115458. datePicker: {
  115459. itemsSelected: '{0} odabrano'
  115460. },
  115461. noDataText: 'Nema dostupnih podataka',
  115462. carousel: {
  115463. prev: 'Prethodno',
  115464. next: 'Sljedeće',
  115465. ariaLabel: {
  115466. delimiter: 'Carousel slide {0} of {1}'
  115467. }
  115468. },
  115469. calendar: {
  115470. moreEvents: 'Još {0}'
  115471. },
  115472. fileInput: {
  115473. counter: 'Odabranih datoteka: {0}',
  115474. counterSize: 'Odabranih datoteka: {0} ({1} ukupno)'
  115475. },
  115476. timePicker: {
  115477. am: 'AM',
  115478. pm: 'PM'
  115479. }
  115480. });
  115481. /***/ }),
  115482. /***/ "./src/locale/hu.ts":
  115483. /*!**************************!*\
  115484. !*** ./src/locale/hu.ts ***!
  115485. \**************************/
  115486. /*! exports provided: default */
  115487. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115488. "use strict";
  115489. __webpack_require__.r(__webpack_exports__);
  115490. /* harmony default export */ __webpack_exports__["default"] = ({
  115491. badge: 'Jelvény',
  115492. close: 'Close',
  115493. dataIterator: {
  115494. noResultsText: 'Nincs egyező találat',
  115495. loadingText: 'Loading item...'
  115496. },
  115497. dataTable: {
  115498. itemsPerPageText: 'Elem oldalanként:',
  115499. ariaLabel: {
  115500. sortDescending: 'Sorted descending. Activate to remove sorting.',
  115501. sortAscending: 'Sorted ascending. Activate to sort descending.',
  115502. sortNone: 'Not sorted. Activate to sort ascending.',
  115503. activateNone: 'Activate to remove sorting.',
  115504. activateDescending: 'Activate to sort descending.',
  115505. activateAscending: 'Activate to sort ascending.'
  115506. },
  115507. sortBy: 'Sort by'
  115508. },
  115509. dataFooter: {
  115510. itemsPerPageText: 'Elem oldalanként:',
  115511. itemsPerPageAll: 'Mind',
  115512. nextPage: 'Következő oldal',
  115513. prevPage: 'Előző oldal',
  115514. firstPage: 'Első oldal',
  115515. lastPage: 'Utolsó oldal',
  115516. pageText: '{0}-{1} / {2}'
  115517. },
  115518. datePicker: {
  115519. itemsSelected: '{0} kiválaszta/-ott'
  115520. },
  115521. noDataText: 'Nincs elérhető adat',
  115522. carousel: {
  115523. prev: 'Korábbi vizuális',
  115524. next: 'Következő vizuális',
  115525. ariaLabel: {
  115526. delimiter: 'Carousel slide {0} of {1}'
  115527. }
  115528. },
  115529. calendar: {
  115530. moreEvents: '{0} további'
  115531. },
  115532. fileInput: {
  115533. counter: '{0} files',
  115534. counterSize: '{0} files ({1} in total)'
  115535. },
  115536. timePicker: {
  115537. am: 'AM',
  115538. pm: 'PM'
  115539. }
  115540. });
  115541. /***/ }),
  115542. /***/ "./src/locale/id.ts":
  115543. /*!**************************!*\
  115544. !*** ./src/locale/id.ts ***!
  115545. \**************************/
  115546. /*! exports provided: default */
  115547. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115548. "use strict";
  115549. __webpack_require__.r(__webpack_exports__);
  115550. /* harmony default export */ __webpack_exports__["default"] = ({
  115551. badge: 'Lencana',
  115552. close: 'Tutup',
  115553. dataIterator: {
  115554. noResultsText: 'Tidak ditemukan catatan yang cocok',
  115555. loadingText: 'Memuat data...'
  115556. },
  115557. dataTable: {
  115558. itemsPerPageText: 'Baris per halaman:',
  115559. ariaLabel: {
  115560. sortDescending: 'Diurutkan kebawah.',
  115561. sortAscending: 'Diurutkan keatas.',
  115562. sortNone: 'Tidak diurutkan.',
  115563. activateNone: 'Aktifkan untuk menghapus penyortiran.',
  115564. activateDescending: 'Aktifkan untuk mengurutkan kebawah.',
  115565. activateAscending: 'Aktifkan untuk mengurutkan keatas.'
  115566. },
  115567. sortBy: 'Urutkan berdasar'
  115568. },
  115569. dataFooter: {
  115570. itemsPerPageText: 'Item per halaman:',
  115571. itemsPerPageAll: 'Semua',
  115572. nextPage: 'Halaman selanjutnya',
  115573. prevPage: 'Halaman sebelumnya',
  115574. firstPage: 'Halaman pertama',
  115575. lastPage: 'Halaman terakhir',
  115576. pageText: '{0}-{1} dari {2}'
  115577. },
  115578. datePicker: {
  115579. itemsSelected: '{0} dipilih'
  115580. },
  115581. noDataText: 'Tidak ada data tersedia',
  115582. carousel: {
  115583. prev: 'Visual sebelumnya',
  115584. next: 'Visual selanjutnya',
  115585. ariaLabel: {
  115586. delimiter: 'Carousel slide {0} of {1}'
  115587. }
  115588. },
  115589. calendar: {
  115590. moreEvents: '{0} lagi'
  115591. },
  115592. fileInput: {
  115593. counter: '{0} berkas',
  115594. counterSize: '{0} berkas (dari total {1})'
  115595. },
  115596. timePicker: {
  115597. am: 'AM',
  115598. pm: 'PM'
  115599. }
  115600. });
  115601. /***/ }),
  115602. /***/ "./src/locale/index.ts":
  115603. /*!*****************************!*\
  115604. !*** ./src/locale/index.ts ***!
  115605. \*****************************/
  115606. /*! exports provided: af, ar, ca, cs, de, el, en, es, et, fa, fr, hr, hu, he, id, it, ja, ko, lv, lt, nl, no, pl, pt, ro, ru, sl, srCyrl, sv, th, tr, uk, zhHans, zhHant */
  115607. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115608. "use strict";
  115609. __webpack_require__.r(__webpack_exports__);
  115610. /* harmony import */ var _af__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./af */ "./src/locale/af.ts");
  115611. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "af", function() { return _af__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  115612. /* harmony import */ var _ar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ar */ "./src/locale/ar.ts");
  115613. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ar", function() { return _ar__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  115614. /* harmony import */ var _ca__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ca */ "./src/locale/ca.ts");
  115615. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ca", function() { return _ca__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  115616. /* harmony import */ var _cs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cs */ "./src/locale/cs.ts");
  115617. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cs", function() { return _cs__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  115618. /* harmony import */ var _de__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./de */ "./src/locale/de.ts");
  115619. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "de", function() { return _de__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  115620. /* harmony import */ var _el__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./el */ "./src/locale/el.ts");
  115621. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "el", function() { return _el__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  115622. /* harmony import */ var _en__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./en */ "./src/locale/en.ts");
  115623. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "en", function() { return _en__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  115624. /* harmony import */ var _es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./es */ "./src/locale/es.ts");
  115625. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "es", function() { return _es__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  115626. /* harmony import */ var _et__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./et */ "./src/locale/et.ts");
  115627. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "et", function() { return _et__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  115628. /* harmony import */ var _fa__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./fa */ "./src/locale/fa.ts");
  115629. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fa", function() { return _fa__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  115630. /* harmony import */ var _fr__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fr */ "./src/locale/fr.ts");
  115631. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fr", function() { return _fr__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  115632. /* harmony import */ var _hr__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./hr */ "./src/locale/hr.ts");
  115633. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hr", function() { return _hr__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  115634. /* harmony import */ var _hu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./hu */ "./src/locale/hu.ts");
  115635. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hu", function() { return _hu__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  115636. /* harmony import */ var _he__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./he */ "./src/locale/he.ts");
  115637. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "he", function() { return _he__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  115638. /* harmony import */ var _id__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./id */ "./src/locale/id.ts");
  115639. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "id", function() { return _id__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  115640. /* harmony import */ var _it__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./it */ "./src/locale/it.ts");
  115641. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "it", function() { return _it__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  115642. /* harmony import */ var _ja__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./ja */ "./src/locale/ja.ts");
  115643. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ja", function() { return _ja__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  115644. /* harmony import */ var _ko__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./ko */ "./src/locale/ko.ts");
  115645. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ko", function() { return _ko__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  115646. /* harmony import */ var _lv__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./lv */ "./src/locale/lv.ts");
  115647. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lv", function() { return _lv__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  115648. /* harmony import */ var _lt__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./lt */ "./src/locale/lt.ts");
  115649. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lt", function() { return _lt__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  115650. /* harmony import */ var _nl__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./nl */ "./src/locale/nl.ts");
  115651. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nl", function() { return _nl__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  115652. /* harmony import */ var _no__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./no */ "./src/locale/no.ts");
  115653. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "no", function() { return _no__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  115654. /* harmony import */ var _pl__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./pl */ "./src/locale/pl.ts");
  115655. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pl", function() { return _pl__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  115656. /* harmony import */ var _pt__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./pt */ "./src/locale/pt.ts");
  115657. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pt", function() { return _pt__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  115658. /* harmony import */ var _ro__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./ro */ "./src/locale/ro.ts");
  115659. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ro", function() { return _ro__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  115660. /* harmony import */ var _ru__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./ru */ "./src/locale/ru.ts");
  115661. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ru", function() { return _ru__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  115662. /* harmony import */ var _sl__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./sl */ "./src/locale/sl.ts");
  115663. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sl", function() { return _sl__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  115664. /* harmony import */ var _sr_Cyrl__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sr-Cyrl */ "./src/locale/sr-Cyrl.ts");
  115665. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "srCyrl", function() { return _sr_Cyrl__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  115666. /* harmony import */ var _sv__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./sv */ "./src/locale/sv.ts");
  115667. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sv", function() { return _sv__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  115668. /* harmony import */ var _th__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./th */ "./src/locale/th.ts");
  115669. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "th", function() { return _th__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  115670. /* harmony import */ var _tr__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./tr */ "./src/locale/tr.ts");
  115671. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tr", function() { return _tr__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  115672. /* harmony import */ var _uk__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./uk */ "./src/locale/uk.ts");
  115673. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uk", function() { return _uk__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  115674. /* harmony import */ var _zh_Hans__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./zh-Hans */ "./src/locale/zh-Hans.ts");
  115675. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zhHans", function() { return _zh_Hans__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  115676. /* harmony import */ var _zh_Hant__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./zh-Hant */ "./src/locale/zh-Hant.ts");
  115677. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zhHant", function() { return _zh_Hant__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  115678. /***/ }),
  115679. /***/ "./src/locale/it.ts":
  115680. /*!**************************!*\
  115681. !*** ./src/locale/it.ts ***!
  115682. \**************************/
  115683. /*! exports provided: default */
  115684. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115685. "use strict";
  115686. __webpack_require__.r(__webpack_exports__);
  115687. /* harmony default export */ __webpack_exports__["default"] = ({
  115688. badge: 'Distintivo',
  115689. close: 'Chiudi',
  115690. dataIterator: {
  115691. noResultsText: 'Nessun risultato trovato',
  115692. loadingText: 'Caricamento in corso...'
  115693. },
  115694. dataTable: {
  115695. itemsPerPageText: 'Righe per pagina:',
  115696. ariaLabel: {
  115697. sortDescending: 'Ordinati in ordine decrescente.',
  115698. sortAscending: 'Ordinati in ordine crescente.',
  115699. sortNone: 'Non ordinato.',
  115700. activateNone: 'Attiva per rimuovere l\'ordinamento.',
  115701. activateDescending: 'Attiva per ordinare in ordine decrescente.',
  115702. activateAscending: 'Attiva per ordinare in ordine crescente.'
  115703. },
  115704. sortBy: 'Ordina per'
  115705. },
  115706. dataFooter: {
  115707. itemsPerPageText: 'Elementi per pagina:',
  115708. itemsPerPageAll: 'Tutti',
  115709. nextPage: 'Pagina seguente',
  115710. prevPage: 'Pagina precedente',
  115711. firstPage: 'Pagina prima',
  115712. lastPage: 'Pagina ultima',
  115713. pageText: '{0}-{1} di {2}'
  115714. },
  115715. datePicker: {
  115716. itemsSelected: '{0} selezionati'
  115717. },
  115718. noDataText: 'Nessun elemento disponibile',
  115719. carousel: {
  115720. prev: 'Vista precedente',
  115721. next: 'Prossima vista',
  115722. ariaLabel: {
  115723. delimiter: 'Carousel slide {0} of {1}'
  115724. }
  115725. },
  115726. calendar: {
  115727. moreEvents: '{0} di più'
  115728. },
  115729. fileInput: {
  115730. counter: '{0} files',
  115731. counterSize: '{0} files ({1} in totale)'
  115732. },
  115733. timePicker: {
  115734. am: 'AM',
  115735. pm: 'PM'
  115736. }
  115737. });
  115738. /***/ }),
  115739. /***/ "./src/locale/ja.ts":
  115740. /*!**************************!*\
  115741. !*** ./src/locale/ja.ts ***!
  115742. \**************************/
  115743. /*! exports provided: default */
  115744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115745. "use strict";
  115746. __webpack_require__.r(__webpack_exports__);
  115747. /* harmony default export */ __webpack_exports__["default"] = ({
  115748. badge: 'バッジ',
  115749. close: '閉じる',
  115750. dataIterator: {
  115751. noResultsText: '検索結果が見つかりません。',
  115752. loadingText: '項目をロード中です...'
  115753. },
  115754. dataTable: {
  115755. itemsPerPageText: '1ページあたりの行数:',
  115756. ariaLabel: {
  115757. sortDescending: '降順の並び替え。',
  115758. sortAscending: '昇順の並び替え。',
  115759. sortNone: 'ソートされていません。',
  115760. activateNone: 'ソートを削除するには有効にしてください。',
  115761. activateDescending: '降順の並び替えのためには有効にしてください。',
  115762. activateAscending: '昇順のソートのためには有効にしてください。'
  115763. },
  115764. sortBy: 'ソート方式'
  115765. },
  115766. dataFooter: {
  115767. itemsPerPageText: '1ページあたりの件数:',
  115768. itemsPerPageAll: 'すべて',
  115769. nextPage: '次のページ',
  115770. prevPage: '前のページ',
  115771. firstPage: '一ページ目',
  115772. lastPage: '最後のページ',
  115773. pageText: '{0}-{1} 件目 / {2}件'
  115774. },
  115775. datePicker: {
  115776. itemsSelected: '{0}日付選択'
  115777. },
  115778. noDataText: 'データはありません。',
  115779. carousel: {
  115780. prev: '前のビジュアル',
  115781. next: '次のビジュアル',
  115782. ariaLabel: {
  115783. delimiter: 'Carousel slide {0} of {1}'
  115784. }
  115785. },
  115786. calendar: {
  115787. moreEvents: 'さらに{0}'
  115788. },
  115789. fileInput: {
  115790. counter: '{0} ファイル',
  115791. counterSize: '{0} ファイル (合計 {1})'
  115792. },
  115793. timePicker: {
  115794. am: 'AM',
  115795. pm: 'PM'
  115796. }
  115797. });
  115798. /***/ }),
  115799. /***/ "./src/locale/ko.ts":
  115800. /*!**************************!*\
  115801. !*** ./src/locale/ko.ts ***!
  115802. \**************************/
  115803. /*! exports provided: default */
  115804. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115805. "use strict";
  115806. __webpack_require__.r(__webpack_exports__);
  115807. /* harmony default export */ __webpack_exports__["default"] = ({
  115808. badge: '배지',
  115809. close: '닫기',
  115810. dataIterator: {
  115811. noResultsText: '일치하는 항목이 없습니다.',
  115812. loadingText: '불러오는 중...'
  115813. },
  115814. dataTable: {
  115815. itemsPerPageText: '페이지 당 행 수:',
  115816. ariaLabel: {
  115817. sortDescending: '내림차순 정렬.',
  115818. sortAscending: '오름차순 정렬.',
  115819. sortNone: '정렬하지 않음.',
  115820. activateNone: '정렬을 취소하려면 활성화하세요.',
  115821. activateDescending: '내림차순 정렬을 위해 활성화하세요.',
  115822. activateAscending: '오름차순 정렬을 위해 활성화하세요.'
  115823. },
  115824. sortBy: 'Sort by'
  115825. },
  115826. dataFooter: {
  115827. itemsPerPageText: '페이지 당 항목 수:',
  115828. itemsPerPageAll: '전체',
  115829. nextPage: '다음 페이지',
  115830. prevPage: '이전 페이지',
  115831. firstPage: '첫 페이지',
  115832. lastPage: '마지막 페이지',
  115833. pageText: '{2} 중 {0}-{1}'
  115834. },
  115835. datePicker: {
  115836. itemsSelected: '{0} 선택됨'
  115837. },
  115838. noDataText: '데이터가 없습니다.',
  115839. carousel: {
  115840. prev: '이전 화면',
  115841. next: '다음 화면',
  115842. ariaLabel: {
  115843. delimiter: 'Carousel slide {0} of {1}'
  115844. }
  115845. },
  115846. calendar: {
  115847. moreEvents: '{0} 더보기'
  115848. },
  115849. fileInput: {
  115850. counter: '{0} files',
  115851. counterSize: '{0} files ({1} in total)'
  115852. },
  115853. timePicker: {
  115854. am: '오전',
  115855. pm: '오후'
  115856. }
  115857. });
  115858. /***/ }),
  115859. /***/ "./src/locale/lt.ts":
  115860. /*!**************************!*\
  115861. !*** ./src/locale/lt.ts ***!
  115862. \**************************/
  115863. /*! exports provided: default */
  115864. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115865. "use strict";
  115866. __webpack_require__.r(__webpack_exports__);
  115867. /* harmony default export */ __webpack_exports__["default"] = ({
  115868. badge: 'Ženklelis',
  115869. close: 'Uždaryti',
  115870. dataIterator: {
  115871. noResultsText: 'Nerasta atitinkančių įrašų',
  115872. loadingText: 'Kraunama...'
  115873. },
  115874. dataTable: {
  115875. itemsPerPageText: 'Eilutės per puslapį:',
  115876. ariaLabel: {
  115877. sortDescending: 'Išrikiuota mažėjimo tvarka.',
  115878. sortAscending: 'Išrikiuota didėjimo tvarka.',
  115879. sortNone: 'Nerikiuota.',
  115880. activateNone: 'Suaktyvinkite, jei norite rikiavimą pašalinti.',
  115881. activateDescending: 'Suaktyvinkite, jei norite rikiuoti mažėjimo tvarka.',
  115882. activateAscending: 'Suaktyvinkite, jei norite rikiuoti didėjimo tvarka.'
  115883. },
  115884. sortBy: 'Sort by'
  115885. },
  115886. dataFooter: {
  115887. itemsPerPageText: 'Įrašai per puslapį:',
  115888. itemsPerPageAll: 'Visi',
  115889. nextPage: 'Kitas puslapis',
  115890. prevPage: 'Ankstesnis puslapis',
  115891. firstPage: 'Pirmas puslapis',
  115892. lastPage: 'Paskutinis puslapis',
  115893. pageText: '{0}-{1} iš {2}'
  115894. },
  115895. datePicker: {
  115896. itemsSelected: '{0} pasirinkta'
  115897. },
  115898. noDataText: 'Nėra duomenų',
  115899. carousel: {
  115900. prev: 'Ankstesnioji skaidrė',
  115901. next: 'Kita skaidrė',
  115902. ariaLabel: {
  115903. delimiter: 'Carousel slide {0} of {1}'
  115904. }
  115905. },
  115906. calendar: {
  115907. moreEvents: 'Daugiau {0}'
  115908. },
  115909. fileInput: {
  115910. counter: '{0} failų',
  115911. counterSize: '{0} failų ({1} iš viso)'
  115912. },
  115913. timePicker: {
  115914. am: 'AM',
  115915. pm: 'PM'
  115916. }
  115917. });
  115918. /***/ }),
  115919. /***/ "./src/locale/lv.ts":
  115920. /*!**************************!*\
  115921. !*** ./src/locale/lv.ts ***!
  115922. \**************************/
  115923. /*! exports provided: default */
  115924. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115925. "use strict";
  115926. __webpack_require__.r(__webpack_exports__);
  115927. /* harmony default export */ __webpack_exports__["default"] = ({
  115928. badge: 'Žetons',
  115929. close: 'Aizvērt',
  115930. dataIterator: {
  115931. noResultsText: 'Nekas netika atrasts',
  115932. loadingText: 'Ielādē...'
  115933. },
  115934. dataTable: {
  115935. itemsPerPageText: 'Rādīt lapā:',
  115936. ariaLabel: {
  115937. sortDescending: 'Sakārtots dilstošā secībā.',
  115938. sortAscending: 'Sakārtots augošā secībā.',
  115939. sortNone: 'Nav sakārtots.',
  115940. activateNone: 'Aktivizēt, lai noņemtu kārtošanu.',
  115941. activateDescending: 'Aktivizēt, lai sakārtotu dilstošā secībā.',
  115942. activateAscending: 'Aktivizēt, lai sakārtotu augošā secībā.'
  115943. },
  115944. sortBy: 'Sort by'
  115945. },
  115946. dataFooter: {
  115947. itemsPerPageText: 'Rādīt lapā:',
  115948. itemsPerPageAll: 'Visu',
  115949. nextPage: 'Nākamā lapa',
  115950. prevPage: 'Iepriekšējā lapa',
  115951. firstPage: 'Pirmā lapa',
  115952. lastPage: 'Pēdējā lapa',
  115953. pageText: '{0}-{1} no {2}'
  115954. },
  115955. datePicker: {
  115956. itemsSelected: '{0} izvēlēts'
  115957. },
  115958. noDataText: 'Nav pieejamu datu',
  115959. carousel: {
  115960. prev: 'Iepriekšējais slaids',
  115961. next: 'Nākamais slaids',
  115962. ariaLabel: {
  115963. delimiter: 'Carousel slide {0} of {1}'
  115964. }
  115965. },
  115966. calendar: {
  115967. moreEvents: 'Vēl {0}'
  115968. },
  115969. fileInput: {
  115970. counter: '{0} files',
  115971. counterSize: '{0} files ({1} in total)'
  115972. },
  115973. timePicker: {
  115974. am: 'AM',
  115975. pm: 'PM'
  115976. }
  115977. });
  115978. /***/ }),
  115979. /***/ "./src/locale/nl.ts":
  115980. /*!**************************!*\
  115981. !*** ./src/locale/nl.ts ***!
  115982. \**************************/
  115983. /*! exports provided: default */
  115984. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115985. "use strict";
  115986. __webpack_require__.r(__webpack_exports__);
  115987. /* harmony default export */ __webpack_exports__["default"] = ({
  115988. badge: 'insigne',
  115989. close: 'Sluiten',
  115990. dataIterator: {
  115991. noResultsText: 'Geen overeenkomende resultaten gevonden',
  115992. loadingText: 'Items aan het laden...'
  115993. },
  115994. dataTable: {
  115995. itemsPerPageText: 'Rijen per pagina:',
  115996. ariaLabel: {
  115997. sortDescending: 'Aflopend gesorteerd.',
  115998. sortAscending: 'Oplopend gesorteerd.',
  115999. sortNone: 'Niet gesorterrd.',
  116000. activateNone: 'Activeer om de sortering te verwijderen.',
  116001. activateDescending: 'Activeer om aflopend te sorteren.',
  116002. activateAscending: 'Activeer om oplopend te sorteren.'
  116003. },
  116004. sortBy: 'Sorteer volgens'
  116005. },
  116006. dataFooter: {
  116007. itemsPerPageText: 'Aantal per pagina:',
  116008. itemsPerPageAll: 'Alles',
  116009. nextPage: 'Volgende pagina',
  116010. prevPage: 'Vorige pagina',
  116011. firstPage: 'Eerste pagina',
  116012. lastPage: 'Laatste pagina',
  116013. pageText: '{0}-{1} van {2}'
  116014. },
  116015. datePicker: {
  116016. itemsSelected: '{0} geselecteerd'
  116017. },
  116018. noDataText: 'Geen gegevens beschikbaar',
  116019. carousel: {
  116020. prev: 'Vorig beeld',
  116021. next: 'Volgend beeld',
  116022. ariaLabel: {
  116023. delimiter: 'Carousel slide {0} of {1}'
  116024. }
  116025. },
  116026. calendar: {
  116027. moreEvents: '{0} meer'
  116028. },
  116029. fileInput: {
  116030. counter: '{0} bestanden',
  116031. counterSize: '{0} bestanden ({1} in totaal)'
  116032. },
  116033. timePicker: {
  116034. am: 'AM',
  116035. pm: 'PM'
  116036. }
  116037. });
  116038. /***/ }),
  116039. /***/ "./src/locale/no.ts":
  116040. /*!**************************!*\
  116041. !*** ./src/locale/no.ts ***!
  116042. \**************************/
  116043. /*! exports provided: default */
  116044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116045. "use strict";
  116046. __webpack_require__.r(__webpack_exports__);
  116047. /* harmony default export */ __webpack_exports__["default"] = ({
  116048. badge: 'Skilt',
  116049. close: 'Lukk',
  116050. dataIterator: {
  116051. noResultsText: 'Fant ingen matchende elementer.',
  116052. loadingText: 'Laster elementer...'
  116053. },
  116054. dataTable: {
  116055. itemsPerPageText: 'Rader per side:',
  116056. ariaLabel: {
  116057. sortDescending: 'Sortert synkende.',
  116058. sortAscending: 'Sortert stigende.',
  116059. sortNone: 'Ikke sortert.',
  116060. activateNone: 'Aktiver for å fjerne sortering.',
  116061. activateDescending: 'Aktiver for å sortere synkende.',
  116062. activateAscending: 'Aktiver for å sortere stigende.'
  116063. },
  116064. sortBy: 'Sorter etter'
  116065. },
  116066. dataFooter: {
  116067. itemsPerPageText: 'Elementer per side:',
  116068. itemsPerPageAll: 'Alle',
  116069. nextPage: 'Neste side',
  116070. prevPage: 'Forrige side',
  116071. firstPage: 'Første side',
  116072. lastPage: 'Siste side',
  116073. pageText: '{0}-{1} av {2}'
  116074. },
  116075. datePicker: {
  116076. itemsSelected: '{0} valgt'
  116077. },
  116078. noDataText: 'Ingen data er tilgjengelig',
  116079. carousel: {
  116080. prev: 'Forrige bilde',
  116081. next: 'Neste bilde',
  116082. ariaLabel: {
  116083. delimiter: 'Karusellbilde {0} av {1}'
  116084. }
  116085. },
  116086. calendar: {
  116087. moreEvents: '{0} flere'
  116088. },
  116089. fileInput: {
  116090. counter: '{0} filer',
  116091. counterSize: '{0} filer ({1} totalt)'
  116092. },
  116093. timePicker: {
  116094. am: 'AM',
  116095. pm: 'PM'
  116096. }
  116097. });
  116098. /***/ }),
  116099. /***/ "./src/locale/pl.ts":
  116100. /*!**************************!*\
  116101. !*** ./src/locale/pl.ts ***!
  116102. \**************************/
  116103. /*! exports provided: default */
  116104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116105. "use strict";
  116106. __webpack_require__.r(__webpack_exports__);
  116107. /* harmony default export */ __webpack_exports__["default"] = ({
  116108. badge: 'Odznaka',
  116109. close: 'Zamknij',
  116110. dataIterator: {
  116111. noResultsText: 'Nie znaleziono danych odpowiadających wyszukiwaniu',
  116112. loadingText: 'Wczytywanie danych...'
  116113. },
  116114. dataTable: {
  116115. itemsPerPageText: 'Wierszy na stronie:',
  116116. ariaLabel: {
  116117. sortDescending: 'Sortowanie malejąco. Kliknij aby zmienić.',
  116118. sortAscending: 'Sortowanie rosnąco. Kliknij aby zmienić.',
  116119. sortNone: 'Bez sortowania. Kliknij aby posortować rosnąco.',
  116120. activateNone: 'Kliknij aby usunąć sortowanie.',
  116121. activateDescending: 'Kliknij aby posortować malejąco.',
  116122. activateAscending: 'Kliknij aby posortować rosnąco.'
  116123. },
  116124. sortBy: 'Sortuj według'
  116125. },
  116126. dataFooter: {
  116127. itemsPerPageText: 'Pozycji na stronie:',
  116128. itemsPerPageAll: 'Wszystkie',
  116129. nextPage: 'Nastęna strona',
  116130. prevPage: 'Poprzednia strona',
  116131. firstPage: 'Pierwsza strona',
  116132. lastPage: 'Ostatnia strona',
  116133. pageText: '{0}-{1} z {2}'
  116134. },
  116135. datePicker: {
  116136. itemsSelected: '{0} dat(y)'
  116137. },
  116138. noDataText: 'Brak danych',
  116139. carousel: {
  116140. prev: 'Poprzedni obraz',
  116141. next: 'Następny obraz',
  116142. ariaLabel: {
  116143. delimiter: 'Carousel slide {0} of {1}'
  116144. }
  116145. },
  116146. calendar: {
  116147. moreEvents: '{0} więcej'
  116148. },
  116149. fileInput: {
  116150. counter: 'Liczba plików: {0}',
  116151. counterSize: 'Liczba plików: {0} (łącznie {1})'
  116152. },
  116153. timePicker: {
  116154. am: 'AM',
  116155. pm: 'PM'
  116156. }
  116157. });
  116158. /***/ }),
  116159. /***/ "./src/locale/pt.ts":
  116160. /*!**************************!*\
  116161. !*** ./src/locale/pt.ts ***!
  116162. \**************************/
  116163. /*! exports provided: default */
  116164. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116165. "use strict";
  116166. __webpack_require__.r(__webpack_exports__);
  116167. /* harmony default export */ __webpack_exports__["default"] = ({
  116168. badge: 'Distintivo',
  116169. close: 'Fechar',
  116170. dataIterator: {
  116171. noResultsText: 'Nenhum dado encontrado',
  116172. loadingText: 'Carregando itens...'
  116173. },
  116174. dataTable: {
  116175. itemsPerPageText: 'Linhas por página:',
  116176. ariaLabel: {
  116177. sortDescending: 'Ordenado decrescente.',
  116178. sortAscending: 'Ordenado crescente.',
  116179. sortNone: 'Não ordenado.',
  116180. activateNone: 'Ative para remover a ordenação.',
  116181. activateDescending: 'Ative para ordenar decrescente.',
  116182. activateAscending: 'Ative para ordenar crescente.'
  116183. },
  116184. sortBy: 'Ordenar por'
  116185. },
  116186. dataFooter: {
  116187. itemsPerPageText: 'Itens por página:',
  116188. itemsPerPageAll: 'Todos',
  116189. nextPage: 'Próxima página',
  116190. prevPage: 'Página anterior',
  116191. firstPage: 'Primeira página',
  116192. lastPage: 'Última página',
  116193. pageText: '{0}-{1} de {2}'
  116194. },
  116195. datePicker: {
  116196. itemsSelected: '{0} selecionado(s)'
  116197. },
  116198. noDataText: 'Não há dados disponíveis',
  116199. carousel: {
  116200. prev: 'Visão anterior',
  116201. next: 'Próxima visão',
  116202. ariaLabel: {
  116203. delimiter: 'Slide {0} de {1} do carrossel'
  116204. }
  116205. },
  116206. calendar: {
  116207. moreEvents: 'Mais {0}'
  116208. },
  116209. fileInput: {
  116210. counter: '{0} arquivo(s)',
  116211. counterSize: '{0} arquivo(s) ({1} no total)'
  116212. },
  116213. timePicker: {
  116214. am: 'AM',
  116215. pm: 'PM'
  116216. }
  116217. });
  116218. /***/ }),
  116219. /***/ "./src/locale/ro.ts":
  116220. /*!**************************!*\
  116221. !*** ./src/locale/ro.ts ***!
  116222. \**************************/
  116223. /*! exports provided: default */
  116224. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116225. "use strict";
  116226. __webpack_require__.r(__webpack_exports__);
  116227. /* harmony default export */ __webpack_exports__["default"] = ({
  116228. badge: 'Insignă',
  116229. close: 'Close',
  116230. dataIterator: {
  116231. noResultsText: 'Nu au fost găsite înregistrări care să se potrivească',
  116232. loadingText: 'Loading item...'
  116233. },
  116234. dataTable: {
  116235. itemsPerPageText: 'Rânduri pe pagină:',
  116236. ariaLabel: {
  116237. sortDescending: 'Sorted descending.',
  116238. sortAscending: 'Sorted ascending.',
  116239. sortNone: 'Not sorted.',
  116240. activateNone: 'Activate to remove sorting.',
  116241. activateDescending: 'Activate to sort descending.',
  116242. activateAscending: 'Activate to sort ascending.'
  116243. },
  116244. sortBy: 'Sort by'
  116245. },
  116246. dataFooter: {
  116247. itemsPerPageText: 'Articole pe pagină:',
  116248. itemsPerPageAll: 'Toate',
  116249. nextPage: 'Pagina următoare',
  116250. prevPage: 'Pagina anterioară',
  116251. firstPage: 'Pagina prima',
  116252. lastPage: 'Pagina ultima',
  116253. pageText: '{0}-{1} din {2}'
  116254. },
  116255. datePicker: {
  116256. itemsSelected: '{0} selectate'
  116257. },
  116258. noDataText: 'Nu există date disponibile',
  116259. carousel: {
  116260. prev: 'Anterior vizual',
  116261. next: 'Următorul vizual',
  116262. ariaLabel: {
  116263. delimiter: 'Carousel slide {0} of {1}'
  116264. }
  116265. },
  116266. calendar: {
  116267. moreEvents: '{0} mai mult'
  116268. },
  116269. fileInput: {
  116270. counter: '{0} files',
  116271. counterSize: '{0} files ({1} in total)'
  116272. },
  116273. timePicker: {
  116274. am: 'AM',
  116275. pm: 'PM'
  116276. }
  116277. });
  116278. /***/ }),
  116279. /***/ "./src/locale/ru.ts":
  116280. /*!**************************!*\
  116281. !*** ./src/locale/ru.ts ***!
  116282. \**************************/
  116283. /*! exports provided: default */
  116284. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116285. "use strict";
  116286. __webpack_require__.r(__webpack_exports__);
  116287. /* harmony default export */ __webpack_exports__["default"] = ({
  116288. badge: 'знак',
  116289. close: 'Закрыть',
  116290. dataIterator: {
  116291. noResultsText: 'Не найдено подходящих записей',
  116292. loadingText: 'Запись загружается...'
  116293. },
  116294. dataTable: {
  116295. itemsPerPageText: 'Строк на странице:',
  116296. ariaLabel: {
  116297. sortDescending: 'Упорядочено по убыванию.',
  116298. sortAscending: 'Упорядочено по возрастанию.',
  116299. sortNone: 'Не упорядочено.',
  116300. activateNone: 'Активируйте, чтобы убрать сортировку.',
  116301. activateDescending: 'Активируйте для упорядочивания убыванию.',
  116302. activateAscending: 'Активируйте для упорядочивания по возрастанию.'
  116303. },
  116304. sortBy: 'Сортировать по'
  116305. },
  116306. dataFooter: {
  116307. itemsPerPageText: 'Записей на странице:',
  116308. itemsPerPageAll: 'Все',
  116309. nextPage: 'Следующая страница',
  116310. prevPage: 'Предыдущая страница',
  116311. firstPage: 'Первая страница',
  116312. lastPage: 'Последняя страница',
  116313. pageText: '{0}-{1} из {2}'
  116314. },
  116315. datePicker: {
  116316. itemsSelected: '{0} выбран'
  116317. },
  116318. noDataText: 'Отсутствуют данные',
  116319. carousel: {
  116320. prev: 'Предыдущий слайд',
  116321. next: 'Следующий слайд',
  116322. ariaLabel: {
  116323. delimiter: 'Слайд {0} из {1}'
  116324. }
  116325. },
  116326. calendar: {
  116327. moreEvents: 'Еще {0}'
  116328. },
  116329. fileInput: {
  116330. counter: 'Файлов: {0}',
  116331. counterSize: 'Файлов: {0} (всего {1})'
  116332. },
  116333. timePicker: {
  116334. am: 'AM',
  116335. pm: 'PM'
  116336. }
  116337. });
  116338. /***/ }),
  116339. /***/ "./src/locale/sl.ts":
  116340. /*!**************************!*\
  116341. !*** ./src/locale/sl.ts ***!
  116342. \**************************/
  116343. /*! exports provided: default */
  116344. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116345. "use strict";
  116346. __webpack_require__.r(__webpack_exports__);
  116347. /* harmony default export */ __webpack_exports__["default"] = ({
  116348. badge: 'Značka',
  116349. close: 'Zapri',
  116350. dataIterator: {
  116351. noResultsText: 'Ni iskanega zapisa',
  116352. loadingText: 'Nalaganje...'
  116353. },
  116354. dataTable: {
  116355. itemsPerPageText: 'Vrstic na stran:',
  116356. ariaLabel: {
  116357. sortDescending: 'Razvrščeno padajoče.',
  116358. sortAscending: 'Razvrščeno naraščajoče.',
  116359. sortNone: 'Ni razvrščeno.',
  116360. activateNone: 'Aktivirajte za odstranitev razvrščanja.',
  116361. activateDescending: 'Aktivirajte za padajoče razvrščanje.',
  116362. activateAscending: 'Aktivirajte za naraščajoče razvrščanje.'
  116363. },
  116364. sortBy: 'Razvrsti po'
  116365. },
  116366. dataFooter: {
  116367. itemsPerPageText: 'Predmetov na stran:',
  116368. itemsPerPageAll: 'Vse',
  116369. nextPage: 'Naslednja stran',
  116370. prevPage: 'Prejšnja stran',
  116371. firstPage: 'Prva stran',
  116372. lastPage: 'Zadnja stran',
  116373. pageText: '{0}-{1} od {2}'
  116374. },
  116375. datePicker: {
  116376. itemsSelected: '{0} izbrano/-ih'
  116377. },
  116378. noDataText: 'Ni podatkov',
  116379. carousel: {
  116380. prev: 'Prejšnji prikaz',
  116381. next: 'Naslednji prikaz',
  116382. ariaLabel: {
  116383. delimiter: 'Carousel slide {0} of {1}'
  116384. }
  116385. },
  116386. calendar: {
  116387. moreEvents: 'Še {0}'
  116388. },
  116389. fileInput: {
  116390. counter: '{0} datotek',
  116391. counterSize: '{0} datotek ({1} skupno)'
  116392. },
  116393. timePicker: {
  116394. am: 'AM',
  116395. pm: 'PM'
  116396. }
  116397. });
  116398. /***/ }),
  116399. /***/ "./src/locale/sr-Cyrl.ts":
  116400. /*!*******************************!*\
  116401. !*** ./src/locale/sr-Cyrl.ts ***!
  116402. \*******************************/
  116403. /*! exports provided: default */
  116404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116405. "use strict";
  116406. __webpack_require__.r(__webpack_exports__);
  116407. /* harmony default export */ __webpack_exports__["default"] = ({
  116408. badge: 'Значка',
  116409. close: 'Close',
  116410. dataIterator: {
  116411. noResultsText: 'Ни један запис није пронађен',
  116412. loadingText: 'Loading item...'
  116413. },
  116414. dataTable: {
  116415. itemsPerPageText: 'Редова по страници:',
  116416. ariaLabel: {
  116417. sortDescending: 'Sorted descending.',
  116418. sortAscending: 'Sorted ascending.',
  116419. sortNone: 'Not sorted.',
  116420. activateNone: 'Activate to remove sorting.',
  116421. activateDescending: 'Activate to sort descending.',
  116422. activateAscending: 'Activate to sort ascending.'
  116423. },
  116424. sortBy: 'Sort by'
  116425. },
  116426. dataFooter: {
  116427. itemsPerPageText: 'Ставки по страници:',
  116428. itemsPerPageAll: 'Све',
  116429. nextPage: 'Следећа страница',
  116430. prevPage: 'Претходна страница',
  116431. firstPage: 'Прва страница',
  116432. lastPage: 'Последња страница',
  116433. pageText: '{0}-{1} од {2}'
  116434. },
  116435. datePicker: {
  116436. itemsSelected: '{0} одабрано'
  116437. },
  116438. noDataText: 'Нема доступних података',
  116439. carousel: {
  116440. prev: 'Превиоус висуал',
  116441. next: 'Нект висуал',
  116442. ariaLabel: {
  116443. delimiter: 'Carousel slide {0} of {1}'
  116444. }
  116445. },
  116446. calendar: {
  116447. moreEvents: '{0} море'
  116448. },
  116449. fileInput: {
  116450. counter: '{0} files',
  116451. counterSize: '{0} files ({1} in total)'
  116452. },
  116453. timePicker: {
  116454. am: 'AM',
  116455. pm: 'PM'
  116456. }
  116457. });
  116458. /***/ }),
  116459. /***/ "./src/locale/sv.ts":
  116460. /*!**************************!*\
  116461. !*** ./src/locale/sv.ts ***!
  116462. \**************************/
  116463. /*! exports provided: default */
  116464. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116465. "use strict";
  116466. __webpack_require__.r(__webpack_exports__);
  116467. /* harmony default export */ __webpack_exports__["default"] = ({
  116468. badge: 'Bricka',
  116469. close: 'Stäng',
  116470. dataIterator: {
  116471. noResultsText: 'Inga poster funna',
  116472. loadingText: 'Laddar data...'
  116473. },
  116474. dataTable: {
  116475. itemsPerPageText: 'Rader per sida:',
  116476. ariaLabel: {
  116477. sortDescending: 'Sorterat fallande.',
  116478. sortAscending: 'Sorterat stigande.',
  116479. sortNone: 'Osorterat.',
  116480. activateNone: 'Aktivera för att ta bort sortering.',
  116481. activateDescending: 'Aktivera för sortering fallande.',
  116482. activateAscending: 'Aktivera för sortering stigande.'
  116483. },
  116484. sortBy: 'Sortera efter'
  116485. },
  116486. dataFooter: {
  116487. itemsPerPageText: 'Objekt per sida:',
  116488. itemsPerPageAll: 'Alla',
  116489. nextPage: 'Nästa sida',
  116490. prevPage: 'Föregående sida',
  116491. firstPage: 'Första sidan',
  116492. lastPage: 'Sista sidan',
  116493. pageText: '{0}-{1} av {2}'
  116494. },
  116495. datePicker: {
  116496. itemsSelected: '{0} markerade'
  116497. },
  116498. noDataText: 'Ingen data tillgänglig',
  116499. carousel: {
  116500. prev: 'Föregående vy',
  116501. next: 'Nästa vy',
  116502. ariaLabel: {
  116503. delimiter: 'Carousel slide {0} of {1}'
  116504. }
  116505. },
  116506. calendar: {
  116507. moreEvents: '{0} fler'
  116508. },
  116509. fileInput: {
  116510. counter: '{0} filer',
  116511. counterSize: '{0} filer (av {1} totalt)'
  116512. },
  116513. timePicker: {
  116514. am: 'AM',
  116515. pm: 'PM'
  116516. }
  116517. });
  116518. /***/ }),
  116519. /***/ "./src/locale/th.ts":
  116520. /*!**************************!*\
  116521. !*** ./src/locale/th.ts ***!
  116522. \**************************/
  116523. /*! exports provided: default */
  116524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116525. "use strict";
  116526. __webpack_require__.r(__webpack_exports__);
  116527. /* harmony default export */ __webpack_exports__["default"] = ({
  116528. badge: 'สัญลักษณ์',
  116529. close: 'ปิด',
  116530. dataIterator: {
  116531. noResultsText: 'ไม่พบข้อมูลที่ค้นหา',
  116532. loadingText: 'กำลังโหลดข้อมูล... กรุณารอสักครู่'
  116533. },
  116534. dataTable: {
  116535. itemsPerPageText: 'แถวต่อหน้า:',
  116536. ariaLabel: {
  116537. sortDescending: 'เรียงลำดับจากมากไปน้อย กดเพื่อปิดการเรียงลำดับ',
  116538. sortAscending: 'เรียงจากน้อยไปมาก กดเพื่อเรียงลำดับจากมากไปน้อย',
  116539. sortNone: 'ไม่ได้จัดเรียง กดเพื่อเรียงลำดับจากน้อยไปมาก',
  116540. activateNone: 'Activate to remove sorting.',
  116541. activateDescending: 'Activate to sort descending.',
  116542. activateAscending: 'Activate to sort ascending.'
  116543. },
  116544. sortBy: 'จัดเรียงตาม'
  116545. },
  116546. dataFooter: {
  116547. itemsPerPageText: 'รายการต่อหน้า:',
  116548. itemsPerPageAll: 'ทั้งหมด',
  116549. nextPage: 'หน้าต่อไป',
  116550. prevPage: 'หน้าที่แล้ว',
  116551. firstPage: 'หน้าแรก',
  116552. lastPage: 'หน้าสุดท้าย',
  116553. pageText: '{0}-{1} จาก {2}'
  116554. },
  116555. datePicker: {
  116556. itemsSelected: 'เลือก {0} วัน'
  116557. },
  116558. noDataText: 'ไม่มีข้อมูล',
  116559. carousel: {
  116560. prev: 'ภาพก่อนหน้า',
  116561. next: 'ภาพต่อไป',
  116562. ariaLabel: {
  116563. delimiter: 'Carousel slide {0} of {1}'
  116564. }
  116565. },
  116566. calendar: {
  116567. moreEvents: 'อีก {0}'
  116568. },
  116569. fileInput: {
  116570. counter: '{0} ไฟล์',
  116571. counterSize: '{0} ไฟล์ (รวม {1})'
  116572. },
  116573. timePicker: {
  116574. am: 'AM',
  116575. pm: 'PM'
  116576. }
  116577. });
  116578. /***/ }),
  116579. /***/ "./src/locale/tr.ts":
  116580. /*!**************************!*\
  116581. !*** ./src/locale/tr.ts ***!
  116582. \**************************/
  116583. /*! exports provided: default */
  116584. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116585. "use strict";
  116586. __webpack_require__.r(__webpack_exports__);
  116587. /* harmony default export */ __webpack_exports__["default"] = ({
  116588. badge: 'rozet',
  116589. close: 'Kapat',
  116590. dataIterator: {
  116591. noResultsText: 'Eşleşen veri bulunamadı',
  116592. loadingText: 'Yükleniyor... Lütfen bekleyin.'
  116593. },
  116594. dataTable: {
  116595. itemsPerPageText: 'Sayfa başına satır:',
  116596. ariaLabel: {
  116597. sortDescending: 'Z den A ya sıralı.',
  116598. sortAscending: 'A dan Z ye sıralı.',
  116599. sortNone: 'Sıralı değil. ',
  116600. activateNone: 'Sıralamayı kaldırmak için etkinleştir.',
  116601. activateDescending: 'Z den A ya sıralamak için etkinleştir.',
  116602. activateAscending: 'A dan Z ye sıralamak için etkinleştir.'
  116603. },
  116604. sortBy: 'Sırala'
  116605. },
  116606. dataFooter: {
  116607. itemsPerPageText: 'Sayfa başına satır:',
  116608. itemsPerPageAll: 'Hepsi',
  116609. nextPage: 'Sonraki sayfa',
  116610. prevPage: 'Önceki sayfa',
  116611. firstPage: 'İlk sayfa',
  116612. lastPage: 'Son sayfa',
  116613. pageText: '{0} - {1} arası, Toplam: {2} kayıt'
  116614. },
  116615. datePicker: {
  116616. itemsSelected: '{0} öge seçildi'
  116617. },
  116618. noDataText: 'Bu görünümde veri yok.',
  116619. carousel: {
  116620. prev: 'Önceki görsel',
  116621. next: 'Sonraki görsel',
  116622. ariaLabel: {
  116623. delimiter: 'Galeri sayfa {0} / {1}'
  116624. }
  116625. },
  116626. calendar: {
  116627. moreEvents: '{0} tane daha'
  116628. },
  116629. fileInput: {
  116630. counter: '{0} dosya',
  116631. counterSize: '{0} dosya (toplamda {1})'
  116632. },
  116633. timePicker: {
  116634. am: 'AM',
  116635. pm: 'PM'
  116636. }
  116637. });
  116638. /***/ }),
  116639. /***/ "./src/locale/uk.ts":
  116640. /*!**************************!*\
  116641. !*** ./src/locale/uk.ts ***!
  116642. \**************************/
  116643. /*! exports provided: default */
  116644. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116645. "use strict";
  116646. __webpack_require__.r(__webpack_exports__);
  116647. /* harmony default export */ __webpack_exports__["default"] = ({
  116648. badge: 'Знак',
  116649. close: 'Закрити',
  116650. dataIterator: {
  116651. noResultsText: 'В результаті пошуку нічого не знайдено',
  116652. loadingText: 'Завантаження...'
  116653. },
  116654. dataTable: {
  116655. itemsPerPageText: 'Рядків на сторінці:',
  116656. ariaLabel: {
  116657. sortDescending: 'Відсортовано за спаданням.',
  116658. sortAscending: 'Відсортовано за зростанням.',
  116659. sortNone: 'Не відсортовано.',
  116660. activateNone: 'Активувати, щоб видалити сортування.',
  116661. activateDescending: 'Активувати, щоб відсортувати за спаданням.',
  116662. activateAscending: 'Активувати, щоб відсортувати за зростанням.'
  116663. },
  116664. sortBy: 'Відсортувати за'
  116665. },
  116666. dataFooter: {
  116667. itemsPerPageText: 'Елементів на сторінці:',
  116668. itemsPerPageAll: 'Всі',
  116669. nextPage: 'Наступна сторінка',
  116670. prevPage: 'Попередня сторінка',
  116671. firstPage: 'Перша сторінка',
  116672. lastPage: 'Остання сторінка',
  116673. pageText: '{0}-{1} з {2}'
  116674. },
  116675. datePicker: {
  116676. itemsSelected: '{0} вибрано'
  116677. },
  116678. noDataText: 'Немає даних для відображення',
  116679. carousel: {
  116680. prev: 'Попередній слайд',
  116681. next: 'Наступий слайд',
  116682. ariaLabel: {
  116683. delimiter: 'Слайд {0} з {1}'
  116684. }
  116685. },
  116686. calendar: {
  116687. moreEvents: 'Ще {0}'
  116688. },
  116689. fileInput: {
  116690. counter: '{0} файлів',
  116691. counterSize: '{0} файлів ({1} загалом)'
  116692. },
  116693. timePicker: {
  116694. am: 'AM',
  116695. pm: 'PM'
  116696. }
  116697. });
  116698. /***/ }),
  116699. /***/ "./src/locale/zh-Hans.ts":
  116700. /*!*******************************!*\
  116701. !*** ./src/locale/zh-Hans.ts ***!
  116702. \*******************************/
  116703. /*! exports provided: default */
  116704. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116705. "use strict";
  116706. __webpack_require__.r(__webpack_exports__);
  116707. /* harmony default export */ __webpack_exports__["default"] = ({
  116708. badge: '徽章',
  116709. close: '关闭',
  116710. dataIterator: {
  116711. noResultsText: '没有符合条件的结果',
  116712. loadingText: '加载中……'
  116713. },
  116714. dataTable: {
  116715. itemsPerPageText: '每页数目:',
  116716. ariaLabel: {
  116717. sortDescending: ':降序排列。',
  116718. sortAscending: ':升序排列。',
  116719. sortNone: ':未排序。',
  116720. activateNone: '点击以移除排序。',
  116721. activateDescending: '点击以降序排列。',
  116722. activateAscending: '点击以升序排列。'
  116723. },
  116724. sortBy: '排序方式'
  116725. },
  116726. dataFooter: {
  116727. itemsPerPageText: '每页数目:',
  116728. itemsPerPageAll: '全部',
  116729. nextPage: '下一页',
  116730. prevPage: '上一页',
  116731. firstPage: '首页',
  116732. lastPage: '尾页',
  116733. pageText: '{0}-{1} 共 {2}'
  116734. },
  116735. datePicker: {
  116736. itemsSelected: '已选择 {0}'
  116737. },
  116738. noDataText: '没有数据',
  116739. carousel: {
  116740. prev: '上一张',
  116741. next: '下一张',
  116742. ariaLabel: {
  116743. delimiter: 'Carousel slide {0} of {1}'
  116744. }
  116745. },
  116746. calendar: {
  116747. moreEvents: '还有 {0} 项'
  116748. },
  116749. fileInput: {
  116750. counter: '{0} 个文件',
  116751. counterSize: '{0} 个文件(共 {1})'
  116752. },
  116753. timePicker: {
  116754. am: 'AM',
  116755. pm: 'PM'
  116756. }
  116757. });
  116758. /***/ }),
  116759. /***/ "./src/locale/zh-Hant.ts":
  116760. /*!*******************************!*\
  116761. !*** ./src/locale/zh-Hant.ts ***!
  116762. \*******************************/
  116763. /*! exports provided: default */
  116764. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116765. "use strict";
  116766. __webpack_require__.r(__webpack_exports__);
  116767. /* harmony default export */ __webpack_exports__["default"] = ({
  116768. badge: '徽章',
  116769. close: '關閉',
  116770. dataIterator: {
  116771. noResultsText: '沒有符合條件的結果',
  116772. loadingText: '讀取中...'
  116773. },
  116774. dataTable: {
  116775. itemsPerPageText: '每頁列數:',
  116776. ariaLabel: {
  116777. sortDescending: ':降序排列。',
  116778. sortAscending: ':升序排列。',
  116779. sortNone: '無排序方式。點擊以升序排列。',
  116780. activateNone: '點擊以移除排序方式。',
  116781. activateDescending: '點擊以降序排列。',
  116782. activateAscending: '點擊以移除排序方式。'
  116783. },
  116784. sortBy: '排序方式'
  116785. },
  116786. dataFooter: {
  116787. itemsPerPageText: '每頁項目:',
  116788. itemsPerPageAll: '全部',
  116789. nextPage: '下一頁',
  116790. prevPage: '上一頁',
  116791. firstPage: '第一頁',
  116792. lastPage: '最後頁',
  116793. pageText: '{2} 條中的 {0}~{1} 條'
  116794. },
  116795. datePicker: {
  116796. itemsSelected: '已選擇 {0}'
  116797. },
  116798. noDataText: '沒有資料',
  116799. carousel: {
  116800. prev: '上一張',
  116801. next: '下一張',
  116802. ariaLabel: {
  116803. delimiter: 'Carousel slide {0} of {1}'
  116804. }
  116805. },
  116806. calendar: {
  116807. moreEvents: '還有其他 {0} 項'
  116808. },
  116809. fileInput: {
  116810. counter: '{0} 個檔案',
  116811. counterSize: '{0} 個檔案(共 {1})'
  116812. },
  116813. timePicker: {
  116814. am: 'AM',
  116815. pm: 'PM'
  116816. }
  116817. });
  116818. /***/ }),
  116819. /***/ "./src/mixins/activatable/index.ts":
  116820. /*!*****************************************!*\
  116821. !*** ./src/mixins/activatable/index.ts ***!
  116822. \*****************************************/
  116823. /*! exports provided: default */
  116824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116825. "use strict";
  116826. __webpack_require__.r(__webpack_exports__);
  116827. /* harmony import */ var _delayable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../delayable */ "./src/mixins/delayable/index.ts");
  116828. /* harmony import */ var _toggleable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toggleable */ "./src/mixins/toggleable/index.ts");
  116829. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  116830. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  116831. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  116832. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  116833. var __values = undefined && undefined.__values || function (o) {
  116834. var m = typeof Symbol === "function" && o[Symbol.iterator],
  116835. i = 0;
  116836. if (m) return m.call(o);
  116837. return {
  116838. next: function next() {
  116839. if (o && i >= o.length) o = void 0;
  116840. return {
  116841. value: o && o[i++],
  116842. done: !o
  116843. };
  116844. }
  116845. };
  116846. }; // Mixins
  116847. // Utilities
  116848. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_delayable__WEBPACK_IMPORTED_MODULE_0__["default"], _toggleable__WEBPACK_IMPORTED_MODULE_1__["default"]);
  116849. /* @vue/component */
  116850. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend({
  116851. name: 'activatable',
  116852. props: {
  116853. activator: {
  116854. default: null,
  116855. validator: function validator(val) {
  116856. return ['string', 'object'].includes(_typeof(val));
  116857. }
  116858. },
  116859. disabled: Boolean,
  116860. internalActivator: Boolean,
  116861. openOnHover: Boolean
  116862. },
  116863. data: function data() {
  116864. return {
  116865. // Do not use this directly, call getActivator() instead
  116866. activatorElement: null,
  116867. activatorNode: [],
  116868. events: ['click', 'mouseenter', 'mouseleave'],
  116869. listeners: {}
  116870. };
  116871. },
  116872. watch: {
  116873. activator: 'resetActivator',
  116874. openOnHover: 'resetActivator'
  116875. },
  116876. mounted: function mounted() {
  116877. var slotType = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlotType"])(this, 'activator', true);
  116878. if (slotType && ['v-slot', 'normal'].includes(slotType)) {
  116879. Object(_util_console__WEBPACK_IMPORTED_MODULE_4__["consoleError"])("The activator slot must be bound, try '<template v-slot:activator=\"{ on }\"><v-btn v-on=\"on\">'", this);
  116880. }
  116881. this.addActivatorEvents();
  116882. },
  116883. beforeDestroy: function beforeDestroy() {
  116884. this.removeActivatorEvents();
  116885. },
  116886. methods: {
  116887. addActivatorEvents: function addActivatorEvents() {
  116888. var e_1, _a;
  116889. if (!this.activator || this.disabled || !this.getActivator()) return;
  116890. this.listeners = this.genActivatorListeners();
  116891. var keys = Object.keys(this.listeners);
  116892. try {
  116893. for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
  116894. var key = keys_1_1.value;
  116895. this.getActivator().addEventListener(key, this.listeners[key]);
  116896. }
  116897. } catch (e_1_1) {
  116898. e_1 = {
  116899. error: e_1_1
  116900. };
  116901. } finally {
  116902. try {
  116903. if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
  116904. } finally {
  116905. if (e_1) throw e_1.error;
  116906. }
  116907. }
  116908. },
  116909. genActivator: function genActivator() {
  116910. var node = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this, 'activator', Object.assign(this.getValueProxy(), {
  116911. on: this.genActivatorListeners(),
  116912. attrs: this.genActivatorAttributes()
  116913. })) || [];
  116914. this.activatorNode = node;
  116915. return node;
  116916. },
  116917. genActivatorAttributes: function genActivatorAttributes() {
  116918. return {
  116919. role: 'button',
  116920. 'aria-haspopup': true,
  116921. 'aria-expanded': String(this.isActive)
  116922. };
  116923. },
  116924. genActivatorListeners: function genActivatorListeners() {
  116925. var _this = this;
  116926. if (this.disabled) return {};
  116927. var listeners = {};
  116928. if (this.openOnHover) {
  116929. listeners.mouseenter = function (e) {
  116930. _this.getActivator(e);
  116931. _this.runDelay('open');
  116932. };
  116933. listeners.mouseleave = function (e) {
  116934. _this.getActivator(e);
  116935. _this.runDelay('close');
  116936. };
  116937. } else {
  116938. listeners.click = function (e) {
  116939. var activator = _this.getActivator(e);
  116940. if (activator) activator.focus();
  116941. e.stopPropagation();
  116942. _this.isActive = !_this.isActive;
  116943. };
  116944. }
  116945. return listeners;
  116946. },
  116947. getActivator: function getActivator(e) {
  116948. // If we've already fetched the activator, re-use
  116949. if (this.activatorElement) return this.activatorElement;
  116950. var activator = null;
  116951. if (this.activator) {
  116952. var target = this.internalActivator ? this.$el : document;
  116953. if (typeof this.activator === 'string') {
  116954. // Selector
  116955. activator = target.querySelector(this.activator);
  116956. } else if (this.activator.$el) {
  116957. // Component (ref)
  116958. activator = this.activator.$el;
  116959. } else {
  116960. // HTMLElement | Element
  116961. activator = this.activator;
  116962. }
  116963. } else if (this.activatorNode.length === 1 || this.activatorNode.length && !e) {
  116964. // Use the contents of the activator slot
  116965. // There's either only one element in it or we
  116966. // don't have a click event to use as a last resort
  116967. var vm = this.activatorNode[0].componentInstance;
  116968. if (vm && vm.$options.mixins && // Activatable is indirectly used via Menuable
  116969. vm.$options.mixins.some(function (m) {
  116970. return m.options && ['activatable', 'menuable'].includes(m.options.name);
  116971. })) {
  116972. // Activator is actually another activatible component, use its activator (#8846)
  116973. activator = vm.getActivator();
  116974. } else {
  116975. activator = this.activatorNode[0].elm;
  116976. }
  116977. } else if (e) {
  116978. // Activated by a click event
  116979. activator = e.currentTarget || e.target;
  116980. }
  116981. this.activatorElement = activator;
  116982. return this.activatorElement;
  116983. },
  116984. getContentSlot: function getContentSlot() {
  116985. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getSlot"])(this, 'default', this.getValueProxy(), true);
  116986. },
  116987. getValueProxy: function getValueProxy() {
  116988. var self = this;
  116989. return {
  116990. get value() {
  116991. return self.isActive;
  116992. },
  116993. set value(isActive) {
  116994. self.isActive = isActive;
  116995. }
  116996. };
  116997. },
  116998. removeActivatorEvents: function removeActivatorEvents() {
  116999. var e_2, _a;
  117000. if (!this.activator || !this.activatorElement) return;
  117001. var keys = Object.keys(this.listeners);
  117002. try {
  117003. for (var keys_2 = __values(keys), keys_2_1 = keys_2.next(); !keys_2_1.done; keys_2_1 = keys_2.next()) {
  117004. var key = keys_2_1.value;
  117005. this.activatorElement.removeEventListener(key, this.listeners[key]);
  117006. }
  117007. } catch (e_2_1) {
  117008. e_2 = {
  117009. error: e_2_1
  117010. };
  117011. } finally {
  117012. try {
  117013. if (keys_2_1 && !keys_2_1.done && (_a = keys_2.return)) _a.call(keys_2);
  117014. } finally {
  117015. if (e_2) throw e_2.error;
  117016. }
  117017. }
  117018. this.listeners = {};
  117019. },
  117020. resetActivator: function resetActivator() {
  117021. this.removeActivatorEvents();
  117022. this.activatorElement = null;
  117023. this.getActivator();
  117024. this.addActivatorEvents();
  117025. }
  117026. }
  117027. }));
  117028. /***/ }),
  117029. /***/ "./src/mixins/applicationable/index.ts":
  117030. /*!*********************************************!*\
  117031. !*** ./src/mixins/applicationable/index.ts ***!
  117032. \*********************************************/
  117033. /*! exports provided: default */
  117034. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117035. "use strict";
  117036. __webpack_require__.r(__webpack_exports__);
  117037. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return applicationable; });
  117038. /* harmony import */ var _positionable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../positionable */ "./src/mixins/positionable/index.ts");
  117039. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  117040. // Util
  117041. function applicationable(value, events) {
  117042. if (events === void 0) {
  117043. events = [];
  117044. }
  117045. /* @vue/component */
  117046. return Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_positionable__WEBPACK_IMPORTED_MODULE_0__["factory"])(['absolute', 'fixed'])).extend({
  117047. name: 'applicationable',
  117048. props: {
  117049. app: Boolean
  117050. },
  117051. computed: {
  117052. applicationProperty: function applicationProperty() {
  117053. return value;
  117054. }
  117055. },
  117056. watch: {
  117057. // If previous value was app
  117058. // reset the provided prop
  117059. app: function app(x, prev) {
  117060. prev ? this.removeApplication(true) : this.callUpdate();
  117061. },
  117062. applicationProperty: function applicationProperty(newVal, oldVal) {
  117063. this.$vuetify.application.unregister(this._uid, oldVal);
  117064. }
  117065. },
  117066. activated: function activated() {
  117067. this.callUpdate();
  117068. },
  117069. created: function created() {
  117070. for (var i = 0, length = events.length; i < length; i++) {
  117071. this.$watch(events[i], this.callUpdate);
  117072. }
  117073. this.callUpdate();
  117074. },
  117075. mounted: function mounted() {
  117076. this.callUpdate();
  117077. },
  117078. deactivated: function deactivated() {
  117079. this.removeApplication();
  117080. },
  117081. destroyed: function destroyed() {
  117082. this.removeApplication();
  117083. },
  117084. methods: {
  117085. callUpdate: function callUpdate() {
  117086. if (!this.app) return;
  117087. this.$vuetify.application.register(this._uid, this.applicationProperty, this.updateApplication());
  117088. },
  117089. removeApplication: function removeApplication(force) {
  117090. if (force === void 0) {
  117091. force = false;
  117092. }
  117093. if (!force && !this.app) return;
  117094. this.$vuetify.application.unregister(this._uid, this.applicationProperty);
  117095. },
  117096. updateApplication: function updateApplication() {
  117097. return 0;
  117098. }
  117099. }
  117100. });
  117101. }
  117102. /***/ }),
  117103. /***/ "./src/mixins/binds-attrs/index.ts":
  117104. /*!*****************************************!*\
  117105. !*** ./src/mixins/binds-attrs/index.ts ***!
  117106. \*****************************************/
  117107. /*! exports provided: default */
  117108. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117109. "use strict";
  117110. __webpack_require__.r(__webpack_exports__);
  117111. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  117112. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  117113. /**
  117114. * This mixin provides `attrs$` and `listeners$` to work around
  117115. * vue bug https://github.com/vuejs/vue/issues/10115
  117116. */
  117117. function makeWatcher(property) {
  117118. return function (val, oldVal) {
  117119. for (var attr in oldVal) {
  117120. if (!Object.prototype.hasOwnProperty.call(val, attr)) {
  117121. this.$delete(this.$data[property], attr);
  117122. }
  117123. }
  117124. for (var attr in val) {
  117125. this.$set(this.$data[property], attr, val[attr]);
  117126. }
  117127. };
  117128. }
  117129. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  117130. data: function data() {
  117131. return {
  117132. attrs$: {},
  117133. listeners$: {}
  117134. };
  117135. },
  117136. created: function created() {
  117137. // Work around unwanted re-renders: https://github.com/vuejs/vue/issues/10115
  117138. // Make sure to use `attrs$` instead of `$attrs` (confusing right?)
  117139. this.$watch('$attrs', makeWatcher('attrs$'), {
  117140. immediate: true
  117141. });
  117142. this.$watch('$listeners', makeWatcher('listeners$'), {
  117143. immediate: true
  117144. });
  117145. }
  117146. }));
  117147. /***/ }),
  117148. /***/ "./src/mixins/bootable/index.ts":
  117149. /*!**************************************!*\
  117150. !*** ./src/mixins/bootable/index.ts ***!
  117151. \**************************************/
  117152. /*! exports provided: default */
  117153. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117154. "use strict";
  117155. __webpack_require__.r(__webpack_exports__);
  117156. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  117157. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "vue");
  117158. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
  117159. // Utilities
  117160. // Types
  117161. /**
  117162. * Bootable
  117163. * @mixin
  117164. *
  117165. * Used to add lazy content functionality to components
  117166. * Looks for change in "isActive" to automatically boot
  117167. * Otherwise can be set manually
  117168. */
  117169. /* @vue/component */
  117170. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_1___default.a.extend().extend({
  117171. name: 'bootable',
  117172. props: {
  117173. eager: Boolean
  117174. },
  117175. data: function data() {
  117176. return {
  117177. isBooted: false
  117178. };
  117179. },
  117180. computed: {
  117181. hasContent: function hasContent() {
  117182. return this.isBooted || this.eager || this.isActive;
  117183. }
  117184. },
  117185. watch: {
  117186. isActive: function isActive() {
  117187. this.isBooted = true;
  117188. }
  117189. },
  117190. created: function created() {
  117191. /* istanbul ignore next */
  117192. if ('lazy' in this.$attrs) {
  117193. Object(_util_console__WEBPACK_IMPORTED_MODULE_0__["removed"])('lazy', this);
  117194. }
  117195. },
  117196. methods: {
  117197. showLazyContent: function showLazyContent(content) {
  117198. return this.hasContent && content ? content() : [this.$createElement()];
  117199. }
  117200. }
  117201. }));
  117202. /***/ }),
  117203. /***/ "./src/mixins/button-group/index.ts":
  117204. /*!******************************************!*\
  117205. !*** ./src/mixins/button-group/index.ts ***!
  117206. \******************************************/
  117207. /*! exports provided: default */
  117208. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117209. "use strict";
  117210. __webpack_require__.r(__webpack_exports__);
  117211. /* harmony import */ var _components_VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../components/VItemGroup/VItemGroup */ "./src/components/VItemGroup/VItemGroup.ts");
  117212. // Extensions
  117213. /* @vue/component */
  117214. /* harmony default export */ __webpack_exports__["default"] = (_components_VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_0__["BaseItemGroup"].extend({
  117215. name: 'button-group',
  117216. provide: function provide() {
  117217. return {
  117218. btnToggle: this
  117219. };
  117220. },
  117221. computed: {
  117222. classes: function classes() {
  117223. return _components_VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_0__["BaseItemGroup"].options.computed.classes.call(this);
  117224. }
  117225. },
  117226. methods: {
  117227. // Isn't being passed down through types
  117228. genData: _components_VItemGroup_VItemGroup__WEBPACK_IMPORTED_MODULE_0__["BaseItemGroup"].options.methods.genData
  117229. }
  117230. }));
  117231. /***/ }),
  117232. /***/ "./src/mixins/colorable/index.ts":
  117233. /*!***************************************!*\
  117234. !*** ./src/mixins/colorable/index.ts ***!
  117235. \***************************************/
  117236. /*! exports provided: default */
  117237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117238. "use strict";
  117239. __webpack_require__.r(__webpack_exports__);
  117240. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  117241. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  117242. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  117243. var __assign = undefined && undefined.__assign || function () {
  117244. __assign = Object.assign || function (t) {
  117245. for (var s, i = 1, n = arguments.length; i < n; i++) {
  117246. s = arguments[i];
  117247. for (var p in s) {
  117248. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  117249. }
  117250. }
  117251. return t;
  117252. };
  117253. return __assign.apply(this, arguments);
  117254. };
  117255. var __read = undefined && undefined.__read || function (o, n) {
  117256. var m = typeof Symbol === "function" && o[Symbol.iterator];
  117257. if (!m) return o;
  117258. var i = m.call(o),
  117259. r,
  117260. ar = [],
  117261. e;
  117262. try {
  117263. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  117264. ar.push(r.value);
  117265. }
  117266. } catch (error) {
  117267. e = {
  117268. error: error
  117269. };
  117270. } finally {
  117271. try {
  117272. if (r && !r.done && (m = i["return"])) m.call(i);
  117273. } finally {
  117274. if (e) throw e.error;
  117275. }
  117276. }
  117277. return ar;
  117278. };
  117279. function isCssColor(color) {
  117280. return !!color && !!color.match(/^(#|var\(--|(rgb|hsl)a?\()/);
  117281. }
  117282. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  117283. name: 'colorable',
  117284. props: {
  117285. color: String
  117286. },
  117287. methods: {
  117288. setBackgroundColor: function setBackgroundColor(color, data) {
  117289. var _a;
  117290. if (data === void 0) {
  117291. data = {};
  117292. }
  117293. if (typeof data.style === 'string') {
  117294. // istanbul ignore next
  117295. Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleError"])('style must be an object', this); // istanbul ignore next
  117296. return data;
  117297. }
  117298. if (typeof data.class === 'string') {
  117299. // istanbul ignore next
  117300. Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleError"])('class must be an object', this); // istanbul ignore next
  117301. return data;
  117302. }
  117303. if (isCssColor(color)) {
  117304. data.style = __assign({}, data.style, {
  117305. 'background-color': "" + color,
  117306. 'border-color': "" + color
  117307. });
  117308. } else if (color) {
  117309. data.class = __assign({}, data.class, (_a = {}, _a[color] = true, _a));
  117310. }
  117311. return data;
  117312. },
  117313. setTextColor: function setTextColor(color, data) {
  117314. var _a;
  117315. if (data === void 0) {
  117316. data = {};
  117317. }
  117318. if (typeof data.style === 'string') {
  117319. // istanbul ignore next
  117320. Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleError"])('style must be an object', this); // istanbul ignore next
  117321. return data;
  117322. }
  117323. if (typeof data.class === 'string') {
  117324. // istanbul ignore next
  117325. Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleError"])('class must be an object', this); // istanbul ignore next
  117326. return data;
  117327. }
  117328. if (isCssColor(color)) {
  117329. data.style = __assign({}, data.style, {
  117330. color: "" + color,
  117331. 'caret-color': "" + color
  117332. });
  117333. } else if (color) {
  117334. var _b = __read(color.toString().trim().split(' ', 2), 2),
  117335. colorName = _b[0],
  117336. colorModifier = _b[1];
  117337. data.class = __assign({}, data.class, (_a = {}, _a[colorName + '--text'] = true, _a));
  117338. if (colorModifier) {
  117339. data.class['text--' + colorModifier] = true;
  117340. }
  117341. }
  117342. return data;
  117343. }
  117344. }
  117345. }));
  117346. /***/ }),
  117347. /***/ "./src/mixins/comparable/index.ts":
  117348. /*!****************************************!*\
  117349. !*** ./src/mixins/comparable/index.ts ***!
  117350. \****************************************/
  117351. /*! exports provided: default */
  117352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117353. "use strict";
  117354. __webpack_require__.r(__webpack_exports__);
  117355. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  117356. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  117357. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  117358. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  117359. name: 'comparable',
  117360. props: {
  117361. valueComparator: {
  117362. type: Function,
  117363. default: _util_helpers__WEBPACK_IMPORTED_MODULE_1__["deepEqual"]
  117364. }
  117365. }
  117366. }));
  117367. /***/ }),
  117368. /***/ "./src/mixins/delayable/index.ts":
  117369. /*!***************************************!*\
  117370. !*** ./src/mixins/delayable/index.ts ***!
  117371. \***************************************/
  117372. /*! exports provided: default */
  117373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117374. "use strict";
  117375. __webpack_require__.r(__webpack_exports__);
  117376. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  117377. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  117378. /**
  117379. * Delayable
  117380. *
  117381. * @mixin
  117382. *
  117383. * Changes the open or close delay time for elements
  117384. */
  117385. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend().extend({
  117386. name: 'delayable',
  117387. props: {
  117388. openDelay: {
  117389. type: [Number, String],
  117390. default: 0
  117391. },
  117392. closeDelay: {
  117393. type: [Number, String],
  117394. default: 0
  117395. }
  117396. },
  117397. data: function data() {
  117398. return {
  117399. openTimeout: undefined,
  117400. closeTimeout: undefined
  117401. };
  117402. },
  117403. methods: {
  117404. /**
  117405. * Clear any pending delay timers from executing
  117406. */
  117407. clearDelay: function clearDelay() {
  117408. clearTimeout(this.openTimeout);
  117409. clearTimeout(this.closeTimeout);
  117410. },
  117411. /**
  117412. * Runs callback after a specified delay
  117413. */
  117414. runDelay: function runDelay(type, cb) {
  117415. var _this = this;
  117416. this.clearDelay();
  117417. var delay = parseInt(this[type + "Delay"], 10);
  117418. this[type + "Timeout"] = setTimeout(cb || function () {
  117419. _this.isActive = {
  117420. open: true,
  117421. close: false
  117422. }[type];
  117423. }, delay);
  117424. }
  117425. }
  117426. }));
  117427. /***/ }),
  117428. /***/ "./src/mixins/dependent/index.ts":
  117429. /*!***************************************!*\
  117430. !*** ./src/mixins/dependent/index.ts ***!
  117431. \***************************************/
  117432. /*! exports provided: default */
  117433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117434. "use strict";
  117435. __webpack_require__.r(__webpack_exports__);
  117436. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  117437. var __read = undefined && undefined.__read || function (o, n) {
  117438. var m = typeof Symbol === "function" && o[Symbol.iterator];
  117439. if (!m) return o;
  117440. var i = m.call(o),
  117441. r,
  117442. ar = [],
  117443. e;
  117444. try {
  117445. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  117446. ar.push(r.value);
  117447. }
  117448. } catch (error) {
  117449. e = {
  117450. error: error
  117451. };
  117452. } finally {
  117453. try {
  117454. if (r && !r.done && (m = i["return"])) m.call(i);
  117455. } finally {
  117456. if (e) throw e.error;
  117457. }
  117458. }
  117459. return ar;
  117460. };
  117461. var __spread = undefined && undefined.__spread || function () {
  117462. for (var ar = [], i = 0; i < arguments.length; i++) {
  117463. ar = ar.concat(__read(arguments[i]));
  117464. }
  117465. return ar;
  117466. };
  117467. function searchChildren(children) {
  117468. var results = [];
  117469. for (var index = 0; index < children.length; index++) {
  117470. var child = children[index];
  117471. if (child.isActive && child.isDependent) {
  117472. results.push(child);
  117473. } else {
  117474. results.push.apply(results, __spread(searchChildren(child.$children)));
  117475. }
  117476. }
  117477. return results;
  117478. }
  117479. /* @vue/component */
  117480. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_0__["default"])().extend({
  117481. name: 'dependent',
  117482. data: function data() {
  117483. return {
  117484. closeDependents: true,
  117485. isActive: false,
  117486. isDependent: true
  117487. };
  117488. },
  117489. watch: {
  117490. isActive: function isActive(val) {
  117491. if (val) return;
  117492. var openDependents = this.getOpenDependents();
  117493. for (var index = 0; index < openDependents.length; index++) {
  117494. openDependents[index].isActive = false;
  117495. }
  117496. }
  117497. },
  117498. methods: {
  117499. getOpenDependents: function getOpenDependents() {
  117500. if (this.closeDependents) return searchChildren(this.$children);
  117501. return [];
  117502. },
  117503. getOpenDependentElements: function getOpenDependentElements() {
  117504. var result = [];
  117505. var openDependents = this.getOpenDependents();
  117506. for (var index = 0; index < openDependents.length; index++) {
  117507. result.push.apply(result, __spread(openDependents[index].getClickableDependentElements()));
  117508. }
  117509. return result;
  117510. },
  117511. getClickableDependentElements: function getClickableDependentElements() {
  117512. var result = [this.$el];
  117513. if (this.$refs.content) result.push(this.$refs.content);
  117514. if (this.overlay) result.push(this.overlay.$el);
  117515. result.push.apply(result, __spread(this.getOpenDependentElements()));
  117516. return result;
  117517. }
  117518. }
  117519. }));
  117520. /***/ }),
  117521. /***/ "./src/mixins/detachable/index.ts":
  117522. /*!****************************************!*\
  117523. !*** ./src/mixins/detachable/index.ts ***!
  117524. \****************************************/
  117525. /*! exports provided: default */
  117526. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117527. "use strict";
  117528. __webpack_require__.r(__webpack_exports__);
  117529. /* harmony import */ var _bootable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bootable */ "./src/mixins/bootable/index.ts");
  117530. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  117531. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  117532. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  117533. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  117534. // Mixins
  117535. // Utilities
  117536. function validateAttachTarget(val) {
  117537. var type = _typeof(val);
  117538. if (type === 'boolean' || type === 'string') return true;
  117539. return val.nodeType === Node.ELEMENT_NODE;
  117540. }
  117541. /* @vue/component */
  117542. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_bootable__WEBPACK_IMPORTED_MODULE_0__["default"]).extend({
  117543. name: 'detachable',
  117544. props: {
  117545. attach: {
  117546. default: false,
  117547. validator: validateAttachTarget
  117548. },
  117549. contentClass: {
  117550. type: String,
  117551. default: ''
  117552. }
  117553. },
  117554. data: function data() {
  117555. return {
  117556. activatorNode: null,
  117557. hasDetached: false
  117558. };
  117559. },
  117560. watch: {
  117561. attach: function attach() {
  117562. this.hasDetached = false;
  117563. this.initDetach();
  117564. },
  117565. hasContent: function hasContent() {
  117566. this.$nextTick(this.initDetach);
  117567. }
  117568. },
  117569. beforeMount: function beforeMount() {
  117570. var _this = this;
  117571. this.$nextTick(function () {
  117572. if (_this.activatorNode) {
  117573. var activator = Array.isArray(_this.activatorNode) ? _this.activatorNode : [_this.activatorNode];
  117574. activator.forEach(function (node) {
  117575. if (!node.elm) return;
  117576. if (!_this.$el.parentNode) return;
  117577. var target = _this.$el === _this.$el.parentNode.firstChild ? _this.$el : _this.$el.nextSibling;
  117578. _this.$el.parentNode.insertBefore(node.elm, target);
  117579. });
  117580. }
  117581. });
  117582. },
  117583. mounted: function mounted() {
  117584. this.hasContent && this.initDetach();
  117585. },
  117586. deactivated: function deactivated() {
  117587. this.isActive = false;
  117588. },
  117589. beforeDestroy: function beforeDestroy() {
  117590. // IE11 Fix
  117591. try {
  117592. if (this.$refs.content && this.$refs.content.parentNode) {
  117593. this.$refs.content.parentNode.removeChild(this.$refs.content);
  117594. }
  117595. if (this.activatorNode) {
  117596. var activator = Array.isArray(this.activatorNode) ? this.activatorNode : [this.activatorNode];
  117597. activator.forEach(function (node) {
  117598. node.elm && node.elm.parentNode && node.elm.parentNode.removeChild(node.elm);
  117599. });
  117600. }
  117601. } catch (e) {
  117602. console.log(e);
  117603. }
  117604. },
  117605. methods: {
  117606. getScopeIdAttrs: function getScopeIdAttrs() {
  117607. var _a;
  117608. var scopeId = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["getObjectValueByPath"])(this.$vnode, 'context.$options._scopeId');
  117609. return scopeId && (_a = {}, _a[scopeId] = '', _a);
  117610. },
  117611. initDetach: function initDetach() {
  117612. if (this._isDestroyed || !this.$refs.content || this.hasDetached || // Leave menu in place if attached
  117613. // and dev has not changed target
  117614. this.attach === '' || // If used as a boolean prop (<v-menu attach>)
  117615. this.attach === true || // If bound to a boolean (<v-menu :attach="true">)
  117616. this.attach === 'attach' // If bound as boolean prop in pug (v-menu(attach))
  117617. ) return;
  117618. var target;
  117619. if (this.attach === false) {
  117620. // Default, detach to app
  117621. target = document.querySelector('[data-app]');
  117622. } else if (typeof this.attach === 'string') {
  117623. // CSS selector
  117624. target = document.querySelector(this.attach);
  117625. } else {
  117626. // DOM Element
  117627. target = this.attach;
  117628. }
  117629. if (!target) {
  117630. Object(_util_console__WEBPACK_IMPORTED_MODULE_3__["consoleWarn"])("Unable to locate target " + (this.attach || '[data-app]'), this);
  117631. return;
  117632. }
  117633. target.appendChild(this.$refs.content);
  117634. this.hasDetached = true;
  117635. }
  117636. }
  117637. }));
  117638. /***/ }),
  117639. /***/ "./src/mixins/elevatable/index.ts":
  117640. /*!****************************************!*\
  117641. !*** ./src/mixins/elevatable/index.ts ***!
  117642. \****************************************/
  117643. /*! exports provided: default */
  117644. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117645. "use strict";
  117646. __webpack_require__.r(__webpack_exports__);
  117647. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  117648. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  117649. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  117650. name: 'elevatable',
  117651. props: {
  117652. elevation: [Number, String]
  117653. },
  117654. computed: {
  117655. computedElevation: function computedElevation() {
  117656. return this.elevation;
  117657. },
  117658. elevationClasses: function elevationClasses() {
  117659. var _a;
  117660. var elevation = this.computedElevation;
  117661. if (elevation == null) return {};
  117662. if (isNaN(parseInt(elevation))) return {};
  117663. return _a = {}, _a["elevation-" + this.elevation] = true, _a;
  117664. }
  117665. }
  117666. }));
  117667. /***/ }),
  117668. /***/ "./src/mixins/filterable/index.ts":
  117669. /*!****************************************!*\
  117670. !*** ./src/mixins/filterable/index.ts ***!
  117671. \****************************************/
  117672. /*! exports provided: default */
  117673. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117674. "use strict";
  117675. __webpack_require__.r(__webpack_exports__);
  117676. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  117677. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  117678. /* @vue/component */
  117679. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  117680. name: 'filterable',
  117681. props: {
  117682. noDataText: {
  117683. type: String,
  117684. default: '$vuetify.noDataText'
  117685. }
  117686. }
  117687. }));
  117688. /***/ }),
  117689. /***/ "./src/mixins/groupable/index.ts":
  117690. /*!***************************************!*\
  117691. !*** ./src/mixins/groupable/index.ts ***!
  117692. \***************************************/
  117693. /*! exports provided: factory, default */
  117694. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117695. "use strict";
  117696. __webpack_require__.r(__webpack_exports__);
  117697. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "factory", function() { return factory; });
  117698. /* harmony import */ var _registrable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../registrable */ "./src/mixins/registrable/index.ts");
  117699. // Mixins
  117700. function factory(namespace, child, parent) {
  117701. // TODO: ts 3.4 broke directly returning this
  117702. var R = Object(_registrable__WEBPACK_IMPORTED_MODULE_0__["inject"])(namespace, child, parent).extend({
  117703. name: 'groupable',
  117704. props: {
  117705. activeClass: {
  117706. type: String,
  117707. default: function _default() {
  117708. if (!this[namespace]) return undefined;
  117709. return this[namespace].activeClass;
  117710. }
  117711. },
  117712. disabled: Boolean
  117713. },
  117714. data: function data() {
  117715. return {
  117716. isActive: false
  117717. };
  117718. },
  117719. computed: {
  117720. groupClasses: function groupClasses() {
  117721. var _a;
  117722. if (!this.activeClass) return {};
  117723. return _a = {}, _a[this.activeClass] = this.isActive, _a;
  117724. }
  117725. },
  117726. created: function created() {
  117727. this[namespace] && this[namespace].register(this);
  117728. },
  117729. beforeDestroy: function beforeDestroy() {
  117730. this[namespace] && this[namespace].unregister(this);
  117731. },
  117732. methods: {
  117733. toggle: function toggle() {
  117734. this.$emit('change');
  117735. }
  117736. }
  117737. });
  117738. return R;
  117739. }
  117740. /* eslint-disable-next-line no-redeclare */
  117741. var Groupable = factory('itemGroup');
  117742. /* harmony default export */ __webpack_exports__["default"] = (Groupable);
  117743. /***/ }),
  117744. /***/ "./src/mixins/intersectable/index.ts":
  117745. /*!*******************************************!*\
  117746. !*** ./src/mixins/intersectable/index.ts ***!
  117747. \*******************************************/
  117748. /*! exports provided: default */
  117749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117750. "use strict";
  117751. __webpack_require__.r(__webpack_exports__);
  117752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return intersectable; });
  117753. /* harmony import */ var _directives_intersect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../directives/intersect */ "./src/directives/intersect/index.ts");
  117754. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  117755. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "vue");
  117756. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);
  117757. // Directives
  117758. // Utilities
  117759. // Types
  117760. function intersectable(options) {
  117761. if (typeof window === 'undefined' || !('IntersectionObserver' in window)) {
  117762. // do nothing because intersection observer is not available
  117763. return vue__WEBPACK_IMPORTED_MODULE_2___default.a.extend({
  117764. name: 'intersectable'
  117765. });
  117766. }
  117767. return vue__WEBPACK_IMPORTED_MODULE_2___default.a.extend({
  117768. name: 'intersectable',
  117769. mounted: function mounted() {
  117770. _directives_intersect__WEBPACK_IMPORTED_MODULE_0__["default"].inserted(this.$el, {
  117771. name: 'intersect',
  117772. value: {
  117773. handler: this.onObserve
  117774. }
  117775. });
  117776. },
  117777. destroyed: function destroyed() {
  117778. _directives_intersect__WEBPACK_IMPORTED_MODULE_0__["default"].unbind(this.$el);
  117779. },
  117780. methods: {
  117781. onObserve: function onObserve(entries, observer, isIntersecting) {
  117782. if (!isIntersecting) return;
  117783. for (var i = 0, length = options.onVisible.length; i < length; i++) {
  117784. var callback = this[options.onVisible[i]];
  117785. if (typeof callback === 'function') {
  117786. callback();
  117787. continue;
  117788. }
  117789. Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleWarn"])(options.onVisible[i] + ' method is not available on the instance but referenced in intersectable mixin options');
  117790. }
  117791. }
  117792. }
  117793. });
  117794. }
  117795. /***/ }),
  117796. /***/ "./src/mixins/loadable/index.ts":
  117797. /*!**************************************!*\
  117798. !*** ./src/mixins/loadable/index.ts ***!
  117799. \**************************************/
  117800. /*! exports provided: default */
  117801. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117802. "use strict";
  117803. __webpack_require__.r(__webpack_exports__);
  117804. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  117805. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  117806. /* harmony import */ var _components_VProgressLinear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../components/VProgressLinear */ "./src/components/VProgressLinear/index.ts");
  117807. /**
  117808. * Loadable
  117809. *
  117810. * @mixin
  117811. *
  117812. * Used to add linear progress bar to components
  117813. * Can use a default bar with a specific color
  117814. * or designate a custom progress linear bar
  117815. */
  117816. /* @vue/component */
  117817. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend().extend({
  117818. name: 'loadable',
  117819. props: {
  117820. loading: {
  117821. type: [Boolean, String],
  117822. default: false
  117823. },
  117824. loaderHeight: {
  117825. type: [Number, String],
  117826. default: 2
  117827. }
  117828. },
  117829. methods: {
  117830. genProgress: function genProgress() {
  117831. if (this.loading === false) return null;
  117832. return this.$slots.progress || this.$createElement(_components_VProgressLinear__WEBPACK_IMPORTED_MODULE_1__["default"], {
  117833. props: {
  117834. absolute: true,
  117835. color: this.loading === true || this.loading === '' ? this.color || 'primary' : this.loading,
  117836. height: this.loaderHeight,
  117837. indeterminate: true
  117838. }
  117839. });
  117840. }
  117841. }
  117842. }));
  117843. /***/ }),
  117844. /***/ "./src/mixins/localable/index.ts":
  117845. /*!***************************************!*\
  117846. !*** ./src/mixins/localable/index.ts ***!
  117847. \***************************************/
  117848. /*! exports provided: default */
  117849. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117850. "use strict";
  117851. __webpack_require__.r(__webpack_exports__);
  117852. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  117853. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  117854. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  117855. name: 'localable',
  117856. props: {
  117857. locale: String
  117858. },
  117859. computed: {
  117860. currentLocale: function currentLocale() {
  117861. return this.locale || this.$vuetify.lang.current;
  117862. }
  117863. }
  117864. }));
  117865. /***/ }),
  117866. /***/ "./src/mixins/measurable/index.ts":
  117867. /*!****************************************!*\
  117868. !*** ./src/mixins/measurable/index.ts ***!
  117869. \****************************************/
  117870. /*! exports provided: default */
  117871. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117872. "use strict";
  117873. __webpack_require__.r(__webpack_exports__);
  117874. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  117875. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "vue");
  117876. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
  117877. // Helpers
  117878. // Types
  117879. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_1___default.a.extend({
  117880. name: 'measurable',
  117881. props: {
  117882. height: [Number, String],
  117883. maxHeight: [Number, String],
  117884. maxWidth: [Number, String],
  117885. minHeight: [Number, String],
  117886. minWidth: [Number, String],
  117887. width: [Number, String]
  117888. },
  117889. computed: {
  117890. measurableStyles: function measurableStyles() {
  117891. var styles = {};
  117892. var height = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["convertToUnit"])(this.height);
  117893. var minHeight = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["convertToUnit"])(this.minHeight);
  117894. var minWidth = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["convertToUnit"])(this.minWidth);
  117895. var maxHeight = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["convertToUnit"])(this.maxHeight);
  117896. var maxWidth = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["convertToUnit"])(this.maxWidth);
  117897. var width = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["convertToUnit"])(this.width);
  117898. if (height) styles.height = height;
  117899. if (minHeight) styles.minHeight = minHeight;
  117900. if (minWidth) styles.minWidth = minWidth;
  117901. if (maxHeight) styles.maxHeight = maxHeight;
  117902. if (maxWidth) styles.maxWidth = maxWidth;
  117903. if (width) styles.width = width;
  117904. return styles;
  117905. }
  117906. }
  117907. }));
  117908. /***/ }),
  117909. /***/ "./src/mixins/menuable/index.ts":
  117910. /*!**************************************!*\
  117911. !*** ./src/mixins/menuable/index.ts ***!
  117912. \**************************************/
  117913. /*! exports provided: default */
  117914. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117915. "use strict";
  117916. __webpack_require__.r(__webpack_exports__);
  117917. /* harmony import */ var _positionable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../positionable */ "./src/mixins/positionable/index.ts");
  117918. /* harmony import */ var _stackable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../stackable */ "./src/mixins/stackable/index.ts");
  117919. /* harmony import */ var _activatable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../activatable */ "./src/mixins/activatable/index.ts");
  117920. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  117921. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  117922. var __assign = undefined && undefined.__assign || function () {
  117923. __assign = Object.assign || function (t) {
  117924. for (var s, i = 1, n = arguments.length; i < n; i++) {
  117925. s = arguments[i];
  117926. for (var p in s) {
  117927. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  117928. }
  117929. }
  117930. return t;
  117931. };
  117932. return __assign.apply(this, arguments);
  117933. }; // Mixins
  117934. // Utilities
  117935. // Types
  117936. var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_stackable__WEBPACK_IMPORTED_MODULE_1__["default"], _positionable__WEBPACK_IMPORTED_MODULE_0__["default"], _activatable__WEBPACK_IMPORTED_MODULE_2__["default"]);
  117937. /* @vue/component */
  117938. /* harmony default export */ __webpack_exports__["default"] = (baseMixins.extend().extend({
  117939. name: 'menuable',
  117940. props: {
  117941. allowOverflow: Boolean,
  117942. light: Boolean,
  117943. dark: Boolean,
  117944. maxWidth: {
  117945. type: [Number, String],
  117946. default: 'auto'
  117947. },
  117948. minWidth: [Number, String],
  117949. nudgeBottom: {
  117950. type: [Number, String],
  117951. default: 0
  117952. },
  117953. nudgeLeft: {
  117954. type: [Number, String],
  117955. default: 0
  117956. },
  117957. nudgeRight: {
  117958. type: [Number, String],
  117959. default: 0
  117960. },
  117961. nudgeTop: {
  117962. type: [Number, String],
  117963. default: 0
  117964. },
  117965. nudgeWidth: {
  117966. type: [Number, String],
  117967. default: 0
  117968. },
  117969. offsetOverflow: Boolean,
  117970. openOnClick: Boolean,
  117971. positionX: {
  117972. type: Number,
  117973. default: null
  117974. },
  117975. positionY: {
  117976. type: Number,
  117977. default: null
  117978. },
  117979. zIndex: {
  117980. type: [Number, String],
  117981. default: null
  117982. }
  117983. },
  117984. data: function data() {
  117985. return {
  117986. absoluteX: 0,
  117987. absoluteY: 0,
  117988. activatedBy: null,
  117989. activatorFixed: false,
  117990. dimensions: {
  117991. activator: {
  117992. top: 0,
  117993. left: 0,
  117994. bottom: 0,
  117995. right: 0,
  117996. width: 0,
  117997. height: 0,
  117998. offsetTop: 0,
  117999. scrollHeight: 0,
  118000. offsetLeft: 0
  118001. },
  118002. content: {
  118003. top: 0,
  118004. left: 0,
  118005. bottom: 0,
  118006. right: 0,
  118007. width: 0,
  118008. height: 0,
  118009. offsetTop: 0,
  118010. scrollHeight: 0
  118011. }
  118012. },
  118013. hasJustFocused: false,
  118014. hasWindow: false,
  118015. inputActivator: false,
  118016. isContentActive: false,
  118017. pageWidth: 0,
  118018. pageYOffset: 0,
  118019. stackClass: 'v-menu__content--active',
  118020. stackMinZIndex: 6
  118021. };
  118022. },
  118023. computed: {
  118024. computedLeft: function computedLeft() {
  118025. var a = this.dimensions.activator;
  118026. var c = this.dimensions.content;
  118027. var activatorLeft = (this.attach !== false ? a.offsetLeft : a.left) || 0;
  118028. var minWidth = Math.max(a.width, c.width);
  118029. var left = 0;
  118030. left += this.left ? activatorLeft - (minWidth - a.width) : activatorLeft;
  118031. if (this.offsetX) {
  118032. var maxWidth = isNaN(Number(this.maxWidth)) ? a.width : Math.min(a.width, Number(this.maxWidth));
  118033. left += this.left ? -maxWidth : a.width;
  118034. }
  118035. if (this.nudgeLeft) left -= parseInt(this.nudgeLeft);
  118036. if (this.nudgeRight) left += parseInt(this.nudgeRight);
  118037. return left;
  118038. },
  118039. computedTop: function computedTop() {
  118040. var a = this.dimensions.activator;
  118041. var c = this.dimensions.content;
  118042. var top = 0;
  118043. if (this.top) top += a.height - c.height;
  118044. if (this.attach !== false) top += a.offsetTop;else top += a.top + this.pageYOffset;
  118045. if (this.offsetY) top += this.top ? -a.height : a.height;
  118046. if (this.nudgeTop) top -= parseInt(this.nudgeTop);
  118047. if (this.nudgeBottom) top += parseInt(this.nudgeBottom);
  118048. return top;
  118049. },
  118050. hasActivator: function hasActivator() {
  118051. return !!this.$slots.activator || !!this.$scopedSlots.activator || !!this.activator || !!this.inputActivator;
  118052. }
  118053. },
  118054. watch: {
  118055. disabled: function disabled(val) {
  118056. val && this.callDeactivate();
  118057. },
  118058. isActive: function isActive(val) {
  118059. if (this.disabled) return;
  118060. val ? this.callActivate() : this.callDeactivate();
  118061. },
  118062. positionX: 'updateDimensions',
  118063. positionY: 'updateDimensions'
  118064. },
  118065. beforeMount: function beforeMount() {
  118066. this.hasWindow = typeof window !== 'undefined';
  118067. },
  118068. methods: {
  118069. absolutePosition: function absolutePosition() {
  118070. return {
  118071. offsetTop: 0,
  118072. offsetLeft: 0,
  118073. scrollHeight: 0,
  118074. top: this.positionY || this.absoluteY,
  118075. bottom: this.positionY || this.absoluteY,
  118076. left: this.positionX || this.absoluteX,
  118077. right: this.positionX || this.absoluteX,
  118078. height: 0,
  118079. width: 0
  118080. };
  118081. },
  118082. activate: function activate() {},
  118083. calcLeft: function calcLeft(menuWidth) {
  118084. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.attach !== false ? this.computedLeft : this.calcXOverflow(this.computedLeft, menuWidth));
  118085. },
  118086. calcTop: function calcTop() {
  118087. return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.attach !== false ? this.computedTop : this.calcYOverflow(this.computedTop));
  118088. },
  118089. calcXOverflow: function calcXOverflow(left, menuWidth) {
  118090. var xOverflow = left + menuWidth - this.pageWidth + 12;
  118091. if ((!this.left || this.right) && xOverflow > 0) {
  118092. left = Math.max(left - xOverflow, 0);
  118093. } else {
  118094. left = Math.max(left, 12);
  118095. }
  118096. return left + this.getOffsetLeft();
  118097. },
  118098. calcYOverflow: function calcYOverflow(top) {
  118099. var documentHeight = this.getInnerHeight();
  118100. var toTop = this.pageYOffset + documentHeight;
  118101. var activator = this.dimensions.activator;
  118102. var contentHeight = this.dimensions.content.height;
  118103. var totalHeight = top + contentHeight;
  118104. var isOverflowing = toTop < totalHeight; // If overflowing bottom and offset
  118105. // TODO: set 'bottom' position instead of 'top'
  118106. if (isOverflowing && this.offsetOverflow && // If we don't have enough room to offset
  118107. // the overflow, don't offset
  118108. activator.top > contentHeight) {
  118109. top = this.pageYOffset + (activator.top - contentHeight); // If overflowing bottom
  118110. } else if (isOverflowing && !this.allowOverflow) {
  118111. top = toTop - contentHeight - 12; // If overflowing top
  118112. } else if (top < this.pageYOffset && !this.allowOverflow) {
  118113. top = this.pageYOffset + 12;
  118114. }
  118115. return top < 12 ? 12 : top;
  118116. },
  118117. callActivate: function callActivate() {
  118118. if (!this.hasWindow) return;
  118119. this.activate();
  118120. },
  118121. callDeactivate: function callDeactivate() {
  118122. this.isContentActive = false;
  118123. this.deactivate();
  118124. },
  118125. checkForPageYOffset: function checkForPageYOffset() {
  118126. if (this.hasWindow) {
  118127. this.pageYOffset = this.activatorFixed ? 0 : this.getOffsetTop();
  118128. }
  118129. },
  118130. checkActivatorFixed: function checkActivatorFixed() {
  118131. if (this.attach !== false) return;
  118132. var el = this.getActivator();
  118133. while (el) {
  118134. if (window.getComputedStyle(el).position === 'fixed') {
  118135. this.activatorFixed = true;
  118136. return;
  118137. }
  118138. el = el.offsetParent;
  118139. }
  118140. this.activatorFixed = false;
  118141. },
  118142. deactivate: function deactivate() {},
  118143. genActivatorListeners: function genActivatorListeners() {
  118144. var _this = this;
  118145. var listeners = _activatable__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.genActivatorListeners.call(this);
  118146. var onClick = listeners.click;
  118147. listeners.click = function (e) {
  118148. if (_this.openOnClick) {
  118149. onClick && onClick(e);
  118150. }
  118151. _this.absoluteX = e.clientX;
  118152. _this.absoluteY = e.clientY;
  118153. };
  118154. return listeners;
  118155. },
  118156. getInnerHeight: function getInnerHeight() {
  118157. if (!this.hasWindow) return 0;
  118158. return window.innerHeight || document.documentElement.clientHeight;
  118159. },
  118160. getOffsetLeft: function getOffsetLeft() {
  118161. if (!this.hasWindow) return 0;
  118162. return window.pageXOffset || document.documentElement.scrollLeft;
  118163. },
  118164. getOffsetTop: function getOffsetTop() {
  118165. if (!this.hasWindow) return 0;
  118166. return window.pageYOffset || document.documentElement.scrollTop;
  118167. },
  118168. getRoundedBoundedClientRect: function getRoundedBoundedClientRect(el) {
  118169. var rect = el.getBoundingClientRect();
  118170. return {
  118171. top: Math.round(rect.top),
  118172. left: Math.round(rect.left),
  118173. bottom: Math.round(rect.bottom),
  118174. right: Math.round(rect.right),
  118175. width: Math.round(rect.width),
  118176. height: Math.round(rect.height)
  118177. };
  118178. },
  118179. measure: function measure(el) {
  118180. if (!el || !this.hasWindow) return null;
  118181. var rect = this.getRoundedBoundedClientRect(el); // Account for activator margin
  118182. if (this.attach !== false) {
  118183. var style = window.getComputedStyle(el);
  118184. rect.left = parseInt(style.marginLeft);
  118185. rect.top = parseInt(style.marginTop);
  118186. }
  118187. return rect;
  118188. },
  118189. sneakPeek: function sneakPeek(cb) {
  118190. var _this = this;
  118191. requestAnimationFrame(function () {
  118192. var el = _this.$refs.content;
  118193. if (!el || el.style.display !== 'none') {
  118194. cb();
  118195. return;
  118196. }
  118197. el.style.display = 'inline-block';
  118198. cb();
  118199. el.style.display = 'none';
  118200. });
  118201. },
  118202. startTransition: function startTransition() {
  118203. var _this = this;
  118204. return new Promise(function (resolve) {
  118205. return requestAnimationFrame(function () {
  118206. _this.isContentActive = _this.hasJustFocused = _this.isActive;
  118207. resolve();
  118208. });
  118209. });
  118210. },
  118211. updateDimensions: function updateDimensions() {
  118212. var _this = this;
  118213. this.hasWindow = typeof window !== 'undefined';
  118214. this.checkActivatorFixed();
  118215. this.checkForPageYOffset();
  118216. this.pageWidth = document.documentElement.clientWidth;
  118217. var dimensions = {
  118218. activator: __assign({}, this.dimensions.activator),
  118219. content: __assign({}, this.dimensions.content)
  118220. }; // Activator should already be shown
  118221. if (!this.hasActivator || this.absolute) {
  118222. dimensions.activator = this.absolutePosition();
  118223. } else {
  118224. var activator = this.getActivator();
  118225. if (!activator) return;
  118226. dimensions.activator = this.measure(activator);
  118227. dimensions.activator.offsetLeft = activator.offsetLeft;
  118228. if (this.attach !== false) {
  118229. // account for css padding causing things to not line up
  118230. // this is mostly for v-autocomplete, hopefully it won't break anything
  118231. dimensions.activator.offsetTop = activator.offsetTop;
  118232. } else {
  118233. dimensions.activator.offsetTop = 0;
  118234. }
  118235. } // Display and hide to get dimensions
  118236. this.sneakPeek(function () {
  118237. _this.$refs.content && (dimensions.content = _this.measure(_this.$refs.content));
  118238. _this.dimensions = dimensions;
  118239. });
  118240. }
  118241. }
  118242. }));
  118243. /***/ }),
  118244. /***/ "./src/mixins/overlayable/index.ts":
  118245. /*!*****************************************!*\
  118246. !*** ./src/mixins/overlayable/index.ts ***!
  118247. \*****************************************/
  118248. /*! exports provided: default */
  118249. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118250. "use strict";
  118251. __webpack_require__.r(__webpack_exports__);
  118252. /* harmony import */ var _components_VOverlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../components/VOverlay */ "./src/components/VOverlay/index.ts");
  118253. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  118254. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "vue");
  118255. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);
  118256. // Components
  118257. // Utilities
  118258. // Types
  118259. /* @vue/component */
  118260. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_2___default.a.extend().extend({
  118261. name: 'overlayable',
  118262. props: {
  118263. hideOverlay: Boolean,
  118264. overlayColor: String,
  118265. overlayOpacity: [Number, String]
  118266. },
  118267. data: function data() {
  118268. return {
  118269. overlay: null
  118270. };
  118271. },
  118272. watch: {
  118273. hideOverlay: function hideOverlay(value) {
  118274. if (!this.isActive) return;
  118275. if (value) this.removeOverlay();else this.genOverlay();
  118276. }
  118277. },
  118278. beforeDestroy: function beforeDestroy() {
  118279. this.removeOverlay();
  118280. },
  118281. methods: {
  118282. createOverlay: function createOverlay() {
  118283. var overlay = new _components_VOverlay__WEBPACK_IMPORTED_MODULE_0__["default"]({
  118284. propsData: {
  118285. absolute: this.absolute,
  118286. value: false,
  118287. color: this.overlayColor,
  118288. opacity: this.overlayOpacity
  118289. }
  118290. });
  118291. overlay.$mount();
  118292. var parent = this.absolute ? this.$el.parentNode : document.querySelector('[data-app]');
  118293. parent && parent.insertBefore(overlay.$el, parent.firstChild);
  118294. this.overlay = overlay;
  118295. },
  118296. genOverlay: function genOverlay() {
  118297. var _this = this;
  118298. this.hideScroll();
  118299. if (this.hideOverlay) return;
  118300. if (!this.overlay) this.createOverlay();
  118301. requestAnimationFrame(function () {
  118302. if (!_this.overlay) return;
  118303. if (_this.activeZIndex !== undefined) {
  118304. _this.overlay.zIndex = String(_this.activeZIndex - 1);
  118305. } else if (_this.$el) {
  118306. _this.overlay.zIndex = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["getZIndex"])(_this.$el);
  118307. }
  118308. });
  118309. if (this.overlay) {
  118310. this.overlay.value = true;
  118311. }
  118312. return true;
  118313. },
  118314. /** removeOverlay(false) will not restore the scollbar afterwards */
  118315. removeOverlay: function removeOverlay(showScroll) {
  118316. var _this = this;
  118317. if (showScroll === void 0) {
  118318. showScroll = true;
  118319. }
  118320. if (this.overlay) {
  118321. Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["addOnceEventListener"])(this.overlay.$el, 'transitionend', function () {
  118322. if (!_this.overlay || !_this.overlay.$el || !_this.overlay.$el.parentNode || _this.overlay.value) return;
  118323. _this.overlay.$el.parentNode.removeChild(_this.overlay.$el);
  118324. _this.overlay.$destroy();
  118325. _this.overlay = null;
  118326. });
  118327. this.overlay.value = false;
  118328. }
  118329. showScroll && this.showScroll();
  118330. },
  118331. scrollListener: function scrollListener(e) {
  118332. if (e.type === 'keydown') {
  118333. if (['INPUT', 'TEXTAREA', 'SELECT'].includes(e.target.tagName) || // https://github.com/vuetifyjs/vuetify/issues/4715
  118334. e.target.isContentEditable) return;
  118335. var up = [_util_helpers__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].up, _util_helpers__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].pageup];
  118336. var down = [_util_helpers__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].down, _util_helpers__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].pagedown];
  118337. if (up.includes(e.keyCode)) {
  118338. e.deltaY = -1;
  118339. } else if (down.includes(e.keyCode)) {
  118340. e.deltaY = 1;
  118341. } else {
  118342. return;
  118343. }
  118344. }
  118345. if (e.target === this.overlay || e.type !== 'keydown' && e.target === document.body || this.checkPath(e)) e.preventDefault();
  118346. },
  118347. hasScrollbar: function hasScrollbar(el) {
  118348. if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;
  118349. var style = window.getComputedStyle(el);
  118350. return ['auto', 'scroll'].includes(style.overflowY) && el.scrollHeight > el.clientHeight;
  118351. },
  118352. shouldScroll: function shouldScroll(el, delta) {
  118353. if (el.scrollTop === 0 && delta < 0) return true;
  118354. return el.scrollTop + el.clientHeight === el.scrollHeight && delta > 0;
  118355. },
  118356. isInside: function isInside(el, parent) {
  118357. if (el === parent) {
  118358. return true;
  118359. } else if (el === null || el === document.body) {
  118360. return false;
  118361. } else {
  118362. return this.isInside(el.parentNode, parent);
  118363. }
  118364. },
  118365. checkPath: function checkPath(e) {
  118366. var path = e.path || this.composedPath(e);
  118367. var delta = e.deltaY;
  118368. if (e.type === 'keydown' && path[0] === document.body) {
  118369. var dialog = this.$refs.dialog; // getSelection returns null in firefox in some edge cases, can be ignored
  118370. var selected = window.getSelection().anchorNode;
  118371. if (dialog && this.hasScrollbar(dialog) && this.isInside(selected, dialog)) {
  118372. return this.shouldScroll(dialog, delta);
  118373. }
  118374. return true;
  118375. }
  118376. for (var index = 0; index < path.length; index++) {
  118377. var el = path[index];
  118378. if (el === document) return true;
  118379. if (el === document.documentElement) return true;
  118380. if (el === this.$refs.content) return true;
  118381. if (this.hasScrollbar(el)) return this.shouldScroll(el, delta);
  118382. }
  118383. return true;
  118384. },
  118385. /**
  118386. * Polyfill for Event.prototype.composedPath
  118387. */
  118388. composedPath: function composedPath(e) {
  118389. if (e.composedPath) return e.composedPath();
  118390. var path = [];
  118391. var el = e.target;
  118392. while (el) {
  118393. path.push(el);
  118394. if (el.tagName === 'HTML') {
  118395. path.push(document);
  118396. path.push(window);
  118397. return path;
  118398. }
  118399. el = el.parentElement;
  118400. }
  118401. return path;
  118402. },
  118403. hideScroll: function hideScroll() {
  118404. if (this.$vuetify.breakpoint.smAndDown) {
  118405. document.documentElement.classList.add('overflow-y-hidden');
  118406. } else {
  118407. Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["addPassiveEventListener"])(window, 'wheel', this.scrollListener, {
  118408. passive: false
  118409. });
  118410. window.addEventListener('keydown', this.scrollListener);
  118411. }
  118412. },
  118413. showScroll: function showScroll() {
  118414. document.documentElement.classList.remove('overflow-y-hidden');
  118415. window.removeEventListener('wheel', this.scrollListener);
  118416. window.removeEventListener('keydown', this.scrollListener);
  118417. }
  118418. }
  118419. }));
  118420. /***/ }),
  118421. /***/ "./src/mixins/picker-button/index.ts":
  118422. /*!*******************************************!*\
  118423. !*** ./src/mixins/picker-button/index.ts ***!
  118424. \*******************************************/
  118425. /*! exports provided: default */
  118426. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118427. "use strict";
  118428. __webpack_require__.r(__webpack_exports__);
  118429. /* harmony import */ var _colorable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colorable */ "./src/mixins/colorable/index.ts");
  118430. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  118431. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  118432. // Mixins
  118433. // Utilities
  118434. /* @vue/component */
  118435. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(_colorable__WEBPACK_IMPORTED_MODULE_0__["default"]).extend({
  118436. methods: {
  118437. genPickerButton: function genPickerButton(prop, value, content, readonly, staticClass) {
  118438. var _this = this;
  118439. if (readonly === void 0) {
  118440. readonly = false;
  118441. }
  118442. if (staticClass === void 0) {
  118443. staticClass = '';
  118444. }
  118445. var active = this[prop] === value;
  118446. var click = function click(event) {
  118447. event.stopPropagation();
  118448. _this.$emit("update:" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["kebabCase"])(prop), value);
  118449. };
  118450. return this.$createElement('div', {
  118451. staticClass: ("v-picker__title__btn " + staticClass).trim(),
  118452. class: {
  118453. 'v-picker__title__btn--active': active,
  118454. 'v-picker__title__btn--readonly': readonly
  118455. },
  118456. on: active || readonly ? undefined : {
  118457. click: click
  118458. }
  118459. }, Array.isArray(content) ? content : [content]);
  118460. }
  118461. }
  118462. }));
  118463. /***/ }),
  118464. /***/ "./src/mixins/picker/index.ts":
  118465. /*!************************************!*\
  118466. !*** ./src/mixins/picker/index.ts ***!
  118467. \************************************/
  118468. /*! exports provided: default */
  118469. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118470. "use strict";
  118471. __webpack_require__.r(__webpack_exports__);
  118472. /* harmony import */ var _components_VPicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../components/VPicker */ "./src/components/VPicker/index.ts");
  118473. /* harmony import */ var _colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../colorable */ "./src/mixins/colorable/index.ts");
  118474. /* harmony import */ var _themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../themeable */ "./src/mixins/themeable/index.ts");
  118475. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  118476. // Components
  118477. // Mixins
  118478. // Utils
  118479. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _themeable__WEBPACK_IMPORTED_MODULE_2__["default"]
  118480. /* @vue/component */
  118481. ).extend({
  118482. name: 'picker',
  118483. props: {
  118484. fullWidth: Boolean,
  118485. headerColor: String,
  118486. landscape: Boolean,
  118487. noTitle: Boolean,
  118488. width: {
  118489. type: [Number, String],
  118490. default: 290
  118491. }
  118492. },
  118493. methods: {
  118494. genPickerTitle: function genPickerTitle() {
  118495. return null;
  118496. },
  118497. genPickerBody: function genPickerBody() {
  118498. return null;
  118499. },
  118500. genPickerActionsSlot: function genPickerActionsSlot() {
  118501. return this.$scopedSlots.default ? this.$scopedSlots.default({
  118502. save: this.save,
  118503. cancel: this.cancel
  118504. }) : this.$slots.default;
  118505. },
  118506. genPicker: function genPicker(staticClass) {
  118507. var children = [];
  118508. if (!this.noTitle) {
  118509. var title = this.genPickerTitle();
  118510. title && children.push(title);
  118511. }
  118512. var body = this.genPickerBody();
  118513. body && children.push(body);
  118514. children.push(this.$createElement('template', {
  118515. slot: 'actions'
  118516. }, [this.genPickerActionsSlot()]));
  118517. return this.$createElement(_components_VPicker__WEBPACK_IMPORTED_MODULE_0__["default"], {
  118518. staticClass: staticClass,
  118519. props: {
  118520. color: this.headerColor || this.color,
  118521. dark: this.dark,
  118522. fullWidth: this.fullWidth,
  118523. landscape: this.landscape,
  118524. light: this.light,
  118525. width: this.width,
  118526. noTitle: this.noTitle
  118527. }
  118528. }, children);
  118529. }
  118530. }
  118531. }));
  118532. /***/ }),
  118533. /***/ "./src/mixins/positionable/index.ts":
  118534. /*!******************************************!*\
  118535. !*** ./src/mixins/positionable/index.ts ***!
  118536. \******************************************/
  118537. /*! exports provided: factory, default */
  118538. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118539. "use strict";
  118540. __webpack_require__.r(__webpack_exports__);
  118541. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "factory", function() { return factory; });
  118542. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  118543. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  118544. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  118545. var availableProps = {
  118546. absolute: Boolean,
  118547. bottom: Boolean,
  118548. fixed: Boolean,
  118549. left: Boolean,
  118550. right: Boolean,
  118551. top: Boolean
  118552. };
  118553. function factory(selected) {
  118554. if (selected === void 0) {
  118555. selected = [];
  118556. }
  118557. return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  118558. name: 'positionable',
  118559. props: selected.length ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["filterObjectOnKeys"])(availableProps, selected) : availableProps
  118560. });
  118561. }
  118562. /* harmony default export */ __webpack_exports__["default"] = (factory()); // Add a `*` before the second `/`
  118563. /* Tests /
  118564. let single = factory(['top']).extend({
  118565. created () {
  118566. this.top
  118567. this.bottom
  118568. this.absolute
  118569. }
  118570. })
  118571. let some = factory(['top', 'bottom']).extend({
  118572. created () {
  118573. this.top
  118574. this.bottom
  118575. this.absolute
  118576. }
  118577. })
  118578. let all = factory().extend({
  118579. created () {
  118580. this.top
  118581. this.bottom
  118582. this.absolute
  118583. this.foobar
  118584. }
  118585. })
  118586. /**/
  118587. /***/ }),
  118588. /***/ "./src/mixins/proxyable/index.ts":
  118589. /*!***************************************!*\
  118590. !*** ./src/mixins/proxyable/index.ts ***!
  118591. \***************************************/
  118592. /*! exports provided: factory, default */
  118593. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118594. "use strict";
  118595. __webpack_require__.r(__webpack_exports__);
  118596. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "factory", function() { return factory; });
  118597. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  118598. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  118599. function factory(prop, event) {
  118600. var _a, _b;
  118601. if (prop === void 0) {
  118602. prop = 'value';
  118603. }
  118604. if (event === void 0) {
  118605. event = 'change';
  118606. }
  118607. return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  118608. name: 'proxyable',
  118609. model: {
  118610. prop: prop,
  118611. event: event
  118612. },
  118613. props: (_a = {}, _a[prop] = {
  118614. required: false
  118615. }, _a),
  118616. data: function data() {
  118617. return {
  118618. internalLazyValue: this[prop]
  118619. };
  118620. },
  118621. computed: {
  118622. internalValue: {
  118623. get: function get() {
  118624. return this.internalLazyValue;
  118625. },
  118626. set: function set(val) {
  118627. if (val === this.internalLazyValue) return;
  118628. this.internalLazyValue = val;
  118629. this.$emit(event, val);
  118630. }
  118631. }
  118632. },
  118633. watch: (_b = {}, _b[prop] = function (val) {
  118634. this.internalLazyValue = val;
  118635. }, _b)
  118636. });
  118637. }
  118638. /* eslint-disable-next-line no-redeclare */
  118639. var Proxyable = factory();
  118640. /* harmony default export */ __webpack_exports__["default"] = (Proxyable);
  118641. /***/ }),
  118642. /***/ "./src/mixins/registrable/index.ts":
  118643. /*!*****************************************!*\
  118644. !*** ./src/mixins/registrable/index.ts ***!
  118645. \*****************************************/
  118646. /*! exports provided: inject, provide */
  118647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118648. "use strict";
  118649. __webpack_require__.r(__webpack_exports__);
  118650. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return inject; });
  118651. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "provide", function() { return provide; });
  118652. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  118653. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  118654. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  118655. function generateWarning(child, parent) {
  118656. return function () {
  118657. return Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleWarn"])("The " + child + " component must be used inside a " + parent);
  118658. };
  118659. }
  118660. function inject(namespace, child, parent) {
  118661. var _a;
  118662. var defaultImpl = child && parent ? {
  118663. register: generateWarning(child, parent),
  118664. unregister: generateWarning(child, parent)
  118665. } : null;
  118666. return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  118667. name: 'registrable-inject',
  118668. inject: (_a = {}, _a[namespace] = {
  118669. default: defaultImpl
  118670. }, _a)
  118671. });
  118672. }
  118673. function provide(namespace, self) {
  118674. if (self === void 0) {
  118675. self = false;
  118676. }
  118677. return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  118678. name: 'registrable-provide',
  118679. methods: self ? {} : {
  118680. register: null,
  118681. unregister: null
  118682. },
  118683. provide: function provide() {
  118684. var _a;
  118685. return _a = {}, _a[namespace] = self ? this : {
  118686. register: this.register,
  118687. unregister: this.unregister
  118688. }, _a;
  118689. }
  118690. });
  118691. }
  118692. /***/ }),
  118693. /***/ "./src/mixins/returnable/index.ts":
  118694. /*!****************************************!*\
  118695. !*** ./src/mixins/returnable/index.ts ***!
  118696. \****************************************/
  118697. /*! exports provided: default */
  118698. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118699. "use strict";
  118700. __webpack_require__.r(__webpack_exports__);
  118701. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  118702. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  118703. /* @vue/component */
  118704. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  118705. name: 'returnable',
  118706. props: {
  118707. returnValue: null
  118708. },
  118709. data: function data() {
  118710. return {
  118711. isActive: false,
  118712. originalValue: null
  118713. };
  118714. },
  118715. watch: {
  118716. isActive: function isActive(val) {
  118717. if (val) {
  118718. this.originalValue = this.returnValue;
  118719. } else {
  118720. this.$emit('update:return-value', this.originalValue);
  118721. }
  118722. }
  118723. },
  118724. methods: {
  118725. save: function save(value) {
  118726. var _this = this;
  118727. this.originalValue = value;
  118728. setTimeout(function () {
  118729. _this.isActive = false;
  118730. });
  118731. }
  118732. }
  118733. }));
  118734. /***/ }),
  118735. /***/ "./src/mixins/rippleable/index.ts":
  118736. /*!****************************************!*\
  118737. !*** ./src/mixins/rippleable/index.ts ***!
  118738. \****************************************/
  118739. /*! exports provided: default */
  118740. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118741. "use strict";
  118742. __webpack_require__.r(__webpack_exports__);
  118743. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  118744. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "vue");
  118745. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
  118746. // Directives
  118747. // Types
  118748. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_1___default.a.extend({
  118749. name: 'rippleable',
  118750. directives: {
  118751. ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_0__["default"]
  118752. },
  118753. props: {
  118754. ripple: {
  118755. type: [Boolean, Object],
  118756. default: true
  118757. }
  118758. },
  118759. methods: {
  118760. genRipple: function genRipple(data) {
  118761. if (data === void 0) {
  118762. data = {};
  118763. }
  118764. if (!this.ripple) return null;
  118765. data.staticClass = 'v-input--selection-controls__ripple';
  118766. data.directives = data.directives || [];
  118767. data.directives.push({
  118768. name: 'ripple',
  118769. value: {
  118770. center: true
  118771. }
  118772. });
  118773. data.on = Object.assign({
  118774. click: this.onChange
  118775. }, this.$listeners);
  118776. return this.$createElement('div', data);
  118777. },
  118778. onChange: function onChange() {}
  118779. }
  118780. }));
  118781. /***/ }),
  118782. /***/ "./src/mixins/routable/index.ts":
  118783. /*!**************************************!*\
  118784. !*** ./src/mixins/routable/index.ts ***!
  118785. \**************************************/
  118786. /*! exports provided: default */
  118787. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118788. "use strict";
  118789. __webpack_require__.r(__webpack_exports__);
  118790. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  118791. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  118792. /* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple/index.ts");
  118793. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  118794. var __assign = undefined && undefined.__assign || function () {
  118795. __assign = Object.assign || function (t) {
  118796. for (var s, i = 1, n = arguments.length; i < n; i++) {
  118797. s = arguments[i];
  118798. for (var p in s) {
  118799. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  118800. }
  118801. }
  118802. return t;
  118803. };
  118804. return __assign.apply(this, arguments);
  118805. };
  118806. // Directives
  118807. // Utilities
  118808. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  118809. name: 'routable',
  118810. directives: {
  118811. Ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_1__["default"]
  118812. },
  118813. props: {
  118814. activeClass: String,
  118815. append: Boolean,
  118816. disabled: Boolean,
  118817. exact: {
  118818. type: Boolean,
  118819. default: undefined
  118820. },
  118821. exactActiveClass: String,
  118822. link: Boolean,
  118823. href: [String, Object],
  118824. to: [String, Object],
  118825. nuxt: Boolean,
  118826. replace: Boolean,
  118827. ripple: {
  118828. type: [Boolean, Object],
  118829. default: null
  118830. },
  118831. tag: String,
  118832. target: String
  118833. },
  118834. data: function data() {
  118835. return {
  118836. isActive: false,
  118837. proxyClass: ''
  118838. };
  118839. },
  118840. computed: {
  118841. classes: function classes() {
  118842. var classes = {};
  118843. if (this.to) return classes;
  118844. if (this.activeClass) classes[this.activeClass] = this.isActive;
  118845. if (this.proxyClass) classes[this.proxyClass] = this.isActive;
  118846. return classes;
  118847. },
  118848. computedRipple: function computedRipple() {
  118849. return this.ripple != null ? this.ripple : !this.disabled && this.isClickable;
  118850. },
  118851. isClickable: function isClickable() {
  118852. if (this.disabled) return false;
  118853. return Boolean(this.isLink || this.$listeners.click || this.$listeners['!click'] || this.$attrs.tabindex);
  118854. },
  118855. isLink: function isLink() {
  118856. return this.to || this.href || this.link;
  118857. },
  118858. styles: function styles() {
  118859. return {};
  118860. }
  118861. },
  118862. watch: {
  118863. $route: 'onRouteChange'
  118864. },
  118865. methods: {
  118866. click: function click(e) {
  118867. this.$emit('click', e);
  118868. },
  118869. generateRouteLink: function generateRouteLink() {
  118870. var _a;
  118871. var exact = this.exact;
  118872. var tag;
  118873. var data = (_a = {
  118874. attrs: {
  118875. tabindex: 'tabindex' in this.$attrs ? this.$attrs.tabindex : undefined
  118876. },
  118877. class: this.classes,
  118878. style: this.styles,
  118879. props: {},
  118880. directives: [{
  118881. name: 'ripple',
  118882. value: this.computedRipple
  118883. }]
  118884. }, _a[this.to ? 'nativeOn' : 'on'] = __assign({}, this.$listeners, {
  118885. click: this.click
  118886. }), _a.ref = 'link', _a);
  118887. if (typeof this.exact === 'undefined') {
  118888. exact = this.to === '/' || this.to === Object(this.to) && this.to.path === '/';
  118889. }
  118890. if (this.to) {
  118891. // Add a special activeClass hook
  118892. // for component level styles
  118893. var activeClass = this.activeClass;
  118894. var exactActiveClass = this.exactActiveClass || activeClass;
  118895. if (this.proxyClass) {
  118896. activeClass = (activeClass + " " + this.proxyClass).trim();
  118897. exactActiveClass = (exactActiveClass + " " + this.proxyClass).trim();
  118898. }
  118899. tag = this.nuxt ? 'nuxt-link' : 'router-link';
  118900. Object.assign(data.props, {
  118901. to: this.to,
  118902. exact: exact,
  118903. activeClass: activeClass,
  118904. exactActiveClass: exactActiveClass,
  118905. append: this.append,
  118906. replace: this.replace
  118907. });
  118908. } else {
  118909. tag = this.href && 'a' || this.tag || 'div';
  118910. if (tag === 'a' && this.href) data.attrs.href = this.href;
  118911. }
  118912. if (this.target) data.attrs.target = this.target;
  118913. return {
  118914. tag: tag,
  118915. data: data
  118916. };
  118917. },
  118918. onRouteChange: function onRouteChange() {
  118919. var _this = this;
  118920. if (!this.to || !this.$refs.link || !this.$route) return;
  118921. var activeClass = (this.activeClass + " " + (this.proxyClass || '')).trim();
  118922. var path = "_vnode.data.class." + activeClass;
  118923. this.$nextTick(function () {
  118924. /* istanbul ignore else */
  118925. if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["getObjectValueByPath"])(_this.$refs.link, path)) {
  118926. _this.toggle();
  118927. }
  118928. });
  118929. },
  118930. toggle: function toggle() {}
  118931. }
  118932. }));
  118933. /***/ }),
  118934. /***/ "./src/mixins/scrollable/index.ts":
  118935. /*!****************************************!*\
  118936. !*** ./src/mixins/scrollable/index.ts ***!
  118937. \****************************************/
  118938. /*! exports provided: default */
  118939. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118940. "use strict";
  118941. __webpack_require__.r(__webpack_exports__);
  118942. /* harmony import */ var _directives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../directives */ "./src/directives/index.ts");
  118943. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  118944. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "vue");
  118945. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);
  118946. // Directives
  118947. // Utilities
  118948. // Types
  118949. /**
  118950. * Scrollable
  118951. *
  118952. * Used for monitoring scrolling and
  118953. * invoking functions based upon
  118954. * scrolling thresholds being
  118955. * met.
  118956. */
  118957. /* @vue/component */
  118958. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_2___default.a.extend({
  118959. name: 'scrollable',
  118960. directives: {
  118961. Scroll: _directives__WEBPACK_IMPORTED_MODULE_0__["Scroll"]
  118962. },
  118963. props: {
  118964. scrollTarget: String,
  118965. scrollThreshold: [String, Number]
  118966. },
  118967. data: function data() {
  118968. return {
  118969. currentScroll: 0,
  118970. currentThreshold: 0,
  118971. isActive: false,
  118972. isScrollingUp: false,
  118973. previousScroll: 0,
  118974. savedScroll: 0,
  118975. target: null
  118976. };
  118977. },
  118978. computed: {
  118979. /**
  118980. * A computed property that returns
  118981. * whether scrolling features are
  118982. * enabled or disabled
  118983. */
  118984. canScroll: function canScroll() {
  118985. return typeof window !== 'undefined';
  118986. },
  118987. /**
  118988. * The threshold that must be met before
  118989. * thresholdMet function is invoked
  118990. */
  118991. computedScrollThreshold: function computedScrollThreshold() {
  118992. return this.scrollThreshold ? Number(this.scrollThreshold) : 300;
  118993. }
  118994. },
  118995. watch: {
  118996. isScrollingUp: function isScrollingUp() {
  118997. this.savedScroll = this.savedScroll || this.currentScroll;
  118998. },
  118999. isActive: function isActive() {
  119000. this.savedScroll = 0;
  119001. }
  119002. },
  119003. mounted: function mounted() {
  119004. if (this.scrollTarget) {
  119005. this.target = document.querySelector(this.scrollTarget);
  119006. if (!this.target) {
  119007. Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleWarn"])("Unable to locate element with identifier " + this.scrollTarget, this);
  119008. }
  119009. }
  119010. },
  119011. methods: {
  119012. onScroll: function onScroll() {
  119013. var _this = this;
  119014. if (!this.canScroll) return;
  119015. this.previousScroll = this.currentScroll;
  119016. this.currentScroll = this.target ? this.target.scrollTop : window.pageYOffset;
  119017. this.isScrollingUp = this.currentScroll < this.previousScroll;
  119018. this.currentThreshold = Math.abs(this.currentScroll - this.computedScrollThreshold);
  119019. this.$nextTick(function () {
  119020. if (Math.abs(_this.currentScroll - _this.savedScroll) > _this.computedScrollThreshold) _this.thresholdMet();
  119021. });
  119022. },
  119023. /**
  119024. * The method invoked when
  119025. * scrolling in any direction
  119026. * has exceeded the threshold
  119027. */
  119028. thresholdMet: function thresholdMet() {}
  119029. }
  119030. }));
  119031. /***/ }),
  119032. /***/ "./src/mixins/selectable/index.ts":
  119033. /*!****************************************!*\
  119034. !*** ./src/mixins/selectable/index.ts ***!
  119035. \****************************************/
  119036. /*! exports provided: default */
  119037. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119038. "use strict";
  119039. __webpack_require__.r(__webpack_exports__);
  119040. /* harmony import */ var _components_VInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../components/VInput */ "./src/components/VInput/index.ts");
  119041. /* harmony import */ var _rippleable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../rippleable */ "./src/mixins/rippleable/index.ts");
  119042. /* harmony import */ var _comparable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../comparable */ "./src/mixins/comparable/index.ts");
  119043. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  119044. // Components
  119045. // Mixins
  119046. // Utilities
  119047. /* @vue/component */
  119048. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_components_VInput__WEBPACK_IMPORTED_MODULE_0__["default"], _rippleable__WEBPACK_IMPORTED_MODULE_1__["default"], _comparable__WEBPACK_IMPORTED_MODULE_2__["default"]).extend({
  119049. name: 'selectable',
  119050. model: {
  119051. prop: 'inputValue',
  119052. event: 'change'
  119053. },
  119054. props: {
  119055. id: String,
  119056. inputValue: null,
  119057. falseValue: null,
  119058. trueValue: null,
  119059. multiple: {
  119060. type: Boolean,
  119061. default: null
  119062. },
  119063. label: String
  119064. },
  119065. data: function data() {
  119066. return {
  119067. hasColor: this.inputValue,
  119068. lazyValue: this.inputValue
  119069. };
  119070. },
  119071. computed: {
  119072. computedColor: function computedColor() {
  119073. if (!this.isActive) return undefined;
  119074. if (this.color) return this.color;
  119075. if (this.isDark && !this.appIsDark) return 'white';
  119076. return 'primary';
  119077. },
  119078. isMultiple: function isMultiple() {
  119079. return this.multiple === true || this.multiple === null && Array.isArray(this.internalValue);
  119080. },
  119081. isActive: function isActive() {
  119082. var _this = this;
  119083. var value = this.value;
  119084. var input = this.internalValue;
  119085. if (this.isMultiple) {
  119086. if (!Array.isArray(input)) return false;
  119087. return input.some(function (item) {
  119088. return _this.valueComparator(item, value);
  119089. });
  119090. }
  119091. if (this.trueValue === undefined || this.falseValue === undefined) {
  119092. return value ? this.valueComparator(value, input) : Boolean(input);
  119093. }
  119094. return this.valueComparator(input, this.trueValue);
  119095. },
  119096. isDirty: function isDirty() {
  119097. return this.isActive;
  119098. },
  119099. rippleState: function rippleState() {
  119100. return !this.disabled && !this.validationState ? undefined : this.validationState;
  119101. }
  119102. },
  119103. watch: {
  119104. inputValue: function inputValue(val) {
  119105. this.lazyValue = val;
  119106. this.hasColor = val;
  119107. }
  119108. },
  119109. methods: {
  119110. genLabel: function genLabel() {
  119111. var _this = this;
  119112. var label = _components_VInput__WEBPACK_IMPORTED_MODULE_0__["default"].options.methods.genLabel.call(this);
  119113. if (!label) return label;
  119114. label.data.on = {
  119115. click: function click(e) {
  119116. // Prevent label from
  119117. // causing the input
  119118. // to focus
  119119. e.preventDefault();
  119120. _this.onChange();
  119121. }
  119122. };
  119123. return label;
  119124. },
  119125. genInput: function genInput(type, attrs) {
  119126. return this.$createElement('input', {
  119127. attrs: Object.assign({
  119128. 'aria-checked': this.isActive.toString(),
  119129. disabled: this.isDisabled,
  119130. id: this.computedId,
  119131. role: type,
  119132. type: type
  119133. }, attrs),
  119134. domProps: {
  119135. value: this.value,
  119136. checked: this.isActive
  119137. },
  119138. on: {
  119139. blur: this.onBlur,
  119140. change: this.onChange,
  119141. focus: this.onFocus,
  119142. keydown: this.onKeydown
  119143. },
  119144. ref: 'input'
  119145. });
  119146. },
  119147. onBlur: function onBlur() {
  119148. this.isFocused = false;
  119149. },
  119150. onChange: function onChange() {
  119151. var _this = this;
  119152. if (this.isDisabled) return;
  119153. var value = this.value;
  119154. var input = this.internalValue;
  119155. if (this.isMultiple) {
  119156. if (!Array.isArray(input)) {
  119157. input = [];
  119158. }
  119159. var length = input.length;
  119160. input = input.filter(function (item) {
  119161. return !_this.valueComparator(item, value);
  119162. });
  119163. if (input.length === length) {
  119164. input.push(value);
  119165. }
  119166. } else if (this.trueValue !== undefined && this.falseValue !== undefined) {
  119167. input = this.valueComparator(input, this.trueValue) ? this.falseValue : this.trueValue;
  119168. } else if (value) {
  119169. input = this.valueComparator(input, value) ? null : value;
  119170. } else {
  119171. input = !input;
  119172. }
  119173. this.validate(true, input);
  119174. this.internalValue = input;
  119175. this.hasColor = input;
  119176. },
  119177. onFocus: function onFocus() {
  119178. this.isFocused = true;
  119179. },
  119180. /** @abstract */
  119181. onKeydown: function onKeydown(e) {}
  119182. }
  119183. }));
  119184. /***/ }),
  119185. /***/ "./src/mixins/sizeable/index.ts":
  119186. /*!**************************************!*\
  119187. !*** ./src/mixins/sizeable/index.ts ***!
  119188. \**************************************/
  119189. /*! exports provided: default */
  119190. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119191. "use strict";
  119192. __webpack_require__.r(__webpack_exports__);
  119193. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  119194. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  119195. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  119196. name: 'sizeable',
  119197. props: {
  119198. large: Boolean,
  119199. small: Boolean,
  119200. xLarge: Boolean,
  119201. xSmall: Boolean
  119202. },
  119203. computed: {
  119204. medium: function medium() {
  119205. return Boolean(!this.xSmall && !this.small && !this.large && !this.xLarge);
  119206. },
  119207. sizeableClasses: function sizeableClasses() {
  119208. return {
  119209. 'v-size--x-small': this.xSmall,
  119210. 'v-size--small': this.small,
  119211. 'v-size--default': this.medium,
  119212. 'v-size--large': this.large,
  119213. 'v-size--x-large': this.xLarge
  119214. };
  119215. }
  119216. }
  119217. }));
  119218. /***/ }),
  119219. /***/ "./src/mixins/ssr-bootable/index.ts":
  119220. /*!******************************************!*\
  119221. !*** ./src/mixins/ssr-bootable/index.ts ***!
  119222. \******************************************/
  119223. /*! exports provided: default */
  119224. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119225. "use strict";
  119226. __webpack_require__.r(__webpack_exports__);
  119227. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  119228. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  119229. /**
  119230. * SSRBootable
  119231. *
  119232. * @mixin
  119233. *
  119234. * Used in layout components (drawer, toolbar, content)
  119235. * to avoid an entry animation when using SSR
  119236. */
  119237. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  119238. name: 'ssr-bootable',
  119239. data: function data() {
  119240. return {
  119241. isBooted: false
  119242. };
  119243. },
  119244. mounted: function mounted() {
  119245. var _this = this; // Use setAttribute instead of dataset
  119246. // because dataset does not work well
  119247. // with unit tests
  119248. window.requestAnimationFrame(function () {
  119249. _this.$el.setAttribute('data-booted', 'true');
  119250. _this.isBooted = true;
  119251. });
  119252. }
  119253. }));
  119254. /***/ }),
  119255. /***/ "./src/mixins/stackable/index.ts":
  119256. /*!***************************************!*\
  119257. !*** ./src/mixins/stackable/index.ts ***!
  119258. \***************************************/
  119259. /*! exports provided: default */
  119260. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119261. "use strict";
  119262. __webpack_require__.r(__webpack_exports__);
  119263. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  119264. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  119265. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  119266. var __read = undefined && undefined.__read || function (o, n) {
  119267. var m = typeof Symbol === "function" && o[Symbol.iterator];
  119268. if (!m) return o;
  119269. var i = m.call(o),
  119270. r,
  119271. ar = [],
  119272. e;
  119273. try {
  119274. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  119275. ar.push(r.value);
  119276. }
  119277. } catch (error) {
  119278. e = {
  119279. error: error
  119280. };
  119281. } finally {
  119282. try {
  119283. if (r && !r.done && (m = i["return"])) m.call(i);
  119284. } finally {
  119285. if (e) throw e.error;
  119286. }
  119287. }
  119288. return ar;
  119289. };
  119290. var __spread = undefined && undefined.__spread || function () {
  119291. for (var ar = [], i = 0; i < arguments.length; i++) {
  119292. ar = ar.concat(__read(arguments[i]));
  119293. }
  119294. return ar;
  119295. };
  119296. /* @vue/component */
  119297. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend().extend({
  119298. name: 'stackable',
  119299. data: function data() {
  119300. return {
  119301. stackElement: null,
  119302. stackExclude: null,
  119303. stackMinZIndex: 0,
  119304. isActive: false
  119305. };
  119306. },
  119307. computed: {
  119308. activeZIndex: function activeZIndex() {
  119309. if (typeof window === 'undefined') return 0;
  119310. var content = this.stackElement || this.$refs.content; // Return current zindex if not active
  119311. var index = !this.isActive ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["getZIndex"])(content) : this.getMaxZIndex(this.stackExclude || [content]) + 2;
  119312. if (index == null) return index; // Return max current z-index (excluding self) + 2
  119313. // (2 to leave room for an overlay below, if needed)
  119314. return parseInt(index);
  119315. }
  119316. },
  119317. methods: {
  119318. getMaxZIndex: function getMaxZIndex(exclude) {
  119319. if (exclude === void 0) {
  119320. exclude = [];
  119321. }
  119322. var base = this.$el; // Start with lowest allowed z-index or z-index of
  119323. // base component's element, whichever is greater
  119324. var zis = [this.stackMinZIndex, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["getZIndex"])(base)]; // Convert the NodeList to an array to
  119325. // prevent an Edge bug with Symbol.iterator
  119326. // https://github.com/vuetifyjs/vuetify/issues/2146
  119327. var activeElements = __spread(document.getElementsByClassName('v-menu__content--active'), document.getElementsByClassName('v-dialog__content--active')); // Get z-index for all active dialogs
  119328. for (var index = 0; index < activeElements.length; index++) {
  119329. if (!exclude.includes(activeElements[index])) {
  119330. zis.push(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["getZIndex"])(activeElements[index]));
  119331. }
  119332. }
  119333. return Math.max.apply(Math, __spread(zis));
  119334. }
  119335. }
  119336. }));
  119337. /***/ }),
  119338. /***/ "./src/mixins/themeable/index.ts":
  119339. /*!***************************************!*\
  119340. !*** ./src/mixins/themeable/index.ts ***!
  119341. \***************************************/
  119342. /*! exports provided: functionalThemeClasses, default */
  119343. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119344. "use strict";
  119345. __webpack_require__.r(__webpack_exports__);
  119346. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "functionalThemeClasses", function() { return functionalThemeClasses; });
  119347. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  119348. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  119349. var __assign = undefined && undefined.__assign || function () {
  119350. __assign = Object.assign || function (t) {
  119351. for (var s, i = 1, n = arguments.length; i < n; i++) {
  119352. s = arguments[i];
  119353. for (var p in s) {
  119354. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  119355. }
  119356. }
  119357. return t;
  119358. };
  119359. return __assign.apply(this, arguments);
  119360. };
  119361. function functionalThemeClasses(context) {
  119362. var vm = __assign({}, context.props, context.injections);
  119363. var isDark = Themeable.options.computed.isDark.call(vm);
  119364. return Themeable.options.computed.themeClasses.call({
  119365. isDark: isDark
  119366. });
  119367. }
  119368. /* @vue/component */
  119369. var Themeable = vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend().extend({
  119370. name: 'themeable',
  119371. provide: function provide() {
  119372. return {
  119373. theme: this.themeableProvide
  119374. };
  119375. },
  119376. inject: {
  119377. theme: {
  119378. default: {
  119379. isDark: false
  119380. }
  119381. }
  119382. },
  119383. props: {
  119384. dark: {
  119385. type: Boolean,
  119386. default: null
  119387. },
  119388. light: {
  119389. type: Boolean,
  119390. default: null
  119391. }
  119392. },
  119393. data: function data() {
  119394. return {
  119395. themeableProvide: {
  119396. isDark: false
  119397. }
  119398. };
  119399. },
  119400. computed: {
  119401. appIsDark: function appIsDark() {
  119402. return this.$vuetify.theme.dark || false;
  119403. },
  119404. isDark: function isDark() {
  119405. if (this.dark === true) {
  119406. // explicitly dark
  119407. return true;
  119408. } else if (this.light === true) {
  119409. // explicitly light
  119410. return false;
  119411. } else {
  119412. // inherit from parent, or default false if there is none
  119413. return this.theme.isDark;
  119414. }
  119415. },
  119416. themeClasses: function themeClasses() {
  119417. return {
  119418. 'theme--dark': this.isDark,
  119419. 'theme--light': !this.isDark
  119420. };
  119421. },
  119422. /** Used by menus and dialogs, inherits from v-app instead of the parent */
  119423. rootIsDark: function rootIsDark() {
  119424. if (this.dark === true) {
  119425. // explicitly dark
  119426. return true;
  119427. } else if (this.light === true) {
  119428. // explicitly light
  119429. return false;
  119430. } else {
  119431. // inherit from v-app
  119432. return this.appIsDark;
  119433. }
  119434. },
  119435. rootThemeClasses: function rootThemeClasses() {
  119436. return {
  119437. 'theme--dark': this.rootIsDark,
  119438. 'theme--light': !this.rootIsDark
  119439. };
  119440. }
  119441. },
  119442. watch: {
  119443. isDark: {
  119444. handler: function handler(newVal, oldVal) {
  119445. if (newVal !== oldVal) {
  119446. this.themeableProvide.isDark = this.isDark;
  119447. }
  119448. },
  119449. immediate: true
  119450. }
  119451. }
  119452. });
  119453. /* harmony default export */ __webpack_exports__["default"] = (Themeable);
  119454. /***/ }),
  119455. /***/ "./src/mixins/toggleable/index.ts":
  119456. /*!****************************************!*\
  119457. !*** ./src/mixins/toggleable/index.ts ***!
  119458. \****************************************/
  119459. /*! exports provided: factory, default */
  119460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119461. "use strict";
  119462. __webpack_require__.r(__webpack_exports__);
  119463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "factory", function() { return factory; });
  119464. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  119465. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  119466. function factory(prop, event) {
  119467. var _a, _b;
  119468. if (prop === void 0) {
  119469. prop = 'value';
  119470. }
  119471. if (event === void 0) {
  119472. event = 'input';
  119473. }
  119474. return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  119475. name: 'toggleable',
  119476. model: {
  119477. prop: prop,
  119478. event: event
  119479. },
  119480. props: (_a = {}, _a[prop] = {
  119481. required: false
  119482. }, _a),
  119483. data: function data() {
  119484. return {
  119485. isActive: !!this[prop]
  119486. };
  119487. },
  119488. watch: (_b = {}, _b[prop] = function (val) {
  119489. this.isActive = !!val;
  119490. }, _b.isActive = function (val) {
  119491. !!val !== this[prop] && this.$emit(event, val);
  119492. }, _b)
  119493. });
  119494. }
  119495. /* eslint-disable-next-line no-redeclare */
  119496. var Toggleable = factory();
  119497. /* harmony default export */ __webpack_exports__["default"] = (Toggleable);
  119498. /***/ }),
  119499. /***/ "./src/mixins/transitionable/index.ts":
  119500. /*!********************************************!*\
  119501. !*** ./src/mixins/transitionable/index.ts ***!
  119502. \********************************************/
  119503. /*! exports provided: default */
  119504. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119505. "use strict";
  119506. __webpack_require__.r(__webpack_exports__);
  119507. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  119508. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  119509. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  119510. name: 'transitionable',
  119511. props: {
  119512. mode: String,
  119513. origin: String,
  119514. transition: String
  119515. }
  119516. }));
  119517. /***/ }),
  119518. /***/ "./src/mixins/translatable/index.ts":
  119519. /*!******************************************!*\
  119520. !*** ./src/mixins/translatable/index.ts ***!
  119521. \******************************************/
  119522. /*! exports provided: default */
  119523. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119524. "use strict";
  119525. __webpack_require__.r(__webpack_exports__);
  119526. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  119527. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  119528. /* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  119529. name: 'translatable',
  119530. props: {
  119531. height: Number
  119532. },
  119533. data: function data() {
  119534. return {
  119535. elOffsetTop: 0,
  119536. parallax: 0,
  119537. parallaxDist: 0,
  119538. percentScrolled: 0,
  119539. scrollTop: 0,
  119540. windowHeight: 0,
  119541. windowBottom: 0
  119542. };
  119543. },
  119544. computed: {
  119545. imgHeight: function imgHeight() {
  119546. return this.objHeight();
  119547. }
  119548. },
  119549. beforeDestroy: function beforeDestroy() {
  119550. window.removeEventListener('scroll', this.translate, false);
  119551. window.removeEventListener('resize', this.translate, false);
  119552. },
  119553. methods: {
  119554. calcDimensions: function calcDimensions() {
  119555. var offset = this.$el.getBoundingClientRect();
  119556. this.scrollTop = window.pageYOffset;
  119557. this.parallaxDist = this.imgHeight - this.height;
  119558. this.elOffsetTop = offset.top + this.scrollTop;
  119559. this.windowHeight = window.innerHeight;
  119560. this.windowBottom = this.scrollTop + this.windowHeight;
  119561. },
  119562. listeners: function listeners() {
  119563. window.addEventListener('scroll', this.translate, false);
  119564. window.addEventListener('resize', this.translate, false);
  119565. },
  119566. /** @abstract **/
  119567. objHeight: function objHeight() {
  119568. throw new Error('Not implemented !');
  119569. },
  119570. translate: function translate() {
  119571. this.calcDimensions();
  119572. this.percentScrolled = (this.windowBottom - this.elOffsetTop) / (parseInt(this.height) + this.windowHeight);
  119573. this.parallax = Math.round(this.parallaxDist * this.percentScrolled);
  119574. }
  119575. }
  119576. }));
  119577. /***/ }),
  119578. /***/ "./src/mixins/validatable/index.ts":
  119579. /*!*****************************************!*\
  119580. !*** ./src/mixins/validatable/index.ts ***!
  119581. \*****************************************/
  119582. /*! exports provided: default */
  119583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119584. "use strict";
  119585. __webpack_require__.r(__webpack_exports__);
  119586. /* harmony import */ var _colorable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colorable */ "./src/mixins/colorable/index.ts");
  119587. /* harmony import */ var _themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../themeable */ "./src/mixins/themeable/index.ts");
  119588. /* harmony import */ var _registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../registrable */ "./src/mixins/registrable/index.ts");
  119589. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  119590. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  119591. /* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
  119592. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  119593. // Mixins
  119594. // Utilities
  119595. /* @vue/component */
  119596. /* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_colorable__WEBPACK_IMPORTED_MODULE_0__["default"], Object(_registrable__WEBPACK_IMPORTED_MODULE_2__["inject"])('form'), _themeable__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
  119597. name: 'validatable',
  119598. props: {
  119599. disabled: Boolean,
  119600. error: Boolean,
  119601. errorCount: {
  119602. type: [Number, String],
  119603. default: 1
  119604. },
  119605. errorMessages: {
  119606. type: [String, Array],
  119607. default: function _default() {
  119608. return [];
  119609. }
  119610. },
  119611. messages: {
  119612. type: [String, Array],
  119613. default: function _default() {
  119614. return [];
  119615. }
  119616. },
  119617. readonly: Boolean,
  119618. rules: {
  119619. type: Array,
  119620. default: function _default() {
  119621. return [];
  119622. }
  119623. },
  119624. success: Boolean,
  119625. successMessages: {
  119626. type: [String, Array],
  119627. default: function _default() {
  119628. return [];
  119629. }
  119630. },
  119631. validateOnBlur: Boolean,
  119632. value: {
  119633. required: false
  119634. }
  119635. },
  119636. data: function data() {
  119637. return {
  119638. errorBucket: [],
  119639. hasColor: false,
  119640. hasFocused: false,
  119641. hasInput: false,
  119642. isFocused: false,
  119643. isResetting: false,
  119644. lazyValue: this.value,
  119645. valid: false
  119646. };
  119647. },
  119648. computed: {
  119649. computedColor: function computedColor() {
  119650. if (this.disabled) return undefined;
  119651. if (this.color) return this.color; // It's assumed that if the input is on a
  119652. // dark background, the user will want to
  119653. // have a white color. If the entire app
  119654. // is setup to be dark, then they will
  119655. // like want to use their primary color
  119656. if (this.isDark && !this.appIsDark) return 'white';else return 'primary';
  119657. },
  119658. hasError: function hasError() {
  119659. return this.internalErrorMessages.length > 0 || this.errorBucket.length > 0 || this.error;
  119660. },
  119661. // TODO: Add logic that allows the user to enable based
  119662. // upon a good validation
  119663. hasSuccess: function hasSuccess() {
  119664. return this.internalSuccessMessages.length > 0 || this.success;
  119665. },
  119666. externalError: function externalError() {
  119667. return this.internalErrorMessages.length > 0 || this.error;
  119668. },
  119669. hasMessages: function hasMessages() {
  119670. return this.validationTarget.length > 0;
  119671. },
  119672. hasState: function hasState() {
  119673. if (this.disabled) return false;
  119674. return this.hasSuccess || this.shouldValidate && this.hasError;
  119675. },
  119676. internalErrorMessages: function internalErrorMessages() {
  119677. return this.genInternalMessages(this.errorMessages);
  119678. },
  119679. internalMessages: function internalMessages() {
  119680. return this.genInternalMessages(this.messages);
  119681. },
  119682. internalSuccessMessages: function internalSuccessMessages() {
  119683. return this.genInternalMessages(this.successMessages);
  119684. },
  119685. internalValue: {
  119686. get: function get() {
  119687. return this.lazyValue;
  119688. },
  119689. set: function set(val) {
  119690. this.lazyValue = val;
  119691. this.$emit('input', val);
  119692. }
  119693. },
  119694. shouldValidate: function shouldValidate() {
  119695. if (this.externalError) return true;
  119696. if (this.isResetting) return false;
  119697. return this.validateOnBlur ? this.hasFocused && !this.isFocused : this.hasInput || this.hasFocused;
  119698. },
  119699. validations: function validations() {
  119700. return this.validationTarget.slice(0, Number(this.errorCount));
  119701. },
  119702. validationState: function validationState() {
  119703. if (this.disabled) return undefined;
  119704. if (this.hasError && this.shouldValidate) return 'error';
  119705. if (this.hasSuccess) return 'success';
  119706. if (this.hasColor) return this.computedColor;
  119707. return undefined;
  119708. },
  119709. validationTarget: function validationTarget() {
  119710. if (this.internalErrorMessages.length > 0) {
  119711. return this.internalErrorMessages;
  119712. } else if (this.successMessages.length > 0) {
  119713. return this.internalSuccessMessages;
  119714. } else if (this.messages.length > 0) {
  119715. return this.internalMessages;
  119716. } else if (this.shouldValidate) {
  119717. return this.errorBucket;
  119718. } else return [];
  119719. }
  119720. },
  119721. watch: {
  119722. rules: {
  119723. handler: function handler(newVal, oldVal) {
  119724. if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["deepEqual"])(newVal, oldVal)) return;
  119725. this.validate();
  119726. },
  119727. deep: true
  119728. },
  119729. internalValue: function internalValue() {
  119730. // If it's the first time we're setting input,
  119731. // mark it with hasInput
  119732. this.hasInput = true;
  119733. this.validateOnBlur || this.$nextTick(this.validate);
  119734. },
  119735. isFocused: function isFocused(val) {
  119736. // Should not check validation
  119737. // if disabled
  119738. if (!val && !this.disabled) {
  119739. this.hasFocused = true;
  119740. this.validateOnBlur && this.$nextTick(this.validate);
  119741. }
  119742. },
  119743. isResetting: function isResetting() {
  119744. var _this = this;
  119745. setTimeout(function () {
  119746. _this.hasInput = false;
  119747. _this.hasFocused = false;
  119748. _this.isResetting = false;
  119749. _this.validate();
  119750. }, 0);
  119751. },
  119752. hasError: function hasError(val) {
  119753. if (this.shouldValidate) {
  119754. this.$emit('update:error', val);
  119755. }
  119756. },
  119757. value: function value(val) {
  119758. this.lazyValue = val;
  119759. }
  119760. },
  119761. beforeMount: function beforeMount() {
  119762. this.validate();
  119763. },
  119764. created: function created() {
  119765. this.form && this.form.register(this);
  119766. },
  119767. beforeDestroy: function beforeDestroy() {
  119768. this.form && this.form.unregister(this);
  119769. },
  119770. methods: {
  119771. genInternalMessages: function genInternalMessages(messages) {
  119772. if (!messages) return [];else if (Array.isArray(messages)) return messages;else return [messages];
  119773. },
  119774. /** @public */
  119775. reset: function reset() {
  119776. this.isResetting = true;
  119777. this.internalValue = Array.isArray(this.internalValue) ? [] : undefined;
  119778. },
  119779. /** @public */
  119780. resetValidation: function resetValidation() {
  119781. this.isResetting = true;
  119782. },
  119783. /** @public */
  119784. validate: function validate(force, value) {
  119785. if (force === void 0) {
  119786. force = false;
  119787. }
  119788. var errorBucket = [];
  119789. value = value || this.internalValue;
  119790. if (force) this.hasInput = this.hasFocused = true;
  119791. for (var index = 0; index < this.rules.length; index++) {
  119792. var rule = this.rules[index];
  119793. var valid = typeof rule === 'function' ? rule(value) : rule;
  119794. if (valid === false || typeof valid === 'string') {
  119795. errorBucket.push(valid || '');
  119796. } else if (typeof valid !== 'boolean') {
  119797. Object(_util_console__WEBPACK_IMPORTED_MODULE_4__["consoleError"])("Rules should return a string or boolean, received '" + _typeof(valid) + "' instead", this);
  119798. }
  119799. }
  119800. this.errorBucket = errorBucket;
  119801. this.valid = errorBucket.length === 0;
  119802. return this.valid;
  119803. }
  119804. }
  119805. }));
  119806. /***/ }),
  119807. /***/ "./src/presets/default/index.ts":
  119808. /*!**************************************!*\
  119809. !*** ./src/presets/default/index.ts ***!
  119810. \**************************************/
  119811. /*! exports provided: preset */
  119812. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119813. "use strict";
  119814. __webpack_require__.r(__webpack_exports__);
  119815. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "preset", function() { return preset; });
  119816. /* harmony import */ var _styles_main_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../styles/main.sass */ "./src/styles/main.sass");
  119817. /* harmony import */ var _styles_main_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_styles_main_sass__WEBPACK_IMPORTED_MODULE_0__);
  119818. /* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../locale */ "./src/locale/index.ts");
  119819. // Styles
  119820. // Locale
  119821. var preset = {
  119822. breakpoint: {
  119823. scrollBarWidth: 16,
  119824. thresholds: {
  119825. xs: 600,
  119826. sm: 960,
  119827. md: 1280,
  119828. lg: 1920
  119829. }
  119830. },
  119831. icons: {
  119832. // TODO: remove v3
  119833. iconfont: 'mdi',
  119834. values: {}
  119835. },
  119836. lang: {
  119837. current: 'en',
  119838. locales: {
  119839. en: _locale__WEBPACK_IMPORTED_MODULE_1__["en"]
  119840. },
  119841. // Default translator exists in lang service
  119842. t: undefined
  119843. },
  119844. rtl: false,
  119845. theme: {
  119846. dark: false,
  119847. default: 'light',
  119848. disable: false,
  119849. options: {
  119850. cspNonce: undefined,
  119851. customProperties: undefined,
  119852. minifyTheme: undefined,
  119853. themeCache: undefined
  119854. },
  119855. themes: {
  119856. light: {
  119857. primary: '#1976D2',
  119858. secondary: '#424242',
  119859. accent: '#82B1FF',
  119860. error: '#FF5252',
  119861. info: '#2196F3',
  119862. success: '#4CAF50',
  119863. warning: '#FB8C00'
  119864. },
  119865. dark: {
  119866. primary: '#2196F3',
  119867. secondary: '#424242',
  119868. accent: '#FF4081',
  119869. error: '#FF5252',
  119870. info: '#2196F3',
  119871. success: '#4CAF50',
  119872. warning: '#FB8C00'
  119873. }
  119874. }
  119875. }
  119876. };
  119877. /***/ }),
  119878. /***/ "./src/services/application/index.ts":
  119879. /*!*******************************************!*\
  119880. !*** ./src/services/application/index.ts ***!
  119881. \*******************************************/
  119882. /*! exports provided: Application */
  119883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119884. "use strict";
  119885. __webpack_require__.r(__webpack_exports__);
  119886. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Application", function() { return Application; });
  119887. /* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ "./src/services/service/index.ts");
  119888. var __extends = undefined && undefined.__extends || function () {
  119889. var _extendStatics = function extendStatics(d, b) {
  119890. _extendStatics = Object.setPrototypeOf || {
  119891. __proto__: []
  119892. } instanceof Array && function (d, b) {
  119893. d.__proto__ = b;
  119894. } || function (d, b) {
  119895. for (var p in b) {
  119896. if (b.hasOwnProperty(p)) d[p] = b[p];
  119897. }
  119898. };
  119899. return _extendStatics(d, b);
  119900. };
  119901. return function (d, b) {
  119902. _extendStatics(d, b);
  119903. function __() {
  119904. this.constructor = d;
  119905. }
  119906. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  119907. };
  119908. }(); // Extensions
  119909. var Application =
  119910. /** @class */
  119911. function (_super) {
  119912. __extends(Application, _super);
  119913. function Application() {
  119914. var _this = _super !== null && _super.apply(this, arguments) || this;
  119915. _this.bar = 0;
  119916. _this.top = 0;
  119917. _this.left = 0;
  119918. _this.insetFooter = 0;
  119919. _this.right = 0;
  119920. _this.bottom = 0;
  119921. _this.footer = 0;
  119922. _this.application = {
  119923. bar: {},
  119924. top: {},
  119925. left: {},
  119926. insetFooter: {},
  119927. right: {},
  119928. bottom: {},
  119929. footer: {}
  119930. };
  119931. return _this;
  119932. }
  119933. Application.prototype.register = function (uid, location, size) {
  119934. var _a;
  119935. this.application[location] = (_a = {}, _a[uid] = size, _a);
  119936. this.update(location);
  119937. };
  119938. Application.prototype.unregister = function (uid, location) {
  119939. if (this.application[location][uid] == null) return;
  119940. delete this.application[location][uid];
  119941. this.update(location);
  119942. };
  119943. Application.prototype.update = function (location) {
  119944. this[location] = Object.values(this.application[location]).reduce(function (acc, cur) {
  119945. return acc + cur;
  119946. }, 0);
  119947. };
  119948. Application.property = 'application';
  119949. return Application;
  119950. }(_service__WEBPACK_IMPORTED_MODULE_0__["Service"]);
  119951. /***/ }),
  119952. /***/ "./src/services/breakpoint/index.ts":
  119953. /*!******************************************!*\
  119954. !*** ./src/services/breakpoint/index.ts ***!
  119955. \******************************************/
  119956. /*! exports provided: Breakpoint */
  119957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119958. "use strict";
  119959. __webpack_require__.r(__webpack_exports__);
  119960. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Breakpoint", function() { return Breakpoint; });
  119961. /* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ "./src/services/service/index.ts");
  119962. var __extends = undefined && undefined.__extends || function () {
  119963. var _extendStatics = function extendStatics(d, b) {
  119964. _extendStatics = Object.setPrototypeOf || {
  119965. __proto__: []
  119966. } instanceof Array && function (d, b) {
  119967. d.__proto__ = b;
  119968. } || function (d, b) {
  119969. for (var p in b) {
  119970. if (b.hasOwnProperty(p)) d[p] = b[p];
  119971. }
  119972. };
  119973. return _extendStatics(d, b);
  119974. };
  119975. return function (d, b) {
  119976. _extendStatics(d, b);
  119977. function __() {
  119978. this.constructor = d;
  119979. }
  119980. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  119981. };
  119982. }(); // Extensions
  119983. var Breakpoint =
  119984. /** @class */
  119985. function (_super) {
  119986. __extends(Breakpoint, _super);
  119987. function Breakpoint(preset) {
  119988. var _this = _super.call(this) || this; // Public
  119989. _this.xs = false;
  119990. _this.sm = false;
  119991. _this.md = false;
  119992. _this.lg = false;
  119993. _this.xl = false;
  119994. _this.xsOnly = false;
  119995. _this.smOnly = false;
  119996. _this.smAndDown = false;
  119997. _this.smAndUp = false;
  119998. _this.mdOnly = false;
  119999. _this.mdAndDown = false;
  120000. _this.mdAndUp = false;
  120001. _this.lgOnly = false;
  120002. _this.lgAndDown = false;
  120003. _this.lgAndUp = false;
  120004. _this.xlOnly = false;
  120005. _this.name = '';
  120006. _this.height = 0;
  120007. _this.width = 0;
  120008. _this.resizeTimeout = 0;
  120009. var _a = preset[Breakpoint.property],
  120010. scrollBarWidth = _a.scrollBarWidth,
  120011. thresholds = _a.thresholds;
  120012. _this.scrollBarWidth = scrollBarWidth;
  120013. _this.thresholds = thresholds;
  120014. _this.init();
  120015. return _this;
  120016. }
  120017. Breakpoint.prototype.init = function () {
  120018. /* istanbul ignore if */
  120019. if (typeof window === 'undefined') return;
  120020. window.addEventListener('resize', this.onResize.bind(this), {
  120021. passive: true
  120022. });
  120023. this.update();
  120024. };
  120025. Breakpoint.prototype.onResize = function () {
  120026. clearTimeout(this.resizeTimeout); // Added debounce to match what
  120027. // v-resize used to do but was
  120028. // removed due to a memory leak
  120029. // https://github.com/vuetifyjs/vuetify/pull/2997
  120030. this.resizeTimeout = window.setTimeout(this.update.bind(this), 200);
  120031. };
  120032. /* eslint-disable-next-line max-statements */
  120033. Breakpoint.prototype.update = function () {
  120034. var height = this.getClientHeight();
  120035. var width = this.getClientWidth();
  120036. var xs = width < this.thresholds.xs;
  120037. var sm = width < this.thresholds.sm && !xs;
  120038. var md = width < this.thresholds.md - this.scrollBarWidth && !(sm || xs);
  120039. var lg = width < this.thresholds.lg - this.scrollBarWidth && !(md || sm || xs);
  120040. var xl = width >= this.thresholds.lg - this.scrollBarWidth;
  120041. this.height = height;
  120042. this.width = width;
  120043. this.xs = xs;
  120044. this.sm = sm;
  120045. this.md = md;
  120046. this.lg = lg;
  120047. this.xl = xl;
  120048. this.xsOnly = xs;
  120049. this.smOnly = sm;
  120050. this.smAndDown = (xs || sm) && !(md || lg || xl);
  120051. this.smAndUp = !xs && (sm || md || lg || xl);
  120052. this.mdOnly = md;
  120053. this.mdAndDown = (xs || sm || md) && !(lg || xl);
  120054. this.mdAndUp = !(xs || sm) && (md || lg || xl);
  120055. this.lgOnly = lg;
  120056. this.lgAndDown = (xs || sm || md || lg) && !xl;
  120057. this.lgAndUp = !(xs || sm || md) && (lg || xl);
  120058. this.xlOnly = xl;
  120059. switch (true) {
  120060. case xs:
  120061. this.name = 'xs';
  120062. break;
  120063. case sm:
  120064. this.name = 'sm';
  120065. break;
  120066. case md:
  120067. this.name = 'md';
  120068. break;
  120069. case lg:
  120070. this.name = 'lg';
  120071. break;
  120072. default:
  120073. this.name = 'xl';
  120074. break;
  120075. }
  120076. }; // Cross-browser support as described in:
  120077. // https://stackoverflow.com/questions/1248081
  120078. Breakpoint.prototype.getClientWidth = function () {
  120079. /* istanbul ignore if */
  120080. if (typeof document === 'undefined') return 0; // SSR
  120081. return Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  120082. };
  120083. Breakpoint.prototype.getClientHeight = function () {
  120084. /* istanbul ignore if */
  120085. if (typeof document === 'undefined') return 0; // SSR
  120086. return Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  120087. };
  120088. Breakpoint.property = 'breakpoint';
  120089. return Breakpoint;
  120090. }(_service__WEBPACK_IMPORTED_MODULE_0__["Service"]);
  120091. /***/ }),
  120092. /***/ "./src/services/goto/easing-patterns.ts":
  120093. /*!**********************************************!*\
  120094. !*** ./src/services/goto/easing-patterns.ts ***!
  120095. \**********************************************/
  120096. /*! exports provided: linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint */
  120097. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120098. "use strict";
  120099. __webpack_require__.r(__webpack_exports__);
  120100. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linear", function() { return linear; });
  120101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInQuad", function() { return easeInQuad; });
  120102. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeOutQuad", function() { return easeOutQuad; });
  120103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInOutQuad", function() { return easeInOutQuad; });
  120104. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInCubic", function() { return easeInCubic; });
  120105. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeOutCubic", function() { return easeOutCubic; });
  120106. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInOutCubic", function() { return easeInOutCubic; });
  120107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInQuart", function() { return easeInQuart; });
  120108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeOutQuart", function() { return easeOutQuart; });
  120109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInOutQuart", function() { return easeInOutQuart; });
  120110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInQuint", function() { return easeInQuint; });
  120111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeOutQuint", function() { return easeOutQuint; });
  120112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInOutQuint", function() { return easeInOutQuint; });
  120113. // linear
  120114. var linear = function linear(t) {
  120115. return t;
  120116. }; // accelerating from zero velocity
  120117. var easeInQuad = function easeInQuad(t) {
  120118. return Math.pow(t, 2);
  120119. }; // decelerating to zero velocity
  120120. var easeOutQuad = function easeOutQuad(t) {
  120121. return t * (2 - t);
  120122. }; // acceleration until halfway, then deceleration
  120123. var easeInOutQuad = function easeInOutQuad(t) {
  120124. return t < 0.5 ? 2 * Math.pow(t, 2) : -1 + (4 - 2 * t) * t;
  120125. }; // accelerating from zero velocity
  120126. var easeInCubic = function easeInCubic(t) {
  120127. return Math.pow(t, 3);
  120128. }; // decelerating to zero velocity
  120129. var easeOutCubic = function easeOutCubic(t) {
  120130. return Math.pow(--t, 3) + 1;
  120131. }; // acceleration until halfway, then deceleration
  120132. var easeInOutCubic = function easeInOutCubic(t) {
  120133. return t < 0.5 ? 4 * Math.pow(t, 3) : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
  120134. }; // accelerating from zero velocity
  120135. var easeInQuart = function easeInQuart(t) {
  120136. return Math.pow(t, 4);
  120137. }; // decelerating to zero velocity
  120138. var easeOutQuart = function easeOutQuart(t) {
  120139. return 1 - Math.pow(--t, 4);
  120140. }; // acceleration until halfway, then deceleration
  120141. var easeInOutQuart = function easeInOutQuart(t) {
  120142. return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
  120143. }; // accelerating from zero velocity
  120144. var easeInQuint = function easeInQuint(t) {
  120145. return Math.pow(t, 5);
  120146. }; // decelerating to zero velocity
  120147. var easeOutQuint = function easeOutQuint(t) {
  120148. return 1 + Math.pow(--t, 5);
  120149. }; // acceleration until halfway, then deceleration
  120150. var easeInOutQuint = function easeInOutQuint(t) {
  120151. return t < 0.5 ? 16 * Math.pow(t, 5) : 1 + 16 * Math.pow(--t, 5);
  120152. };
  120153. /***/ }),
  120154. /***/ "./src/services/goto/index.ts":
  120155. /*!************************************!*\
  120156. !*** ./src/services/goto/index.ts ***!
  120157. \************************************/
  120158. /*! exports provided: default, Goto */
  120159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120160. "use strict";
  120161. __webpack_require__.r(__webpack_exports__);
  120162. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return goTo; });
  120163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Goto", function() { return Goto; });
  120164. /* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ "./src/services/service/index.ts");
  120165. /* harmony import */ var _easing_patterns__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./easing-patterns */ "./src/services/goto/easing-patterns.ts");
  120166. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ "./src/services/goto/util.ts");
  120167. var __extends = undefined && undefined.__extends || function () {
  120168. var _extendStatics = function extendStatics(d, b) {
  120169. _extendStatics = Object.setPrototypeOf || {
  120170. __proto__: []
  120171. } instanceof Array && function (d, b) {
  120172. d.__proto__ = b;
  120173. } || function (d, b) {
  120174. for (var p in b) {
  120175. if (b.hasOwnProperty(p)) d[p] = b[p];
  120176. }
  120177. };
  120178. return _extendStatics(d, b);
  120179. };
  120180. return function (d, b) {
  120181. _extendStatics(d, b);
  120182. function __() {
  120183. this.constructor = d;
  120184. }
  120185. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  120186. };
  120187. }();
  120188. var __assign = undefined && undefined.__assign || function () {
  120189. __assign = Object.assign || function (t) {
  120190. for (var s, i = 1, n = arguments.length; i < n; i++) {
  120191. s = arguments[i];
  120192. for (var p in s) {
  120193. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  120194. }
  120195. }
  120196. return t;
  120197. };
  120198. return __assign.apply(this, arguments);
  120199. }; // Extensions
  120200. // Utilities
  120201. function goTo(_target, _settings) {
  120202. if (_settings === void 0) {
  120203. _settings = {};
  120204. }
  120205. var settings = __assign({
  120206. container: document.scrollingElement || document.body || document.documentElement,
  120207. duration: 500,
  120208. offset: 0,
  120209. easing: 'easeInOutCubic',
  120210. appOffset: true
  120211. }, _settings);
  120212. var container = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getContainer"])(settings.container);
  120213. /* istanbul ignore else */
  120214. if (settings.appOffset && goTo.framework.application) {
  120215. var isDrawer = container.classList.contains('v-navigation-drawer');
  120216. var isClipped = container.classList.contains('v-navigation-drawer--clipped');
  120217. var _a = goTo.framework.application,
  120218. bar = _a.bar,
  120219. top = _a.top;
  120220. settings.offset += bar;
  120221. /* istanbul ignore else */
  120222. if (!isDrawer || isClipped) settings.offset += top;
  120223. }
  120224. var startTime = performance.now();
  120225. var targetLocation;
  120226. if (typeof _target === 'number') {
  120227. targetLocation = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getOffset"])(_target) - settings.offset;
  120228. } else {
  120229. targetLocation = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getOffset"])(_target) - Object(_util__WEBPACK_IMPORTED_MODULE_2__["getOffset"])(container) - settings.offset;
  120230. }
  120231. var startLocation = container.scrollTop;
  120232. if (targetLocation === startLocation) return Promise.resolve(targetLocation);
  120233. var ease = typeof settings.easing === 'function' ? settings.easing : _easing_patterns__WEBPACK_IMPORTED_MODULE_1__[settings.easing];
  120234. /* istanbul ignore else */
  120235. if (!ease) throw new TypeError("Easing function \"" + settings.easing + "\" not found."); // Cannot be tested properly in jsdom
  120236. // tslint:disable-next-line:promise-must-complete
  120237. /* istanbul ignore next */
  120238. return new Promise(function (resolve) {
  120239. return requestAnimationFrame(function step(currentTime) {
  120240. var timeElapsed = currentTime - startTime;
  120241. var progress = Math.abs(settings.duration ? Math.min(timeElapsed / settings.duration, 1) : 1);
  120242. container.scrollTop = Math.floor(startLocation + (targetLocation - startLocation) * ease(progress));
  120243. var clientHeight = container === document.body ? document.documentElement.clientHeight : container.clientHeight;
  120244. if (progress === 1 || clientHeight + container.scrollTop === container.scrollHeight) {
  120245. return resolve(targetLocation);
  120246. }
  120247. requestAnimationFrame(step);
  120248. });
  120249. });
  120250. }
  120251. goTo.framework = {};
  120252. goTo.init = function () {};
  120253. var Goto =
  120254. /** @class */
  120255. function (_super) {
  120256. __extends(Goto, _super);
  120257. function Goto() {
  120258. var _this = _super.call(this) || this;
  120259. return goTo;
  120260. }
  120261. Goto.property = 'goTo';
  120262. return Goto;
  120263. }(_service__WEBPACK_IMPORTED_MODULE_0__["Service"]);
  120264. /***/ }),
  120265. /***/ "./src/services/goto/util.ts":
  120266. /*!***********************************!*\
  120267. !*** ./src/services/goto/util.ts ***!
  120268. \***********************************/
  120269. /*! exports provided: getOffset, getContainer */
  120270. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120271. "use strict";
  120272. __webpack_require__.r(__webpack_exports__);
  120273. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOffset", function() { return getOffset; });
  120274. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getContainer", function() { return getContainer; });
  120275. // Return target's cumulative offset from the top
  120276. function getOffset(target) {
  120277. if (typeof target === 'number') {
  120278. return target;
  120279. }
  120280. var el = $(target);
  120281. if (!el) {
  120282. throw typeof target === 'string' ? new Error("Target element \"" + target + "\" not found.") : new TypeError("Target must be a Number/Selector/HTMLElement/VueComponent, received " + type(target) + " instead.");
  120283. }
  120284. var totalOffset = 0;
  120285. while (el) {
  120286. totalOffset += el.offsetTop;
  120287. el = el.offsetParent;
  120288. }
  120289. return totalOffset;
  120290. }
  120291. function getContainer(container) {
  120292. var el = $(container);
  120293. if (el) return el;
  120294. throw typeof container === 'string' ? new Error("Container element \"" + container + "\" not found.") : new TypeError("Container must be a Selector/HTMLElement/VueComponent, received " + type(container) + " instead.");
  120295. }
  120296. function type(el) {
  120297. return el == null ? el : el.constructor.name;
  120298. }
  120299. function $(el) {
  120300. if (typeof el === 'string') {
  120301. return document.querySelector(el);
  120302. } else if (el && el._isVue) {
  120303. return el.$el;
  120304. } else if (el instanceof HTMLElement) {
  120305. return el;
  120306. } else {
  120307. return null;
  120308. }
  120309. }
  120310. /***/ }),
  120311. /***/ "./src/services/icons/index.ts":
  120312. /*!*************************************!*\
  120313. !*** ./src/services/icons/index.ts ***!
  120314. \*************************************/
  120315. /*! exports provided: Icons */
  120316. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120317. "use strict";
  120318. __webpack_require__.r(__webpack_exports__);
  120319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Icons", function() { return Icons; });
  120320. /* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ "./src/services/service/index.ts");
  120321. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  120322. /* harmony import */ var _presets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./presets */ "./src/services/icons/presets/index.ts");
  120323. var __extends = undefined && undefined.__extends || function () {
  120324. var _extendStatics = function extendStatics(d, b) {
  120325. _extendStatics = Object.setPrototypeOf || {
  120326. __proto__: []
  120327. } instanceof Array && function (d, b) {
  120328. d.__proto__ = b;
  120329. } || function (d, b) {
  120330. for (var p in b) {
  120331. if (b.hasOwnProperty(p)) d[p] = b[p];
  120332. }
  120333. };
  120334. return _extendStatics(d, b);
  120335. };
  120336. return function (d, b) {
  120337. _extendStatics(d, b);
  120338. function __() {
  120339. this.constructor = d;
  120340. }
  120341. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  120342. };
  120343. }(); // Extensions
  120344. // Utilities
  120345. // Presets
  120346. var Icons =
  120347. /** @class */
  120348. function (_super) {
  120349. __extends(Icons, _super);
  120350. function Icons(preset) {
  120351. var _this = _super.call(this) || this;
  120352. var _a = preset[Icons.property],
  120353. iconfont = _a.iconfont,
  120354. values = _a.values;
  120355. _this.iconfont = iconfont;
  120356. _this.values = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["mergeDeep"])(_presets__WEBPACK_IMPORTED_MODULE_2__["default"][iconfont], values);
  120357. return _this;
  120358. }
  120359. Icons.property = 'icons';
  120360. return Icons;
  120361. }(_service__WEBPACK_IMPORTED_MODULE_0__["Service"]);
  120362. /***/ }),
  120363. /***/ "./src/services/icons/presets/fa-svg.ts":
  120364. /*!**********************************************!*\
  120365. !*** ./src/services/icons/presets/fa-svg.ts ***!
  120366. \**********************************************/
  120367. /*! exports provided: convertToComponentDeclarations, default */
  120368. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120369. "use strict";
  120370. __webpack_require__.r(__webpack_exports__);
  120371. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToComponentDeclarations", function() { return convertToComponentDeclarations; });
  120372. /* harmony import */ var _fa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fa */ "./src/services/icons/presets/fa.ts");
  120373. function convertToComponentDeclarations(component, iconSet) {
  120374. var result = {};
  120375. for (var key in iconSet) {
  120376. result[key] = {
  120377. component: component,
  120378. props: {
  120379. icon: iconSet[key].split(' fa-')
  120380. }
  120381. };
  120382. }
  120383. return result;
  120384. }
  120385. /* harmony default export */ __webpack_exports__["default"] = (convertToComponentDeclarations('font-awesome-icon', _fa__WEBPACK_IMPORTED_MODULE_0__["default"]));
  120386. /***/ }),
  120387. /***/ "./src/services/icons/presets/fa.ts":
  120388. /*!******************************************!*\
  120389. !*** ./src/services/icons/presets/fa.ts ***!
  120390. \******************************************/
  120391. /*! exports provided: default */
  120392. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120393. "use strict";
  120394. __webpack_require__.r(__webpack_exports__);
  120395. var icons = {
  120396. complete: 'fas fa-check',
  120397. cancel: 'fas fa-times-circle',
  120398. close: 'fas fa-times',
  120399. delete: 'fas fa-times-circle',
  120400. clear: 'fas fa-times-circle',
  120401. success: 'fas fa-check-circle',
  120402. info: 'fas fa-info-circle',
  120403. warning: 'fas fa-exclamation',
  120404. error: 'fas fa-exclamation-triangle',
  120405. prev: 'fas fa-chevron-left',
  120406. next: 'fas fa-chevron-right',
  120407. checkboxOn: 'fas fa-check-square',
  120408. checkboxOff: 'far fa-square',
  120409. checkboxIndeterminate: 'fas fa-minus-square',
  120410. delimiter: 'fas fa-circle',
  120411. sort: 'fas fa-sort-up',
  120412. expand: 'fas fa-chevron-down',
  120413. menu: 'fas fa-bars',
  120414. subgroup: 'fas fa-caret-down',
  120415. dropdown: 'fas fa-caret-down',
  120416. radioOn: 'far fa-dot-circle',
  120417. radioOff: 'far fa-circle',
  120418. edit: 'fas fa-edit',
  120419. ratingEmpty: 'far fa-star',
  120420. ratingFull: 'fas fa-star',
  120421. ratingHalf: 'fas fa-star-half',
  120422. loading: 'fas fa-sync',
  120423. first: 'fas fa-step-backward',
  120424. last: 'fas fa-step-forward',
  120425. unfold: 'fas fa-arrows-alt-v',
  120426. file: 'fas fa-paperclip',
  120427. plus: 'fas fa-plus',
  120428. minus: 'fas fa-minus'
  120429. };
  120430. /* harmony default export */ __webpack_exports__["default"] = (icons);
  120431. /***/ }),
  120432. /***/ "./src/services/icons/presets/fa4.ts":
  120433. /*!*******************************************!*\
  120434. !*** ./src/services/icons/presets/fa4.ts ***!
  120435. \*******************************************/
  120436. /*! exports provided: default */
  120437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120438. "use strict";
  120439. __webpack_require__.r(__webpack_exports__);
  120440. var icons = {
  120441. complete: 'fa fa-check',
  120442. cancel: 'fa fa-times-circle',
  120443. close: 'fa fa-times',
  120444. delete: 'fa fa-times-circle',
  120445. clear: 'fa fa-times-circle',
  120446. success: 'fa fa-check-circle',
  120447. info: 'fa fa-info-circle',
  120448. warning: 'fa fa-exclamation',
  120449. error: 'fa fa-exclamation-triangle',
  120450. prev: 'fa fa-chevron-left',
  120451. next: 'fa fa-chevron-right',
  120452. checkboxOn: 'fa fa-check-square',
  120453. checkboxOff: 'fa fa-square-o',
  120454. checkboxIndeterminate: 'fa fa-minus-square',
  120455. delimiter: 'fa fa-circle',
  120456. sort: 'fa fa-sort-up',
  120457. expand: 'fa fa-chevron-down',
  120458. menu: 'fa fa-bars',
  120459. subgroup: 'fa fa-caret-down',
  120460. dropdown: 'fa fa-caret-down',
  120461. radioOn: 'fa fa-dot-circle-o',
  120462. radioOff: 'fa fa-circle-o',
  120463. edit: 'fa fa-pencil',
  120464. ratingEmpty: 'fa fa-star-o',
  120465. ratingFull: 'fa fa-star',
  120466. ratingHalf: 'fa fa-star-half-o',
  120467. loading: 'fa fa-refresh',
  120468. first: 'fa fa-step-backward',
  120469. last: 'fa fa-step-forward',
  120470. unfold: 'fa fa-angle-double-down',
  120471. file: 'fa fa-paperclip',
  120472. plus: 'fa fa-plus',
  120473. minus: 'fa fa-minus'
  120474. };
  120475. /* harmony default export */ __webpack_exports__["default"] = (icons);
  120476. /***/ }),
  120477. /***/ "./src/services/icons/presets/index.ts":
  120478. /*!*********************************************!*\
  120479. !*** ./src/services/icons/presets/index.ts ***!
  120480. \*********************************************/
  120481. /*! exports provided: default */
  120482. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120483. "use strict";
  120484. __webpack_require__.r(__webpack_exports__);
  120485. /* harmony import */ var _mdi_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mdi-svg */ "./src/services/icons/presets/mdi-svg.ts");
  120486. /* harmony import */ var _md__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./md */ "./src/services/icons/presets/md.ts");
  120487. /* harmony import */ var _mdi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mdi */ "./src/services/icons/presets/mdi.ts");
  120488. /* harmony import */ var _fa__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fa */ "./src/services/icons/presets/fa.ts");
  120489. /* harmony import */ var _fa4__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fa4 */ "./src/services/icons/presets/fa4.ts");
  120490. /* harmony import */ var _fa_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./fa-svg */ "./src/services/icons/presets/fa-svg.ts");
  120491. /* harmony default export */ __webpack_exports__["default"] = (Object.freeze({
  120492. mdiSvg: _mdi_svg__WEBPACK_IMPORTED_MODULE_0__["default"],
  120493. md: _md__WEBPACK_IMPORTED_MODULE_1__["default"],
  120494. mdi: _mdi__WEBPACK_IMPORTED_MODULE_2__["default"],
  120495. fa: _fa__WEBPACK_IMPORTED_MODULE_3__["default"],
  120496. fa4: _fa4__WEBPACK_IMPORTED_MODULE_4__["default"],
  120497. faSvg: _fa_svg__WEBPACK_IMPORTED_MODULE_5__["default"]
  120498. }));
  120499. /***/ }),
  120500. /***/ "./src/services/icons/presets/md.ts":
  120501. /*!******************************************!*\
  120502. !*** ./src/services/icons/presets/md.ts ***!
  120503. \******************************************/
  120504. /*! exports provided: default */
  120505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120506. "use strict";
  120507. __webpack_require__.r(__webpack_exports__);
  120508. var icons = {
  120509. complete: 'check',
  120510. cancel: 'cancel',
  120511. close: 'close',
  120512. delete: 'cancel',
  120513. clear: 'clear',
  120514. success: 'check_circle',
  120515. info: 'info',
  120516. warning: 'priority_high',
  120517. error: 'warning',
  120518. prev: 'chevron_left',
  120519. next: 'chevron_right',
  120520. checkboxOn: 'check_box',
  120521. checkboxOff: 'check_box_outline_blank',
  120522. checkboxIndeterminate: 'indeterminate_check_box',
  120523. delimiter: 'fiber_manual_record',
  120524. sort: 'arrow_upward',
  120525. expand: 'keyboard_arrow_down',
  120526. menu: 'menu',
  120527. subgroup: 'arrow_drop_down',
  120528. dropdown: 'arrow_drop_down',
  120529. radioOn: 'radio_button_checked',
  120530. radioOff: 'radio_button_unchecked',
  120531. edit: 'edit',
  120532. ratingEmpty: 'star_border',
  120533. ratingFull: 'star',
  120534. ratingHalf: 'star_half',
  120535. loading: 'cached',
  120536. first: 'first_page',
  120537. last: 'last_page',
  120538. unfold: 'unfold_more',
  120539. file: 'attach_file',
  120540. plus: 'add',
  120541. minus: 'remove'
  120542. };
  120543. /* harmony default export */ __webpack_exports__["default"] = (icons);
  120544. /***/ }),
  120545. /***/ "./src/services/icons/presets/mdi-svg.ts":
  120546. /*!***********************************************!*\
  120547. !*** ./src/services/icons/presets/mdi-svg.ts ***!
  120548. \***********************************************/
  120549. /*! exports provided: default */
  120550. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120551. "use strict";
  120552. __webpack_require__.r(__webpack_exports__);
  120553. var icons = {
  120554. complete: 'M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z',
  120555. cancel: 'M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z',
  120556. close: 'M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z',
  120557. delete: 'M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z',
  120558. clear: 'M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z',
  120559. success: 'M12,2C17.52,2 22,6.48 22,12C22,17.52 17.52,22 12,22C6.48,22 2,17.52 2,12C2,6.48 6.48,2 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z',
  120560. info: 'M13,9H11V7H13M13,17H11V11H13M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2Z',
  120561. warning: 'M11,4.5H13V15.5H11V4.5M13,17.5V19.5H11V17.5H13Z',
  120562. error: 'M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z',
  120563. prev: 'M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z',
  120564. next: 'M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z',
  120565. checkboxOn: 'M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.89 20.1,3 19,3Z',
  120566. checkboxOff: 'M19,3H5C3.89,3 3,3.89 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z',
  120567. checkboxIndeterminate: 'M17,13H7V11H17M19,3H5C3.89,3 3,3.89 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.89 20.1,3 19,3Z',
  120568. delimiter: 'M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2Z',
  120569. sort: 'M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z',
  120570. expand: 'M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z',
  120571. menu: 'M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z',
  120572. subgroup: 'M7,10L12,15L17,10H7Z',
  120573. dropdown: 'M7,10L12,15L17,10H7Z',
  120574. radioOn: 'M12,20C7.58,20 4,16.42 4,12C4,7.58 7.58,4 12,4C16.42,4 20,7.58 20,12C20,16.42 16.42,20 12,20M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2M12,7C9.24,7 7,9.24 7,12C7,14.76 9.24,17 12,17C14.76,17 17,14.76 17,12C17,9.24 14.76,7 12,7Z',
  120575. radioOff: 'M12,20C7.58,20 4,16.42 4,12C4,7.58 7.58,4 12,4C16.42,4 20,7.58 20,12C20,16.42 16.42,20 12,20M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2Z',
  120576. edit: 'M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z',
  120577. ratingEmpty: 'M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z',
  120578. ratingFull: 'M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z',
  120579. ratingHalf: 'M12,15.4V6.1L13.71,10.13L18.09,10.5L14.77,13.39L15.76,17.67M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z',
  120580. loading: 'M19,8L15,12H18C18,15.31 15.31,18 12,18C11,18 10.03,17.75 9.2,17.3L7.74,18.76C8.97,19.54 10.43,20 12,20C16.42,20 20,16.42 20,12H23M6,12C6,8.69 8.69,6 12,6C13,6 13.97,6.25 14.8,6.7L16.26,5.24C15.03,4.46 13.57,4 12,4C7.58,4 4,7.58 4,12H1L5,16L9,12',
  120581. first: 'M18.41,16.59L13.82,12L18.41,7.41L17,6L11,12L17,18L18.41,16.59M6,6H8V18H6V6Z',
  120582. last: 'M5.59,7.41L10.18,12L5.59,16.59L7,18L13,12L7,6L5.59,7.41M16,6H18V18H16V6Z',
  120583. unfold: 'M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z',
  120584. file: 'M16.5,6V17.5C16.5,19.71 14.71,21.5 12.5,21.5C10.29,21.5 8.5,19.71 8.5,17.5V5C8.5,3.62 9.62,2.5 11,2.5C12.38,2.5 13.5,3.62 13.5,5V15.5C13.5,16.05 13.05,16.5 12.5,16.5C11.95,16.5 11.5,16.05 11.5,15.5V6H10V15.5C10,16.88 11.12,18 12.5,18C13.88,18 15,16.88 15,15.5V5C15,2.79 13.21,1 11,1C8.79,1 7,2.79 7,5V17.5C7,20.54 9.46,23 12.5,23C15.54,23 18,20.54 18,17.5V6H16.5Z',
  120585. plus: 'M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z',
  120586. minus: 'M19,13H5V11H19V13Z'
  120587. };
  120588. /* harmony default export */ __webpack_exports__["default"] = (icons);
  120589. /***/ }),
  120590. /***/ "./src/services/icons/presets/mdi.ts":
  120591. /*!*******************************************!*\
  120592. !*** ./src/services/icons/presets/mdi.ts ***!
  120593. \*******************************************/
  120594. /*! exports provided: default */
  120595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120596. "use strict";
  120597. __webpack_require__.r(__webpack_exports__);
  120598. var icons = {
  120599. complete: 'mdi-check',
  120600. cancel: 'mdi-close-circle',
  120601. close: 'mdi-close',
  120602. delete: 'mdi-close-circle',
  120603. clear: 'mdi-close',
  120604. success: 'mdi-check-circle',
  120605. info: 'mdi-information',
  120606. warning: 'mdi-exclamation',
  120607. error: 'mdi-alert',
  120608. prev: 'mdi-chevron-left',
  120609. next: 'mdi-chevron-right',
  120610. checkboxOn: 'mdi-checkbox-marked',
  120611. checkboxOff: 'mdi-checkbox-blank-outline',
  120612. checkboxIndeterminate: 'mdi-minus-box',
  120613. delimiter: 'mdi-circle',
  120614. sort: 'mdi-arrow-up',
  120615. expand: 'mdi-chevron-down',
  120616. menu: 'mdi-menu',
  120617. subgroup: 'mdi-menu-down',
  120618. dropdown: 'mdi-menu-down',
  120619. radioOn: 'mdi-radiobox-marked',
  120620. radioOff: 'mdi-radiobox-blank',
  120621. edit: 'mdi-pencil',
  120622. ratingEmpty: 'mdi-star-outline',
  120623. ratingFull: 'mdi-star',
  120624. ratingHalf: 'mdi-star-half',
  120625. loading: 'mdi-cached',
  120626. first: 'mdi-page-first',
  120627. last: 'mdi-page-last',
  120628. unfold: 'mdi-unfold-more-horizontal',
  120629. file: 'mdi-paperclip',
  120630. plus: 'mdi-plus',
  120631. minus: 'mdi-minus'
  120632. };
  120633. /* harmony default export */ __webpack_exports__["default"] = (icons);
  120634. /***/ }),
  120635. /***/ "./src/services/index.ts":
  120636. /*!*******************************!*\
  120637. !*** ./src/services/index.ts ***!
  120638. \*******************************/
  120639. /*! exports provided: Application, Breakpoint, Goto, Icons, Lang, Presets, Theme */
  120640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120641. "use strict";
  120642. __webpack_require__.r(__webpack_exports__);
  120643. /* harmony import */ var _application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./application */ "./src/services/application/index.ts");
  120644. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Application", function() { return _application__WEBPACK_IMPORTED_MODULE_0__["Application"]; });
  120645. /* harmony import */ var _breakpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./breakpoint */ "./src/services/breakpoint/index.ts");
  120646. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Breakpoint", function() { return _breakpoint__WEBPACK_IMPORTED_MODULE_1__["Breakpoint"]; });
  120647. /* harmony import */ var _goto__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./goto */ "./src/services/goto/index.ts");
  120648. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Goto", function() { return _goto__WEBPACK_IMPORTED_MODULE_2__["Goto"]; });
  120649. /* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./icons */ "./src/services/icons/index.ts");
  120650. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Icons", function() { return _icons__WEBPACK_IMPORTED_MODULE_3__["Icons"]; });
  120651. /* harmony import */ var _lang__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lang */ "./src/services/lang/index.ts");
  120652. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Lang", function() { return _lang__WEBPACK_IMPORTED_MODULE_4__["Lang"]; });
  120653. /* harmony import */ var _presets__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./presets */ "./src/services/presets/index.ts");
  120654. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Presets", function() { return _presets__WEBPACK_IMPORTED_MODULE_5__["Presets"]; });
  120655. /* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./theme */ "./src/services/theme/index.ts");
  120656. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Theme", function() { return _theme__WEBPACK_IMPORTED_MODULE_6__["Theme"]; });
  120657. /***/ }),
  120658. /***/ "./src/services/lang/index.ts":
  120659. /*!************************************!*\
  120660. !*** ./src/services/lang/index.ts ***!
  120661. \************************************/
  120662. /*! exports provided: Lang */
  120663. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120664. "use strict";
  120665. __webpack_require__.r(__webpack_exports__);
  120666. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Lang", function() { return Lang; });
  120667. /* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ "./src/services/service/index.ts");
  120668. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  120669. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  120670. var __extends = undefined && undefined.__extends || function () {
  120671. var _extendStatics = function extendStatics(d, b) {
  120672. _extendStatics = Object.setPrototypeOf || {
  120673. __proto__: []
  120674. } instanceof Array && function (d, b) {
  120675. d.__proto__ = b;
  120676. } || function (d, b) {
  120677. for (var p in b) {
  120678. if (b.hasOwnProperty(p)) d[p] = b[p];
  120679. }
  120680. };
  120681. return _extendStatics(d, b);
  120682. };
  120683. return function (d, b) {
  120684. _extendStatics(d, b);
  120685. function __() {
  120686. this.constructor = d;
  120687. }
  120688. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  120689. };
  120690. }();
  120691. var __read = undefined && undefined.__read || function (o, n) {
  120692. var m = typeof Symbol === "function" && o[Symbol.iterator];
  120693. if (!m) return o;
  120694. var i = m.call(o),
  120695. r,
  120696. ar = [],
  120697. e;
  120698. try {
  120699. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  120700. ar.push(r.value);
  120701. }
  120702. } catch (error) {
  120703. e = {
  120704. error: error
  120705. };
  120706. } finally {
  120707. try {
  120708. if (r && !r.done && (m = i["return"])) m.call(i);
  120709. } finally {
  120710. if (e) throw e.error;
  120711. }
  120712. }
  120713. return ar;
  120714. };
  120715. var __spread = undefined && undefined.__spread || function () {
  120716. for (var ar = [], i = 0; i < arguments.length; i++) {
  120717. ar = ar.concat(__read(arguments[i]));
  120718. }
  120719. return ar;
  120720. }; // Extensions
  120721. // Utilities
  120722. var LANG_PREFIX = '$vuetify.';
  120723. var fallback = Symbol('Lang fallback');
  120724. function getTranslation(locale, key, usingDefault, defaultLocale) {
  120725. if (usingDefault === void 0) {
  120726. usingDefault = false;
  120727. }
  120728. var shortKey = key.replace(LANG_PREFIX, '');
  120729. var translation = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["getObjectValueByPath"])(locale, shortKey, fallback);
  120730. if (translation === fallback) {
  120731. if (usingDefault) {
  120732. Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["consoleError"])("Translation key \"" + shortKey + "\" not found in fallback");
  120733. translation = key;
  120734. } else {
  120735. Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["consoleWarn"])("Translation key \"" + shortKey + "\" not found, falling back to default");
  120736. translation = getTranslation(defaultLocale, key, true, defaultLocale);
  120737. }
  120738. }
  120739. return translation;
  120740. }
  120741. var Lang =
  120742. /** @class */
  120743. function (_super) {
  120744. __extends(Lang, _super);
  120745. function Lang(preset) {
  120746. var _this = _super.call(this) || this;
  120747. _this.defaultLocale = 'en';
  120748. var _a = preset[Lang.property],
  120749. current = _a.current,
  120750. locales = _a.locales,
  120751. t = _a.t;
  120752. _this.current = current;
  120753. _this.locales = locales;
  120754. _this.translator = t || _this.defaultTranslator;
  120755. return _this;
  120756. }
  120757. Lang.prototype.currentLocale = function (key) {
  120758. var translation = this.locales[this.current];
  120759. var defaultLocale = this.locales[this.defaultLocale];
  120760. return getTranslation(translation, key, false, defaultLocale);
  120761. };
  120762. Lang.prototype.t = function (key) {
  120763. var params = [];
  120764. for (var _i = 1; _i < arguments.length; _i++) {
  120765. params[_i - 1] = arguments[_i];
  120766. }
  120767. if (!key.startsWith(LANG_PREFIX)) return this.replace(key, params);
  120768. return this.translator.apply(this, __spread([key], params));
  120769. };
  120770. Lang.prototype.defaultTranslator = function (key) {
  120771. var params = [];
  120772. for (var _i = 1; _i < arguments.length; _i++) {
  120773. params[_i - 1] = arguments[_i];
  120774. }
  120775. return this.replace(this.currentLocale(key), params);
  120776. };
  120777. Lang.prototype.replace = function (str, params) {
  120778. return str.replace(/\{(\d+)\}/g, function (match, index) {
  120779. /* istanbul ignore next */
  120780. return String(params[+index]);
  120781. });
  120782. };
  120783. Lang.property = 'lang';
  120784. return Lang;
  120785. }(_service__WEBPACK_IMPORTED_MODULE_0__["Service"]);
  120786. /***/ }),
  120787. /***/ "./src/services/presets/index.ts":
  120788. /*!***************************************!*\
  120789. !*** ./src/services/presets/index.ts ***!
  120790. \***************************************/
  120791. /*! exports provided: Presets */
  120792. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120793. "use strict";
  120794. __webpack_require__.r(__webpack_exports__);
  120795. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Presets", function() { return Presets; });
  120796. /* harmony import */ var _presets_default__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../presets/default */ "./src/presets/default/index.ts");
  120797. /* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
  120798. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  120799. /* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../service */ "./src/services/service/index.ts");
  120800. var __extends = undefined && undefined.__extends || function () {
  120801. var _extendStatics = function extendStatics(d, b) {
  120802. _extendStatics = Object.setPrototypeOf || {
  120803. __proto__: []
  120804. } instanceof Array && function (d, b) {
  120805. d.__proto__ = b;
  120806. } || function (d, b) {
  120807. for (var p in b) {
  120808. if (b.hasOwnProperty(p)) d[p] = b[p];
  120809. }
  120810. };
  120811. return _extendStatics(d, b);
  120812. };
  120813. return function (d, b) {
  120814. _extendStatics(d, b);
  120815. function __() {
  120816. this.constructor = d;
  120817. }
  120818. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  120819. };
  120820. }();
  120821. var __rest = undefined && undefined.__rest || function (s, e) {
  120822. var t = {};
  120823. for (var p in s) {
  120824. if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  120825. }
  120826. if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  120827. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  120828. }
  120829. return t;
  120830. }; // Preset
  120831. // Utilities
  120832. var Presets =
  120833. /** @class */
  120834. function (_super) {
  120835. __extends(Presets, _super);
  120836. function Presets(parentPreset, parent) {
  120837. var _this = _super.call(this) || this; // The default preset
  120838. var defaultPreset = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["mergeDeep"])({}, _presets_default__WEBPACK_IMPORTED_MODULE_0__["preset"]); // The user provided preset
  120839. var userPreset = parent.userPreset; // The user provided global preset
  120840. var _a = userPreset.preset,
  120841. globalPreset = _a === void 0 ? {} : _a,
  120842. preset = __rest(userPreset, ["preset"]);
  120843. if (globalPreset.preset != null) {
  120844. Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleWarn"])('Global presets do not support the **preset** option, it can be safely omitted');
  120845. }
  120846. parent.preset = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["mergeDeep"])(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["mergeDeep"])(defaultPreset, globalPreset), preset);
  120847. return _this;
  120848. }
  120849. Presets.property = 'presets';
  120850. return Presets;
  120851. }(_service__WEBPACK_IMPORTED_MODULE_3__["Service"]);
  120852. /***/ }),
  120853. /***/ "./src/services/service/index.ts":
  120854. /*!***************************************!*\
  120855. !*** ./src/services/service/index.ts ***!
  120856. \***************************************/
  120857. /*! exports provided: Service */
  120858. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120859. "use strict";
  120860. __webpack_require__.r(__webpack_exports__);
  120861. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Service", function() { return Service; });
  120862. var Service =
  120863. /** @class */
  120864. function () {
  120865. function Service() {
  120866. this.framework = {};
  120867. }
  120868. Service.prototype.init = function (root, ssrContext) {};
  120869. return Service;
  120870. }();
  120871. /***/ }),
  120872. /***/ "./src/services/theme/index.ts":
  120873. /*!*************************************!*\
  120874. !*** ./src/services/theme/index.ts ***!
  120875. \*************************************/
  120876. /*! exports provided: Theme */
  120877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120878. "use strict";
  120879. __webpack_require__.r(__webpack_exports__);
  120880. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Theme", function() { return Theme; });
  120881. /* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ "./src/services/service/index.ts");
  120882. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./src/services/theme/utils.ts");
  120883. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "vue");
  120884. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);
  120885. var __extends = undefined && undefined.__extends || function () {
  120886. var _extendStatics = function extendStatics(d, b) {
  120887. _extendStatics = Object.setPrototypeOf || {
  120888. __proto__: []
  120889. } instanceof Array && function (d, b) {
  120890. d.__proto__ = b;
  120891. } || function (d, b) {
  120892. for (var p in b) {
  120893. if (b.hasOwnProperty(p)) d[p] = b[p];
  120894. }
  120895. };
  120896. return _extendStatics(d, b);
  120897. };
  120898. return function (d, b) {
  120899. _extendStatics(d, b);
  120900. function __() {
  120901. this.constructor = d;
  120902. }
  120903. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  120904. };
  120905. }();
  120906. /* eslint-disable no-multi-spaces */
  120907. // Extensions
  120908. // Utilities
  120909. // Types
  120910. var Theme =
  120911. /** @class */
  120912. function (_super) {
  120913. __extends(Theme, _super);
  120914. function Theme(preset) {
  120915. var _this = _super.call(this) || this;
  120916. _this.disabled = false;
  120917. _this.isDark = null;
  120918. _this.vueInstance = null;
  120919. _this.vueMeta = null;
  120920. var _a = preset[Theme.property],
  120921. dark = _a.dark,
  120922. disable = _a.disable,
  120923. options = _a.options,
  120924. themes = _a.themes;
  120925. _this.dark = Boolean(dark);
  120926. _this.defaults = _this.themes = themes;
  120927. _this.options = options;
  120928. if (disable) {
  120929. _this.disabled = true;
  120930. return _this;
  120931. }
  120932. _this.themes = {
  120933. dark: _this.fillVariant(themes.dark, true),
  120934. light: _this.fillVariant(themes.light, false)
  120935. };
  120936. return _this;
  120937. }
  120938. Object.defineProperty(Theme.prototype, "css", {
  120939. // When setting css, check for element
  120940. // and apply new values
  120941. set: function set(val) {
  120942. if (this.vueMeta) {
  120943. if (this.isVueMeta23) {
  120944. this.applyVueMeta23();
  120945. }
  120946. return;
  120947. }
  120948. this.checkOrCreateStyleElement() && (this.styleEl.innerHTML = val);
  120949. },
  120950. enumerable: true,
  120951. configurable: true
  120952. });
  120953. Object.defineProperty(Theme.prototype, "dark", {
  120954. get: function get() {
  120955. return Boolean(this.isDark);
  120956. },
  120957. set: function set(val) {
  120958. var oldDark = this.isDark;
  120959. this.isDark = val; // Only apply theme after dark
  120960. // has already been set before
  120961. oldDark != null && this.applyTheme();
  120962. },
  120963. enumerable: true,
  120964. configurable: true
  120965. }); // Apply current theme default
  120966. // only called on client side
  120967. Theme.prototype.applyTheme = function () {
  120968. if (this.disabled) return this.clearCss();
  120969. this.css = this.generatedStyles;
  120970. };
  120971. Theme.prototype.clearCss = function () {
  120972. this.css = '';
  120973. }; // Initialize theme for SSR and SPA
  120974. // Attach to ssrContext head or
  120975. // apply new theme to document
  120976. Theme.prototype.init = function (root, ssrContext) {
  120977. if (this.disabled) return;
  120978. /* istanbul ignore else */
  120979. if (root.$meta) {
  120980. this.initVueMeta(root);
  120981. } else if (ssrContext) {
  120982. this.initSSR(ssrContext);
  120983. }
  120984. this.initTheme();
  120985. }; // Allows for you to set target theme
  120986. Theme.prototype.setTheme = function (theme, value) {
  120987. this.themes[theme] = Object.assign(this.themes[theme], value);
  120988. this.applyTheme();
  120989. }; // Reset theme defaults
  120990. Theme.prototype.resetThemes = function () {
  120991. this.themes.light = Object.assign({}, this.defaults.light);
  120992. this.themes.dark = Object.assign({}, this.defaults.dark);
  120993. this.applyTheme();
  120994. }; // Check for existence of style element
  120995. Theme.prototype.checkOrCreateStyleElement = function () {
  120996. this.styleEl = document.getElementById('vuetify-theme-stylesheet');
  120997. /* istanbul ignore next */
  120998. if (this.styleEl) return true;
  120999. this.genStyleElement(); // If doesn't have it, create it
  121000. return Boolean(this.styleEl);
  121001. };
  121002. Theme.prototype.fillVariant = function (theme, dark) {
  121003. if (theme === void 0) {
  121004. theme = {};
  121005. }
  121006. var defaultTheme = this.themes[dark ? 'dark' : 'light'];
  121007. return Object.assign({}, defaultTheme, theme);
  121008. }; // Generate the style element
  121009. // if applicable
  121010. Theme.prototype.genStyleElement = function () {
  121011. /* istanbul ignore if */
  121012. if (typeof document === 'undefined') return;
  121013. /* istanbul ignore next */
  121014. var options = this.options || {};
  121015. this.styleEl = document.createElement('style');
  121016. this.styleEl.type = 'text/css';
  121017. this.styleEl.id = 'vuetify-theme-stylesheet';
  121018. if (options.cspNonce) {
  121019. this.styleEl.setAttribute('nonce', options.cspNonce);
  121020. }
  121021. document.head.appendChild(this.styleEl);
  121022. };
  121023. Theme.prototype.initVueMeta = function (root) {
  121024. var _this = this;
  121025. this.vueMeta = root.$meta();
  121026. if (this.isVueMeta23) {
  121027. // vue-meta needs to apply after mounted()
  121028. root.$nextTick(function () {
  121029. _this.applyVueMeta23();
  121030. });
  121031. return;
  121032. }
  121033. var metaKeyName = typeof this.vueMeta.getOptions === 'function' ? this.vueMeta.getOptions().keyName : 'metaInfo';
  121034. var metaInfo = root.$options[metaKeyName] || {};
  121035. root.$options[metaKeyName] = function () {
  121036. metaInfo.style = metaInfo.style || [];
  121037. var vuetifyStylesheet = metaInfo.style.find(function (s) {
  121038. return s.id === 'vuetify-theme-stylesheet';
  121039. });
  121040. if (!vuetifyStylesheet) {
  121041. metaInfo.style.push({
  121042. cssText: _this.generatedStyles,
  121043. type: 'text/css',
  121044. id: 'vuetify-theme-stylesheet',
  121045. nonce: (_this.options || {}).cspNonce
  121046. });
  121047. } else {
  121048. vuetifyStylesheet.cssText = _this.generatedStyles;
  121049. }
  121050. return metaInfo;
  121051. };
  121052. };
  121053. Theme.prototype.applyVueMeta23 = function () {
  121054. var set = this.vueMeta.addApp('vuetify').set;
  121055. set({
  121056. style: [{
  121057. cssText: this.generatedStyles,
  121058. type: 'text/css',
  121059. id: 'vuetify-theme-stylesheet',
  121060. nonce: (this.options || {}).cspNonce
  121061. }]
  121062. });
  121063. };
  121064. Theme.prototype.initSSR = function (ssrContext) {
  121065. var options = this.options || {}; // SSR
  121066. var nonce = options.cspNonce ? " nonce=\"" + options.cspNonce + "\"" : '';
  121067. ssrContext.head = ssrContext.head || '';
  121068. ssrContext.head += "<style type=\"text/css\" id=\"vuetify-theme-stylesheet\"" + nonce + ">" + this.generatedStyles + "</style>";
  121069. };
  121070. Theme.prototype.initTheme = function () {
  121071. var _this = this; // Only watch for reactivity on client side
  121072. if (typeof document === 'undefined') return; // If we get here somehow, ensure
  121073. // existing instance is removed
  121074. if (this.vueInstance) this.vueInstance.$destroy(); // Use Vue instance to track reactivity
  121075. // TODO: Update to use RFC if merged
  121076. // https://github.com/vuejs/rfcs/blob/advanced-reactivity-api/active-rfcs/0000-advanced-reactivity-api.md
  121077. this.vueInstance = new vue__WEBPACK_IMPORTED_MODULE_2___default.a({
  121078. data: {
  121079. themes: this.themes
  121080. },
  121081. watch: {
  121082. themes: {
  121083. immediate: true,
  121084. deep: true,
  121085. handler: function handler() {
  121086. return _this.applyTheme();
  121087. }
  121088. }
  121089. }
  121090. });
  121091. };
  121092. Object.defineProperty(Theme.prototype, "currentTheme", {
  121093. get: function get() {
  121094. var target = this.dark ? 'dark' : 'light';
  121095. return this.themes[target];
  121096. },
  121097. enumerable: true,
  121098. configurable: true
  121099. });
  121100. Object.defineProperty(Theme.prototype, "generatedStyles", {
  121101. get: function get() {
  121102. var theme = this.parsedTheme;
  121103. /* istanbul ignore next */
  121104. var options = this.options || {};
  121105. var css;
  121106. if (options.themeCache != null) {
  121107. css = options.themeCache.get(theme);
  121108. /* istanbul ignore if */
  121109. if (css != null) return css;
  121110. }
  121111. css = _utils__WEBPACK_IMPORTED_MODULE_1__["genStyles"](theme, options.customProperties);
  121112. if (options.minifyTheme != null) {
  121113. css = options.minifyTheme(css);
  121114. }
  121115. if (options.themeCache != null) {
  121116. options.themeCache.set(theme, css);
  121117. }
  121118. return css;
  121119. },
  121120. enumerable: true,
  121121. configurable: true
  121122. });
  121123. Object.defineProperty(Theme.prototype, "parsedTheme", {
  121124. get: function get() {
  121125. /* istanbul ignore next */
  121126. var theme = this.currentTheme || {};
  121127. return _utils__WEBPACK_IMPORTED_MODULE_1__["parse"](theme);
  121128. },
  121129. enumerable: true,
  121130. configurable: true
  121131. });
  121132. Object.defineProperty(Theme.prototype, "isVueMeta23", {
  121133. // Is using v2.3 of vue-meta
  121134. // https://github.com/nuxt/vue-meta/releases/tag/v2.3.0
  121135. get: function get() {
  121136. return typeof this.vueMeta.addApp === 'function';
  121137. },
  121138. enumerable: true,
  121139. configurable: true
  121140. });
  121141. Theme.property = 'theme';
  121142. return Theme;
  121143. }(_service__WEBPACK_IMPORTED_MODULE_0__["Service"]);
  121144. /***/ }),
  121145. /***/ "./src/services/theme/utils.ts":
  121146. /*!*************************************!*\
  121147. !*** ./src/services/theme/utils.ts ***!
  121148. \*************************************/
  121149. /*! exports provided: parse, genStyles, genVariations, lighten, darken */
  121150. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121151. "use strict";
  121152. __webpack_require__.r(__webpack_exports__);
  121153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; });
  121154. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genStyles", function() { return genStyles; });
  121155. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genVariations", function() { return genVariations; });
  121156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lighten", function() { return lighten; });
  121157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "darken", function() { return darken; });
  121158. /* harmony import */ var _util_colorUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/colorUtils */ "./src/util/colorUtils.ts");
  121159. /* harmony import */ var _util_color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/color/transformSRGB */ "./src/util/color/transformSRGB.ts");
  121160. /* harmony import */ var _util_color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/color/transformCIELAB */ "./src/util/color/transformCIELAB.ts");
  121161. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  121162. var __rest = undefined && undefined.__rest || function (s, e) {
  121163. var t = {};
  121164. for (var p in s) {
  121165. if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  121166. }
  121167. if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  121168. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  121169. }
  121170. return t;
  121171. };
  121172. var __read = undefined && undefined.__read || function (o, n) {
  121173. var m = typeof Symbol === "function" && o[Symbol.iterator];
  121174. if (!m) return o;
  121175. var i = m.call(o),
  121176. r,
  121177. ar = [],
  121178. e;
  121179. try {
  121180. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  121181. ar.push(r.value);
  121182. }
  121183. } catch (error) {
  121184. e = {
  121185. error: error
  121186. };
  121187. } finally {
  121188. try {
  121189. if (r && !r.done && (m = i["return"])) m.call(i);
  121190. } finally {
  121191. if (e) throw e.error;
  121192. }
  121193. }
  121194. return ar;
  121195. };
  121196. function parse(theme, isItem) {
  121197. if (isItem === void 0) {
  121198. isItem = false;
  121199. }
  121200. var anchor = theme.anchor,
  121201. variant = __rest(theme, ["anchor"]);
  121202. var colors = Object.keys(variant);
  121203. var parsedTheme = {};
  121204. for (var i = 0; i < colors.length; ++i) {
  121205. var name = colors[i];
  121206. var value = theme[name];
  121207. if (value == null) continue;
  121208. if (isItem) {
  121209. /* istanbul ignore else */
  121210. if (name === 'base' || name.startsWith('lighten') || name.startsWith('darken')) {
  121211. parsedTheme[name] = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["colorToHex"])(value);
  121212. }
  121213. } else if (_typeof(value) === 'object') {
  121214. parsedTheme[name] = parse(value, true);
  121215. } else {
  121216. parsedTheme[name] = genVariations(name, Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["colorToInt"])(value));
  121217. }
  121218. }
  121219. if (!isItem) {
  121220. parsedTheme.anchor = anchor || parsedTheme.base || parsedTheme.primary.base;
  121221. }
  121222. return parsedTheme;
  121223. }
  121224. /**
  121225. * Generate the CSS for a base color (.primary)
  121226. */
  121227. var genBaseColor = function genBaseColor(name, value) {
  121228. return "\n.v-application ." + name + " {\n background-color: " + value + " !important;\n border-color: " + value + " !important;\n}\n.v-application ." + name + "--text {\n color: " + value + " !important;\n caret-color: " + value + " !important;\n}";
  121229. };
  121230. /**
  121231. * Generate the CSS for a variant color (.primary.darken-2)
  121232. */
  121233. var genVariantColor = function genVariantColor(name, variant, value) {
  121234. var _a = __read(variant.split(/(\d)/, 2), 2),
  121235. type = _a[0],
  121236. n = _a[1];
  121237. return "\n.v-application ." + name + "." + type + "-" + n + " {\n background-color: " + value + " !important;\n border-color: " + value + " !important;\n}\n.v-application ." + name + "--text.text--" + type + "-" + n + " {\n color: " + value + " !important;\n caret-color: " + value + " !important;\n}";
  121238. };
  121239. var genColorVariableName = function genColorVariableName(name, variant) {
  121240. if (variant === void 0) {
  121241. variant = 'base';
  121242. }
  121243. return "--v-" + name + "-" + variant;
  121244. };
  121245. var genColorVariable = function genColorVariable(name, variant) {
  121246. if (variant === void 0) {
  121247. variant = 'base';
  121248. }
  121249. return "var(" + genColorVariableName(name, variant) + ")";
  121250. };
  121251. function genStyles(theme, cssVar) {
  121252. if (cssVar === void 0) {
  121253. cssVar = false;
  121254. }
  121255. var anchor = theme.anchor,
  121256. variant = __rest(theme, ["anchor"]);
  121257. var colors = Object.keys(variant);
  121258. if (!colors.length) return '';
  121259. var variablesCss = '';
  121260. var css = '';
  121261. var aColor = cssVar ? genColorVariable('anchor') : anchor;
  121262. css += ".v-application a { color: " + aColor + "; }";
  121263. cssVar && (variablesCss += " " + genColorVariableName('anchor') + ": " + anchor + ";\n");
  121264. for (var i = 0; i < colors.length; ++i) {
  121265. var name = colors[i];
  121266. var value = theme[name];
  121267. css += genBaseColor(name, cssVar ? genColorVariable(name) : value.base);
  121268. cssVar && (variablesCss += " " + genColorVariableName(name) + ": " + value.base + ";\n");
  121269. var variants = Object.keys(value);
  121270. for (var i_1 = 0; i_1 < variants.length; ++i_1) {
  121271. var variant_1 = variants[i_1];
  121272. var variantValue = value[variant_1];
  121273. if (variant_1 === 'base') continue;
  121274. css += genVariantColor(name, variant_1, cssVar ? genColorVariable(name, variant_1) : variantValue);
  121275. cssVar && (variablesCss += " " + genColorVariableName(name, variant_1) + ": " + variantValue + ";\n");
  121276. }
  121277. }
  121278. if (cssVar) {
  121279. variablesCss = ":root {\n" + variablesCss + "}\n\n";
  121280. }
  121281. return variablesCss + css;
  121282. }
  121283. function genVariations(name, value) {
  121284. var values = {
  121285. base: Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["intToHex"])(value)
  121286. };
  121287. for (var i = 5; i > 0; --i) {
  121288. values["lighten" + i] = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["intToHex"])(lighten(value, i));
  121289. }
  121290. for (var i = 1; i <= 4; ++i) {
  121291. values["darken" + i] = Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["intToHex"])(darken(value, i));
  121292. }
  121293. return values;
  121294. }
  121295. function lighten(value, amount) {
  121296. var lab = _util_color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__["fromXYZ"](_util_color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__["toXYZ"](value));
  121297. lab[0] = lab[0] + amount * 10;
  121298. return _util_color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__["fromXYZ"](_util_color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__["toXYZ"](lab));
  121299. }
  121300. function darken(value, amount) {
  121301. var lab = _util_color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__["fromXYZ"](_util_color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__["toXYZ"](value));
  121302. lab[0] = lab[0] - amount * 10;
  121303. return _util_color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__["fromXYZ"](_util_color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__["toXYZ"](lab));
  121304. }
  121305. /***/ }),
  121306. /***/ "./src/styles/components/_selection-controls.sass":
  121307. /*!********************************************************!*\
  121308. !*** ./src/styles/components/_selection-controls.sass ***!
  121309. \********************************************************/
  121310. /*! no static exports found */
  121311. /***/ (function(module, exports, __webpack_require__) {
  121312. // extracted by mini-css-extract-plugin
  121313. /***/ }),
  121314. /***/ "./src/styles/main.sass":
  121315. /*!******************************!*\
  121316. !*** ./src/styles/main.sass ***!
  121317. \******************************/
  121318. /*! no static exports found */
  121319. /***/ (function(module, exports, __webpack_require__) {
  121320. // extracted by mini-css-extract-plugin
  121321. /***/ }),
  121322. /***/ "./src/util/color/transformCIELAB.ts":
  121323. /*!*******************************************!*\
  121324. !*** ./src/util/color/transformCIELAB.ts ***!
  121325. \*******************************************/
  121326. /*! exports provided: fromXYZ, toXYZ */
  121327. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121328. "use strict";
  121329. __webpack_require__.r(__webpack_exports__);
  121330. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromXYZ", function() { return fromXYZ; });
  121331. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toXYZ", function() { return toXYZ; });
  121332. var delta = 0.20689655172413793; // 6÷29
  121333. var cielabForwardTransform = function cielabForwardTransform(t) {
  121334. return t > Math.pow(delta, 3) ? Math.cbrt(t) : t / (3 * Math.pow(delta, 2)) + 4 / 29;
  121335. };
  121336. var cielabReverseTransform = function cielabReverseTransform(t) {
  121337. return t > delta ? Math.pow(t, 3) : 3 * Math.pow(delta, 2) * (t - 4 / 29);
  121338. };
  121339. function fromXYZ(xyz) {
  121340. var transform = cielabForwardTransform;
  121341. var transformedY = transform(xyz[1]);
  121342. return [116 * transformedY - 16, 500 * (transform(xyz[0] / 0.95047) - transformedY), 200 * (transformedY - transform(xyz[2] / 1.08883))];
  121343. }
  121344. function toXYZ(lab) {
  121345. var transform = cielabReverseTransform;
  121346. var Ln = (lab[0] + 16) / 116;
  121347. return [transform(Ln + lab[1] / 500) * 0.95047, transform(Ln), transform(Ln - lab[2] / 200) * 1.08883];
  121348. }
  121349. /***/ }),
  121350. /***/ "./src/util/color/transformSRGB.ts":
  121351. /*!*****************************************!*\
  121352. !*** ./src/util/color/transformSRGB.ts ***!
  121353. \*****************************************/
  121354. /*! exports provided: fromXYZ, toXYZ */
  121355. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121356. "use strict";
  121357. __webpack_require__.r(__webpack_exports__);
  121358. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromXYZ", function() { return fromXYZ; });
  121359. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toXYZ", function() { return toXYZ; });
  121360. /* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
  121361. // For converting XYZ to sRGB
  121362. var srgbForwardMatrix = [[3.2406, -1.5372, -0.4986], [-0.9689, 1.8758, 0.0415], [0.0557, -0.2040, 1.0570]]; // Forward gamma adjust
  121363. var srgbForwardTransform = function srgbForwardTransform(C) {
  121364. return C <= 0.0031308 ? C * 12.92 : 1.055 * Math.pow(C, 1 / 2.4) - 0.055;
  121365. }; // For converting sRGB to XYZ
  121366. var srgbReverseMatrix = [[0.4124, 0.3576, 0.1805], [0.2126, 0.7152, 0.0722], [0.0193, 0.1192, 0.9505]]; // Reverse gamma adjust
  121367. var srgbReverseTransform = function srgbReverseTransform(C) {
  121368. return C <= 0.04045 ? C / 12.92 : Math.pow((C + 0.055) / 1.055, 2.4);
  121369. };
  121370. function fromXYZ(xyz) {
  121371. var rgb = Array(3);
  121372. var transform = srgbForwardTransform;
  121373. var matrix = srgbForwardMatrix; // Matrix transform, then gamma adjustment
  121374. for (var i = 0; i < 3; ++i) {
  121375. rgb[i] = Math.round(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["clamp"])(transform(matrix[i][0] * xyz[0] + matrix[i][1] * xyz[1] + matrix[i][2] * xyz[2])) * 255);
  121376. } // Rescale back to [0, 255]
  121377. return (rgb[0] << 16) + (rgb[1] << 8) + (rgb[2] << 0);
  121378. }
  121379. function toXYZ(rgb) {
  121380. var xyz = [0, 0, 0];
  121381. var transform = srgbReverseTransform;
  121382. var matrix = srgbReverseMatrix; // Rescale from [0, 255] to [0, 1] then adjust sRGB gamma to linear RGB
  121383. var r = transform((rgb >> 16 & 0xff) / 255);
  121384. var g = transform((rgb >> 8 & 0xff) / 255);
  121385. var b = transform((rgb >> 0 & 0xff) / 255); // Matrix color space transform
  121386. for (var i = 0; i < 3; ++i) {
  121387. xyz[i] = matrix[i][0] * r + matrix[i][1] * g + matrix[i][2] * b;
  121388. }
  121389. return xyz;
  121390. }
  121391. /***/ }),
  121392. /***/ "./src/util/colorUtils.ts":
  121393. /*!********************************!*\
  121394. !*** ./src/util/colorUtils.ts ***!
  121395. \********************************/
  121396. /*! exports provided: colorToInt, intToHex, colorToHex, HSVAtoRGBA, RGBAtoHSVA, HSVAtoHSLA, HSLAtoHSVA, RGBAtoCSS, RGBtoCSS, RGBAtoHex, HexToRGBA, HexToHSVA, HSVAtoHex, parseHex, RGBtoInt, contrastRatio */
  121397. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121398. "use strict";
  121399. __webpack_require__.r(__webpack_exports__);
  121400. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorToInt", function() { return colorToInt; });
  121401. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "intToHex", function() { return intToHex; });
  121402. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorToHex", function() { return colorToHex; });
  121403. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HSVAtoRGBA", function() { return HSVAtoRGBA; });
  121404. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBAtoHSVA", function() { return RGBAtoHSVA; });
  121405. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HSVAtoHSLA", function() { return HSVAtoHSLA; });
  121406. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HSLAtoHSVA", function() { return HSLAtoHSVA; });
  121407. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBAtoCSS", function() { return RGBAtoCSS; });
  121408. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBtoCSS", function() { return RGBtoCSS; });
  121409. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBAtoHex", function() { return RGBAtoHex; });
  121410. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HexToRGBA", function() { return HexToRGBA; });
  121411. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HexToHSVA", function() { return HexToHSVA; });
  121412. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HSVAtoHex", function() { return HSVAtoHex; });
  121413. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseHex", function() { return parseHex; });
  121414. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBtoInt", function() { return RGBtoInt; });
  121415. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "contrastRatio", function() { return contrastRatio; });
  121416. /* harmony import */ var _console__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./console */ "./src/util/console.ts");
  121417. /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/util/helpers.ts");
  121418. /* harmony import */ var _color_transformSRGB__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./color/transformSRGB */ "./src/util/color/transformSRGB.ts");
  121419. var __assign = undefined && undefined.__assign || function () {
  121420. __assign = Object.assign || function (t) {
  121421. for (var s, i = 1, n = arguments.length; i < n; i++) {
  121422. s = arguments[i];
  121423. for (var p in s) {
  121424. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  121425. }
  121426. }
  121427. return t;
  121428. };
  121429. return __assign.apply(this, arguments);
  121430. };
  121431. var __read = undefined && undefined.__read || function (o, n) {
  121432. var m = typeof Symbol === "function" && o[Symbol.iterator];
  121433. if (!m) return o;
  121434. var i = m.call(o),
  121435. r,
  121436. ar = [],
  121437. e;
  121438. try {
  121439. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  121440. ar.push(r.value);
  121441. }
  121442. } catch (error) {
  121443. e = {
  121444. error: error
  121445. };
  121446. } finally {
  121447. try {
  121448. if (r && !r.done && (m = i["return"])) m.call(i);
  121449. } finally {
  121450. if (e) throw e.error;
  121451. }
  121452. }
  121453. return ar;
  121454. };
  121455. function colorToInt(color) {
  121456. var rgb;
  121457. if (typeof color === 'number') {
  121458. rgb = color;
  121459. } else if (typeof color === 'string') {
  121460. var c = color[0] === '#' ? color.substring(1) : color;
  121461. if (c.length === 3) {
  121462. c = c.split('').map(function (char) {
  121463. return char + char;
  121464. }).join('');
  121465. }
  121466. if (c.length !== 6) {
  121467. Object(_console__WEBPACK_IMPORTED_MODULE_0__["consoleWarn"])("'" + color + "' is not a valid rgb color");
  121468. }
  121469. rgb = parseInt(c, 16);
  121470. } else {
  121471. throw new TypeError("Colors can only be numbers or strings, recieved " + (color == null ? color : color.constructor.name) + " instead");
  121472. }
  121473. if (rgb < 0) {
  121474. Object(_console__WEBPACK_IMPORTED_MODULE_0__["consoleWarn"])("Colors cannot be negative: '" + color + "'");
  121475. rgb = 0;
  121476. } else if (rgb > 0xffffff || isNaN(rgb)) {
  121477. Object(_console__WEBPACK_IMPORTED_MODULE_0__["consoleWarn"])("'" + color + "' is not a valid rgb color");
  121478. rgb = 0xffffff;
  121479. }
  121480. return rgb;
  121481. }
  121482. function intToHex(color) {
  121483. var hexColor = color.toString(16);
  121484. if (hexColor.length < 6) hexColor = '0'.repeat(6 - hexColor.length) + hexColor;
  121485. return '#' + hexColor;
  121486. }
  121487. function colorToHex(color) {
  121488. return intToHex(colorToInt(color));
  121489. }
  121490. /**
  121491. * Converts HSVA to RGBA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV
  121492. *
  121493. * @param color HSVA color as an array [0-360, 0-1, 0-1, 0-1]
  121494. */
  121495. function HSVAtoRGBA(hsva) {
  121496. var h = hsva.h,
  121497. s = hsva.s,
  121498. v = hsva.v,
  121499. a = hsva.a;
  121500. var f = function f(n) {
  121501. var k = (n + h / 60) % 6;
  121502. return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
  121503. };
  121504. var rgb = [f(5), f(3), f(1)].map(function (v) {
  121505. return Math.round(v * 255);
  121506. });
  121507. return {
  121508. r: rgb[0],
  121509. g: rgb[1],
  121510. b: rgb[2],
  121511. a: a
  121512. };
  121513. }
  121514. /**
  121515. * Converts RGBA to HSVA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV
  121516. *
  121517. * @param color RGBA color as an array [0-255, 0-255, 0-255, 0-1]
  121518. */
  121519. function RGBAtoHSVA(rgba) {
  121520. if (!rgba) return {
  121521. h: 0,
  121522. s: 1,
  121523. v: 1,
  121524. a: 1
  121525. };
  121526. var r = rgba.r / 255;
  121527. var g = rgba.g / 255;
  121528. var b = rgba.b / 255;
  121529. var max = Math.max(r, g, b);
  121530. var min = Math.min(r, g, b);
  121531. var h = 0;
  121532. if (max !== min) {
  121533. if (max === r) {
  121534. h = 60 * (0 + (g - b) / (max - min));
  121535. } else if (max === g) {
  121536. h = 60 * (2 + (b - r) / (max - min));
  121537. } else if (max === b) {
  121538. h = 60 * (4 + (r - g) / (max - min));
  121539. }
  121540. }
  121541. if (h < 0) h = h + 360;
  121542. var s = max === 0 ? 0 : (max - min) / max;
  121543. var hsv = [h, s, max];
  121544. return {
  121545. h: hsv[0],
  121546. s: hsv[1],
  121547. v: hsv[2],
  121548. a: rgba.a
  121549. };
  121550. }
  121551. function HSVAtoHSLA(hsva) {
  121552. var h = hsva.h,
  121553. s = hsva.s,
  121554. v = hsva.v,
  121555. a = hsva.a;
  121556. var l = v - v * s / 2;
  121557. var sprime = l === 1 || l === 0 ? 0 : (v - l) / Math.min(l, 1 - l);
  121558. return {
  121559. h: h,
  121560. s: sprime,
  121561. l: l,
  121562. a: a
  121563. };
  121564. }
  121565. function HSLAtoHSVA(hsl) {
  121566. var h = hsl.h,
  121567. s = hsl.s,
  121568. l = hsl.l,
  121569. a = hsl.a;
  121570. var v = l + s * Math.min(l, 1 - l);
  121571. var sprime = v === 0 ? 0 : 2 - 2 * l / v;
  121572. return {
  121573. h: h,
  121574. s: sprime,
  121575. v: v,
  121576. a: a
  121577. };
  121578. }
  121579. function RGBAtoCSS(rgba) {
  121580. return "rgba(" + rgba.r + ", " + rgba.g + ", " + rgba.b + ", " + rgba.a + ")";
  121581. }
  121582. function RGBtoCSS(rgba) {
  121583. return RGBAtoCSS(__assign({}, rgba, {
  121584. a: 1
  121585. }));
  121586. }
  121587. function RGBAtoHex(rgba) {
  121588. var toHex = function toHex(v) {
  121589. var h = Math.round(v).toString(16);
  121590. return ('00'.substr(0, 2 - h.length) + h).toUpperCase();
  121591. };
  121592. return "#" + [toHex(rgba.r), toHex(rgba.g), toHex(rgba.b), toHex(Math.round(rgba.a * 255))].join('');
  121593. }
  121594. function HexToRGBA(hex) {
  121595. var rgba = Object(_helpers__WEBPACK_IMPORTED_MODULE_1__["chunk"])(hex.slice(1), 2).map(function (c) {
  121596. return parseInt(c, 16);
  121597. });
  121598. return {
  121599. r: rgba[0],
  121600. g: rgba[1],
  121601. b: rgba[2],
  121602. a: Math.round(rgba[3] / 255 * 100) / 100
  121603. };
  121604. }
  121605. function HexToHSVA(hex) {
  121606. var rgb = HexToRGBA(hex);
  121607. return RGBAtoHSVA(rgb);
  121608. }
  121609. function HSVAtoHex(hsva) {
  121610. return RGBAtoHex(HSVAtoRGBA(hsva));
  121611. }
  121612. function parseHex(hex) {
  121613. if (hex.startsWith('#')) {
  121614. hex = hex.slice(1);
  121615. }
  121616. hex = hex.replace(/([^0-9a-f])/gi, 'F');
  121617. if (hex.length === 3) {
  121618. hex = hex.split('').map(function (x) {
  121619. return x + x;
  121620. }).join('');
  121621. }
  121622. if (hex.length === 6) {
  121623. hex = Object(_helpers__WEBPACK_IMPORTED_MODULE_1__["padEnd"])(hex, 8, 'F');
  121624. } else {
  121625. hex = Object(_helpers__WEBPACK_IMPORTED_MODULE_1__["padEnd"])(Object(_helpers__WEBPACK_IMPORTED_MODULE_1__["padEnd"])(hex, 6), 8, 'F');
  121626. }
  121627. return ("#" + hex).toUpperCase().substr(0, 9);
  121628. }
  121629. function RGBtoInt(rgba) {
  121630. return (rgba.r << 16) + (rgba.g << 8) + rgba.b;
  121631. }
  121632. /**
  121633. * Returns the contrast ratio (1-21) between two colors.
  121634. *
  121635. * @param c1 First color
  121636. * @param c2 Second color
  121637. */
  121638. function contrastRatio(c1, c2) {
  121639. var _a = __read(Object(_color_transformSRGB__WEBPACK_IMPORTED_MODULE_2__["toXYZ"])(RGBtoInt(c1)), 2),
  121640. y1 = _a[1];
  121641. var _b = __read(Object(_color_transformSRGB__WEBPACK_IMPORTED_MODULE_2__["toXYZ"])(RGBtoInt(c2)), 2),
  121642. y2 = _b[1];
  121643. return (Math.max(y1, y2) + 0.05) / (Math.min(y1, y2) + 0.05);
  121644. }
  121645. /***/ }),
  121646. /***/ "./src/util/colors.ts":
  121647. /*!****************************!*\
  121648. !*** ./src/util/colors.ts ***!
  121649. \****************************/
  121650. /*! exports provided: default */
  121651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121652. "use strict";
  121653. __webpack_require__.r(__webpack_exports__);
  121654. var red = Object.freeze({
  121655. base: '#f44336',
  121656. lighten5: '#ffebee',
  121657. lighten4: '#ffcdd2',
  121658. lighten3: '#ef9a9a',
  121659. lighten2: '#e57373',
  121660. lighten1: '#ef5350',
  121661. darken1: '#e53935',
  121662. darken2: '#d32f2f',
  121663. darken3: '#c62828',
  121664. darken4: '#b71c1c',
  121665. accent1: '#ff8a80',
  121666. accent2: '#ff5252',
  121667. accent3: '#ff1744',
  121668. accent4: '#d50000'
  121669. });
  121670. var pink = Object.freeze({
  121671. base: '#e91e63',
  121672. lighten5: '#fce4ec',
  121673. lighten4: '#f8bbd0',
  121674. lighten3: '#f48fb1',
  121675. lighten2: '#f06292',
  121676. lighten1: '#ec407a',
  121677. darken1: '#d81b60',
  121678. darken2: '#c2185b',
  121679. darken3: '#ad1457',
  121680. darken4: '#880e4f',
  121681. accent1: '#ff80ab',
  121682. accent2: '#ff4081',
  121683. accent3: '#f50057',
  121684. accent4: '#c51162'
  121685. });
  121686. var purple = Object.freeze({
  121687. base: '#9c27b0',
  121688. lighten5: '#f3e5f5',
  121689. lighten4: '#e1bee7',
  121690. lighten3: '#ce93d8',
  121691. lighten2: '#ba68c8',
  121692. lighten1: '#ab47bc',
  121693. darken1: '#8e24aa',
  121694. darken2: '#7b1fa2',
  121695. darken3: '#6a1b9a',
  121696. darken4: '#4a148c',
  121697. accent1: '#ea80fc',
  121698. accent2: '#e040fb',
  121699. accent3: '#d500f9',
  121700. accent4: '#aa00ff'
  121701. });
  121702. var deepPurple = Object.freeze({
  121703. base: '#673ab7',
  121704. lighten5: '#ede7f6',
  121705. lighten4: '#d1c4e9',
  121706. lighten3: '#b39ddb',
  121707. lighten2: '#9575cd',
  121708. lighten1: '#7e57c2',
  121709. darken1: '#5e35b1',
  121710. darken2: '#512da8',
  121711. darken3: '#4527a0',
  121712. darken4: '#311b92',
  121713. accent1: '#b388ff',
  121714. accent2: '#7c4dff',
  121715. accent3: '#651fff',
  121716. accent4: '#6200ea'
  121717. });
  121718. var indigo = Object.freeze({
  121719. base: '#3f51b5',
  121720. lighten5: '#e8eaf6',
  121721. lighten4: '#c5cae9',
  121722. lighten3: '#9fa8da',
  121723. lighten2: '#7986cb',
  121724. lighten1: '#5c6bc0',
  121725. darken1: '#3949ab',
  121726. darken2: '#303f9f',
  121727. darken3: '#283593',
  121728. darken4: '#1a237e',
  121729. accent1: '#8c9eff',
  121730. accent2: '#536dfe',
  121731. accent3: '#3d5afe',
  121732. accent4: '#304ffe'
  121733. });
  121734. var blue = Object.freeze({
  121735. base: '#2196f3',
  121736. lighten5: '#e3f2fd',
  121737. lighten4: '#bbdefb',
  121738. lighten3: '#90caf9',
  121739. lighten2: '#64b5f6',
  121740. lighten1: '#42a5f5',
  121741. darken1: '#1e88e5',
  121742. darken2: '#1976d2',
  121743. darken3: '#1565c0',
  121744. darken4: '#0d47a1',
  121745. accent1: '#82b1ff',
  121746. accent2: '#448aff',
  121747. accent3: '#2979ff',
  121748. accent4: '#2962ff'
  121749. });
  121750. var lightBlue = Object.freeze({
  121751. base: '#03a9f4',
  121752. lighten5: '#e1f5fe',
  121753. lighten4: '#b3e5fc',
  121754. lighten3: '#81d4fa',
  121755. lighten2: '#4fc3f7',
  121756. lighten1: '#29b6f6',
  121757. darken1: '#039be5',
  121758. darken2: '#0288d1',
  121759. darken3: '#0277bd',
  121760. darken4: '#01579b',
  121761. accent1: '#80d8ff',
  121762. accent2: '#40c4ff',
  121763. accent3: '#00b0ff',
  121764. accent4: '#0091ea'
  121765. });
  121766. var cyan = Object.freeze({
  121767. base: '#00bcd4',
  121768. lighten5: '#e0f7fa',
  121769. lighten4: '#b2ebf2',
  121770. lighten3: '#80deea',
  121771. lighten2: '#4dd0e1',
  121772. lighten1: '#26c6da',
  121773. darken1: '#00acc1',
  121774. darken2: '#0097a7',
  121775. darken3: '#00838f',
  121776. darken4: '#006064',
  121777. accent1: '#84ffff',
  121778. accent2: '#18ffff',
  121779. accent3: '#00e5ff',
  121780. accent4: '#00b8d4'
  121781. });
  121782. var teal = Object.freeze({
  121783. base: '#009688',
  121784. lighten5: '#e0f2f1',
  121785. lighten4: '#b2dfdb',
  121786. lighten3: '#80cbc4',
  121787. lighten2: '#4db6ac',
  121788. lighten1: '#26a69a',
  121789. darken1: '#00897b',
  121790. darken2: '#00796b',
  121791. darken3: '#00695c',
  121792. darken4: '#004d40',
  121793. accent1: '#a7ffeb',
  121794. accent2: '#64ffda',
  121795. accent3: '#1de9b6',
  121796. accent4: '#00bfa5'
  121797. });
  121798. var green = Object.freeze({
  121799. base: '#4caf50',
  121800. lighten5: '#e8f5e9',
  121801. lighten4: '#c8e6c9',
  121802. lighten3: '#a5d6a7',
  121803. lighten2: '#81c784',
  121804. lighten1: '#66bb6a',
  121805. darken1: '#43a047',
  121806. darken2: '#388e3c',
  121807. darken3: '#2e7d32',
  121808. darken4: '#1b5e20',
  121809. accent1: '#b9f6ca',
  121810. accent2: '#69f0ae',
  121811. accent3: '#00e676',
  121812. accent4: '#00c853'
  121813. });
  121814. var lightGreen = Object.freeze({
  121815. base: '#8bc34a',
  121816. lighten5: '#f1f8e9',
  121817. lighten4: '#dcedc8',
  121818. lighten3: '#c5e1a5',
  121819. lighten2: '#aed581',
  121820. lighten1: '#9ccc65',
  121821. darken1: '#7cb342',
  121822. darken2: '#689f38',
  121823. darken3: '#558b2f',
  121824. darken4: '#33691e',
  121825. accent1: '#ccff90',
  121826. accent2: '#b2ff59',
  121827. accent3: '#76ff03',
  121828. accent4: '#64dd17'
  121829. });
  121830. var lime = Object.freeze({
  121831. base: '#cddc39',
  121832. lighten5: '#f9fbe7',
  121833. lighten4: '#f0f4c3',
  121834. lighten3: '#e6ee9c',
  121835. lighten2: '#dce775',
  121836. lighten1: '#d4e157',
  121837. darken1: '#c0ca33',
  121838. darken2: '#afb42b',
  121839. darken3: '#9e9d24',
  121840. darken4: '#827717',
  121841. accent1: '#f4ff81',
  121842. accent2: '#eeff41',
  121843. accent3: '#c6ff00',
  121844. accent4: '#aeea00'
  121845. });
  121846. var yellow = Object.freeze({
  121847. base: '#ffeb3b',
  121848. lighten5: '#fffde7',
  121849. lighten4: '#fff9c4',
  121850. lighten3: '#fff59d',
  121851. lighten2: '#fff176',
  121852. lighten1: '#ffee58',
  121853. darken1: '#fdd835',
  121854. darken2: '#fbc02d',
  121855. darken3: '#f9a825',
  121856. darken4: '#f57f17',
  121857. accent1: '#ffff8d',
  121858. accent2: '#ffff00',
  121859. accent3: '#ffea00',
  121860. accent4: '#ffd600'
  121861. });
  121862. var amber = Object.freeze({
  121863. base: '#ffc107',
  121864. lighten5: '#fff8e1',
  121865. lighten4: '#ffecb3',
  121866. lighten3: '#ffe082',
  121867. lighten2: '#ffd54f',
  121868. lighten1: '#ffca28',
  121869. darken1: '#ffb300',
  121870. darken2: '#ffa000',
  121871. darken3: '#ff8f00',
  121872. darken4: '#ff6f00',
  121873. accent1: '#ffe57f',
  121874. accent2: '#ffd740',
  121875. accent3: '#ffc400',
  121876. accent4: '#ffab00'
  121877. });
  121878. var orange = Object.freeze({
  121879. base: '#ff9800',
  121880. lighten5: '#fff3e0',
  121881. lighten4: '#ffe0b2',
  121882. lighten3: '#ffcc80',
  121883. lighten2: '#ffb74d',
  121884. lighten1: '#ffa726',
  121885. darken1: '#fb8c00',
  121886. darken2: '#f57c00',
  121887. darken3: '#ef6c00',
  121888. darken4: '#e65100',
  121889. accent1: '#ffd180',
  121890. accent2: '#ffab40',
  121891. accent3: '#ff9100',
  121892. accent4: '#ff6d00'
  121893. });
  121894. var deepOrange = Object.freeze({
  121895. base: '#ff5722',
  121896. lighten5: '#fbe9e7',
  121897. lighten4: '#ffccbc',
  121898. lighten3: '#ffab91',
  121899. lighten2: '#ff8a65',
  121900. lighten1: '#ff7043',
  121901. darken1: '#f4511e',
  121902. darken2: '#e64a19',
  121903. darken3: '#d84315',
  121904. darken4: '#bf360c',
  121905. accent1: '#ff9e80',
  121906. accent2: '#ff6e40',
  121907. accent3: '#ff3d00',
  121908. accent4: '#dd2c00'
  121909. });
  121910. var brown = Object.freeze({
  121911. base: '#795548',
  121912. lighten5: '#efebe9',
  121913. lighten4: '#d7ccc8',
  121914. lighten3: '#bcaaa4',
  121915. lighten2: '#a1887f',
  121916. lighten1: '#8d6e63',
  121917. darken1: '#6d4c41',
  121918. darken2: '#5d4037',
  121919. darken3: '#4e342e',
  121920. darken4: '#3e2723'
  121921. });
  121922. var blueGrey = Object.freeze({
  121923. base: '#607d8b',
  121924. lighten5: '#eceff1',
  121925. lighten4: '#cfd8dc',
  121926. lighten3: '#b0bec5',
  121927. lighten2: '#90a4ae',
  121928. lighten1: '#78909c',
  121929. darken1: '#546e7a',
  121930. darken2: '#455a64',
  121931. darken3: '#37474f',
  121932. darken4: '#263238'
  121933. });
  121934. var grey = Object.freeze({
  121935. base: '#9e9e9e',
  121936. lighten5: '#fafafa',
  121937. lighten4: '#f5f5f5',
  121938. lighten3: '#eeeeee',
  121939. lighten2: '#e0e0e0',
  121940. lighten1: '#bdbdbd',
  121941. darken1: '#757575',
  121942. darken2: '#616161',
  121943. darken3: '#424242',
  121944. darken4: '#212121'
  121945. });
  121946. var shades = Object.freeze({
  121947. black: '#000000',
  121948. white: '#ffffff',
  121949. transparent: 'transparent'
  121950. });
  121951. /* harmony default export */ __webpack_exports__["default"] = (Object.freeze({
  121952. red: red,
  121953. pink: pink,
  121954. purple: purple,
  121955. deepPurple: deepPurple,
  121956. indigo: indigo,
  121957. blue: blue,
  121958. lightBlue: lightBlue,
  121959. cyan: cyan,
  121960. teal: teal,
  121961. green: green,
  121962. lightGreen: lightGreen,
  121963. lime: lime,
  121964. yellow: yellow,
  121965. amber: amber,
  121966. orange: orange,
  121967. deepOrange: deepOrange,
  121968. brown: brown,
  121969. blueGrey: blueGrey,
  121970. grey: grey,
  121971. shades: shades
  121972. }));
  121973. /***/ }),
  121974. /***/ "./src/util/console.ts":
  121975. /*!*****************************!*\
  121976. !*** ./src/util/console.ts ***!
  121977. \*****************************/
  121978. /*! exports provided: consoleInfo, consoleWarn, consoleError, deprecate, breaking, removed */
  121979. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121980. "use strict";
  121981. __webpack_require__.r(__webpack_exports__);
  121982. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consoleInfo", function() { return consoleInfo; });
  121983. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consoleWarn", function() { return consoleWarn; });
  121984. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consoleError", function() { return consoleError; });
  121985. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deprecate", function() { return deprecate; });
  121986. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "breaking", function() { return breaking; });
  121987. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removed", function() { return removed; });
  121988. function createMessage(message, vm, parent) {
  121989. if (parent) {
  121990. vm = {
  121991. _isVue: true,
  121992. $parent: parent,
  121993. $options: vm
  121994. };
  121995. }
  121996. if (vm) {
  121997. // Only show each message once per instance
  121998. vm.$_alreadyWarned = vm.$_alreadyWarned || [];
  121999. if (vm.$_alreadyWarned.includes(message)) return;
  122000. vm.$_alreadyWarned.push(message);
  122001. }
  122002. return "[Vuetify] " + message + (vm ? generateComponentTrace(vm) : '');
  122003. }
  122004. function consoleInfo(message, vm, parent) {
  122005. var newMessage = createMessage(message, vm, parent);
  122006. newMessage != null && console.info(newMessage);
  122007. }
  122008. function consoleWarn(message, vm, parent) {
  122009. var newMessage = createMessage(message, vm, parent);
  122010. newMessage != null && console.warn(newMessage);
  122011. }
  122012. function consoleError(message, vm, parent) {
  122013. var newMessage = createMessage(message, vm, parent);
  122014. newMessage != null && console.error(newMessage);
  122015. }
  122016. function deprecate(original, replacement, vm, parent) {
  122017. consoleWarn("[UPGRADE] '" + original + "' is deprecated, use '" + replacement + "' instead.", vm, parent);
  122018. }
  122019. function breaking(original, replacement, vm, parent) {
  122020. consoleError("[BREAKING] '" + original + "' has been removed, use '" + replacement + "' instead. For more information, see the upgrade guide https://github.com/vuetifyjs/vuetify/releases/tag/v2.0.0#user-content-upgrade-guide", vm, parent);
  122021. }
  122022. function removed(original, vm, parent) {
  122023. consoleWarn("[REMOVED] '" + original + "' has been removed. You can safely omit it.", vm, parent);
  122024. }
  122025. /**
  122026. * Shamelessly stolen from vuejs/vue/blob/dev/src/core/util/debug.js
  122027. */
  122028. var classifyRE = /(?:^|[-_])(\w)/g;
  122029. var classify = function classify(str) {
  122030. return str.replace(classifyRE, function (c) {
  122031. return c.toUpperCase();
  122032. }).replace(/[-_]/g, '');
  122033. };
  122034. function formatComponentName(vm, includeFile) {
  122035. if (vm.$root === vm) {
  122036. return '<Root>';
  122037. }
  122038. var options = typeof vm === 'function' && vm.cid != null ? vm.options : vm._isVue ? vm.$options || vm.constructor.options : vm || {};
  122039. var name = options.name || options._componentTag;
  122040. var file = options.__file;
  122041. if (!name && file) {
  122042. var match = file.match(/([^/\\]+)\.vue$/);
  122043. name = match && match[1];
  122044. }
  122045. return (name ? "<" + classify(name) + ">" : "<Anonymous>") + (file && includeFile !== false ? " at " + file : '');
  122046. }
  122047. function generateComponentTrace(vm) {
  122048. if (vm._isVue && vm.$parent) {
  122049. var tree = [];
  122050. var currentRecursiveSequence = 0;
  122051. while (vm) {
  122052. if (tree.length > 0) {
  122053. var last = tree[tree.length - 1];
  122054. if (last.constructor === vm.constructor) {
  122055. currentRecursiveSequence++;
  122056. vm = vm.$parent;
  122057. continue;
  122058. } else if (currentRecursiveSequence > 0) {
  122059. tree[tree.length - 1] = [last, currentRecursiveSequence];
  122060. currentRecursiveSequence = 0;
  122061. }
  122062. }
  122063. tree.push(vm);
  122064. vm = vm.$parent;
  122065. }
  122066. return '\n\nfound in\n\n' + tree.map(function (vm, i) {
  122067. return "" + (i === 0 ? '---> ' : ' '.repeat(5 + i * 2)) + (Array.isArray(vm) ? formatComponentName(vm[0]) + "... (" + vm[1] + " recursive calls)" : formatComponentName(vm));
  122068. }).join('\n');
  122069. } else {
  122070. return "\n\n(found in " + formatComponentName(vm) + ")";
  122071. }
  122072. }
  122073. /***/ }),
  122074. /***/ "./src/util/dateTimeUtils.ts":
  122075. /*!***********************************!*\
  122076. !*** ./src/util/dateTimeUtils.ts ***!
  122077. \***********************************/
  122078. /*! exports provided: weekNumber, isLeapYear */
  122079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122080. "use strict";
  122081. __webpack_require__.r(__webpack_exports__);
  122082. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "weekNumber", function() { return weekNumber; });
  122083. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLeapYear", function() { return isLeapYear; });
  122084. function createUTCDate(year, month, day) {
  122085. if (month === void 0) {
  122086. month = 0;
  122087. }
  122088. if (day === void 0) {
  122089. day = 1;
  122090. }
  122091. var date;
  122092. if (year < 100 && year >= 0) {
  122093. date = new Date(Date.UTC(year, month, day));
  122094. if (isFinite(date.getUTCFullYear())) {
  122095. date.setUTCFullYear(year);
  122096. }
  122097. } else {
  122098. date = new Date(Date.UTC(year, month, day));
  122099. }
  122100. return date;
  122101. }
  122102. function firstWeekOffset(year, firstDayOfWeek, firstDayOfYear) {
  122103. var firstWeekDayInFirstWeek = 7 + firstDayOfWeek - firstDayOfYear;
  122104. var firstWeekDayOfYear = (7 + createUTCDate(year, 0, firstWeekDayInFirstWeek).getUTCDay() - firstDayOfWeek) % 7;
  122105. return -firstWeekDayOfYear + firstWeekDayInFirstWeek - 1;
  122106. }
  122107. function dayOfYear(year, month, day, firstDayOfWeek) {
  122108. var dayOfYear = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334][month];
  122109. if (month > 1 && isLeapYear(year)) {
  122110. dayOfYear++;
  122111. }
  122112. return dayOfYear + day;
  122113. }
  122114. function weeksInYear(year, firstDayOfWeek, firstDayOfYear) {
  122115. var weekOffset = firstWeekOffset(year, firstDayOfWeek, firstDayOfYear);
  122116. var weekOffsetNext = firstWeekOffset(year + 1, firstDayOfWeek, firstDayOfYear);
  122117. var daysInYear = isLeapYear(year) ? 366 : 365;
  122118. return (daysInYear - weekOffset + weekOffsetNext) / 7;
  122119. }
  122120. function weekNumber(year, month, day, firstDayOfWeek, localeFirstDayOfYear) {
  122121. var weekOffset = firstWeekOffset(year, firstDayOfWeek, localeFirstDayOfYear);
  122122. var week = Math.ceil((dayOfYear(year, month, day, firstDayOfWeek) - weekOffset) / 7);
  122123. if (week < 1) {
  122124. return week + weeksInYear(year - 1, firstDayOfWeek, localeFirstDayOfYear);
  122125. } else if (week > weeksInYear(year, firstDayOfWeek, localeFirstDayOfYear)) {
  122126. return week - weeksInYear(year, firstDayOfWeek, localeFirstDayOfYear);
  122127. } else {
  122128. return week;
  122129. }
  122130. }
  122131. function isLeapYear(year) {
  122132. return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
  122133. }
  122134. /***/ }),
  122135. /***/ "./src/util/dedupeModelListeners.ts":
  122136. /*!******************************************!*\
  122137. !*** ./src/util/dedupeModelListeners.ts ***!
  122138. \******************************************/
  122139. /*! exports provided: default */
  122140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122141. "use strict";
  122142. __webpack_require__.r(__webpack_exports__);
  122143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return dedupeModelListeners; });
  122144. /**
  122145. * Removes duplicate `@input` listeners when
  122146. * using v-model with functional components
  122147. *
  122148. * @see https://github.com/vuetifyjs/vuetify/issues/4460
  122149. */
  122150. function dedupeModelListeners(data) {
  122151. if (data.model && data.on && data.on.input) {
  122152. if (Array.isArray(data.on.input)) {
  122153. var i = data.on.input.indexOf(data.model.callback);
  122154. if (i > -1) data.on.input.splice(i, 1);
  122155. } else {
  122156. delete data.on.input;
  122157. }
  122158. }
  122159. }
  122160. /***/ }),
  122161. /***/ "./src/util/helpers.ts":
  122162. /*!*****************************!*\
  122163. !*** ./src/util/helpers.ts ***!
  122164. \*****************************/
  122165. /*! exports provided: createSimpleFunctional, directiveConfig, addOnceEventListener, passiveSupported, addPassiveEventListener, getNestedValue, deepEqual, getObjectValueByPath, getPropertyFromItem, createRange, getZIndex, escapeHTML, filterObjectOnKeys, convertToUnit, kebabCase, isObject, keyCodes, remapInternalIcon, keys, camelize, arrayDiff, upperFirst, groupItems, wrapInArray, sortItems, defaultFilter, searchItems, getSlotType, debounce, getPrefixedScopedSlots, getSlot, clamp, padEnd, chunk, humanReadableFileSize, camelizeObjectKeys, mergeDeep, fillArray */
  122166. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122167. "use strict";
  122168. __webpack_require__.r(__webpack_exports__);
  122169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleFunctional", function() { return createSimpleFunctional; });
  122170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "directiveConfig", function() { return directiveConfig; });
  122171. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addOnceEventListener", function() { return addOnceEventListener; });
  122172. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "passiveSupported", function() { return passiveSupported; });
  122173. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addPassiveEventListener", function() { return addPassiveEventListener; });
  122174. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNestedValue", function() { return getNestedValue; });
  122175. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepEqual", function() { return deepEqual; });
  122176. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getObjectValueByPath", function() { return getObjectValueByPath; });
  122177. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPropertyFromItem", function() { return getPropertyFromItem; });
  122178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRange", function() { return createRange; });
  122179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getZIndex", function() { return getZIndex; });
  122180. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeHTML", function() { return escapeHTML; });
  122181. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterObjectOnKeys", function() { return filterObjectOnKeys; });
  122182. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToUnit", function() { return convertToUnit; });
  122183. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return kebabCase; });
  122184. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; });
  122185. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return keyCodes; });
  122186. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "remapInternalIcon", function() { return remapInternalIcon; });
  122187. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return keys; });
  122188. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "camelize", function() { return camelize; });
  122189. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayDiff", function() { return arrayDiff; });
  122190. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return upperFirst; });
  122191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupItems", function() { return groupItems; });
  122192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapInArray", function() { return wrapInArray; });
  122193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortItems", function() { return sortItems; });
  122194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultFilter", function() { return defaultFilter; });
  122195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "searchItems", function() { return searchItems; });
  122196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSlotType", function() { return getSlotType; });
  122197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; });
  122198. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPrefixedScopedSlots", function() { return getPrefixedScopedSlots; });
  122199. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSlot", function() { return getSlot; });
  122200. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return clamp; });
  122201. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "padEnd", function() { return padEnd; });
  122202. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return chunk; });
  122203. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "humanReadableFileSize", function() { return humanReadableFileSize; });
  122204. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "camelizeObjectKeys", function() { return camelizeObjectKeys; });
  122205. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeDeep", function() { return mergeDeep; });
  122206. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fillArray", function() { return fillArray; });
  122207. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  122208. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  122209. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  122210. var __assign = undefined && undefined.__assign || function () {
  122211. __assign = Object.assign || function (t) {
  122212. for (var s, i = 1, n = arguments.length; i < n; i++) {
  122213. s = arguments[i];
  122214. for (var p in s) {
  122215. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  122216. }
  122217. }
  122218. return t;
  122219. };
  122220. return __assign.apply(this, arguments);
  122221. };
  122222. var __read = undefined && undefined.__read || function (o, n) {
  122223. var m = typeof Symbol === "function" && o[Symbol.iterator];
  122224. if (!m) return o;
  122225. var i = m.call(o),
  122226. r,
  122227. ar = [],
  122228. e;
  122229. try {
  122230. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  122231. ar.push(r.value);
  122232. }
  122233. } catch (error) {
  122234. e = {
  122235. error: error
  122236. };
  122237. } finally {
  122238. try {
  122239. if (r && !r.done && (m = i["return"])) m.call(i);
  122240. } finally {
  122241. if (e) throw e.error;
  122242. }
  122243. }
  122244. return ar;
  122245. };
  122246. var __spread = undefined && undefined.__spread || function () {
  122247. for (var ar = [], i = 0; i < arguments.length; i++) {
  122248. ar = ar.concat(__read(arguments[i]));
  122249. }
  122250. return ar;
  122251. };
  122252. function createSimpleFunctional(c, el, name) {
  122253. if (el === void 0) {
  122254. el = 'div';
  122255. }
  122256. return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  122257. name: name || c.replace(/__/g, '-'),
  122258. functional: true,
  122259. render: function render(h, _a) {
  122260. var data = _a.data,
  122261. children = _a.children;
  122262. data.staticClass = (c + " " + (data.staticClass || '')).trim();
  122263. return h(el, data, children);
  122264. }
  122265. });
  122266. }
  122267. function directiveConfig(binding, defaults) {
  122268. if (defaults === void 0) {
  122269. defaults = {};
  122270. }
  122271. return __assign({}, defaults, binding.modifiers, {
  122272. value: binding.arg
  122273. }, binding.value || {});
  122274. }
  122275. function addOnceEventListener(el, eventName, cb, options) {
  122276. if (options === void 0) {
  122277. options = false;
  122278. }
  122279. var once = function once(event) {
  122280. cb(event);
  122281. el.removeEventListener(eventName, once, options);
  122282. };
  122283. el.addEventListener(eventName, once, options);
  122284. }
  122285. var passiveSupported = false;
  122286. try {
  122287. if (typeof window !== 'undefined') {
  122288. var testListenerOpts = Object.defineProperty({}, 'passive', {
  122289. get: function get() {
  122290. passiveSupported = true;
  122291. }
  122292. });
  122293. window.addEventListener('testListener', testListenerOpts, testListenerOpts);
  122294. window.removeEventListener('testListener', testListenerOpts, testListenerOpts);
  122295. }
  122296. } catch (e) {
  122297. console.warn(e);
  122298. }
  122299. function addPassiveEventListener(el, event, cb, options) {
  122300. el.addEventListener(event, cb, passiveSupported ? options : false);
  122301. }
  122302. function getNestedValue(obj, path, fallback) {
  122303. var last = path.length - 1;
  122304. if (last < 0) return obj === undefined ? fallback : obj;
  122305. for (var i = 0; i < last; i++) {
  122306. if (obj == null) {
  122307. return fallback;
  122308. }
  122309. obj = obj[path[i]];
  122310. }
  122311. if (obj == null) return fallback;
  122312. return obj[path[last]] === undefined ? fallback : obj[path[last]];
  122313. }
  122314. function deepEqual(a, b) {
  122315. if (a === b) return true;
  122316. if (a instanceof Date && b instanceof Date) {
  122317. // If the values are Date, they were convert to timestamp with getTime and compare it
  122318. if (a.getTime() !== b.getTime()) return false;
  122319. }
  122320. if (a !== Object(a) || b !== Object(b)) {
  122321. // If the values aren't objects, they were already checked for equality
  122322. return false;
  122323. }
  122324. var props = Object.keys(a);
  122325. if (props.length !== Object.keys(b).length) {
  122326. // Different number of props, don't bother to check
  122327. return false;
  122328. }
  122329. return props.every(function (p) {
  122330. return deepEqual(a[p], b[p]);
  122331. });
  122332. }
  122333. function getObjectValueByPath(obj, path, fallback) {
  122334. // credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621
  122335. if (obj == null || !path || typeof path !== 'string') return fallback;
  122336. if (obj[path] !== undefined) return obj[path];
  122337. path = path.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties
  122338. path = path.replace(/^\./, ''); // strip a leading dot
  122339. return getNestedValue(obj, path.split('.'), fallback);
  122340. }
  122341. function getPropertyFromItem(item, property, fallback) {
  122342. if (property == null) return item === undefined ? fallback : item;
  122343. if (item !== Object(item)) return fallback === undefined ? item : fallback;
  122344. if (typeof property === 'string') return getObjectValueByPath(item, property, fallback);
  122345. if (Array.isArray(property)) return getNestedValue(item, property, fallback);
  122346. if (typeof property !== 'function') return fallback;
  122347. var value = property(item, fallback);
  122348. return typeof value === 'undefined' ? fallback : value;
  122349. }
  122350. function createRange(length) {
  122351. return Array.from({
  122352. length: length
  122353. }, function (v, k) {
  122354. return k;
  122355. });
  122356. }
  122357. function getZIndex(el) {
  122358. if (!el || el.nodeType !== Node.ELEMENT_NODE) return 0;
  122359. var index = +window.getComputedStyle(el).getPropertyValue('z-index');
  122360. if (!index) return getZIndex(el.parentNode);
  122361. return index;
  122362. }
  122363. var tagsToReplace = {
  122364. '&': '&amp;',
  122365. '<': '&lt;',
  122366. '>': '&gt;'
  122367. };
  122368. function escapeHTML(str) {
  122369. return str.replace(/[&<>]/g, function (tag) {
  122370. return tagsToReplace[tag] || tag;
  122371. });
  122372. }
  122373. function filterObjectOnKeys(obj, keys) {
  122374. var filtered = {};
  122375. for (var i = 0; i < keys.length; i++) {
  122376. var key = keys[i];
  122377. if (typeof obj[key] !== 'undefined') {
  122378. filtered[key] = obj[key];
  122379. }
  122380. }
  122381. return filtered;
  122382. }
  122383. function convertToUnit(str, unit) {
  122384. if (unit === void 0) {
  122385. unit = 'px';
  122386. }
  122387. if (str == null || str === '') {
  122388. return undefined;
  122389. } else if (isNaN(+str)) {
  122390. return String(str);
  122391. } else {
  122392. return "" + Number(str) + unit;
  122393. }
  122394. }
  122395. function kebabCase(str) {
  122396. return (str || '').replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
  122397. }
  122398. function isObject(obj) {
  122399. return obj !== null && _typeof(obj) === 'object';
  122400. } // KeyboardEvent.keyCode aliases
  122401. var keyCodes = Object.freeze({
  122402. enter: 13,
  122403. tab: 9,
  122404. delete: 46,
  122405. esc: 27,
  122406. space: 32,
  122407. up: 38,
  122408. down: 40,
  122409. left: 37,
  122410. right: 39,
  122411. end: 35,
  122412. home: 36,
  122413. del: 46,
  122414. backspace: 8,
  122415. insert: 45,
  122416. pageup: 33,
  122417. pagedown: 34
  122418. }); // This remaps internal names like '$cancel' or '$vuetify.icons.cancel'
  122419. // to the current name or component for that icon.
  122420. function remapInternalIcon(vm, iconName) {
  122421. if (!iconName.startsWith('$')) {
  122422. return iconName;
  122423. } // Get the target icon name
  122424. var iconPath = "$vuetify.icons.values." + iconName.split('$').pop().split('.').pop(); // Now look up icon indirection name,
  122425. // e.g. '$vuetify.icons.values.cancel'
  122426. return getObjectValueByPath(vm, iconPath, iconName);
  122427. }
  122428. function keys(o) {
  122429. return Object.keys(o);
  122430. }
  122431. /**
  122432. * Camelize a hyphen-delimited string.
  122433. */
  122434. var camelizeRE = /-(\w)/g;
  122435. var camelize = function camelize(str) {
  122436. return str.replace(camelizeRE, function (_, c) {
  122437. return c ? c.toUpperCase() : '';
  122438. });
  122439. };
  122440. /**
  122441. * Returns the set difference of B and A, i.e. the set of elements in B but not in A
  122442. */
  122443. function arrayDiff(a, b) {
  122444. var diff = [];
  122445. for (var i = 0; i < b.length; i++) {
  122446. if (a.indexOf(b[i]) < 0) diff.push(b[i]);
  122447. }
  122448. return diff;
  122449. }
  122450. /**
  122451. * Makes the first character of a string uppercase
  122452. */
  122453. function upperFirst(str) {
  122454. return str.charAt(0).toUpperCase() + str.slice(1);
  122455. }
  122456. function groupItems(items, groupBy, groupDesc) {
  122457. var key = groupBy[0];
  122458. var groups = [];
  122459. var current = null;
  122460. for (var i = 0; i < items.length; i++) {
  122461. var item = items[i];
  122462. var val = getObjectValueByPath(item, key);
  122463. if (current !== val) {
  122464. current = val;
  122465. groups.push({
  122466. name: val,
  122467. items: []
  122468. });
  122469. }
  122470. groups[groups.length - 1].items.push(item);
  122471. }
  122472. return groups;
  122473. }
  122474. function wrapInArray(v) {
  122475. return v != null ? Array.isArray(v) ? v : [v] : [];
  122476. }
  122477. function sortItems(items, sortBy, sortDesc, locale, customSorters) {
  122478. if (sortBy === null || !sortBy.length) return items;
  122479. var stringCollator = new Intl.Collator(locale, {
  122480. sensitivity: 'accent',
  122481. usage: 'sort'
  122482. });
  122483. return items.sort(function (a, b) {
  122484. var _a, _b;
  122485. for (var i = 0; i < sortBy.length; i++) {
  122486. var sortKey = sortBy[i];
  122487. var sortA = getObjectValueByPath(a, sortKey);
  122488. var sortB = getObjectValueByPath(b, sortKey);
  122489. if (sortDesc[i]) {
  122490. _a = __read([sortB, sortA], 2), sortA = _a[0], sortB = _a[1];
  122491. }
  122492. if (customSorters && customSorters[sortKey]) {
  122493. var customResult = customSorters[sortKey](sortA, sortB);
  122494. if (!customResult) continue;
  122495. return customResult;
  122496. } // Check if both cannot be evaluated
  122497. if (sortA === null && sortB === null) {
  122498. continue;
  122499. }
  122500. _b = __read([sortA, sortB].map(function (s) {
  122501. return (s || '').toString().toLocaleLowerCase();
  122502. }), 2), sortA = _b[0], sortB = _b[1];
  122503. if (sortA !== sortB) {
  122504. if (!isNaN(sortA) && !isNaN(sortB)) return Number(sortA) - Number(sortB);
  122505. return stringCollator.compare(sortA, sortB);
  122506. }
  122507. }
  122508. return 0;
  122509. });
  122510. }
  122511. function defaultFilter(value, search, item) {
  122512. return value != null && search != null && typeof value !== 'boolean' && value.toString().toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) !== -1;
  122513. }
  122514. function searchItems(items, search) {
  122515. if (!search) return items;
  122516. search = search.toString().toLowerCase();
  122517. if (search.trim() === '') return items;
  122518. return items.filter(function (item) {
  122519. return Object.keys(item).some(function (key) {
  122520. return defaultFilter(getObjectValueByPath(item, key), search, item);
  122521. });
  122522. });
  122523. }
  122524. /**
  122525. * Returns:
  122526. * - 'normal' for old style slots - `<template slot="default">`
  122527. * - 'scoped' for old style scoped slots (`<template slot="default" slot-scope="data">`) or bound v-slot (`#default="data"`)
  122528. * - 'v-slot' for unbound v-slot (`#default`) - only if the third param is true, otherwise counts as scoped
  122529. */
  122530. function getSlotType(vm, name, split) {
  122531. if (vm.$slots[name] && vm.$scopedSlots[name] && vm.$scopedSlots[name].name) {
  122532. return split ? 'v-slot' : 'scoped';
  122533. }
  122534. if (vm.$slots[name]) return 'normal';
  122535. if (vm.$scopedSlots[name]) return 'scoped';
  122536. }
  122537. function debounce(fn, delay) {
  122538. var timeoutId = 0;
  122539. return function () {
  122540. var args = [];
  122541. for (var _i = 0; _i < arguments.length; _i++) {
  122542. args[_i] = arguments[_i];
  122543. }
  122544. clearTimeout(timeoutId);
  122545. timeoutId = setTimeout(function () {
  122546. return fn.apply(void 0, __spread(args));
  122547. }, delay);
  122548. };
  122549. }
  122550. function getPrefixedScopedSlots(prefix, scopedSlots) {
  122551. return Object.keys(scopedSlots).filter(function (k) {
  122552. return k.startsWith(prefix);
  122553. }).reduce(function (obj, k) {
  122554. obj[k.replace(prefix, '')] = scopedSlots[k];
  122555. return obj;
  122556. }, {});
  122557. }
  122558. function getSlot(vm, name, data, optional) {
  122559. if (name === void 0) {
  122560. name = 'default';
  122561. }
  122562. if (optional === void 0) {
  122563. optional = false;
  122564. }
  122565. if (vm.$scopedSlots[name]) {
  122566. return vm.$scopedSlots[name](data instanceof Function ? data() : data);
  122567. } else if (vm.$slots[name] && (!data || optional)) {
  122568. return vm.$slots[name];
  122569. }
  122570. return undefined;
  122571. }
  122572. function clamp(value, min, max) {
  122573. if (min === void 0) {
  122574. min = 0;
  122575. }
  122576. if (max === void 0) {
  122577. max = 1;
  122578. }
  122579. return Math.max(min, Math.min(max, value));
  122580. }
  122581. function padEnd(str, length, char) {
  122582. if (char === void 0) {
  122583. char = '0';
  122584. }
  122585. return str + char.repeat(Math.max(0, length - str.length));
  122586. }
  122587. function chunk(str, size) {
  122588. if (size === void 0) {
  122589. size = 1;
  122590. }
  122591. var chunked = [];
  122592. var index = 0;
  122593. while (index < str.length) {
  122594. chunked.push(str.substr(index, size));
  122595. index += size;
  122596. }
  122597. return chunked;
  122598. }
  122599. function humanReadableFileSize(bytes, binary) {
  122600. if (binary === void 0) {
  122601. binary = false;
  122602. }
  122603. var base = binary ? 1024 : 1000;
  122604. if (bytes < base) {
  122605. return bytes + " B";
  122606. }
  122607. var prefix = binary ? ['Ki', 'Mi', 'Gi'] : ['k', 'M', 'G'];
  122608. var unit = -1;
  122609. while (Math.abs(bytes) >= base && unit < prefix.length - 1) {
  122610. bytes /= base;
  122611. ++unit;
  122612. }
  122613. return bytes.toFixed(1) + " " + prefix[unit] + "B";
  122614. }
  122615. function camelizeObjectKeys(obj) {
  122616. if (!obj) return {};
  122617. return Object.keys(obj).reduce(function (o, key) {
  122618. o[camelize(key)] = obj[key];
  122619. return o;
  122620. }, {});
  122621. }
  122622. function mergeDeep(source, target) {
  122623. if (source === void 0) {
  122624. source = {};
  122625. }
  122626. if (target === void 0) {
  122627. target = {};
  122628. }
  122629. for (var key in target) {
  122630. var sourceProperty = source[key];
  122631. var targetProperty = target[key]; // Only continue deep merging if
  122632. // both properties are objects
  122633. if (isObject(sourceProperty) && isObject(targetProperty)) {
  122634. source[key] = mergeDeep(sourceProperty, targetProperty);
  122635. continue;
  122636. }
  122637. source[key] = targetProperty;
  122638. }
  122639. return source;
  122640. }
  122641. function fillArray(length, obj) {
  122642. return Array(length).fill(obj);
  122643. }
  122644. /***/ }),
  122645. /***/ "./src/util/mergeData.ts":
  122646. /*!*******************************!*\
  122647. !*** ./src/util/mergeData.ts ***!
  122648. \*******************************/
  122649. /*! exports provided: default */
  122650. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122651. "use strict";
  122652. __webpack_require__.r(__webpack_exports__);
  122653. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mergeData; });
  122654. /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/util/helpers.ts");
  122655. var __assign = undefined && undefined.__assign || function () {
  122656. __assign = Object.assign || function (t) {
  122657. for (var s, i = 1, n = arguments.length; i < n; i++) {
  122658. s = arguments[i];
  122659. for (var p in s) {
  122660. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  122661. }
  122662. }
  122663. return t;
  122664. };
  122665. return __assign.apply(this, arguments);
  122666. };
  122667. var __values = undefined && undefined.__values || function (o) {
  122668. var m = typeof Symbol === "function" && o[Symbol.iterator],
  122669. i = 0;
  122670. if (m) return m.call(o);
  122671. return {
  122672. next: function next() {
  122673. if (o && i >= o.length) o = void 0;
  122674. return {
  122675. value: o && o[i++],
  122676. done: !o
  122677. };
  122678. }
  122679. };
  122680. };
  122681. var __read = undefined && undefined.__read || function (o, n) {
  122682. var m = typeof Symbol === "function" && o[Symbol.iterator];
  122683. if (!m) return o;
  122684. var i = m.call(o),
  122685. r,
  122686. ar = [],
  122687. e;
  122688. try {
  122689. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  122690. ar.push(r.value);
  122691. }
  122692. } catch (error) {
  122693. e = {
  122694. error: error
  122695. };
  122696. } finally {
  122697. try {
  122698. if (r && !r.done && (m = i["return"])) m.call(i);
  122699. } finally {
  122700. if (e) throw e.error;
  122701. }
  122702. }
  122703. return ar;
  122704. };
  122705. var pattern = {
  122706. styleList: /;(?![^(]*\))/g,
  122707. styleProp: /:(.*)/
  122708. };
  122709. function parseStyle(style) {
  122710. var e_1, _a;
  122711. var styleMap = {};
  122712. try {
  122713. for (var _b = __values(style.split(pattern.styleList)), _c = _b.next(); !_c.done; _c = _b.next()) {
  122714. var s = _c.value;
  122715. var _d = __read(s.split(pattern.styleProp), 2),
  122716. key = _d[0],
  122717. val = _d[1];
  122718. key = key.trim();
  122719. if (!key) {
  122720. continue;
  122721. } // May be undefined if the `key: value` pair is incomplete.
  122722. if (typeof val === 'string') {
  122723. val = val.trim();
  122724. }
  122725. styleMap[Object(_helpers__WEBPACK_IMPORTED_MODULE_0__["camelize"])(key)] = val;
  122726. }
  122727. } catch (e_1_1) {
  122728. e_1 = {
  122729. error: e_1_1
  122730. };
  122731. } finally {
  122732. try {
  122733. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  122734. } finally {
  122735. if (e_1) throw e_1.error;
  122736. }
  122737. }
  122738. return styleMap;
  122739. }
  122740. function mergeData() {
  122741. var e_2, _a, e_3, _b;
  122742. var mergeTarget = {};
  122743. var i = arguments.length;
  122744. var prop;
  122745. var event; // Allow for variadic argument length.
  122746. while (i--) {
  122747. try {
  122748. // Iterate through the data properties and execute merge strategies
  122749. // Object.keys eliminates need for hasOwnProperty call
  122750. for (var _c = (e_2 = void 0, __values(Object.keys(arguments[i]))), _d = _c.next(); !_d.done; _d = _c.next()) {
  122751. prop = _d.value;
  122752. switch (prop) {
  122753. // Array merge strategy (array concatenation)
  122754. case 'class':
  122755. case 'style':
  122756. case 'directives':
  122757. if (!arguments[i][prop]) {
  122758. break;
  122759. }
  122760. if (!Array.isArray(mergeTarget[prop])) {
  122761. mergeTarget[prop] = [];
  122762. }
  122763. if (prop === 'style') {
  122764. var style = void 0;
  122765. if (Array.isArray(arguments[i].style)) {
  122766. style = arguments[i].style;
  122767. } else {
  122768. style = [arguments[i].style];
  122769. }
  122770. for (var j = 0; j < style.length; j++) {
  122771. var s = style[j];
  122772. if (typeof s === 'string') {
  122773. style[j] = parseStyle(s);
  122774. }
  122775. }
  122776. arguments[i].style = style;
  122777. } // Repackaging in an array allows Vue runtime
  122778. // to merge class/style bindings regardless of type.
  122779. mergeTarget[prop] = mergeTarget[prop].concat(arguments[i][prop]);
  122780. break;
  122781. // Space delimited string concatenation strategy
  122782. case 'staticClass':
  122783. if (!arguments[i][prop]) {
  122784. break;
  122785. }
  122786. if (mergeTarget[prop] === undefined) {
  122787. mergeTarget[prop] = '';
  122788. }
  122789. if (mergeTarget[prop]) {
  122790. // Not an empty string, so concatenate
  122791. mergeTarget[prop] += ' ';
  122792. }
  122793. mergeTarget[prop] += arguments[i][prop].trim();
  122794. break;
  122795. // Object, the properties of which to merge via array merge strategy (array concatenation).
  122796. // Callback merge strategy merges callbacks to the beginning of the array,
  122797. // so that the last defined callback will be invoked first.
  122798. // This is done since to mimic how Object.assign merging
  122799. // uses the last given value to assign.
  122800. case 'on':
  122801. case 'nativeOn':
  122802. if (!arguments[i][prop]) {
  122803. break;
  122804. }
  122805. if (!mergeTarget[prop]) {
  122806. mergeTarget[prop] = {};
  122807. }
  122808. var listeners = mergeTarget[prop];
  122809. try {
  122810. for (var _e = (e_3 = void 0, __values(Object.keys(arguments[i][prop] || {}))), _f = _e.next(); !_f.done; _f = _e.next()) {
  122811. event = _f.value; // Concat function to array of functions if callback present.
  122812. if (listeners[event]) {
  122813. // Insert current iteration data in beginning of merged array.
  122814. listeners[event] = Array().concat( // eslint-disable-line
  122815. listeners[event], arguments[i][prop][event]);
  122816. } else {
  122817. // Straight assign.
  122818. listeners[event] = arguments[i][prop][event];
  122819. }
  122820. }
  122821. } catch (e_3_1) {
  122822. e_3 = {
  122823. error: e_3_1
  122824. };
  122825. } finally {
  122826. try {
  122827. if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
  122828. } finally {
  122829. if (e_3) throw e_3.error;
  122830. }
  122831. }
  122832. break;
  122833. // Object merge strategy
  122834. case 'attrs':
  122835. case 'props':
  122836. case 'domProps':
  122837. case 'scopedSlots':
  122838. case 'staticStyle':
  122839. case 'hook':
  122840. case 'transition':
  122841. if (!arguments[i][prop]) {
  122842. break;
  122843. }
  122844. if (!mergeTarget[prop]) {
  122845. mergeTarget[prop] = {};
  122846. }
  122847. mergeTarget[prop] = __assign({}, arguments[i][prop], mergeTarget[prop]);
  122848. break;
  122849. // Reassignment strategy (no merge)
  122850. case 'slot':
  122851. case 'key':
  122852. case 'ref':
  122853. case 'tag':
  122854. case 'show':
  122855. case 'keepAlive':
  122856. default:
  122857. if (!mergeTarget[prop]) {
  122858. mergeTarget[prop] = arguments[i][prop];
  122859. }
  122860. }
  122861. }
  122862. } catch (e_2_1) {
  122863. e_2 = {
  122864. error: e_2_1
  122865. };
  122866. } finally {
  122867. try {
  122868. if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
  122869. } finally {
  122870. if (e_2) throw e_2.error;
  122871. }
  122872. }
  122873. }
  122874. return mergeTarget;
  122875. }
  122876. /***/ }),
  122877. /***/ "./src/util/mixins.ts":
  122878. /*!****************************!*\
  122879. !*** ./src/util/mixins.ts ***!
  122880. \****************************/
  122881. /*! exports provided: default */
  122882. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122883. "use strict";
  122884. __webpack_require__.r(__webpack_exports__);
  122885. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mixins; });
  122886. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
  122887. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  122888. /* eslint-disable max-len, import/export, no-use-before-define */
  122889. function mixins() {
  122890. var args = [];
  122891. for (var _i = 0; _i < arguments.length; _i++) {
  122892. args[_i] = arguments[_i];
  122893. }
  122894. return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
  122895. mixins: args
  122896. });
  122897. }
  122898. /***/ }),
  122899. /***/ "./src/util/rebuildFunctionalSlots.ts":
  122900. /*!********************************************!*\
  122901. !*** ./src/util/rebuildFunctionalSlots.ts ***!
  122902. \********************************************/
  122903. /*! exports provided: default */
  122904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122905. "use strict";
  122906. __webpack_require__.r(__webpack_exports__);
  122907. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return rebuildFunctionalSlots; });
  122908. function rebuildFunctionalSlots(slots, h) {
  122909. var children = [];
  122910. for (var slot in slots) {
  122911. if (slots.hasOwnProperty(slot)) {
  122912. children.push(h('template', {
  122913. slot: slot
  122914. }, slots[slot]));
  122915. }
  122916. }
  122917. return children;
  122918. }
  122919. /***/ }),
  122920. /***/ "vue":
  122921. /*!******************************************************************************!*\
  122922. !*** external {"commonjs":"vue","commonjs2":"vue","amd":"vue","root":"Vue"} ***!
  122923. \******************************************************************************/
  122924. /*! no static exports found */
  122925. /***/ (function(module, exports) {
  122926. module.exports = __WEBPACK_EXTERNAL_MODULE_vue__;
  122927. /***/ })
  122928. /******/ })["default"];
  122929. });
  122930. //# sourceMappingURL=vuetify.js.map
  122931. /***/ }),
  122932. /***/ "./node_modules/vuex/dist/vuex.esm.js":
  122933. /*!********************************************!*\
  122934. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  122935. \********************************************/
  122936. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  122937. /*! exports used: default */
  122938. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122939. "use strict";
  122940. /* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export Store */
  122941. /* unused harmony export createNamespacedHelpers */
  122942. /* unused harmony export install */
  122943. /* unused harmony export mapActions */
  122944. /* unused harmony export mapGetters */
  122945. /* unused harmony export mapMutations */
  122946. /* unused harmony export mapState */
  122947. /*!
  122948. * vuex v3.4.0
  122949. * (c) 2020 Evan You
  122950. * @license MIT
  122951. */
  122952. function applyMixin (Vue) {
  122953. var version = Number(Vue.version.split('.')[0]);
  122954. if (version >= 2) {
  122955. Vue.mixin({ beforeCreate: vuexInit });
  122956. } else {
  122957. // override init and inject vuex init procedure
  122958. // for 1.x backwards compatibility.
  122959. var _init = Vue.prototype._init;
  122960. Vue.prototype._init = function (options) {
  122961. if ( options === void 0 ) options = {};
  122962. options.init = options.init
  122963. ? [vuexInit].concat(options.init)
  122964. : vuexInit;
  122965. _init.call(this, options);
  122966. };
  122967. }
  122968. /**
  122969. * Vuex init hook, injected into each instances init hooks list.
  122970. */
  122971. function vuexInit () {
  122972. var options = this.$options;
  122973. // store injection
  122974. if (options.store) {
  122975. this.$store = typeof options.store === 'function'
  122976. ? options.store()
  122977. : options.store;
  122978. } else if (options.parent && options.parent.$store) {
  122979. this.$store = options.parent.$store;
  122980. }
  122981. }
  122982. }
  122983. var target = typeof window !== 'undefined'
  122984. ? window
  122985. : typeof global !== 'undefined'
  122986. ? global
  122987. : {};
  122988. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  122989. function devtoolPlugin (store) {
  122990. if (!devtoolHook) { return }
  122991. store._devtoolHook = devtoolHook;
  122992. devtoolHook.emit('vuex:init', store);
  122993. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  122994. store.replaceState(targetState);
  122995. });
  122996. store.subscribe(function (mutation, state) {
  122997. devtoolHook.emit('vuex:mutation', mutation, state);
  122998. }, { prepend: true });
  122999. store.subscribeAction(function (action, state) {
  123000. devtoolHook.emit('vuex:action', action, state);
  123001. }, { prepend: true });
  123002. }
  123003. /**
  123004. * Get the first item that pass the test
  123005. * by second argument function
  123006. *
  123007. * @param {Array} list
  123008. * @param {Function} f
  123009. * @return {*}
  123010. */
  123011. /**
  123012. * forEach for object
  123013. */
  123014. function forEachValue (obj, fn) {
  123015. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  123016. }
  123017. function isObject (obj) {
  123018. return obj !== null && typeof obj === 'object'
  123019. }
  123020. function isPromise (val) {
  123021. return val && typeof val.then === 'function'
  123022. }
  123023. function assert (condition, msg) {
  123024. if (!condition) { throw new Error(("[vuex] " + msg)) }
  123025. }
  123026. function partial (fn, arg) {
  123027. return function () {
  123028. return fn(arg)
  123029. }
  123030. }
  123031. // Base data struct for store's module, package with some attribute and method
  123032. var Module = function Module (rawModule, runtime) {
  123033. this.runtime = runtime;
  123034. // Store some children item
  123035. this._children = Object.create(null);
  123036. // Store the origin module object which passed by programmer
  123037. this._rawModule = rawModule;
  123038. var rawState = rawModule.state;
  123039. // Store the origin module's state
  123040. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  123041. };
  123042. var prototypeAccessors = { namespaced: { configurable: true } };
  123043. prototypeAccessors.namespaced.get = function () {
  123044. return !!this._rawModule.namespaced
  123045. };
  123046. Module.prototype.addChild = function addChild (key, module) {
  123047. this._children[key] = module;
  123048. };
  123049. Module.prototype.removeChild = function removeChild (key) {
  123050. delete this._children[key];
  123051. };
  123052. Module.prototype.getChild = function getChild (key) {
  123053. return this._children[key]
  123054. };
  123055. Module.prototype.hasChild = function hasChild (key) {
  123056. return key in this._children
  123057. };
  123058. Module.prototype.update = function update (rawModule) {
  123059. this._rawModule.namespaced = rawModule.namespaced;
  123060. if (rawModule.actions) {
  123061. this._rawModule.actions = rawModule.actions;
  123062. }
  123063. if (rawModule.mutations) {
  123064. this._rawModule.mutations = rawModule.mutations;
  123065. }
  123066. if (rawModule.getters) {
  123067. this._rawModule.getters = rawModule.getters;
  123068. }
  123069. };
  123070. Module.prototype.forEachChild = function forEachChild (fn) {
  123071. forEachValue(this._children, fn);
  123072. };
  123073. Module.prototype.forEachGetter = function forEachGetter (fn) {
  123074. if (this._rawModule.getters) {
  123075. forEachValue(this._rawModule.getters, fn);
  123076. }
  123077. };
  123078. Module.prototype.forEachAction = function forEachAction (fn) {
  123079. if (this._rawModule.actions) {
  123080. forEachValue(this._rawModule.actions, fn);
  123081. }
  123082. };
  123083. Module.prototype.forEachMutation = function forEachMutation (fn) {
  123084. if (this._rawModule.mutations) {
  123085. forEachValue(this._rawModule.mutations, fn);
  123086. }
  123087. };
  123088. Object.defineProperties( Module.prototype, prototypeAccessors );
  123089. var ModuleCollection = function ModuleCollection (rawRootModule) {
  123090. // register root module (Vuex.Store options)
  123091. this.register([], rawRootModule, false);
  123092. };
  123093. ModuleCollection.prototype.get = function get (path) {
  123094. return path.reduce(function (module, key) {
  123095. return module.getChild(key)
  123096. }, this.root)
  123097. };
  123098. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  123099. var module = this.root;
  123100. return path.reduce(function (namespace, key) {
  123101. module = module.getChild(key);
  123102. return namespace + (module.namespaced ? key + '/' : '')
  123103. }, '')
  123104. };
  123105. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  123106. update([], this.root, rawRootModule);
  123107. };
  123108. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  123109. var this$1 = this;
  123110. if ( runtime === void 0 ) runtime = true;
  123111. if ((true)) {
  123112. assertRawModule(path, rawModule);
  123113. }
  123114. var newModule = new Module(rawModule, runtime);
  123115. if (path.length === 0) {
  123116. this.root = newModule;
  123117. } else {
  123118. var parent = this.get(path.slice(0, -1));
  123119. parent.addChild(path[path.length - 1], newModule);
  123120. }
  123121. // register nested modules
  123122. if (rawModule.modules) {
  123123. forEachValue(rawModule.modules, function (rawChildModule, key) {
  123124. this$1.register(path.concat(key), rawChildModule, runtime);
  123125. });
  123126. }
  123127. };
  123128. ModuleCollection.prototype.unregister = function unregister (path) {
  123129. var parent = this.get(path.slice(0, -1));
  123130. var key = path[path.length - 1];
  123131. if (!parent.getChild(key).runtime) { return }
  123132. parent.removeChild(key);
  123133. };
  123134. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  123135. var parent = this.get(path.slice(0, -1));
  123136. var key = path[path.length - 1];
  123137. return parent.hasChild(key)
  123138. };
  123139. function update (path, targetModule, newModule) {
  123140. if ((true)) {
  123141. assertRawModule(path, newModule);
  123142. }
  123143. // update target module
  123144. targetModule.update(newModule);
  123145. // update nested modules
  123146. if (newModule.modules) {
  123147. for (var key in newModule.modules) {
  123148. if (!targetModule.getChild(key)) {
  123149. if ((true)) {
  123150. console.warn(
  123151. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  123152. 'manual reload is needed'
  123153. );
  123154. }
  123155. return
  123156. }
  123157. update(
  123158. path.concat(key),
  123159. targetModule.getChild(key),
  123160. newModule.modules[key]
  123161. );
  123162. }
  123163. }
  123164. }
  123165. var functionAssert = {
  123166. assert: function (value) { return typeof value === 'function'; },
  123167. expected: 'function'
  123168. };
  123169. var objectAssert = {
  123170. assert: function (value) { return typeof value === 'function' ||
  123171. (typeof value === 'object' && typeof value.handler === 'function'); },
  123172. expected: 'function or object with "handler" function'
  123173. };
  123174. var assertTypes = {
  123175. getters: functionAssert,
  123176. mutations: functionAssert,
  123177. actions: objectAssert
  123178. };
  123179. function assertRawModule (path, rawModule) {
  123180. Object.keys(assertTypes).forEach(function (key) {
  123181. if (!rawModule[key]) { return }
  123182. var assertOptions = assertTypes[key];
  123183. forEachValue(rawModule[key], function (value, type) {
  123184. assert(
  123185. assertOptions.assert(value),
  123186. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  123187. );
  123188. });
  123189. });
  123190. }
  123191. function makeAssertionMessage (path, key, type, value, expected) {
  123192. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  123193. if (path.length > 0) {
  123194. buf += " in module \"" + (path.join('.')) + "\"";
  123195. }
  123196. buf += " is " + (JSON.stringify(value)) + ".";
  123197. return buf
  123198. }
  123199. var Vue; // bind on install
  123200. var Store = function Store (options) {
  123201. var this$1 = this;
  123202. if ( options === void 0 ) options = {};
  123203. // Auto install if it is not done yet and `window` has `Vue`.
  123204. // To allow users to avoid auto-installation in some cases,
  123205. // this code should be placed here. See #731
  123206. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  123207. install(window.Vue);
  123208. }
  123209. if ((true)) {
  123210. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  123211. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  123212. assert(this instanceof Store, "store must be called with the new operator.");
  123213. }
  123214. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  123215. var strict = options.strict; if ( strict === void 0 ) strict = false;
  123216. // store internal state
  123217. this._committing = false;
  123218. this._actions = Object.create(null);
  123219. this._actionSubscribers = [];
  123220. this._mutations = Object.create(null);
  123221. this._wrappedGetters = Object.create(null);
  123222. this._modules = new ModuleCollection(options);
  123223. this._modulesNamespaceMap = Object.create(null);
  123224. this._subscribers = [];
  123225. this._watcherVM = new Vue();
  123226. this._makeLocalGettersCache = Object.create(null);
  123227. // bind commit and dispatch to self
  123228. var store = this;
  123229. var ref = this;
  123230. var dispatch = ref.dispatch;
  123231. var commit = ref.commit;
  123232. this.dispatch = function boundDispatch (type, payload) {
  123233. return dispatch.call(store, type, payload)
  123234. };
  123235. this.commit = function boundCommit (type, payload, options) {
  123236. return commit.call(store, type, payload, options)
  123237. };
  123238. // strict mode
  123239. this.strict = strict;
  123240. var state = this._modules.root.state;
  123241. // init root module.
  123242. // this also recursively registers all sub-modules
  123243. // and collects all module getters inside this._wrappedGetters
  123244. installModule(this, state, [], this._modules.root);
  123245. // initialize the store vm, which is responsible for the reactivity
  123246. // (also registers _wrappedGetters as computed properties)
  123247. resetStoreVM(this, state);
  123248. // apply plugins
  123249. plugins.forEach(function (plugin) { return plugin(this$1); });
  123250. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  123251. if (useDevtools) {
  123252. devtoolPlugin(this);
  123253. }
  123254. };
  123255. var prototypeAccessors$1 = { state: { configurable: true } };
  123256. prototypeAccessors$1.state.get = function () {
  123257. return this._vm._data.$$state
  123258. };
  123259. prototypeAccessors$1.state.set = function (v) {
  123260. if ((true)) {
  123261. assert(false, "use store.replaceState() to explicit replace store state.");
  123262. }
  123263. };
  123264. Store.prototype.commit = function commit (_type, _payload, _options) {
  123265. var this$1 = this;
  123266. // check object-style commit
  123267. var ref = unifyObjectStyle(_type, _payload, _options);
  123268. var type = ref.type;
  123269. var payload = ref.payload;
  123270. var options = ref.options;
  123271. var mutation = { type: type, payload: payload };
  123272. var entry = this._mutations[type];
  123273. if (!entry) {
  123274. if ((true)) {
  123275. console.error(("[vuex] unknown mutation type: " + type));
  123276. }
  123277. return
  123278. }
  123279. this._withCommit(function () {
  123280. entry.forEach(function commitIterator (handler) {
  123281. handler(payload);
  123282. });
  123283. });
  123284. this._subscribers
  123285. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  123286. .forEach(function (sub) { return sub(mutation, this$1.state); });
  123287. if (
  123288. ( true) &&
  123289. options && options.silent
  123290. ) {
  123291. console.warn(
  123292. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  123293. 'Use the filter functionality in the vue-devtools'
  123294. );
  123295. }
  123296. };
  123297. Store.prototype.dispatch = function dispatch (_type, _payload) {
  123298. var this$1 = this;
  123299. // check object-style dispatch
  123300. var ref = unifyObjectStyle(_type, _payload);
  123301. var type = ref.type;
  123302. var payload = ref.payload;
  123303. var action = { type: type, payload: payload };
  123304. var entry = this._actions[type];
  123305. if (!entry) {
  123306. if ((true)) {
  123307. console.error(("[vuex] unknown action type: " + type));
  123308. }
  123309. return
  123310. }
  123311. try {
  123312. this._actionSubscribers
  123313. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  123314. .filter(function (sub) { return sub.before; })
  123315. .forEach(function (sub) { return sub.before(action, this$1.state); });
  123316. } catch (e) {
  123317. if ((true)) {
  123318. console.warn("[vuex] error in before action subscribers: ");
  123319. console.error(e);
  123320. }
  123321. }
  123322. var result = entry.length > 1
  123323. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  123324. : entry[0](payload);
  123325. return new Promise(function (resolve, reject) {
  123326. result.then(function (res) {
  123327. try {
  123328. this$1._actionSubscribers
  123329. .filter(function (sub) { return sub.after; })
  123330. .forEach(function (sub) { return sub.after(action, this$1.state); });
  123331. } catch (e) {
  123332. if ((true)) {
  123333. console.warn("[vuex] error in after action subscribers: ");
  123334. console.error(e);
  123335. }
  123336. }
  123337. resolve(res);
  123338. }, function (error) {
  123339. try {
  123340. this$1._actionSubscribers
  123341. .filter(function (sub) { return sub.error; })
  123342. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  123343. } catch (e) {
  123344. if ((true)) {
  123345. console.warn("[vuex] error in error action subscribers: ");
  123346. console.error(e);
  123347. }
  123348. }
  123349. reject(error);
  123350. });
  123351. })
  123352. };
  123353. Store.prototype.subscribe = function subscribe (fn, options) {
  123354. return genericSubscribe(fn, this._subscribers, options)
  123355. };
  123356. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  123357. var subs = typeof fn === 'function' ? { before: fn } : fn;
  123358. return genericSubscribe(subs, this._actionSubscribers, options)
  123359. };
  123360. Store.prototype.watch = function watch (getter, cb, options) {
  123361. var this$1 = this;
  123362. if ((true)) {
  123363. assert(typeof getter === 'function', "store.watch only accepts a function.");
  123364. }
  123365. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  123366. };
  123367. Store.prototype.replaceState = function replaceState (state) {
  123368. var this$1 = this;
  123369. this._withCommit(function () {
  123370. this$1._vm._data.$$state = state;
  123371. });
  123372. };
  123373. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  123374. if ( options === void 0 ) options = {};
  123375. if (typeof path === 'string') { path = [path]; }
  123376. if ((true)) {
  123377. assert(Array.isArray(path), "module path must be a string or an Array.");
  123378. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  123379. }
  123380. this._modules.register(path, rawModule);
  123381. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  123382. // reset store to update getters...
  123383. resetStoreVM(this, this.state);
  123384. };
  123385. Store.prototype.unregisterModule = function unregisterModule (path) {
  123386. var this$1 = this;
  123387. if (typeof path === 'string') { path = [path]; }
  123388. if ((true)) {
  123389. assert(Array.isArray(path), "module path must be a string or an Array.");
  123390. }
  123391. this._modules.unregister(path);
  123392. this._withCommit(function () {
  123393. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  123394. Vue.delete(parentState, path[path.length - 1]);
  123395. });
  123396. resetStore(this);
  123397. };
  123398. Store.prototype.hasModule = function hasModule (path) {
  123399. if (typeof path === 'string') { path = [path]; }
  123400. if ((true)) {
  123401. assert(Array.isArray(path), "module path must be a string or an Array.");
  123402. }
  123403. return this._modules.isRegistered(path)
  123404. };
  123405. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  123406. this._modules.update(newOptions);
  123407. resetStore(this, true);
  123408. };
  123409. Store.prototype._withCommit = function _withCommit (fn) {
  123410. var committing = this._committing;
  123411. this._committing = true;
  123412. fn();
  123413. this._committing = committing;
  123414. };
  123415. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  123416. function genericSubscribe (fn, subs, options) {
  123417. if (subs.indexOf(fn) < 0) {
  123418. options && options.prepend
  123419. ? subs.unshift(fn)
  123420. : subs.push(fn);
  123421. }
  123422. return function () {
  123423. var i = subs.indexOf(fn);
  123424. if (i > -1) {
  123425. subs.splice(i, 1);
  123426. }
  123427. }
  123428. }
  123429. function resetStore (store, hot) {
  123430. store._actions = Object.create(null);
  123431. store._mutations = Object.create(null);
  123432. store._wrappedGetters = Object.create(null);
  123433. store._modulesNamespaceMap = Object.create(null);
  123434. var state = store.state;
  123435. // init all modules
  123436. installModule(store, state, [], store._modules.root, true);
  123437. // reset vm
  123438. resetStoreVM(store, state, hot);
  123439. }
  123440. function resetStoreVM (store, state, hot) {
  123441. var oldVm = store._vm;
  123442. // bind store public getters
  123443. store.getters = {};
  123444. // reset local getters cache
  123445. store._makeLocalGettersCache = Object.create(null);
  123446. var wrappedGetters = store._wrappedGetters;
  123447. var computed = {};
  123448. forEachValue(wrappedGetters, function (fn, key) {
  123449. // use computed to leverage its lazy-caching mechanism
  123450. // direct inline function use will lead to closure preserving oldVm.
  123451. // using partial to return function with only arguments preserved in closure environment.
  123452. computed[key] = partial(fn, store);
  123453. Object.defineProperty(store.getters, key, {
  123454. get: function () { return store._vm[key]; },
  123455. enumerable: true // for local getters
  123456. });
  123457. });
  123458. // use a Vue instance to store the state tree
  123459. // suppress warnings just in case the user has added
  123460. // some funky global mixins
  123461. var silent = Vue.config.silent;
  123462. Vue.config.silent = true;
  123463. store._vm = new Vue({
  123464. data: {
  123465. $$state: state
  123466. },
  123467. computed: computed
  123468. });
  123469. Vue.config.silent = silent;
  123470. // enable strict mode for new vm
  123471. if (store.strict) {
  123472. enableStrictMode(store);
  123473. }
  123474. if (oldVm) {
  123475. if (hot) {
  123476. // dispatch changes in all subscribed watchers
  123477. // to force getter re-evaluation for hot reloading.
  123478. store._withCommit(function () {
  123479. oldVm._data.$$state = null;
  123480. });
  123481. }
  123482. Vue.nextTick(function () { return oldVm.$destroy(); });
  123483. }
  123484. }
  123485. function installModule (store, rootState, path, module, hot) {
  123486. var isRoot = !path.length;
  123487. var namespace = store._modules.getNamespace(path);
  123488. // register in namespace map
  123489. if (module.namespaced) {
  123490. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  123491. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  123492. }
  123493. store._modulesNamespaceMap[namespace] = module;
  123494. }
  123495. // set state
  123496. if (!isRoot && !hot) {
  123497. var parentState = getNestedState(rootState, path.slice(0, -1));
  123498. var moduleName = path[path.length - 1];
  123499. store._withCommit(function () {
  123500. if ((true)) {
  123501. if (moduleName in parentState) {
  123502. console.warn(
  123503. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  123504. );
  123505. }
  123506. }
  123507. Vue.set(parentState, moduleName, module.state);
  123508. });
  123509. }
  123510. var local = module.context = makeLocalContext(store, namespace, path);
  123511. module.forEachMutation(function (mutation, key) {
  123512. var namespacedType = namespace + key;
  123513. registerMutation(store, namespacedType, mutation, local);
  123514. });
  123515. module.forEachAction(function (action, key) {
  123516. var type = action.root ? key : namespace + key;
  123517. var handler = action.handler || action;
  123518. registerAction(store, type, handler, local);
  123519. });
  123520. module.forEachGetter(function (getter, key) {
  123521. var namespacedType = namespace + key;
  123522. registerGetter(store, namespacedType, getter, local);
  123523. });
  123524. module.forEachChild(function (child, key) {
  123525. installModule(store, rootState, path.concat(key), child, hot);
  123526. });
  123527. }
  123528. /**
  123529. * make localized dispatch, commit, getters and state
  123530. * if there is no namespace, just use root ones
  123531. */
  123532. function makeLocalContext (store, namespace, path) {
  123533. var noNamespace = namespace === '';
  123534. var local = {
  123535. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  123536. var args = unifyObjectStyle(_type, _payload, _options);
  123537. var payload = args.payload;
  123538. var options = args.options;
  123539. var type = args.type;
  123540. if (!options || !options.root) {
  123541. type = namespace + type;
  123542. if (( true) && !store._actions[type]) {
  123543. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  123544. return
  123545. }
  123546. }
  123547. return store.dispatch(type, payload)
  123548. },
  123549. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  123550. var args = unifyObjectStyle(_type, _payload, _options);
  123551. var payload = args.payload;
  123552. var options = args.options;
  123553. var type = args.type;
  123554. if (!options || !options.root) {
  123555. type = namespace + type;
  123556. if (( true) && !store._mutations[type]) {
  123557. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  123558. return
  123559. }
  123560. }
  123561. store.commit(type, payload, options);
  123562. }
  123563. };
  123564. // getters and state object must be gotten lazily
  123565. // because they will be changed by vm update
  123566. Object.defineProperties(local, {
  123567. getters: {
  123568. get: noNamespace
  123569. ? function () { return store.getters; }
  123570. : function () { return makeLocalGetters(store, namespace); }
  123571. },
  123572. state: {
  123573. get: function () { return getNestedState(store.state, path); }
  123574. }
  123575. });
  123576. return local
  123577. }
  123578. function makeLocalGetters (store, namespace) {
  123579. if (!store._makeLocalGettersCache[namespace]) {
  123580. var gettersProxy = {};
  123581. var splitPos = namespace.length;
  123582. Object.keys(store.getters).forEach(function (type) {
  123583. // skip if the target getter is not match this namespace
  123584. if (type.slice(0, splitPos) !== namespace) { return }
  123585. // extract local getter type
  123586. var localType = type.slice(splitPos);
  123587. // Add a port to the getters proxy.
  123588. // Define as getter property because
  123589. // we do not want to evaluate the getters in this time.
  123590. Object.defineProperty(gettersProxy, localType, {
  123591. get: function () { return store.getters[type]; },
  123592. enumerable: true
  123593. });
  123594. });
  123595. store._makeLocalGettersCache[namespace] = gettersProxy;
  123596. }
  123597. return store._makeLocalGettersCache[namespace]
  123598. }
  123599. function registerMutation (store, type, handler, local) {
  123600. var entry = store._mutations[type] || (store._mutations[type] = []);
  123601. entry.push(function wrappedMutationHandler (payload) {
  123602. handler.call(store, local.state, payload);
  123603. });
  123604. }
  123605. function registerAction (store, type, handler, local) {
  123606. var entry = store._actions[type] || (store._actions[type] = []);
  123607. entry.push(function wrappedActionHandler (payload) {
  123608. var res = handler.call(store, {
  123609. dispatch: local.dispatch,
  123610. commit: local.commit,
  123611. getters: local.getters,
  123612. state: local.state,
  123613. rootGetters: store.getters,
  123614. rootState: store.state
  123615. }, payload);
  123616. if (!isPromise(res)) {
  123617. res = Promise.resolve(res);
  123618. }
  123619. if (store._devtoolHook) {
  123620. return res.catch(function (err) {
  123621. store._devtoolHook.emit('vuex:error', err);
  123622. throw err
  123623. })
  123624. } else {
  123625. return res
  123626. }
  123627. });
  123628. }
  123629. function registerGetter (store, type, rawGetter, local) {
  123630. if (store._wrappedGetters[type]) {
  123631. if ((true)) {
  123632. console.error(("[vuex] duplicate getter key: " + type));
  123633. }
  123634. return
  123635. }
  123636. store._wrappedGetters[type] = function wrappedGetter (store) {
  123637. return rawGetter(
  123638. local.state, // local state
  123639. local.getters, // local getters
  123640. store.state, // root state
  123641. store.getters // root getters
  123642. )
  123643. };
  123644. }
  123645. function enableStrictMode (store) {
  123646. store._vm.$watch(function () { return this._data.$$state }, function () {
  123647. if ((true)) {
  123648. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  123649. }
  123650. }, { deep: true, sync: true });
  123651. }
  123652. function getNestedState (state, path) {
  123653. return path.reduce(function (state, key) { return state[key]; }, state)
  123654. }
  123655. function unifyObjectStyle (type, payload, options) {
  123656. if (isObject(type) && type.type) {
  123657. options = payload;
  123658. payload = type;
  123659. type = type.type;
  123660. }
  123661. if ((true)) {
  123662. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  123663. }
  123664. return { type: type, payload: payload, options: options }
  123665. }
  123666. function install (_Vue) {
  123667. if (Vue && _Vue === Vue) {
  123668. if ((true)) {
  123669. console.error(
  123670. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  123671. );
  123672. }
  123673. return
  123674. }
  123675. Vue = _Vue;
  123676. applyMixin(Vue);
  123677. }
  123678. /**
  123679. * Reduce the code which written in Vue.js for getting the state.
  123680. * @param {String} [namespace] - Module's namespace
  123681. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  123682. * @param {Object}
  123683. */
  123684. var mapState = normalizeNamespace(function (namespace, states) {
  123685. var res = {};
  123686. if (( true) && !isValidMap(states)) {
  123687. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  123688. }
  123689. normalizeMap(states).forEach(function (ref) {
  123690. var key = ref.key;
  123691. var val = ref.val;
  123692. res[key] = function mappedState () {
  123693. var state = this.$store.state;
  123694. var getters = this.$store.getters;
  123695. if (namespace) {
  123696. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  123697. if (!module) {
  123698. return
  123699. }
  123700. state = module.context.state;
  123701. getters = module.context.getters;
  123702. }
  123703. return typeof val === 'function'
  123704. ? val.call(this, state, getters)
  123705. : state[val]
  123706. };
  123707. // mark vuex getter for devtools
  123708. res[key].vuex = true;
  123709. });
  123710. return res
  123711. });
  123712. /**
  123713. * Reduce the code which written in Vue.js for committing the mutation
  123714. * @param {String} [namespace] - Module's namespace
  123715. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  123716. * @return {Object}
  123717. */
  123718. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  123719. var res = {};
  123720. if (( true) && !isValidMap(mutations)) {
  123721. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  123722. }
  123723. normalizeMap(mutations).forEach(function (ref) {
  123724. var key = ref.key;
  123725. var val = ref.val;
  123726. res[key] = function mappedMutation () {
  123727. var args = [], len = arguments.length;
  123728. while ( len-- ) args[ len ] = arguments[ len ];
  123729. // Get the commit method from store
  123730. var commit = this.$store.commit;
  123731. if (namespace) {
  123732. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  123733. if (!module) {
  123734. return
  123735. }
  123736. commit = module.context.commit;
  123737. }
  123738. return typeof val === 'function'
  123739. ? val.apply(this, [commit].concat(args))
  123740. : commit.apply(this.$store, [val].concat(args))
  123741. };
  123742. });
  123743. return res
  123744. });
  123745. /**
  123746. * Reduce the code which written in Vue.js for getting the getters
  123747. * @param {String} [namespace] - Module's namespace
  123748. * @param {Object|Array} getters
  123749. * @return {Object}
  123750. */
  123751. var mapGetters = normalizeNamespace(function (namespace, getters) {
  123752. var res = {};
  123753. if (( true) && !isValidMap(getters)) {
  123754. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  123755. }
  123756. normalizeMap(getters).forEach(function (ref) {
  123757. var key = ref.key;
  123758. var val = ref.val;
  123759. // The namespace has been mutated by normalizeNamespace
  123760. val = namespace + val;
  123761. res[key] = function mappedGetter () {
  123762. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  123763. return
  123764. }
  123765. if (( true) && !(val in this.$store.getters)) {
  123766. console.error(("[vuex] unknown getter: " + val));
  123767. return
  123768. }
  123769. return this.$store.getters[val]
  123770. };
  123771. // mark vuex getter for devtools
  123772. res[key].vuex = true;
  123773. });
  123774. return res
  123775. });
  123776. /**
  123777. * Reduce the code which written in Vue.js for dispatch the action
  123778. * @param {String} [namespace] - Module's namespace
  123779. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  123780. * @return {Object}
  123781. */
  123782. var mapActions = normalizeNamespace(function (namespace, actions) {
  123783. var res = {};
  123784. if (( true) && !isValidMap(actions)) {
  123785. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  123786. }
  123787. normalizeMap(actions).forEach(function (ref) {
  123788. var key = ref.key;
  123789. var val = ref.val;
  123790. res[key] = function mappedAction () {
  123791. var args = [], len = arguments.length;
  123792. while ( len-- ) args[ len ] = arguments[ len ];
  123793. // get dispatch function from store
  123794. var dispatch = this.$store.dispatch;
  123795. if (namespace) {
  123796. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  123797. if (!module) {
  123798. return
  123799. }
  123800. dispatch = module.context.dispatch;
  123801. }
  123802. return typeof val === 'function'
  123803. ? val.apply(this, [dispatch].concat(args))
  123804. : dispatch.apply(this.$store, [val].concat(args))
  123805. };
  123806. });
  123807. return res
  123808. });
  123809. /**
  123810. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  123811. * @param {String} namespace
  123812. * @return {Object}
  123813. */
  123814. var createNamespacedHelpers = function (namespace) { return ({
  123815. mapState: mapState.bind(null, namespace),
  123816. mapGetters: mapGetters.bind(null, namespace),
  123817. mapMutations: mapMutations.bind(null, namespace),
  123818. mapActions: mapActions.bind(null, namespace)
  123819. }); };
  123820. /**
  123821. * Normalize the map
  123822. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  123823. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  123824. * @param {Array|Object} map
  123825. * @return {Object}
  123826. */
  123827. function normalizeMap (map) {
  123828. if (!isValidMap(map)) {
  123829. return []
  123830. }
  123831. return Array.isArray(map)
  123832. ? map.map(function (key) { return ({ key: key, val: key }); })
  123833. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  123834. }
  123835. /**
  123836. * Validate whether given map is valid or not
  123837. * @param {*} map
  123838. * @return {Boolean}
  123839. */
  123840. function isValidMap (map) {
  123841. return Array.isArray(map) || isObject(map)
  123842. }
  123843. /**
  123844. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  123845. * @param {Function} fn
  123846. * @return {Function}
  123847. */
  123848. function normalizeNamespace (fn) {
  123849. return function (namespace, map) {
  123850. if (typeof namespace !== 'string') {
  123851. map = namespace;
  123852. namespace = '';
  123853. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  123854. namespace += '/';
  123855. }
  123856. return fn(namespace, map)
  123857. }
  123858. }
  123859. /**
  123860. * Search a special module from store by namespace. if module not exist, print error message.
  123861. * @param {Object} store
  123862. * @param {String} helper
  123863. * @param {String} namespace
  123864. * @return {Object}
  123865. */
  123866. function getModuleByNamespace (store, helper, namespace) {
  123867. var module = store._modulesNamespaceMap[namespace];
  123868. if (( true) && !module) {
  123869. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  123870. }
  123871. return module
  123872. }
  123873. var index = {
  123874. Store: Store,
  123875. install: install,
  123876. version: '3.4.0',
  123877. mapState: mapState,
  123878. mapMutations: mapMutations,
  123879. mapGetters: mapGetters,
  123880. mapActions: mapActions,
  123881. createNamespacedHelpers: createNamespacedHelpers
  123882. };
  123883. /* harmony default export */ __webpack_exports__["a"] = (index);
  123884. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  123885. /***/ }),
  123886. /***/ "./node_modules/webpack/buildin/global.js":
  123887. /*!***********************************!*\
  123888. !*** (webpack)/buildin/global.js ***!
  123889. \***********************************/
  123890. /*! no static exports found */
  123891. /*! all exports used */
  123892. /***/ (function(module, exports) {
  123893. var g;
  123894. // This works in non-strict mode
  123895. g = (function() {
  123896. return this;
  123897. })();
  123898. try {
  123899. // This works if eval is allowed (see CSP)
  123900. g = g || new Function("return this")();
  123901. } catch (e) {
  123902. // This works if the window reference is available
  123903. if (typeof window === "object") g = window;
  123904. }
  123905. // g can still be undefined, but nothing to do about it...
  123906. // We return undefined, instead of nothing here, so it's
  123907. // easier to handle this case. if(!global) { ...}
  123908. module.exports = g;
  123909. /***/ }),
  123910. /***/ "./node_modules/yeast/index.js":
  123911. /*!*************************************!*\
  123912. !*** ./node_modules/yeast/index.js ***!
  123913. \*************************************/
  123914. /*! no static exports found */
  123915. /*! all exports used */
  123916. /***/ (function(module, exports, __webpack_require__) {
  123917. "use strict";
  123918. var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')
  123919. , length = 64
  123920. , map = {}
  123921. , seed = 0
  123922. , i = 0
  123923. , prev;
  123924. /**
  123925. * Return a string representing the specified number.
  123926. *
  123927. * @param {Number} num The number to convert.
  123928. * @returns {String} The string representation of the number.
  123929. * @api public
  123930. */
  123931. function encode(num) {
  123932. var encoded = '';
  123933. do {
  123934. encoded = alphabet[num % length] + encoded;
  123935. num = Math.floor(num / length);
  123936. } while (num > 0);
  123937. return encoded;
  123938. }
  123939. /**
  123940. * Return the integer value specified by the given string.
  123941. *
  123942. * @param {String} str The string to convert.
  123943. * @returns {Number} The integer value represented by the string.
  123944. * @api public
  123945. */
  123946. function decode(str) {
  123947. var decoded = 0;
  123948. for (i = 0; i < str.length; i++) {
  123949. decoded = decoded * length + map[str.charAt(i)];
  123950. }
  123951. return decoded;
  123952. }
  123953. /**
  123954. * Yeast: A tiny growing id generator.
  123955. *
  123956. * @returns {String} A unique id.
  123957. * @api public
  123958. */
  123959. function yeast() {
  123960. var now = encode(+new Date());
  123961. if (now !== prev) return seed = 0, prev = now;
  123962. return now +'.'+ encode(seed++);
  123963. }
  123964. //
  123965. // Map each character to its index.
  123966. //
  123967. for (; i < length; i++) map[alphabet[i]] = i;
  123968. //
  123969. // Expose the `yeast`, `encode` and `decode` functions.
  123970. //
  123971. yeast.encode = encode;
  123972. yeast.decode = decode;
  123973. module.exports = yeast;
  123974. /***/ }),
  123975. /***/ "./resources/js lazy recursive \\.vue$/":
  123976. /*!***********************************!*\
  123977. !*** ./resources/js lazy \.vue$/ ***!
  123978. \***********************************/
  123979. /*! no static exports found */
  123980. /*! all exports used */
  123981. /***/ (function(module, exports) {
  123982. function webpackEmptyAsyncContext(req) {
  123983. // Here Promise.resolve().then() is used instead of new Promise() to prevent
  123984. // uncaught exception popping up in devtools
  123985. return Promise.resolve().then(function() {
  123986. var e = new Error("Cannot find module '" + req + "'");
  123987. e.code = 'MODULE_NOT_FOUND';
  123988. throw e;
  123989. });
  123990. }
  123991. webpackEmptyAsyncContext.keys = function() { return []; };
  123992. webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
  123993. module.exports = webpackEmptyAsyncContext;
  123994. webpackEmptyAsyncContext.id = "./resources/js lazy recursive \\.vue$/";
  123995. /***/ }),
  123996. /***/ "./resources/js lazy recursive ^.*$":
  123997. /*!*************************************************!*\
  123998. !*** ./resources/js lazy ^.*$ namespace object ***!
  123999. \*************************************************/
  124000. /*! no static exports found */
  124001. /*! all exports used */
  124002. /***/ (function(module, exports, __webpack_require__) {
  124003. var map = {
  124004. "./app": [
  124005. "./resources/js/app.js",
  124006. 9
  124007. ],
  124008. "./app.js": [
  124009. "./resources/js/app.js",
  124010. 9
  124011. ],
  124012. "./bootstrap": [
  124013. "./resources/js/bootstrap.js",
  124014. 7,
  124015. 0,
  124016. 1
  124017. ],
  124018. "./bootstrap.js": [
  124019. "./resources/js/bootstrap.js",
  124020. 7,
  124021. 0,
  124022. 1
  124023. ],
  124024. "./components/vuex": [
  124025. "./resources/js/components/vuex/index.js",
  124026. 9
  124027. ],
  124028. "./components/vuex/": [
  124029. "./resources/js/components/vuex/index.js",
  124030. 9
  124031. ],
  124032. "./components/vuex/index": [
  124033. "./resources/js/components/vuex/index.js",
  124034. 9
  124035. ],
  124036. "./components/vuex/index.js": [
  124037. "./resources/js/components/vuex/index.js",
  124038. 9
  124039. ],
  124040. "./fix.scss": [
  124041. "./resources/js/fix.scss",
  124042. 7
  124043. ]
  124044. };
  124045. function webpackAsyncContext(req) {
  124046. if(!__webpack_require__.o(map, req)) {
  124047. return Promise.resolve().then(function() {
  124048. var e = new Error("Cannot find module '" + req + "'");
  124049. e.code = 'MODULE_NOT_FOUND';
  124050. throw e;
  124051. });
  124052. }
  124053. var ids = map[req], id = ids[0];
  124054. return Promise.all(ids.slice(2).map(__webpack_require__.e)).then(function() {
  124055. return __webpack_require__.t(id, ids[1])
  124056. });
  124057. }
  124058. webpackAsyncContext.keys = function webpackAsyncContextKeys() {
  124059. return Object.keys(map);
  124060. };
  124061. webpackAsyncContext.id = "./resources/js lazy recursive ^.*$";
  124062. module.exports = webpackAsyncContext;
  124063. /***/ }),
  124064. /***/ "./resources/js/app.js":
  124065. /*!*****************************!*\
  124066. !*** ./resources/js/app.js ***!
  124067. \*****************************/
  124068. /*! no exports provided */
  124069. /*! all exports used */
  124070. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124071. "use strict";
  124072. __webpack_require__.r(__webpack_exports__);
  124073. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
  124074. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  124075. /* harmony import */ var _fix_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fix.scss */ "./resources/js/fix.scss");
  124076. /* harmony import */ var _fix_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_fix_scss__WEBPACK_IMPORTED_MODULE_1__);
  124077. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js");
  124078. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);
  124079. /* harmony import */ var vuetify__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vuetify */ "./node_modules/vuetify/dist/vuetify.js");
  124080. /* harmony import */ var vuetify__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vuetify__WEBPACK_IMPORTED_MODULE_3__);
  124081. /* harmony import */ var _components_vuex_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/vuex/index */ "./resources/js/components/vuex/index.js");
  124082. /* harmony import */ var vue_socket_io__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue-socket.io */ "./node_modules/vue-socket.io/dist/vue-socketio.js");
  124083. /* harmony import */ var vue_socket_io__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(vue_socket_io__WEBPACK_IMPORTED_MODULE_5__);
  124084. /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! socket.io-client */ "./node_modules/socket.io-client/lib/index.js");
  124085. /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(socket_io_client__WEBPACK_IMPORTED_MODULE_6__);
  124086. /* jQuery & Bootstrap Init */
  124087. window.$ = window.jQuery = jquery__WEBPACK_IMPORTED_MODULE_0___default.a;
  124088. /* Fix */
  124089. var location = window.location;
  124090. var pathname = location.pathname;
  124091. window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
  124092. window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
  124093. window.OT = __webpack_require__(/*! @opentok/client */ "./node_modules/@opentok/client/dist/js/opentok.js");
  124094. window.Vue = vue__WEBPACK_IMPORTED_MODULE_2___default.a;
  124095. vue__WEBPACK_IMPORTED_MODULE_2___default.a.prototype.$eventBus = new vue__WEBPACK_IMPORTED_MODULE_2___default.a();
  124096. vue__WEBPACK_IMPORTED_MODULE_2___default.a.use(vuetify__WEBPACK_IMPORTED_MODULE_3___default.a);
  124097. var files = __webpack_require__("./resources/js lazy recursive \\.vue$/").keys();
  124098. files.forEach(function (file) {
  124099. var component = file.split('/').pop().split('.')[0];
  124100. vue__WEBPACK_IMPORTED_MODULE_2___default.a.component(component, function () {
  124101. return __webpack_require__("./resources/js lazy recursive ^.*$")("".concat(file));
  124102. });
  124103. });
  124104. vue__WEBPACK_IMPORTED_MODULE_2___default.a.use(new vue_socket_io__WEBPACK_IMPORTED_MODULE_5___default.a({
  124105. debug: false,
  124106. connection: socket_io_client__WEBPACK_IMPORTED_MODULE_6___default()("http://localhost:3000")
  124107. }));
  124108. var app = new vue__WEBPACK_IMPORTED_MODULE_2___default.a({
  124109. el: '#app',
  124110. store: _components_vuex_index__WEBPACK_IMPORTED_MODULE_4__["default"],
  124111. vuetify: new vuetify__WEBPACK_IMPORTED_MODULE_3___default.a()
  124112. });
  124113. /***/ }),
  124114. /***/ "./resources/js/components/vuex/index.js":
  124115. /*!***********************************************!*\
  124116. !*** ./resources/js/components/vuex/index.js ***!
  124117. \***********************************************/
  124118. /*! exports provided: default */
  124119. /*! all exports used */
  124120. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124121. "use strict";
  124122. __webpack_require__.r(__webpack_exports__);
  124123. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js");
  124124. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  124125. /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js");
  124126. vue__WEBPACK_IMPORTED_MODULE_0___default.a.use(vuex__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]);
  124127. /* harmony default export */ __webpack_exports__["default"] = (function () {
  124128. return new vuex__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].Store({
  124129. modules: {//
  124130. },
  124131. state: {
  124132. user: {
  124133. id: null,
  124134. UID: null,
  124135. name: 'Guest',
  124136. type: 'guest',
  124137. pin: null,
  124138. avatarFile: null,
  124139. is_active_and_visible: true,
  124140. isAdmin: false
  124141. },
  124142. session: {
  124143. screenSharingAvailable: false,
  124144. sessionConnected: false,
  124145. screenSharingActive: false
  124146. },
  124147. active_menu_item: {
  124148. name: 'Lobbies',
  124149. "class": 'mdi mdi-view-dashboard',
  124150. template: 'lobby-list'
  124151. },
  124152. meeting: {
  124153. id: "",
  124154. name: "",
  124155. passwordRequired: false,
  124156. lobby: null,
  124157. active_members: 0,
  124158. scheduledDate: null,
  124159. startedAt: null
  124160. },
  124161. lobbies: [],
  124162. chat_user_notification: false
  124163. },
  124164. mutations: {
  124165. setUsername: function setUsername(state, data) {
  124166. state.user.name = data;
  124167. },
  124168. setUsertype: function setUsertype(state, data) {
  124169. state.user.type = data;
  124170. },
  124171. setInitialUser: function setInitialUser(state, data) {
  124172. state.user = data;
  124173. },
  124174. setUser: function setUser(state, data) {
  124175. state.user = data;
  124176. },
  124177. setUserAvatarFile: function setUserAvatarFile(state, data) {
  124178. state.user.avatarFile = data;
  124179. },
  124180. setUserActivityState: function setUserActivityState(state, data) {
  124181. state.user.is_active_and_visible = data;
  124182. },
  124183. setScreenShareState: function setScreenShareState(state, data) {
  124184. state.session.screenSharingActive = data;
  124185. },
  124186. setMenuItem: function setMenuItem(state, data) {
  124187. state.active_menu_item = data;
  124188. },
  124189. setLobbies: function setLobbies(state, data) {
  124190. state.lobbies = data;
  124191. },
  124192. addNewLobby: function addNewLobby(state, data) {
  124193. state.lobbies.push(data);
  124194. },
  124195. setSingleLobby: function setSingleLobby(state, data) {
  124196. var lobby = state.lobbies.findIndex(function (cur) {
  124197. return cur.id == data.id;
  124198. });
  124199. if (lobby !== -1) {
  124200. state.lobbies[lobby].meetings = data.meetings.map(function (m) {
  124201. m.active_members = [];
  124202. m.associates_online = [];
  124203. return m;
  124204. });
  124205. }
  124206. },
  124207. setLobbyActivity: function setLobbyActivity(state, data) {
  124208. var lobby = state.lobbies.filter(function (cur) {
  124209. return cur.id == data.lobbyID;
  124210. });
  124211. if (lobby.length) {
  124212. var meeting = lobby[0].meetings.filter(function (cur) {
  124213. return cur.id == data.meetingID;
  124214. });
  124215. if (meeting.length) {
  124216. meeting[0].active_members = data.active_members;
  124217. meeting[0].associates_online = data.associates_online;
  124218. if (state.meeting.id && state.meeting.id == meeting[0].id) {
  124219. state.meeting.active_members = data.active_members;
  124220. }
  124221. }
  124222. }
  124223. },
  124224. setNewMeetingInLobby: function setNewMeetingInLobby(state, data) {
  124225. var lobby = state.lobbies.filter(function (cur) {
  124226. return cur.id == parseInt(data.lobby.id);
  124227. });
  124228. if (lobby.length) {
  124229. data.finalDate = new Date(data.scheduled_date ? data.scheduled_date : data.created_at);
  124230. lobby[0].meetings.push(data);
  124231. lobby[0].meetings.sort(function (a, b) {
  124232. return a.finalDate - b.finalDate;
  124233. });
  124234. }
  124235. },
  124236. setMeeting: function setMeeting(state, data) {
  124237. state.meeting = data;
  124238. },
  124239. setScreesharingAvailability: function setScreesharingAvailability(state, data) {
  124240. state.session.screenSharingAvailable = data;
  124241. },
  124242. setSessionConnectivityState: function setSessionConnectivityState(state, data) {
  124243. state.session.sessionConnected = data;
  124244. },
  124245. setChatUserNotification: function setChatUserNotification(state, data) {
  124246. state.chat_user_notification = data;
  124247. }
  124248. },
  124249. actions: {
  124250. leaveMeeting: function leaveMeeting(store) {
  124251. var meeting = {
  124252. id: '',
  124253. name: '',
  124254. passwordRequired: false,
  124255. lobby: null,
  124256. active_members: 0,
  124257. scheduledDate: null,
  124258. startedAt: null
  124259. };
  124260. store.commit('setMeeting', meeting);
  124261. }
  124262. }
  124263. });
  124264. });
  124265. /***/ }),
  124266. /***/ "./resources/js/fix.scss":
  124267. /*!*******************************!*\
  124268. !*** ./resources/js/fix.scss ***!
  124269. \*******************************/
  124270. /*! no static exports found */
  124271. /*! all exports used */
  124272. /***/ (function(module, exports, __webpack_require__) {
  124273. var content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/src??ref--7-2!../../node_modules/sass-loader/dist/cjs.js??ref--7-3!./fix.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./resources/js/fix.scss");
  124274. if(typeof content === 'string') content = [[module.i, content, '']];
  124275. var transform;
  124276. var insertInto;
  124277. var options = {"hmr":true}
  124278. options.transform = transform
  124279. options.insertInto = undefined;
  124280. var update = __webpack_require__(/*! ../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
  124281. if(content.locals) module.exports = content.locals;
  124282. if(false) {}
  124283. /***/ }),
  124284. /***/ "./resources/sass/app.scss":
  124285. /*!*********************************!*\
  124286. !*** ./resources/sass/app.scss ***!
  124287. \*********************************/
  124288. /*! no static exports found */
  124289. /***/ (function(module, exports) {
  124290. // removed by extract-text-webpack-plugin
  124291. /***/ }),
  124292. /***/ 0:
  124293. /*!*************************************************************!*\
  124294. !*** multi ./resources/js/app.js ./resources/sass/app.scss ***!
  124295. \*************************************************************/
  124296. /*! no static exports found */
  124297. /*! all exports used */
  124298. /***/ (function(module, exports, __webpack_require__) {
  124299. __webpack_require__(/*! C:\Users\Flavionel\Desktop\Work\Programing\Sal_Projects\Java_Stag\frontend\resources\js\app.js */"./resources/js/app.js");
  124300. module.exports = __webpack_require__(/*! C:\Users\Flavionel\Desktop\Work\Programing\Sal_Projects\Java_Stag\frontend\resources\sass\app.scss */"./resources/sass/app.scss");
  124301. /***/ }),
  124302. /***/ 1:
  124303. /*!********************!*\
  124304. !*** ws (ignored) ***!
  124305. \********************/
  124306. /*! no static exports found */
  124307. /*! all exports used */
  124308. /***/ (function(module, exports) {
  124309. /* (ignored) */
  124310. /***/ })
  124311. /******/ });